3 changed files with 455 additions and 6 deletions
@ -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…
Reference in new issue