Browse Source

拆分箱标签功能暂存

dev_web_online
安虹睿 2 years ago
parent
commit
5ab59d68b2
  1. 68
      fe/PC/src/mixins/printMixin.js
  2. 12
      fe/PC/src/router/index.js
  3. 381
      fe/PC/src/views/labelManage/PartiallyPreparedProducts/splitLabels.vue

68
fe/PC/src/mixins/printMixin.js

@ -55,6 +55,74 @@ export function initPrintPackingCodeData(propsData,options,name,url){
return data
}
//打印【箱标签-上下2个】(xiangbq_two.rdlx)
//使用位置:拆分箱标签 (splitLabels.vue)
/**
* @param {*} propsData 必填 详情数据 示例this.propsData
* @param {*} options 自定义特殊配置值 示例{'number':'poNumber'} (number值将传为poNumber)
* @param {*} name reportName
* @param {*} url dataUrl
* @returns
*/
export function initPrintPackingCodeTwoData(oldData,newData,options,name,url){
if(!oldData && !newData)return {}
let _printData = {}
let _options = options ? options : {}
// 上方信息
if(oldData){
_printData={
"oldTitle":oldData[_options.title] || oldData.title || "FATY 物品发运单",//上方_title
"oldSupplierSimpleName": oldData[_options.supplierSimpleName] || oldData.supplierSimpleName,//上方_供应商名称
"oldSupplierCode": oldData[_options.supplierCode] || oldData.supplierCode,//上方_供应商代码
"oldPoNumber": oldData[_options.poNumber] || oldData.poNumber,//上方_订单号
"oldAsnNumber": oldData[_options.asnNumber] || oldData.asnNumber,//上方_发货单号
"oldRemark": oldData[_options.remark] || oldData.remark,//上方_备注
"oldPlanArriveDate":oldData[_options.planArriveDate] || oldData.planArriveDate,//上方_要求到货时间
"oldSupplierItemName": oldData[_options.supplierItemName] || oldData.supplierItemName,//上方_零件名(供应商零件名)
"oldSupplierItemCode": oldData[_options.supplierItemCode] || oldData.supplierItemCode,//上方_零件号(供应商零件号)
"oldSpecifications": oldData[_options.specifications] || oldData.specifications,//上方_规格
"oldProduceDate": oldData[_options.produceDate] || oldData.produceDate,//上方_生产时间
"oldLot": oldData[_options.lot] || oldData.lot,//上方_生产批次
"oldLocationErpCode": oldData[_options.locationErpCode] || oldData.locationErpCode,//上方_储位
"oldItemCode": oldData[_options.itemCode] || oldData.itemCode,//上方_物品代码(ERP号)
"oldQty": oldData[_options.qty] || oldData.qty,//上方_要货数量 + 整包数量
"oldPackingCode": oldData[_options.packingCode] || oldData.packingCode,//上方_条形码
"oldPrintIndex":oldData[_options.printIndex] || 1,//上方_打印序列
..._printData
}
}
// 下方信息
if(newData){
_printData={
"newTitle":newData[_options.title] || newData.title || "FATY 物品发运单",//下方_title
"newSupplierSimpleName": newData[_options.supplierSimpleName] || newData.supplierSimpleName,//下方_供应商名称
"newSupplierCode": newData[_options.supplierCode] || newData.supplierCode,//下方_供应商代码
"newPoNumber": newData[_options.poNumber] || newData.poNumber,//下方_订单号
"newAsnNumber": newData[_options.asnNumber] || newData.asnNumber,//下方_发货单号
"newRemark": newData[_options.remark] || newData.remark,//下方_备注
"newPlanArriveDate":newData[_options.planArriveDate] || newData.planArriveDate,//下方_要求到货时间
"newSupplierItemName": newData[_options.supplierItemName] || newData.supplierItemName,//下方_零件名(供应商零件名)
"newSupplierItemCode": newData[_options.supplierItemCode] || newData.supplierItemCode,//下方_零件号(供应商零件号)
"newSpecifications": newData[_options.specifications] || newData.specifications,//下方_规格
"newProduceDate": newData[_options.produceDate] || newData.produceDate,//下方_生产时间
"newLot": newData[_options.lot] || newData.lot,//下方_生产批次
"newLocationErpCode": newData[_options.locationErpCode] || newData.locationErpCode,//下方_储位
"newItemCode": newData[_options.itemCode] || newData.itemCode,//下方_物品代码(ERP号)
"newQty": newData[_options.qty] || newData.qty,//下方_要货数量 + 整包数量
"newPackingCode": newData[_options.packingCode] || newData.packingCode,//下方_条形码
"newPrintIndex":newData[_options.printIndex] || 1,//下方_打印序列
..._printData
}
}
let data = {
reportName: name || 'xiangbq_two.rdlx',
dataUrl: url || 'ccc',
jsonData: JSON.stringify(_printData)
};
return data
}
// 打印【箱标签-单页4个】 (xiangbq_many.rdlx)
// 使用位置:半成品上架标签 (PartiallyPreparedProducts.vue) | 生产退库标签 (productionReturnLabel.vue)
// | 创建标签 (RecycledMaterialsLabel.vue) | 到货请求 (PurchaseReceiptRequest.vue)

12
fe/PC/src/router/index.js

@ -138,15 +138,15 @@ export const constantRoutes = [
// {
// path: '/',
// component: Layout,
// redirect: '/_dashboard',
// redirect: '/splitLabels',
// hidden: true,
// children: [{
// path: '_dashboard',
// component: () => import('@/views/dashboard/_index'),
// name: '_dashboard',
// path: 'splitLabels',
// component: () => import('@/views/labelManage/PartiallyPreparedProducts/splitLabels.vue'),
// name: 'splitLabels',
// meta: {
// title: '_dashboard',
// icon: '系统首页',
// title: 'splitLabels',
// icon: '拆分箱标签',
// }
// }]
// },

381
fe/PC/src/views/labelManage/PartiallyPreparedProducts/splitLabels.vue

@ -0,0 +1,381 @@
<template>
<div class="appMainPage" v-loading="pageLoading">
<!-- 标签管理-业务标签-拆分箱标签 -->
<StepsFormAlone
:stepArray="stepArray"
ref="steps_split"
:hideLastBtsn="true"
>
<template v-slot:stepSlot1>
<curren-Form
ref="form_split"
size="medium"
:searchData="selectData"
:searchForm="selectForm"
:rules="selectRules"
:searchOptions="editOptions"
@push="detailsDataPush(arguments)"
></curren-Form>
</template>
<template v-slot:stepSlot2>
<currenTableFlex
:flexTableData="flexSelectTableData"
:flexSearchOptions="editOptions"
:flexTableColumns="flexTableColumns"
:showAddBtn="false"
:showAllDeleteButton="false"
:isShowIndex="true"
></currenTableFlex>
</template>
<template v-slot:stepSlot3>
<!-- 结果 -->
<resultStatus>
<template>
<el-button @click="rest()">返回</el-button>
<el-button type="primary" @click="printHandle()">打印</el-button>
</template>
</resultStatus>
</template>
</StepsFormAlone>
<!-- 搜索按钮窗体组件 -->
<searchPage
ref="searchTable"
:tableLoading="Loading.autoTableLoading"
:advancedFilter="advancedFilter()"
:filterPageListParams="filterPageListParams"
:formTitle="searchTitle"
:displayDialog="displayDialog.AddNewDialog"
:searchTableData="searchData"
:searchTableColumns="searchColumns"
:searchTotalCount="searchTotalCount"
:supplierItemPage="searchPageListParams"
@handleSelectionChange="prepareFormData"
@SizeChange="searchAlterResultCount($event, searchPageListParams)"
@CurrentChange="searchAlertoldSkipCount($event, searchPageListParams)"
@tableButtonClick="searchSubmit(arguments)"
></searchPage>
</div>
</template>
<script>
import { getPageList } from "@/api/wms-api"
import { initDataToHttpFormat } from "@/utils/index"
import { postInventoryLabelCode_count } from "@/api/wms-core"
import currenForm from "@/components/currenForm"
import StepsFormAlone from "@/components/StepsFormAlone"
import resultStatus from "@/components/resultStatus"
import currenTableFlex from "@/components/currenTableFlex"
import {initPrintPackingCodeTwoData} from "@/mixins/printMixin"
import _ from "lodash"
import { mixins } from "@/mixins/mixins"
import { LoadingMixins } from "@/mixins/LoadingMixins"
import { filterSelectMixins } from '@/mixins/filter-Select'
export default {
name: "RecycledMaterialsLabel",
mixins: [
mixins,
LoadingMixins,
filterSelectMixins
],
components: {
currenForm,
StepsFormAlone,
currenTableFlex,
resultStatus,
},
watch:{
"selectData.labelType"(val){
console.log("watch",val)
this.changeFormItemShow(val)
}
},
data () {
let _this = this
return {
pageLoading:false,
// options
stepArray:[
{title:"信息筛选",next:()=>{return _this.firstNext()}},
{title:"预览信息",cancle:()=>{return _this.sencondPre()}},
{title:"打印"},
],
selectItemInfo:{},//
selectSupplierItemInfo:{},//
selectSupplierInfo:{},//
selectPoNumberInfo:{},//
//
defaultSelectData:{
oldPackingCode:"",//
itemCode:"",//
itemName:"",//
canMake:null,//
canBuy:null,//
labelType:null,//1 2
isRecycled:null,//
canOutsourcing:null,//
qty:"",
lot:"",
labelQty:"1",
supplierCode:"",
poNumber:"",
remark:"",
arriveDate:undefined,
produceDate:undefined,
},
//
selectData:{},
//
selectForm:[
{
type: "filterSelect", label: "原箱标签", prop: "oldPackingCode", optionsLabel: "itemCode", optionsValue: "packingCode", clearable:true,
focus: (type,val) => { return this.getFilterList(type, val, "wms/inventory/Inventory-Balance")},
searchButton: (val) => { this.showSerarchPage(val, 'wms/inventory/Inventory-Balance', 'InventoryBalance', '箱标签选择', this.selectData) },
colSpan: 12,
},
{ type: "input",disabled:true,label: "物品代码", prop: "itemCode", colSpan: 12 },
{ type: "input",disabled:true,label: "物品名称", prop: "itemName", colSpan: 12 },
{ type: "select",disabled:true, label: "制造件", prop: "canMake", options: "whetherOrNot", colSpan: 12 },
{ type: "select", disabled:true,label: "采购件", prop: "canBuy", options: "whetherOrNot", colSpan: 12 },
{ type: "select", disabled:true,label: "标签类型", prop: "labelType", options: "labelTypeSelectOption", colSpan: 12 },
{ type: "select", disabled:true,label: "回收件", prop: "isRecycled", options: "whetherOrNot", colSpan: 12 },
{ type: "select", disabled:true,label: "外包件", prop: "canOutsourcing", options: "whetherOrNot", colSpan: 12 },
{ type: "inputNumber", label: "实际数量", prop: "qty",colSpan: 12 },
{ type: "input", label: "批次", prop: "lot", colSpan: 12 },
// { type: "inputNumber", label: "", prop: "labelQty", min:1,colSpan: 12 },
{ type: "dateTime", label: "生产时间", prop: "produceDate", colSpan: 12 },
{ type: "dateTime", label: "到货时间", prop: "arriveDate", colSpan: 12 },
{ type: "input", label: "备注", prop: "remark", colSpan: 12 },
{ type: "input",disabled:true,label: "供应商代码", prop: "supplierCode", colSpan: 12 },
{ type: "input",disabled:true,label: "采购订单号", prop: "poNumber", colSpan: 12 },
// {
// hide:false,type: "filterSelect", label: "", prop: "supplierCode", optionsLabel: "supplierSimpleName", optionsValue: "supplierCode", clearable:true,
// beforeFocus:()=>{if(!this.selectData.itemCode || this.selectData.itemCode.length <= 0){this.$message.error(''); return false}else{return true}},
// focus: (type,val) => { return this.getFilterList(type, val, "basedata/supplier-item",this.isFilter("itemCode", this.selectData.itemCode))},
// searchButton: (val) => { this.showSerarchPage(val, 'basedata/supplier-item', 'SupplierItem', '', this.selectData,
// this.isFilter("itemCode", this.selectData.itemCode)
// ) },
// colSpan: 12,
// },
// {
// hide:false,type: "filterSelect", label: "", prop: "poNumber",optionsValue: "poNumber", clearable:true,getType:"getPage",
// beforeFocus:()=>{if(!this.selectData.itemCode || this.selectData.itemCode.length <= 0){this.$message.error(''); return false}else{return true}},
// focus: (type,val) => { return this.getFilterList(type, {itemCode:this.selectData.itemCode}, "wms/store/supplier-asn/get-list-by-item-code")},
// colSpan: 12,
// },
],
// Rules
selectRules:{
oldPackingCode: [{ required: true, trigger: "change", message: "请选择原箱标签" },],
// itemCode: [{ required: true, trigger: "change", message: "" },],
labelType:[{ required: true, trigger: "change", message: "标签类型不能为空" }],
qty: [{ required: true, trigger: "change", message: "实际数量不能为空" }],
// labelQty: [{ required: true, trigger: "change", message: "" }],
// supplierCode: [{ required: false, trigger: "change", message: "" }],
// poNumber: [{ required: false, trigger: "change", message: "" }],
},
//
flexTableColumns:[
{ label: "原箱标签", prop: "oldPackingCode", },
{ label: "物品代码", prop: "itemCode", },
{ label: "物品名称", prop: "itemName", },
{ label: "批次", prop: "lot", },
{ label: "实际数量", prop: "qty", },
{ width:"auto",label: "生产日期", prop: "produceDate",type: "dateTime" },
{ label: "供应商代码", prop: "supplierCode", },
{ label: "供应商简称", prop: "supplierSimpleName", },
{ width:"auto",label: "供应商零件号", prop: "supplierItemCode", },
{ width:"auto",label: "供应商零件名", prop: "supplierItemName", },
{ width:"auto",label: "采购订单号", prop: "poNumber",type: "dateTime" },
{ width:"auto",label: "备注", prop: "remark", },
{ width:"auto",label: "箱标签", prop: "packingCode",fixed:"right" },
],
//
flexSelectTableData:[],
};
},
created(){
this.selectData = this.defaultSelectData
},
methods: {
consoleLog(){
console.log('selectItemInfo',this.selectItemInfo)//basedata/item-basic/list
console.log('selectData',this.selectData)
console.log('selectSupplierItemInfo',this.selectSupplierItemInfo)//basedata/supplier-item/list
console.log('selectSupplierInfo',this.selectSupplierInfo)//basedata/supplier/{id}
console.log('selectPoNumberInfo',this.selectPoNumberInfo)
},
//
rest(){
this.selectItemInfo={};
this.selectSupplierItemInfo = {}
this.selectPoNumberInfo = {}
this.selectSupplierInfo = {}
this.selectData = this.defaultSelectData
this.flexSelectTableData = [];
this.$refs.steps_split.returnFirstActive()
this.$refs.form_split.getDom().resetFields();
},
// prop
getFormPropIndex(prop){
let _index = null
this.selectForm.forEach((item,key)=>{
if(item.prop == prop)_index = key
})
return _index
},
//
detailsDataPush (val) {
// todo:
if(val[1].prop == "oldPackingCode"){
this.rest()
this.selectItemInfo = val[0];
this.selectSupplierItemInfo = val[0];//todo
this.selectPoNumberInfo = val[0];//todo
this.selectData.oldPackingCode = this.selectItemInfo.packingCode
this.selectData.itemCode = this.selectItemInfo.itemCode
this.selectData.itemName = this.selectItemInfo.itemName
this.selectData.canBuy=this.selectItemInfo.canBuy;
this.selectData.canMake=this.selectItemInfo.canMake;
this.selectData.isRecycled=this.selectItemInfo.isRecycled;
this.selectData.canOutsourcing=this.selectItemInfo.canOutsourcing;
// true
let _labelType_index = this.getFormPropIndex('labelType')
if((this.selectItemInfo.canBuy && !this.selectItemInfo.canMake) || (!this.selectItemInfo.canBuy && this.selectItemInfo.canMake)){
this.selectData.labelType = this.selectItemInfo.canBuy ? 1 : 2;
this.selectForm[_labelType_index].disabled = true
}else{
this.selectData.labelType = null
this.selectForm[_labelType_index].disabled = false
}
}
//
// if(val[1].prop == "supplierCode"){
// this.selectSupplierItemInfo = val[0];
// this.selectData.supplierCode = this.selectSupplierItemInfo.supplierCode
// let params = {
// condition: {
// filters: []
// }
// }
// params.condition.filters.push(...this.isFilter("code", this.selectData.supplierCode))
// getPageList(params, "basedata/supplier").then(res => {
// this.selectSupplierInfo = res.items[0]
// })
// }
//
// if(val[1].prop == "poNumber"){
// this.selectPoNumberInfo = val[0];
// }
},
//
changeFormItemShow(val){
this.selectData.labelType = val
let _poNumber_index = this.getFormPropIndex('poNumber')
let _supplierCode_index = this.getFormPropIndex('supplierCode')
//
if(this.selectData.labelType == 1){
this.selectForm[_poNumber_index].hide = false
this.selectForm[_supplierCode_index].hide = false
// this.selectRules.poNumber[0].required = true
// this.selectRules.supplierCode[0].required = true
}
//
else{
this.selectForm[_poNumber_index].hide = true
this.selectForm[_supplierCode_index].hide = true
// this.selectRules.poNumber[0].required = false
// this.selectRules.supplierCode[0].required = false
}
},
//
firstNext(){
return new Promise((resolve,reject) => {
this.$refs['form_split'].getDom().validate(valid=>{
if(valid){
// this.consoleLog()
let _data = {
// fullBarcodeString: undefined,//
itemCode: this.selectData.itemCode || null,
itemName: this.selectItemInfo.itemName || null,
itemDesc1: this.selectItemInfo.itemDesc1 || null,
itemDesc2: this.selectItemInfo.itemDesc2 || null,
lot: this.selectData.lot || "",
// supplierBatch: undefined,//
arriveDate: initDataToHttpFormat(this.selectData.arriveDate),
produceDate: initDataToHttpFormat(this.selectData.produceDate),
// expireDate: undefined,//
stdPackQty: Number(this.selectItemInfo.stdPackQty) || 0,
uom: this.selectItemInfo.basicUom || "",
qty: Number(this.selectData.qty),
labelStatus: 1,//
// recommendLocationCode: undefined,//
// locationErpCode: undefined,//
// containerCode: undefined,//
supplierCode: this.selectData.supplierCode,
poNumber: this.selectData.poNumber,
rpNumber: this.selectPoNumberInfo.rpNumber,
asnNumber: this.selectPoNumberInfo.number,
// qLevel: this.selectItemInfo.qLevel || undefined,//
// qualityFile: undefined,//
// prodLine: undefined,//
// team: undefined,//
// shift: undefined,//
specifications: this.selectItemInfo.color || null,
supplierName: this.selectSupplierItemInfo.supplierName,
supplierSimpleName: this.selectSupplierItemInfo.supplierSimpleName,
supplierItemCode: this.selectSupplierItemInfo.supplierItemCode,
supplierItemName: this.selectSupplierItemInfo.itemName,
labelType: this.selectData.labelType,
planArriveDate: initDataToHttpFormat(this.selectPoNumberInfo.planArriveDate),
remark:this.selectData.remark,//
}
//
this.pageLoading = true;
postInventoryLabelCode_count({count:this.selectData.labelQty}, _data)
.then(res => {
this.pageLoading = false
this.flexSelectTableData = res
this.flexSelectTableData.forEach(item=>{
item.packingCode=item.code
})
this.flexSelectTableData[0].oldPackingCode = this.selectData.oldPackingCode
resolve()
})
.catch(err => {
this.pageLoading = false
reject()
})
}
})
})
},
//
sencondPre(){
return new Promise((resolve,reject) => {
resolve()
})
},
//
printHandle(){
let _oldData = this.selectItemInfo
let _newData = this.flexSelectTableData[0]
_oldData.title = "原箱标签"
_newData.title = "拆分箱标签"
this.Print(initPrintPackingCodeTwoData(_oldData,_newData))
},
//
isFilter (val, data) {
let filter = [
{
logic: "And",
column: val,
action: "==",
value: data
}
]
return filter
},
},
}
</script>
Loading…
Cancel
Save