From 39dbbe4b4a91ff8ddcee2f597873a4dea5a91b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E8=99=B9=E7=9D=BF?= <297504645@qq.com> Date: Fri, 15 Mar 2024 17:26:51 +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=E5=8A=9F=E8=83=BD+filterSelect=E5=A4=9A=E9=80=89?= =?UTF-8?q?=E6=83=85=E5=86=B5=E5=B0=81=E8=A3=85=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fe/PC/src/components/filterSelect/index.vue | 2 +- fe/PC/src/filters/status.js | 15 +- fe/PC/src/mixins/filter-Select.js | 46 ++-- fe/PC/src/router/index.js | 16 ++ fe/PC/src/utils/tableColumns/index.js | 2 +- .../WorkshopManage/ProductionLine-old.vue | 249 ++++++++++++++++++ .../WorkshopManage/ProductionLine.vue | 12 +- .../materialsAdjustmentFunc.vue | 51 ++-- 8 files changed, 345 insertions(+), 48 deletions(-) create mode 100644 fe/PC/src/views/basicData/WorkshopManage/ProductionLine-old.vue diff --git a/fe/PC/src/components/filterSelect/index.vue b/fe/PC/src/components/filterSelect/index.vue index 2ce4a5971..5c11d3235 100644 --- a/fe/PC/src/components/filterSelect/index.vue +++ b/fe/PC/src/components/filterSelect/index.vue @@ -133,7 +133,7 @@ export default { if(_value.length > 0 && !this.selectItem.noFilter){ let _column = this.selectItem.optionsValue || this.selectItem.prop // 单选 - if(typeof _value == 'string'){ + if(!this.selectItem.multiple){ _params.condition.filters.push({logic:"And",column:_column,action:"Like",value:_value}) } // 多选 diff --git a/fe/PC/src/filters/status.js b/fe/PC/src/filters/status.js index 3a82c7901..979fa5272 100644 --- a/fe/PC/src/filters/status.js +++ b/fe/PC/src/filters/status.js @@ -1333,7 +1333,7 @@ export function nextAction(index, prop) { } return Enum(type, index, prop) } -//客户类型 枚举为空 +//客户类型 /** * * @param {Boolean} @@ -1380,7 +1380,18 @@ export function areaType(index, prop) { */ export function productionLineType(index, prop) { let type = { - + 1: { + label: "注塑", + value: 1 + }, + 2: { + label: "喷涂", + value: 2 + }, + 3: { + label: "装配", + value: 3 + }, } return Enum(type, index, prop) } diff --git a/fe/PC/src/mixins/filter-Select.js b/fe/PC/src/mixins/filter-Select.js index cb5df5f9e..d1cbd0048 100644 --- a/fe/PC/src/mixins/filter-Select.js +++ b/fe/PC/src/mixins/filter-Select.js @@ -37,10 +37,11 @@ export const filterSelectMixins = { } }, methods: { - getFilterList(type,params,url,newFilter){ + getFilterList(type,params,url,newFilter,resultCount){ // 正常过滤条件获取列表(getPageList) return new Promise(resolve => { if(!type || type == "getPageList"){ + if(resultCount)params.MaxResultCount = resultCount if(newFilter)params.condition.filters = params.condition.filters.concat(newFilter) getPageList(params, url).then(res => { resolve(res.items) @@ -90,31 +91,29 @@ export const filterSelectMixins = { getList(val, SkipCount, URL) { this.Loading.autoTableLoading = true; val.SkipCount = (SkipCount - 1) * val.MaxResultCount + let _select = [] getPageList(val, URL).then(res => { // 给搜索列表赋值 this.searchData = res.items this.searchTotalCount = res.totalCount // 回显 - this.$nextTick(() => { - if (this.mainData[this.searchFormData.prop]) { - // 多选回显处理 - 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 => { - this.$refs.searchTable.$refs.searchTable.$refs.multipleTable.toggleRowSelection([ - { - row: item - }]) - }) - }) - + if (this.mainData[this.searchFormData.prop]) { + // 多选回显处理 + 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))) + _select = [..._select,...hxRs] + }) + this.$nextTick(() => { + _select.forEach(item => { + this.$refs.searchTable.$refs.searchTable.$refs.multipleTable.toggleRowSelection([{row: item,selected:true}]) + }) + }) + } this.Loading.autoTableLoading = false; }).catch(err => { this.Loading.autoTableLoading = false; @@ -136,6 +135,7 @@ export const filterSelectMixins = { if (val[0] == 'cancel') { this.displayDialog.AddNewDialog = false } else { + // 多选 if (this.isMoreSelectTable) { if (this.stagingFormData.length >= 1) { const { @@ -152,7 +152,7 @@ export const filterSelectMixins = { this.mainData[prop] += item[optionsValue[0]][optionsValue[1]] + ',' } }) - this.mainData[prop] = this.mainData[prop].substring(0,(this.mainData[prop].length-1)) + this.mainData[prop] = (this.mainData[prop].substring(0,(this.mainData[prop].length-1))).split(",") } else { this.mainData[prop][showProp] = '' this.stagingFormData.forEach(item => { @@ -168,7 +168,9 @@ export const filterSelectMixins = { } else { this.$warningMsg('请选择数据!') } - } else { + } + // 单选 + else { if (this.stagingFormData.length == 1) { const { prop, diff --git a/fe/PC/src/router/index.js b/fe/PC/src/router/index.js index 78f01342b..0b0e883d4 100644 --- a/fe/PC/src/router/index.js +++ b/fe/PC/src/router/index.js @@ -190,6 +190,22 @@ export const constantRoutes = [ } }] }, + { + path: '/', + component: Layout, + redirect: '/gridlayout', + hidden: true, + children: [{ + path: 'ProductionLine', + component: () => import('@/views/basicData/WorkshopManage/ProductionLine.vue'), + name: 'ProductionLine', + meta: { + keepAlive : true, + title: '生产线信息', + icon: '生产线信息', + } + }] + }, ] /** diff --git a/fe/PC/src/utils/tableColumns/index.js b/fe/PC/src/utils/tableColumns/index.js index 9642ffb9c..7f794d62e 100644 --- a/fe/PC/src/utils/tableColumns/index.js +++ b/fe/PC/src/utils/tableColumns/index.js @@ -712,7 +712,7 @@ export const Workshop = [ export const ProductionLine = [ { label: "生产线代码", prop: "code", fixed: "left", type: "name" }, { label: "生产线名称", prop: 'name' }, - { label: "类型", prop: "type" }, + { label: "类型", prop: "type", type: "filter", filters: "productionLineType"}, { label: "车间代码", prop: "workshopCode" }, { label: "原料库位", prop: "rawLocationCode" }, { label: "成品库位", prop: "productLocationCode" }, diff --git a/fe/PC/src/views/basicData/WorkshopManage/ProductionLine-old.vue b/fe/PC/src/views/basicData/WorkshopManage/ProductionLine-old.vue new file mode 100644 index 000000000..82eab83c7 --- /dev/null +++ b/fe/PC/src/views/basicData/WorkshopManage/ProductionLine-old.vue @@ -0,0 +1,249 @@ + + + \ No newline at end of file diff --git a/fe/PC/src/views/basicData/WorkshopManage/ProductionLine.vue b/fe/PC/src/views/basicData/WorkshopManage/ProductionLine.vue index 82eab83c7..c4eaff370 100644 --- a/fe/PC/src/views/basicData/WorkshopManage/ProductionLine.vue +++ b/fe/PC/src/views/basicData/WorkshopManage/ProductionLine.vue @@ -130,9 +130,9 @@ export default { remark: null, name: null, description: null, - type: 1, + type: null, workshopCode: null, - rawLocationCode: null, + rawLocationCode: [], productLocationCode: null, rawLocationGroupCode: null, code: null, @@ -144,9 +144,9 @@ export default { remark: null, name: null, description: null, - type: 1, + type: null, workshopCode: null, - rawLocationCode: null, + rawLocationCode: [], rawLocationGroupCode: null, productLocationCode: null, concurrencyStamp: null, @@ -165,7 +165,7 @@ export default { }, { 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"},]) }, + searchButton: (val) => { this.showSerarchPage(val, 'basedata/location', 'Location', '库位选择', this.CreateFormData,[{logic:"And",column:"type",action:"==",value:"2"}])}, colSpan: 12,multiple:true }, @@ -227,11 +227,13 @@ export default { editRules: { cerateRule: { code: [{ required: true, trigger: "blur", message: "不可为空" }], + type: [{ required: true, trigger: "blur", message: "不可为空" }], workshopCode: [{ required: true, trigger: "change", message: "不可为空" }], rawLocationCode: [{ required: true, trigger: "change", message: "不可为空" }], productLocationCode: [{ required: true, trigger: "change", message: "不可为空" }], }, editRule: { + type: [{ required: true, trigger: "blur", message: "不可为空" }], workshopCode: [{ required: true, trigger: "change", message: "不可为空" }], rawLocationCode: [{ required: true, trigger: "change", message: "不可为空" }], productLocationCode: [{ required: true, trigger: "change", message: "不可为空" }], diff --git a/fe/PC/src/views/inventoryManage/recycledMaterials/materialsAdjustmentFunc.vue b/fe/PC/src/views/inventoryManage/recycledMaterials/materialsAdjustmentFunc.vue index 367457f48..8434c2d77 100644 --- a/fe/PC/src/views/inventoryManage/recycledMaterials/materialsAdjustmentFunc.vue +++ b/fe/PC/src/views/inventoryManage/recycledMaterials/materialsAdjustmentFunc.vue @@ -67,6 +67,7 @@ :flexSearchOptions="editOptions" :flexTableColumns="addPopColumns_FS" @detailsDataPush="pushFS" + @clearHandle="clearHandle_FS" >
@@ -89,6 +90,7 @@ :showAddBtn="false" :showAllDeleteButton="false" @detailsDataPush="pushHB" + @clearHandle="clearHandle_HB" >
@@ -150,26 +152,26 @@ 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") + focus: (type,val) => { return this.getFilterList(type, val, "basedata/Item-Basic",this.isFilter("isRecycled","true"),1000)}, // 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))}, + focus: (type,val,tableScope) => { return this.getFilterList(type, val, "basedata/supplier-item",this.isFilter("itemCode", this.addPopData_FS[tableScope.$index].itemCode),1000)}, 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))}, + focus: (type,val,tableScope) => { return this.getFilterList(type, val, "wms/store/supplier-asn",this.isFilter("supplierCode", this.addPopData_FS[tableScope.$index].supplierCode),1000)}, 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"))}, - searchButton: (val) => { this.showSerarchPage(val, 'basedata/Location', 'InventoryBalance', '库位选择', this.addPopData_HB) }, - width:"auto", searchButton:false + focus: (type,val) => { return this.getFilterList(type, val, "basedata/Location",this.isFilter("type", "2"),1000)}, + // searchButton: (val) => { this.showSerarchPage(val, 'basedata/Location', 'InventoryBalance', '库位选择', this.addPopData_HB) }, + width:"auto" }, { type: "input", validType:'pointNumber', label: "数量", prop: "qty", width:"auto", rules: [{ @@ -198,12 +200,12 @@ export default { //原料表头信息 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"))}, + focus: (type,val) => { return this.getFilterList(type, val, "basedata/Item-Basic",this.isFilter("type", "10C02"),1000)}, width:"auto" }, { 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))}, + focus: (type,val,tableScope) => { return this.getFilterList(type, val, "wms/inventory/Inventory-Balance",this.isFilter("itemCode", this.addPopData_YL[tableScope.$index].itemCode),1000)}, width:"auto", }, // 库存数量、库位:自动带出 @@ -241,26 +243,26 @@ export default { //混拌料表头信息 addPopColumns_HB:[ { type: "filterSelect", label: "物品代码", prop: "itemCode", optionsLabel: "name", optionsValue: "code", - focus: (type,val) => { return this.getFilterList(type, val, "basedata/Item-Basic",this.isFilterForHB())}, + focus: (type,val) => { return this.getFilterList(type, val, "basedata/Item-Basic",this.isFilterForHB(),1000)}, // 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))}, + beforeFocus:(tableScope)=>{if(!this.addPopData_HB[tableScope.$index].itemCode || this.addPopData_HB[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_HB[tableScope.$index].itemCode),1000)}, 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))}, + beforeFocus:(tableScope)=>{if(!this.addPopData_HB[tableScope.$index].itemCode || this.addPopData_HB[tableScope.$index].itemCode.length <= 0 || !this.addPopData_HB[tableScope.$index].supplierCode || this.addPopData_HB[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_HB[tableScope.$index].supplierCode),1000)}, width:"auto", }, { type: "filterSelect", label: "目标库位", prop: "locationCode", optionsLabel: "name", optionsValue: "code", - focus: (type,val) => { return this.getFilterList(type, val, "basedata/Location")}, - searchButton: (val) => { this.showSerarchPage(val, 'basedata/Location', 'InventoryBalance', '库位选择', this.addPopData_HB) }, - width:"auto", searchButton:false + focus: (type,val) => { return this.getFilterList(type, val, "basedata/Location",false,1000)}, + // searchButton: (val) => { this.showSerarchPage(val, 'basedata/Location', 'InventoryBalance', '库位选择', this.addPopData_HB) }, + width:"auto" }, { type: "input", validType:'pointNumber', label: "数量", prop: "qty", width:"auto", rules: [{ @@ -369,7 +371,7 @@ export default { let _prop_yl = prop_yl ? prop_yl : prop; return item.remark == '原料' ? this.packingStagingLists[item.packingCode][_prop_yl] : this.newPackArr[index][prop] }, - // todo:最后提交接口 + // 最后提交接口 lastCommitHttp(){ this.addPopData_YL.forEach(item=>{ item.remark = '原料' @@ -609,6 +611,9 @@ export default { this.addPopData_FS[data[3].$index].itemCode = null }) } + this.addPopData_FS[data[3].$index].supplierCode = null + this.addPopData_FS[data[3].$index].poNumber = null + this.addPopData_FS[data[3].$index].locationCode = null } if(data[1].prop == "supplierCode"){ this.supplierStagingLists[data[2]] = data[0] @@ -620,6 +625,11 @@ export default { this.locationStagingLists[data[2]] = data[0] } }, + // 粉碎料清空 + clearHandle_FS(item,scope){ + this.addPopData_FS[scope.$index].supplierCode = null + this.addPopData_FS[scope.$index].poNumber = null + }, // 原料下拉 pushYL(data){ if(data[1].prop=="itemCode"){ @@ -666,6 +676,8 @@ export default { pushHB(data){ if(data[1].prop == "itemCode"){ this.itemStagingLists[data[2]] = data[0] + this.addPopData_HB[data[3].$index].supplierCode = null + this.addPopData_HB[data[3].$index].poNumber = null } if(data[1].prop == "supplierCode"){ this.supplierStagingLists[data[2]] = data[0] @@ -677,6 +689,11 @@ export default { this.locationStagingLists[data[2]] = data[0] } }, + // 粉碎料清空 + clearHandle_HB(item,scope){ + this.addPopData_HB[scope.$index].supplierCode = null + this.addPopData_HB[scope.$index].poNumber = null + }, } };