From be39016e1a9d567691391c613ebaeea46ed32634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E8=99=B9=E7=9D=BF?= <297504645@qq.com> Date: Thu, 14 Mar 2024 17:25:33 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90nev-pc=E3=80=91=E5=9B=9E=E6=94=B6?= =?UTF-8?q?=E6=96=99=E7=AD=89=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fe/PC/src/api/wms-core.js | 2 +- fe/PC/src/components/currenTable/index.vue | 1 + fe/PC/src/components/filterSelect/index.vue | 26 +- fe/PC/src/mixins/filter-Select.js | 8 +- fe/PC/src/router/index.js | 16 + fe/PC/src/utils/detailsTableColumns/index.js | 44 +++ fe/PC/src/utils/formatTime.js | 11 + fe/PC/src/utils/tableColumns/index.js | 33 ++ fe/PC/src/utils/tabsDesTions/index.js | 29 ++ .../WorkshopManage/ProductionLine.vue | 18 +- .../materialsAdjustmentFunc.vue | 321 ++++++++++-------- .../purchaseReceipt/PurchaseOrderHigher.vue | 163 +++++++++ 12 files changed, 514 insertions(+), 158 deletions(-) create mode 100644 fe/PC/src/views/rawMaterialManage/purchaseReceipt/PurchaseOrderHigher.vue diff --git a/fe/PC/src/api/wms-core.js b/fe/PC/src/api/wms-core.js index c4506650a..835091e63 100644 --- a/fe/PC/src/api/wms-core.js +++ b/fe/PC/src/api/wms-core.js @@ -29,7 +29,7 @@ export function postInventoryLabelCode(data) { } //生产、采购生成标签(一次多个)| 标签管理模块 -export function postInventoryLabelCode_count(params,data) { +export async function postInventoryLabelCode_count(params,data) { return request({ url: baseURL + 'label/inventory-label/generate-and-create/many/'+params.count, method: 'post', diff --git a/fe/PC/src/components/currenTable/index.vue b/fe/PC/src/components/currenTable/index.vue index 2a1eb8cfb..8475b38bc 100644 --- a/fe/PC/src/components/currenTable/index.vue +++ b/fe/PC/src/components/currenTable/index.vue @@ -148,6 +148,7 @@ v-if="item.type === 'filterSelect'" :selectModel="scope.row[item.prop]" :selectItem="item" + :tableScope="scope" @filterOptionSelectHandle="(item,props,val)=>{filterOptionSelectHandle(item,props,val,scope)}" @filterClearHandle="(item)=>{filterClearHandle(item,scope)}" > diff --git a/fe/PC/src/components/filterSelect/index.vue b/fe/PC/src/components/filterSelect/index.vue index b44940515..2ce4a5971 100644 --- a/fe/PC/src/components/filterSelect/index.vue +++ b/fe/PC/src/components/filterSelect/index.vue @@ -55,8 +55,8 @@ export default { props: { // 数据类型基础配置 selectModel: { - type: String, - default: "" + type: String | Array , + default: null }, // 数据类型基础配置 selectItem: { @@ -65,6 +65,13 @@ export default { return {} } }, + // 当前table的行信息 + tableScope:{ + type: Object, + default: () => { + return {} + } + } }, data () { return { @@ -81,7 +88,7 @@ export default { }, created () { if(this.selectItem){ - this.value = this.selectModel + this.value = JSON.parse(JSON.stringify(this.selectModel)) this.options = this.selectItem.options this.isRemoteReset() } @@ -105,7 +112,7 @@ export default { }, // 给focus返回参数操作 getHttpData(query){ - if(this.selectItem.beforeFocus && !this.selectItem.beforeFocus()){ + if(this.selectItem.beforeFocus && !this.selectItem.beforeFocus(this.tableScope)){ return } if(this.selectItem.focus){ @@ -125,12 +132,19 @@ export default { } if(_value.length > 0 && !this.selectItem.noFilter){ let _column = this.selectItem.optionsValue || this.selectItem.prop - _params.condition.filters.push({logic:"And",column:_column,action:"Like",value:_value}) + // 单选 + if(typeof _value == 'string'){ + _params.condition.filters.push({logic:"And",column:_column,action:"Like",value:_value}) + } + // 多选 + // else{ + // _params.condition.filters.push({logic:"And",column:_column,action:"In",value:JSON.stringify(_value)}) + // } } } // api中《getPage》方式:在业务页面调用getFilterList时候 自行传第二个val值 // 执行方法并传参 - this.selectItem.focus(this.selectItem.getType,_params) + this.selectItem.focus(this.selectItem.getType,_params,this.tableScope) .then(res=>{ this.options = res if(!res || res.length <= 0){ diff --git a/fe/PC/src/mixins/filter-Select.js b/fe/PC/src/mixins/filter-Select.js index 32ab8bfe7..cb5df5f9e 100644 --- a/fe/PC/src/mixins/filter-Select.js +++ b/fe/PC/src/mixins/filter-Select.js @@ -97,8 +97,12 @@ export const filterSelectMixins = { // 回显 this.$nextTick(() => { if (this.mainData[this.searchFormData.prop]) { - // 针对多选回显处理 - let mainDataArry = this.mainData[this.searchFormData.prop].split(',') + // 多选回显处理 + let mainDataArry = this.mainData[this.searchFormData.prop] + // 单选处理回显处理 + if(typeof this.mainData[this.searchFormData.prop] == 'string'){ + mainDataArry = this.mainData[this.searchFormData.prop].split(',') + } mainDataArry.forEach(mainDataArryItem => { let hxRs = res.items.filter((item => (item[this.searchFormData.optionsValue] == mainDataArryItem))) hxRs.forEach(item => { diff --git a/fe/PC/src/router/index.js b/fe/PC/src/router/index.js index 92eb7175a..78f01342b 100644 --- a/fe/PC/src/router/index.js +++ b/fe/PC/src/router/index.js @@ -174,6 +174,22 @@ export const constantRoutes = [ } }] }, + { + path: '/', + component: Layout, + redirect: '/gridlayout', + hidden: true, + children: [{ + path: 'PurchaseOrderHigher', + component: () => import('@/views/rawMaterialManage/purchaseReceipt/PurchaseOrderHigher.vue'), + name: 'PurchaseOrderHigher', + meta: { + keepAlive : true, + title: '采购订单(关闭订单行)', + icon: '系统首页', + } + }] + }, ] /** diff --git a/fe/PC/src/utils/detailsTableColumns/index.js b/fe/PC/src/utils/detailsTableColumns/index.js index c746257bd..4f12c87dc 100644 --- a/fe/PC/src/utils/detailsTableColumns/index.js +++ b/fe/PC/src/utils/detailsTableColumns/index.js @@ -108,6 +108,50 @@ export const PurchaseOrder = [ // { label: "主表ID", prop: 'masterID' }, // ************** 确定隐藏 ************************ ] +// 采购订单信息 (有关闭订单行) +export const PurchaseOrderHigher = [ + { label: "物品代码", prop: "itemCode", fixed: "left" }, + { label: "物品名称", prop: "itemName" }, + { label: "物品描述1", prop: "itemDesc1" }, + { label: "物品描述2", prop: "itemDesc2" }, + { label: "配置", prop: "item_configurationFromFE" }, + { label: "发货数量", prop: "qty" }, + { label: "物品单位", prop: "uom" }, + { label: "生产批次", prop: "lot" }, + { label: "ERP储位", prop: "locationErpCode" }, + { label: "项目编号", prop: "projectCode" }, + { label: "类型", prop: "ctype", type: "filter", filters: "SupplierAsnCtypeSta" }, + { label: "已发货数量", prop: "shippedQty" }, + { label: "已收货数量", prop: "receivedQty" }, + { label: "已退货数量", prop: "returnedQty" }, + { label: "已上架数量", prop: "putAwayQty" }, + // ----------------------------------------------------------------------- + { label: "筹措员代码", prop: 'planUserCode' }, + { label: "要求到货时间", prop: "planArriveDate", type: "dateTime" }, + { label: "过期时间", prop: "expireDate", type: "dateTime" }, + { label: "发货单号", prop: 'number' }, + { label: "上次修改时间", prop: 'lastModificationTime', type: "dateTime" }, + { label: "上次修改者ID", prop: "lastModifierId" }, + { label: "标包数量", prop: 'stdPackQty' }, + { label: "订单行", prop: 'poLine' }, + { label: "供应商包装计量单位", prop: 'supplierPackUom' }, + { label: "供应商包装数量", prop: 'supplierPackQty' }, + { label: "转换率", prop: 'convertRate' }, + { label: "是否寄存订单", prop: 'isConsignment' }, + { label: "备注", prop: 'remark' }, + { label: "订单备注", prop: 'orderRemark' }, + { label: "事务ID", prop: "tenantId" }, + { label: "创建时间", prop: 'creationTime', type: "dateTime" }, + { label: "创建者ID", prop: 'creatorId' }, + // { label: "标包计量单位", prop: 'stdPackUom' }, + // ************** 确定隐藏 ************************ + // { label: "生产时间", prop: "produceDate", type: "dateTime" }, + // { label: "lineStatus", prop: 'lineStatus' }, + // { label: "ID", prop: 'id' }, + // { label: "主表ID", prop: 'masterID' }, + // ************** 确定隐藏 ************************ +] + // 到货请求 20230404 export const PurchaseReceiptRequest = [ { label: "物品代码", prop: "itemCode", fixed: "left" }, diff --git a/fe/PC/src/utils/formatTime.js b/fe/PC/src/utils/formatTime.js index 4019a2b42..a31daeb51 100644 --- a/fe/PC/src/utils/formatTime.js +++ b/fe/PC/src/utils/formatTime.js @@ -82,4 +82,15 @@ export function formatTimeStampToNorm(data,type,connect){ default: return year+arr[0] + month+arr[1] + day+arr[2] + " " +hour+arr[3] + minute+arr[4] + second+arr[5]; } +} + +// 获取当前时间 +export function getNowInit(type){ + return formatTimeStampToNorm(new Date(), type || 'datetime') +} + + +// 获取当前时间 带T +export function getNowToT(type){ + return formatTimeToT(formatTimeStampToNorm(new Date(), type || 'datetime')) } \ No newline at end of file diff --git a/fe/PC/src/utils/tableColumns/index.js b/fe/PC/src/utils/tableColumns/index.js index 7ce540d8f..9642ffb9c 100644 --- a/fe/PC/src/utils/tableColumns/index.js +++ b/fe/PC/src/utils/tableColumns/index.js @@ -1067,6 +1067,39 @@ export const PurchaseOrder = [ // { label: "事务ID", prop: "tenantId" }, // ************** 确认隐藏 ************************ ] +// 采购订单信息 (有关闭订单行) +export const PurchaseOrderHigher = [ + { + label: "采购订单号", + prop: "number", + fixed: "left", + type: "name", + width: orderWidth + }, + { label: "供应商代码", prop: "supplierCode" }, + { label: "供应商名称", prop: "supplierName" }, + { label: "供应商地址", prop: "supplierAddress",showProp: true }, + { label: "订单备注", prop: 'remark' }, + { label: "创建时间", prop: 'creationTime', type:'dateTime' }, + { label: "操作员", prop: 'worker' }, + { label: "联系人姓名", prop: 'contactName' }, + { label: "联系人电话", prop: 'contactPhone' }, + { label: "联系人邮件", prop: 'contactEmail' }, + { label: "生效日期", prop: 'activeDate', type: "dateTime" }, + { label: "订单类型", prop: 'poType' }, + { label: "是否寄存订单", prop: 'isConsignment', type: "filter", filters: "whetherOrNot" }, + { label: "订单日期", prop: 'orderDate',type: "dateTime" }, + { label: "截止日期", prop: 'dueDate',type: "dateTime" }, + { label: "版本", prop: 'version' }, + { label: "税率", prop: 'taxRate' }, + { label: "上次修改时间", prop: 'lastModificationTime', type: "dateTime" }, + // ************** 确认隐藏 ************************ + // { label: "orderStatus", prop: 'orderStatus' }, + // { label: "上次修改者ID", prop: "lastModifierId" }, + // { label: "创建者ID", prop: 'creatorId' }, + // { label: "事务ID", prop: "tenantId" }, + // ************** 确认隐藏 ************************ +] // 到货请求 20230404 export const PurchaseReceiptRequest = [ { diff --git a/fe/PC/src/utils/tabsDesTions/index.js b/fe/PC/src/utils/tabsDesTions/index.js index 87dcc4765..ec81aa33a 100644 --- a/fe/PC/src/utils/tabsDesTions/index.js +++ b/fe/PC/src/utils/tabsDesTions/index.js @@ -807,6 +807,35 @@ export const PurchaseOrder = [ // { label: "orderStatus", prop: 'orderStatus' }, // ************** 确认隐藏 ************************ ] + +// 采购订单信息 (有关闭订单行) +export const PurchaseOrderHigher = [ + { label: "采购订单号", prop: 'number' }, + { label: "供应商代码", prop: "supplierCode" }, + { label: "供应商名称", prop: "supplierName" }, + { label: "供应商地址", prop: "supplierAddress" }, + { label: "订单备注", prop: 'remark' }, + { label: "创建时间", prop: 'creationTime', type:'dateTime' }, + { label: "创建者ID", prop: "creatorId" }, + { label: "操作员", prop: 'worker' }, + { label: "联系人姓名", prop: 'contactName' }, + { label: "联系人电话", prop: 'contactPhone' }, + { label: "联系人邮件", prop: 'contactEmail' }, + { label: "上次修改时间", prop: 'lastModificationTime', type: "dateTime" }, + { label: "上次修改者ID", prop: "lastModifierId" }, + { label: "生效日期", prop: 'activeDate', type: "dateTime" }, + { label: "事务ID", prop: "tenantId" }, + { label: "订单类型", prop: 'poType' }, + { label: "是否寄存订单", prop: 'isConsignment', type: "filter", filters: "whetherOrNot" }, + { label: "订单日期", prop: 'orderDate',type: "dateTime" }, + { label: "截止日期", prop: 'dueDate',type: "dateTime" }, + { label: "版本", prop: 'version' }, + { label: "税率", prop: 'taxRate' }, + // ************** 确认隐藏 ************************ + // { label: "ID", prop: 'id' }, + // { label: "orderStatus", prop: 'orderStatus' }, + // ************** 确认隐藏 ************************ +] // 到货请求 已调整 20230404 export const PurchaseReceiptRequest = [ { label: "到货单号", prop: "number" }, diff --git a/fe/PC/src/views/basicData/WorkshopManage/ProductionLine.vue b/fe/PC/src/views/basicData/WorkshopManage/ProductionLine.vue index 2be330bbe..82eab83c7 100644 --- a/fe/PC/src/views/basicData/WorkshopManage/ProductionLine.vue +++ b/fe/PC/src/views/basicData/WorkshopManage/ProductionLine.vue @@ -58,6 +58,7 @@ @SizeChange="searchAlterResultCount($event, searchPageListParams)" @CurrentChange="searchAlertoldSkipCount($event, searchPageListParams)" @tableButtonClick="searchSubmit(arguments)" + :isMoreSelectTable="true" > @@ -159,15 +160,14 @@ export default { { type: "select", label: "类型", prop: "type", options: "productionLineType", colSpan: 12 }, { type: "filterSelect", label: "车间代码", prop: "workshopCode", optionsLabel: "name", optionsValue: "code", focus: (type,val) => { return this.getFilterList(type, val, "basedata/workshop")}, - searchButton: (val) => { this.showSerarchPage(val, 'basedata/workshop', 'Workshop', '车间选择', this.CreateFormData) }, colSpan: 12 }, - - { type: "filterSelect", label: "原料库位", prop: "rawLocationCode", optionsLabel: "name", optionsValue: "code", - focus: (type,val) => { return this.getFilterList(type, val, "basedata/location",[ - {logic:"And",column:"type",action:"==",value:"2"}, - ])}, - searchButton: (val) => { this.showSerarchPage(val, 'basedata/location', 'Location', '库位选择', this.CreateFormData,[ - {logic:"And",column:"type",action:"==",value:"2"}, - ]) }, colSpan: 12 }, + searchButton: (val) => { this.showSerarchPage(val, 'basedata/workshop', 'Workshop', '车间选择', this.CreateFormData) }, + colSpan: 12 + }, + { type: "filterSelect", label: "原料库位", prop: "rawLocationCode", optionsLabel: "name", optionsValue: "code", + focus: (type,val) => { return this.getFilterList(type, val, "basedata/location",[{logic:"And",column:"type",action:"==",value:"2"}])}, + searchButton: (val) => { this.showSerarchPage(val, 'basedata/location', 'Location', '库位选择', this.CreateFormData,[{logic:"And",column:"type",action:"==",value:"2"},]) }, + colSpan: 12,multiple:true + }, { type: "filterSelect", label: "原料库位组", prop: "rawLocationGroupCode", optionsLabel: "name", optionsValue: "code", focus: (type,val) => { return this.getFilterList(type, val, "basedata/location-group",[ diff --git a/fe/PC/src/views/inventoryManage/recycledMaterials/materialsAdjustmentFunc.vue b/fe/PC/src/views/inventoryManage/recycledMaterials/materialsAdjustmentFunc.vue index 4a29bb420..367457f48 100644 --- a/fe/PC/src/views/inventoryManage/recycledMaterials/materialsAdjustmentFunc.vue +++ b/fe/PC/src/views/inventoryManage/recycledMaterials/materialsAdjustmentFunc.vue @@ -77,8 +77,6 @@ :flexSearchOptions="editOptions" :flexTableColumns="addPopColumns_YL" @detailsDataPush="pushYL" - @updateSelectListTable="updateSelectListTable_YL" - @changeSelect="changeSelect_YL" @clearHandle="clearHandle_YL" > @@ -113,6 +111,7 @@ import { filterSelectMixins } from '@/mixins/filter-Select' import detailsRules from '@/utils/rules'; import { getPageList,itemTransformNewCreate } from "@/api/wms-api" import { postInventoryLabelCode_count } from "@/api/wms-core" +import { getNowToT,formatTimeStampToNorm } from '@/utils/formatTime' import store from '@/store' export default { name: "materialsAdjustmentFunc", @@ -127,16 +126,6 @@ export default { components:{ currenTableFlex }, - watch: { - 'packingsYL_Options':{ - handler(val) { - console.log(128,val) - this.addPopColumns_YL[1].userOptions = val; - }, - deep: true, - immediate: true, - }, - }, data () { return { URL: 'wms/store/item-transform-request', @@ -153,6 +142,8 @@ export default { //粉碎料信息 addPopData_FS:[{ itemCode:null, + supplierCode:null, + poNumber:null, qty:null, locationCode:null, }], @@ -160,8 +151,20 @@ export default { addPopColumns_FS:[ { type: "filterSelect", label: "物品代码", prop: "itemCode", optionsLabel: "name", optionsValue: "code", focus: (type,val) => { return this.getFilterList(type, val, "basedata/Item-Basic")},//this.isFilter("isRecycled","true") - searchButton: (val) => { this.showSerarchPage(val, 'basedata/Item-Basic', 'ItemBasic', '物品选择', this.addPopData_HB) }, - width:"auto", searchButton:false + // searchButton: (val) => { this.showSerarchPage(val, 'basedata/Item-Basic', 'ItemBasic', '物品选择', this.addPopData_HB) }, + width:"auto" + }, + { + type: "filterSelect", label: "供应商代码", prop: "supplierCode", optionsLabel: "supplierSimpleName", optionsValue: "supplierCode", clearable:true, + beforeFocus:(tableScope)=>{if(!this.addPopData_FS[tableScope.$index].itemCode || this.addPopData_FS[tableScope.$index].length <= 0){this.$message.error('请选择物品代码'); return false}else{return true}}, + focus: (type,val,tableScope) => { return this.getFilterList(type, val, "basedata/supplier-item",this.isFilter("itemCode", this.addPopData_FS[tableScope.$index].itemCode))}, + width:"auto", + }, + { + type: "filterSelect", label: "采购订单号", prop: "poNumber",optionsValue: "poNumber", clearable:true, + beforeFocus:(tableScope)=>{if(!this.addPopData_FS[tableScope.$index].itemCode || this.addPopData_FS[tableScope.$index].itemCode.length <= 0 || !this.addPopData_FS[tableScope.$index].supplierCode || this.addPopData_FS[tableScope.$index].supplierCode.length <= 0){this.$message.error('请选择物品代码和供应商代码'); return false}else{return true}}, + focus: (type,val,tableScope) => { return this.getFilterList(type, val, "wms/store/supplier-asn",this.isFilter("supplierCode", this.addPopData_FS[tableScope.$index].supplierCode))}, + width:"auto", }, { type: "filterSelect", label: "目标库位", prop: "locationCode", optionsLabel: "name", optionsValue: "code", focus: (type,val) => { return this.getFilterList(type, val, "basedata/Location",this.isFilter("type", "2"))}, @@ -171,7 +174,7 @@ export default { { type: "input", validType:'pointNumber', label: "数量", prop: "qty", width:"auto", rules: [{ type: "number", - trigger: ["change","blur"], + trigger: ["blur"], validator: (rule, value, callback) => { let _index = rule.field.slice(8,9) let _qty = Number(this.addPopData_FS[_index].qty) @@ -192,32 +195,25 @@ export default { locationCode:null, qty:null }], - packingsYL_Options:[], - itemPackings_YL:{}, //原料表头信息 addPopColumns_YL:[ { type: "filterSelect", label: "物品代码", prop: "itemCode", optionsLabel: "name", optionsValue: "code", focus: (type,val) => { return this.getFilterList(type, val, "basedata/Item-Basic",this.isFilter("type", "10C02"))}, width:"auto" }, - // { type: "filterSelect", label: "箱标签", prop: "packingCode", - // // optionsLabel: "itemCode", optionsValue: "packingCode", - // focus: (type,val) => { return this.getFilterList(type, val, "wms/inventory/Inventory-Balance")}, - // colSpan: 12 - // }, - { type: "select", label: "箱码", prop: "packingCode", - optionsLabel: "packingCode", optionsValue: "packingCode", - userOptions:this.packingsYL_Options,width:"auto", - filterable:true,clearable:true + { type: "filterSelect", label: "箱标签", prop: "packingCode", optionsLabel: "packingCode", optionsValue: "packingCode", clearable:true, + beforeFocus:(tableScope)=>{if(!this.addPopData_YL[tableScope.$index].itemCode || this.addPopData_YL[tableScope.$index].length <= 0){this.$message.error('请选择物品代码'); return false}else{return true}}, + focus: (type,val,tableScope) => { return this.getFilterList(type, val, "wms/inventory/Inventory-Balance",this.isFilter("itemCode", this.addPopData_YL[tableScope.$index].itemCode))}, + width:"auto", }, - // todo: 库存数量、库位:自动带出 + // 库存数量、库位:自动带出 { label: "库存数量", prop: "inventoryQty", width:"auto" }, { label: "库位", prop: "locationCode", width:"auto" }, - // todo: 小于等于库存数量 + // 小于等于库存数量 { type: "input", validType:'pointNumber', label: "数量", prop: "qty", width:"auto", rules: [{ type: "number", - trigger: ["change","blur"], + trigger: ["blur"], validator: (rule, value, callback) => { let _index = rule.field.slice(8,9) if(this.addPopData_YL[_index].qty == null){ @@ -237,15 +233,29 @@ export default { //混拌料信息 addPopData_HB:[{ itemCode:null, + supplierCode:null, + poNumber:null, qty:null, locationCode:null, }], //混拌料表头信息 addPopColumns_HB:[ { type: "filterSelect", label: "物品代码", prop: "itemCode", optionsLabel: "name", optionsValue: "code", - focus: (type,val) => { return this.getFilterList(type, val, "basedata/Item-Basic")}, - searchButton: (val) => { this.showSerarchPage(val, 'basedata/Item-Basic', 'ItemBasic', '物品选择', this.addPopData_HB) }, - width:"auto", searchButton:false + focus: (type,val) => { return this.getFilterList(type, val, "basedata/Item-Basic",this.isFilterForHB())}, + // searchButton: (val) => { this.showSerarchPage(val, 'basedata/Item-Basic', 'ItemBasic', '物品选择', this.addPopData_HB) }, + width:"auto", + }, + { + type: "filterSelect", label: "供应商代码", prop: "supplierCode", optionsLabel: "supplierSimpleName", optionsValue: "supplierCode", clearable:true, + beforeFocus:(tableScope)=>{if(!this.addPopData_FS[tableScope.$index].itemCode || this.addPopData_FS[tableScope.$index].length <= 0){this.$message.error('请选择物品代码'); return false}else{return true}}, + focus: (type,val,tableScope) => { return this.getFilterList(type, val, "basedata/supplier-item",this.isFilter("itemCode", this.addPopData_FS[tableScope.$index].itemCode))}, + width:"auto", + }, + { + type: "filterSelect", label: "采购订单号", prop: "poNumber",optionsValue: "poNumber", clearable:true, + beforeFocus:(tableScope)=>{if(!this.addPopData_FS[tableScope.$index].itemCode || this.addPopData_FS[tableScope.$index].itemCode.length <= 0 || !this.addPopData_FS[tableScope.$index].supplierCode || this.addPopData_FS[tableScope.$index].supplierCode.length <= 0){this.$message.error('请选择物品代码和供应商代码'); return false}else{return true}}, + focus: (type,val,tableScope) => { return this.getFilterList(type, val, "wms/store/supplier-asn",this.isFilter("supplierCode", this.addPopData_FS[tableScope.$index].supplierCode))}, + width:"auto", }, { type: "filterSelect", label: "目标库位", prop: "locationCode", optionsLabel: "name", optionsValue: "code", focus: (type,val) => { return this.getFilterList(type, val, "basedata/Location")}, @@ -255,7 +265,7 @@ export default { { type: "input", validType:'pointNumber', label: "数量", prop: "qty", width:"auto", rules: [{ type: "number", - trigger: ["change","blur"], + trigger: ["blur"], validator: (rule, value, callback) => { let _index = rule.field.slice(8,9) let _qty = Number(this.addPopData_HB[_index].qty) @@ -269,7 +279,10 @@ export default { }, ], itemStagingLists:{},//物料相关内容暂存 + supplierStagingLists:{},// 供应商信息暂存 + asnStagingLists:{},// 供应商发货通知暂存 locationStagingLists:{},//库位相关内容暂存 + packingStagingLists:{},//箱码相关内容暂存 needNewPackingList:[],//需要生成项目的列表信息(N个粉碎料+1个混拌料) newPackArr:[],//已生成的新箱码 }; @@ -278,6 +291,25 @@ export default { // this.paging(); }, methods:{ + // 混拌料物品筛选,不可选粉碎料选过的 + isFilterForHB(){ + let _items = [] + this.addPopData_FS.forEach(item=>{ + if(item.itemCode)_items.push(item.itemCode) + }) + if(_items.length <= 0){ + return [] + } + let filter = [ + { + logic: "And", + column: 'code', + action: "NotIn", + value: JSON.stringify(_items) + } + ] + return filter + }, //过滤查询条件 isFilter (val, data) { let filter = [ @@ -300,6 +332,8 @@ export default { initAddPopData(){ this.addPopData_FS=[{ itemCode:null, + supplierCode:null, + poNumber:null, qty:null, locationCode:null, }] @@ -312,6 +346,8 @@ export default { }] this.addPopData_HB=[{ itemCode:null, + supplierCode:null, + poNumber:null, qty:null, locationCode:null, }] @@ -328,20 +364,26 @@ export default { }); }, + // 最后提交的from值转义 + getFormDataInit(item,index,prop,prop_yl){ + let _prop_yl = prop_yl ? prop_yl : prop; + return item.remark == '原料' ? this.packingStagingLists[item.packingCode][_prop_yl] : this.newPackArr[index][prop] + }, // todo:最后提交接口 lastCommitHttp(){ - console.log(336,this.newPackArr) - this.addPopColumns_YL.forEach(item=>{ + this.addPopData_YL.forEach(item=>{ item.remark = '原料' }) let _allDetails = [ ...this.addPopData_FS, - ...this.addPopColumns_YL + ...this.addPopData_YL ] - let _toData = this.addPopColumns_HB[0] + let _toData = this.addPopData_HB[0] let _toItemInfo = this.itemStagingLists[_toData.itemCode] let _toLocationInfo = this.locationStagingLists[_toData.locationCode] + let _toData_new = this.newPackArr[this.newPackArr.length - 1] let _details = [] + let _this = this _allDetails.forEach((item,index)=>{ let _itemInfo = this.itemStagingLists[item.itemCode] let _locationInfo = this.locationStagingLists[item.locationCode] @@ -350,42 +392,43 @@ export default { itemCode: item.itemCode || null, itemName: _itemInfo.name || null, itemDesc1: _itemInfo.desc1 || null, - itemDesc2: _item_info.desc2 || null, - "fromPackingCode": item.packingCode || null,//todo:粉碎料无packingCode,是否需要添加选择项 - toPackingCode: this.newPackArr[index], + itemDesc2: _itemInfo.desc2 || null, + fromPackingCode: item.packingCode ? item.packingCode : this.newPackArr[index].code, + toPackingCode: _toData_new.code, toItemCode: _toData.itemCode || null, toItemName: _toItemInfo.name || null, toItemDesc1: _toItemInfo.desc1 || null, toItemDesc2: _toItemInfo.desc2 || null, - uom: _item_info.basicUom || null, + uom: _itemInfo.basicUom || null, fromQty: item.qty, toQty: _toData.qty, - "fromSupplierBatch": null,//todo - "fromArriveDate": null,//todo - "fromProduceDate": null,//todo - "fromExpireDate": null,//todo - "fromLot": null,//todo - "fromStatus": null,//todo + // 原料的走本身 + fromSupplierBatch: this.getFormDataInit(item,index,'supplierBatch'), + fromArriveDate: this.getFormDataInit(item,index,'arriveDate'), + fromProduceDate: this.getFormDataInit(item,index,'produceDate'), + fromExpireDate: this.getFormDataInit(item,index,'expireDate'), + fromLot: this.getFormDataInit(item,index,'lot'), + fromStatus: this.getFormDataInit(item,index,'labelStatus','status'), fromLocationCode: item.locationCode || null, fromLocationArea: _locationInfo.areaCode || null, fromLocationGroup: _locationInfo.locationGroupCode || null, fromLocationErpCode: _locationInfo.erpLocationCode || null, fromWarehouseCode: _locationInfo.warehouseCode || null, - "fromContainerCode": null,//todo - "toSupplierBatch": null,//todo - "toArriveDate": null,//todo - "toProduceDate": null,//todo - "toExpireDate": null,//todo - "toLot": null,//todo - "toStatus": null,//todo + fromContainerCode: this.getFormDataInit(item,index,'containerCode'), + toSupplierBatch: _toData_new.supplierBatch || null, + toArriveDate: _toData_new.arriveDate || null, + toProduceDate: _toData_new.produceDate || null, + toExpireDate: _toData_new.expireDate || null, + toLot: _toData_new.lot || null, + toStatus: 1, toLocationCode: _toData.locationCode || null, toLocationArea: _toLocationInfo.areaCode || null, toLocationGroup: _toLocationInfo.locationGroupCode || null, toLocationErpCode: _toLocationInfo.erpLocationCode || null, toWarehouseCode: _toLocationInfo.warehouseCode || null, - "toContainerCode": null,//todo - worker: store.getters.name.userName,//todo - "reasonCode": null,//todo + toContainerCode: _toData_new.containerCode || null, + worker: store.getters.name.userName, + reasonCode: null, } _details.push(_item) }) @@ -396,13 +439,13 @@ export default { itemName: _toItemInfo.name || null, itemDesc1: _toItemInfo.desc1 || null, itemDesc2: _toItemInfo.desc2 || null, - "lot": null,//todo - "supplierBatch": null,//todo - "arriveDate": null,//todo - "produceDate": null,//todo - "expireDate": null,//todo - packingCode: this.newPackArr[this.newPackArr.length - 1], - "containerCode": null,//todo + lot: _toData_new.lot || null, + supplierBatch: _toData_new.supplierBatch || null, + arriveDate: _toData_new.arriveDate || null, + produceDate: _toData_new.produceDate || null, + expireDate: _toData_new.expireDate || null, + packingCode: _toData_new.code, + containerCode: _toData_new.containerCode || null, uom: _toItemInfo.basicUom || null, qty: _toData.qty, stdPackQty: Number(_toItemInfo.stdPackQty) || 0, @@ -410,20 +453,20 @@ export default { locationArea: _toLocationInfo.areaCode || null, locationGroup: _toLocationInfo.locationGroupCode || null, locationErpCode: _toLocationInfo.erpLocationCode || null, - "status": null,//todo + status: 1, warehouseCode: _toLocationInfo.warehouseCode || null, - "reasonCode": null,//todo + reasonCode: null, } ] let _finalData = { - "tenantId": null,//todo - "remark": null,//todo - "extraProperties": null,//todo - worker: store.getters.name.userName,//todo - activeDate: new Date(),//todo - "number": null,//todo - "requestNumber": null,//todo - "jobNumber": null,//todo + tenantId: null, + remark: "", + extraProperties: null, + worker: store.getters.name.userName, + activeDate: getNowToT(), + number: "", + requestNumber: "", + jobNumber: "", details:_details, recDetails:_recDetail } @@ -450,7 +493,7 @@ export default { //如果成功了,继续发送 if(_resultBack == 1){ let _index = Number(index) + 1 - _this.resendHandle(_index) + this.resendHandle(_index) } //失败了提示不进行任何处理 else{ @@ -463,45 +506,47 @@ export default { let _item = this.needNewPackingList[index] let _item_info = this.itemStagingLists[_item.itemCode] let _location_info = this.locationStagingLists[_item.locationCode] + let _supplier_info = this.supplierStagingLists[_item.supplierCode] + let _asn_info = this.asnStagingLists[_item.poNumber] let _creatPackData = { itemCode: _item_info.code || null, itemName: _item_info.name || null, itemDesc1: _item_info.desc1 || null, itemDesc2: _item_info.desc2 || null, - lot: null,//todo - supplierBatch: null,//todo - arriveDate: null,//todo - produceDate: null,//todo - expireDate: null,//todo + lot: formatTimeStampToNorm(new Date(),'date'), + arriveDate: getNowToT(), + produceDate: getNowToT(), + expireDate: "9999-12-31", stdPackQty: Number(_item_info.stdPackQty) || 0, uom: _item_info.basicUom || null, qty: Number(_item.qty), - labelStatus: 1,//todo - recommendLocationCode: _location_info.code || null,//todo - locationErpCode: _location_info.erpLocationCode || null,//todo - containerCode: null,//todo - supplierCode: null,//todo - poNumber: null,//todo - rpNumber: null,//todo - asnNumber: null,//todo - qLevel: _item_info.elevel || null,//todo - qualityFile: null,//todo - prodLine: null,//todo - team: null,//todo - shift: null,//todo - specifications: null,//todo - supplierName: null,//todo - supplierSimpleName: null,//todo - supplierItemCode: null,//todo - supplierItemName: null,//todo - labelType: null,//todo - planArriveDate: null,//todo + labelStatus: 1, + recommendLocationCode: _location_info.code || null, + locationErpCode: _location_info.erpLocationCode || null, + containerCode: null, + supplierCode: _item.supplierCode, + poNumber: _item.poNumber, + rpNumber: _asn_info.rpNumber, + asnNumber: _asn_info.number, + qLevel: _item_info.elevel || null, + qualityFile: null, + prodLine: null, + team: null, + shift: null, + specifications: null, + supplierBatch: null,//todo + supplierName: null,//todo:basedata/supplier-item/list中无此字段 + supplierSimpleName: _supplier_info.supplierSimpleName, + supplierItemCode: _supplier_info.supplierItemCode, + supplierItemName: null,//todo:basedata/supplier-item/list中无此字段 + labelType: 1,//采购标签 + planArriveDate: "9999-12-31", remark:null, } let resultBack = null // // 生成标签(接口) - postInventoryLabelCode_count({count:1}, _creatPackData) - .then(res=>{ resultBack = 1;this.newPackArr[index] = res }) + await postInventoryLabelCode_count({count:1}, _creatPackData) + .then(res=>{ resultBack = 1;this.newPackArr[index] = res[0] }) .catch(err=>{ resultBack = 0 }) return resultBack @@ -511,7 +556,7 @@ export default { // 检测【粉碎料】信息是否填全 let _err_FS=0 this.addPopData_FS.forEach(item=>{ - if(!item.itemCode || Number(item.qty <= 0) || !item.locationCode){ + if(!item.itemCode || Number(item.qty <= 0) || !item.locationCode || !item.supplierCode || !item.poNumber){ _err_FS++ } }) @@ -533,7 +578,7 @@ export default { // 检测【混拌料】信息是否填全 let _err_HB=0 this.addPopData_HB.forEach(item=>{ - if(!item.itemCode || Number(item.qty <= 0) || !item.locationCode){ + if(!item.itemCode || Number(item.qty <= 0) || !item.locationCode || !item.supplierCode || !item.poNumber){ _err_HB++ } }) @@ -558,6 +603,18 @@ export default { pushFS(data){ if(data[1].prop == "itemCode"){ this.itemStagingLists[data[2]] = data[0] + if(data[2] == this.addPopData_HB[0].itemCode){ + this.$warningMsg("不可选择与混拌料相同的物料") + this.$nextTick(()=>{ + this.addPopData_FS[data[3].$index].itemCode = null + }) + } + } + if(data[1].prop == "supplierCode"){ + this.supplierStagingLists[data[2]] = data[0] + } + if(data[1].prop == "poNumber"){ + this.asnStagingLists[data[2]] = data[0] } if(data[1].prop == "locationCode"){ this.locationStagingLists[data[2]] = data[0] @@ -565,7 +622,16 @@ export default { }, // 原料下拉 pushYL(data){ - if(data[1].prop="itemCode"){ + if(data[1].prop=="itemCode"){ + this.itemStagingLists[data[2]] = data[0] + } + else if(data[1].prop=="packingCode"){ + this.packingStagingLists[data[2]] = data[0] + this.addPopData_YL[data[3].$index].packingCode = data[2] + this.addPopData_YL[data[3].$index].inventoryQty = data[0].qty + this.addPopData_YL[data[3].$index].locationCode = data[0].locationCode + this.addPopData_YL[data[3].$index].qty = null + // 获取库位相关信息 let params = { Sorting: "", MaxResultCount: 1000, @@ -573,20 +639,15 @@ export default { condition: { filters: [{ logic: "And", - column: "itemCode", + column: "code", action: "==", - value: data[0].code + value: data[0].locationCode }] } } this.Loading.appMainLoading = true - // todo:字段确定 - console.log(311,data[3].$index) - this.addPopData_YL[data[3].$index].packingCode = null - this.addPopData_YL[data[3].$index].inventoryQty = null - this.addPopData_YL[data[3].$index].locationCode = null - getPageList(params, "wms/inventory/inventory-balance").then((res)=>{ - this.itemPackings_YL[data[0].code] = res.items + getPageList(params, "basedata/Location").then((res)=>{ + this.locationStagingLists[data[0].locationCode] = res.items[0] this.Loading.appMainLoading = false }) .catch(err=>{ @@ -594,17 +655,6 @@ export default { }) } }, - // 原料selet更改 - changeSelect_YL(prop, val,item,searchData,scope){ - if(prop == 'packingCode'){ - let _currentRow = this.itemPackings_YL[searchData.itemCode].filter(item=>{ - return val == item.packingCode - }) - // todo:字段确定 - this.addPopData_YL[scope.$index].inventoryQty = _currentRow.length > 0 ? _currentRow[0].qty : null - this.addPopData_YL[scope.$index].locationCode = _currentRow.length > 0 ? _currentRow[0].locationCode : null - } - }, // 原料清空 clearHandle_YL(item,scope){ this.addPopData_YL[scope.$index].packingCode = null @@ -612,26 +662,17 @@ export default { this.addPopData_YL[scope.$index].locationCode = null this.addPopData_YL[scope.$index].qty = null }, - // 原料select展开/关闭 - updateSelectListTable_YL(data,item,scope,tableData){ - // 展开 - if(data){ - if(item.prop == "packingCode"){ - this.packingsYL_Options = [] - if(!tableData[scope.$index].itemCode || tableData[scope.$index].itemCode.length == 0){ - this.$warningMsg("请先选择物料") - } - if(this.itemPackings_YL[tableData[scope.$index].itemCode]){ - this.packingsYL_Options = this.itemPackings_YL[tableData[scope.$index].itemCode] - } - } - } - }, // 混拌料下拉 pushHB(data){ if(data[1].prop == "itemCode"){ this.itemStagingLists[data[2]] = data[0] } + if(data[1].prop == "supplierCode"){ + this.supplierStagingLists[data[2]] = data[0] + } + if(data[1].prop == "poNumber"){ + this.asnStagingLists[data[2]] = data[0] + } if(data[1].prop == "locationCode"){ this.locationStagingLists[data[2]] = data[0] } diff --git a/fe/PC/src/views/rawMaterialManage/purchaseReceipt/PurchaseOrderHigher.vue b/fe/PC/src/views/rawMaterialManage/purchaseReceipt/PurchaseOrderHigher.vue new file mode 100644 index 000000000..99c649b4f --- /dev/null +++ b/fe/PC/src/views/rawMaterialManage/purchaseReceipt/PurchaseOrderHigher.vue @@ -0,0 +1,163 @@ + + + \ No newline at end of file