diff --git a/src/views/modules/customer/customerInformationManagement.vue b/src/views/modules/customer/customerInformationManagement.vue index 4d8386f..e428e58 100644 --- a/src/views/modules/customer/customerInformationManagement.vue +++ b/src/views/modules/customer/customerInformationManagement.vue @@ -106,7 +106,7 @@ - + @@ -121,34 +121,34 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -170,15 +170,19 @@ type="textarea" v-model="modalData.customerDescription" readonly - :rows="1" + :rows="2" resize='none' - maxlength="300" show-word-limit :readonly="detailModalFlag" style="width: 457px;height: 20px"> + --> + + + + 保存 关闭 @@ -211,14 +215,17 @@ - - + + + + + - + @@ -231,10 +238,24 @@ - + + - + + + + + + 保存 关闭 @@ -242,43 +263,36 @@ - - + + + + + + - - - + + + - - - - - + + - + - - - - - - - - - + - + 保存 关闭 @@ -699,8 +713,10 @@ saveProjectInfo } from "@/api/project/project.js" import Chooselist from '@/views/modules/common/Chooselist' + import DictDataSelect from '../sys/dict-data-select.vue' export default { components: { + DictDataSelect, Chooselist }, watch: { @@ -771,13 +787,15 @@ updateBy: '', primaryContact: '', contactStatus: '', - addressName: '' + addressName: '', + customerAddress:'' }, contactModalData: { flag: '', title: '', site: this.$store.state.user.site, customerNo: '', + customerDesc: '', contactId: '', contactName: '', contactLandlineNumber: '', @@ -785,6 +803,7 @@ contactPhoneNumber2: '', contactPhoneNumber3: '', position: '', + departmentName:'', mailbox: '', primaryContact: '', contactStatus: '', @@ -799,10 +818,11 @@ title: '', site: this.$store.state.user.site, customerNo: '', + customerDesc: '', addressId: '', addressName: '', - unit: '', - primaryAddress: '', + companyName: '', + defaultAddress: '', addressStatus: '', addressType: '', remark: '', @@ -816,10 +836,11 @@ title: '', site: this.$store.state.user.site, customerNo: '', + customerDesc: '', addressId: '', addressName: '', - unit: '', - primaryAddress: '', + companyName: '', + defaultAddress: '', addressStatus: '', addressType: '', remark: '', @@ -1108,6 +1129,24 @@ fixed: '', columnWidth: 80 }, + { + userId: this.$store.state.user.name, + functionId: 101001, + serialNumber: '101001Table2DepartmentName', + tableId: '101001Table2', + tableName: '客户联系人表', + columnProp: 'departmentName', + headerAlign: 'center', + align: 'center', + columnLabel: '部门', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + }, { userId: this.$store.state.user.name, functionId: 101001, @@ -1135,7 +1174,7 @@ columnProp: 'primaryContact', headerAlign: 'center', align: 'center', - columnLabel: '主联系人', + columnLabel: '默认联系人', columnHidden: false, columnImage: false, columnSortable: false, @@ -1239,74 +1278,74 @@ { userId: this.$store.state.user.name, functionId: 101001, - serialNumber: '101001Table3AddressName', + serialNumber: '101001Table3AddressType', tableId: '101001Table3', tableName: '客户联系地址表', - columnProp: 'addressName', + columnProp: 'addressType', headerAlign: 'center', align: 'center', - columnLabel: '地址', + columnLabel: '地址类型', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 160 + columnWidth: 80 }, { userId: this.$store.state.user.name, functionId: 101001, - serialNumber: '101001Table3Unit', + serialNumber: '101001Table3CompanyName', tableId: '101001Table3', tableName: '客户联系地址表', - columnProp: 'unit', + columnProp: 'companyName', headerAlign: 'center', align: 'center', - columnLabel: '单位', + columnLabel: '公司名称', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 80 + columnWidth: 160 }, { userId: this.$store.state.user.name, functionId: 101001, - serialNumber: '101001Table3AddressType', + serialNumber: '101001Table3AddressName', tableId: '101001Table3', tableName: '客户联系地址表', - columnProp: 'addressType', + columnProp: 'addressName', headerAlign: 'center', align: 'center', - columnLabel: '地址类型', + columnLabel: '地址', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 80 + columnWidth: 160 }, { userId: this.$store.state.user.name, functionId: 101001, - serialNumber: '101001Table3Active', + serialNumber: '101001Table3DefaultAddress', tableId: '101001Table3', tableName: '客户联系地址表', - columnProp: 'primaryAddress', + columnProp: 'defaultAddress', headerAlign: 'center', align: 'center', - columnLabel: '主要地址', + columnLabel: '默认地址', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 80 + columnWidth: 160 }, { userId: this.$store.state.user.name, @@ -1685,7 +1724,7 @@ trigger: 'change' } ], - primaryAddress: [ + defaultAddress: [ { required: true, message: ' ', @@ -1911,7 +1950,8 @@ getCustomerAddressList () { let tempData = { site: this.$store.state.user.site, - customerNo: this.customerCurrentRow.customerNo + customerNo: this.customerCurrentRow.customerNo, + customerDesc: this.customerCurrentRow.customerDesc } customerAddressSearch(tempData).then(({data}) => { if (data && data.code === 0) { @@ -1964,7 +2004,7 @@ primaryContact: '', contactStatus: '', addressName: '', - primaryAddress: 'Y', + defaultAddress: 'Y', addressStatus: '启用', addressType: '类型一', createBy: this.$store.state.user.name @@ -1989,8 +2029,9 @@ contactPhoneNumber2: '', contactPhoneNumber3: '', position: '', + departmentName:'', mailbox: '', - primaryContact: '', + primaryContact: 'N', contactStatus: '', remark: '', createDate: '', @@ -2010,8 +2051,8 @@ customerNo: this.customerCurrentRow.customerNo, addressId: '', addressName: '', - unit: '', - primaryAddress: '', + companyName: this.customerCurrentRow.customerDesc, + defaultAddress: '', addressStatus: '', addressType: '', remark: '', @@ -2086,7 +2127,7 @@ primaryContact: 'Y', contactStatus: row.contactStatus, addressName: row.addressName, - primaryAddress: 'Y', + defaultAddress: 'Y', updateBy: this.$store.state.user.name } this.modalDisableFlag = true @@ -2110,6 +2151,7 @@ contactPhoneNumber2: row.contactPhoneNumber2, contactPhoneNumber3: row.contactPhoneNumber3, position: row.position, + departmentName: row.departmentName, mailbox: row.mailbox, primaryContact: row.primaryContact, contactStatus: row.contactStatus, @@ -2132,8 +2174,8 @@ customerNo: row.customerNo, addressId: row.addressId, addressName: row.addressName, - unit: row.unit, - primaryAddress: row.primaryAddress, + companyName: row.companyName, + defaultAddress: row.defaultAddress, addressStatus: row.addressStatus, addressType: row.addressType, remark: row.remark, @@ -2255,6 +2297,7 @@ contactPhoneNumber2: row.contactPhoneNumber2, contactPhoneNumber3: row.contactPhoneNumber3, position: row.position, + departmentName: row.departmentName, mailbox: row.mailbox, primaryContact: row.primaryContact, contactStatus: row.contactStatus, @@ -2275,8 +2318,8 @@ customerNo: row.customerNo, addressId: row.addressId, addressName: row.addressName, - unit: row.unit, - primaryAddress: row.primaryAddress, + companyName: row.companyName, + defaultAddress: row.defaultAddress, addressStatus: row.addressStatus, addressType: row.addressType, remark: row.remark, @@ -2369,13 +2412,13 @@ }).then(() => { let tempContactName = null for (let i = 0; i < this.contactSelections.length; i++){ - // 判断是否有主联系人 + // 判断是否有默认联系人 if (this.contactSelections[i].primaryContact === 'Y') { tempContactName = this.contactSelections[i].contactName } } if (tempContactName !== '' || tempContactName != null) { - this.$confirm(tempContactName +` 为主联系人,是否确认删除?`, '提示', { + this.$confirm(tempContactName +` 为默认联系人,是否确认删除?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' @@ -2443,7 +2486,7 @@ let tempAddressName = null for (let i = 0; i < this.addressSelections.length; i++){ // 判断是否有主联系地址 - if (this.addressSelections[i].primaryAddress === 'Y') { + if (this.addressSelections[i].defaultAddress === 'Y') { tempAddressName = this.addressSelections[i].addressName } } @@ -2594,8 +2637,12 @@ this.$message.warning('请输入公司职务!') return } + if(this.contactModalData.departmentName === '' || this.contactModalData.departmentName == null){ + this.$message.warning('请输入部门名称') + return + } if (this.contactModalData.primaryContact === '' || this.contactModalData.primaryContact == null) { - this.$message.warning('请选择是否为主联系人!') + this.$message.warning('请选择是否为默认联系人!') return } if (this.contactModalData.contactStatus === '' || this.contactModalData.contactStatus == null) { @@ -2648,7 +2695,7 @@ this.$message.warning('请输入地址!') return } - if (this.addressModalData.primaryAddress === '' || this.addressModalData.primaryAddress == null) { + if (this.addressModalData.defaultAddress === '' || this.addressModalData.defaultAddress == null) { this.$message.warning('请选择是否为主要地址!') return } diff --git a/src/views/modules/part/partInformation.vue b/src/views/modules/part/partInformation.vue index 45d908b..e2bdf96 100644 --- a/src/views/modules/part/partInformation.vue +++ b/src/views/modules/part/partInformation.vue @@ -118,7 +118,7 @@ - + @@ -153,6 +153,27 @@ + + + + + + + + + + + + + + + + + + + + + 物料分类 @@ -289,6 +310,45 @@ + + + + + 新增 + + + + + + + + + + + @@ -513,6 +573,103 @@ 关闭 + + +
+ + + + + + + + + 查询 + + +
+ + + 可选制造商: + + + + + + + + + + +
+ 添加>> +
+
+ 删除<< +
+
+ + 已有制造商: + + + + + + + + + +
+ + 关闭 + +
@@ -535,7 +692,13 @@ getAgentListBy, // 根据条件查询可选代理商 addPartAgent, // 新增物料代理商 deletePartAgent, // 删除物料代理商 - deleteAgent // 删除物料代理商(单删) + deleteAgent, // 删除物料制造商(单删) + getManufacturerList, // 获取制造商列表 + getPartManufacturer, // 获取物料制造商 + getManufacturerListBy, // 根据条件查询可选制造商 + addPartManufacturer, // 新增物料制造商 + deletePartManufacturer, // 删除物料制造商 + deleteManufacturer // 删除物料制造商(单删) } from '@/api/part/partInformation.js' import { getFileContentList, // 获取物料单附件列表 @@ -544,8 +707,10 @@ } from '@/api/quotation/quotationInformation.js' import Chooselist from '@/views/modules/common/Chooselist' import partUploadFile from "./part_upload_file" + import DictDataSelect from '../sys/dict-data-select.vue' export default { components: { + DictDataSelect, Chooselist, partUploadFile }, @@ -613,6 +778,11 @@ groupName: '', umId: '', umName: '', + weightNet: '', + uomForWeightNet: '', + volumeNet: '', + uomForVolumeNet: '', + lotTrackingCode: '', active: '', remark: '', supplierId: '', @@ -651,10 +821,16 @@ agentId: '', agentName: '', }, + manufacturerData: { + site: this.$store.state.user.site, + manufacturerId: '', + manufacturerName: '', + }, // ======== 数据列表 ======== dataList: [], partItemList: [], partAgentList: [], + partManufacturerList: [], fileContentList: [], availableValueList:[], agentList: [], @@ -663,6 +839,12 @@ agentSelections2: [], agentList1: [], agentList2: [], + manufacturerList: [], + manufacturerSelections: [], + manufacturerSelections1: [], + manufacturerSelections2: [], + manufacturerList1: [], + manufacturerList2: [], // ======== 列表表头 ======== columnList: [ { @@ -758,49 +940,103 @@ { userId: this.$store.state.user.name, functionId: 104001, - serialNumber: '104001Table1PartType', + serialNumber: '104001Table1WeightNet', tableId: '104001Table1', tableName: '物料信息表', - columnProp: 'partType', + columnProp: 'weightNet', + headerAlign: 'center', + align: 'right', + columnLabel: '净重', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 60 + }, + { + userId: this.$store.state.user.name, + functionId: 104001, + serialNumber: '104001Table1UomForWeightNet', + tableId: '104001Table1', + tableName: '物料信息表', + columnProp: 'uomForWeightNet', headerAlign: 'center', align: 'left', - columnLabel: '物料类别', + columnLabel: '净重单位', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 80 + columnWidth: 60 }, { userId: this.$store.state.user.name, functionId: 104001, - serialNumber: '104001Table1FamilyName', + serialNumber: '104001Table1VolumeNet', tableId: '104001Table1', tableName: '物料信息表', - columnProp: 'familyName', + columnProp: 'volumeNet', + headerAlign: 'center', + align: 'right', + columnLabel: '体积', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 60 + }, + { + userId: this.$store.state.user.name, + functionId: 104001, + serialNumber: '104001Table1UomForVolumeNet', + tableId: '104001Table1', + tableName: '物料信息表', + columnProp: 'uomForVolumeNet', headerAlign: 'center', align: 'left', - columnLabel: '物料分类', + columnLabel: '体积单位', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 80 + columnWidth: 60 }, { userId: this.$store.state.user.name, functionId: 104001, - serialNumber: '104001Table1GroupName', + serialNumber: '104001Table1LotTrackingCode', tableId: '104001Table1', tableName: '物料信息表', - columnProp: 'groupName', + columnProp: 'lotTrackingCode', headerAlign: 'center', align: 'left', - columnLabel: '物料分组', + columnLabel: '批号跟踪', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 60 + }, + { + userId: this.$store.state.user.name, + functionId: 104001, + serialNumber: '104001Table1PartType', + tableId: '104001Table1', + tableName: '物料信息表', + columnProp: 'partType', + headerAlign: 'center', + align: 'left', + columnLabel: '物料类别', columnHidden: false, columnImage: false, columnSortable: false, @@ -812,13 +1048,13 @@ { userId: this.$store.state.user.name, functionId: 104001, - serialNumber: '104001Table1OtherGroup1', + serialNumber: '104001Table1FamilyName', tableId: '104001Table1', tableName: '物料信息表', - columnProp: 'productGroupName1', + columnProp: 'familyName', headerAlign: 'center', align: 'left', - columnLabel: '商品组1', + columnLabel: '物料分类', columnHidden: false, columnImage: false, columnSortable: false, @@ -830,13 +1066,13 @@ { userId: this.$store.state.user.name, functionId: 104001, - serialNumber: '104001Table1OtherGroup2', + serialNumber: '104001Table1GroupName', tableId: '104001Table1', tableName: '物料信息表', - columnProp: 'productGroupName2', + columnProp: 'groupName', headerAlign: 'center', align: 'left', - columnLabel: '商品组2', + columnLabel: '物料分组', columnHidden: false, columnImage: false, columnSortable: false, @@ -848,13 +1084,13 @@ { userId: this.$store.state.user.name, functionId: 104001, - serialNumber: '104001Table1OtherGroup3', + serialNumber: '104001Table1OtherGroup1', tableId: '104001Table1', tableName: '物料信息表', - columnProp: 'productGroupName3', + columnProp: 'productGroupName1', headerAlign: 'center', align: 'left', - columnLabel: '会计组', + columnLabel: '商品组1', columnHidden: false, columnImage: false, columnSortable: false, @@ -866,13 +1102,13 @@ { userId: this.$store.state.user.name, functionId: 104001, - serialNumber: '104001Table1OtherGroup4', + serialNumber: '104001Table1OtherGroup2', tableId: '104001Table1', tableName: '物料信息表', - columnProp: 'productGroupName4', + columnProp: 'productGroupName2', headerAlign: 'center', align: 'left', - columnLabel: '计划员', + columnLabel: '商品组2', columnHidden: false, columnImage: false, columnSortable: false, @@ -884,56 +1120,56 @@ { userId: this.$store.state.user.name, functionId: 104001, - serialNumber: '104001Table1ItemNo', + serialNumber: '104001Table1OtherGroup3', tableId: '104001Table1', tableName: '物料信息表', - columnProp: 'codeDesc', + columnProp: 'productGroupName3', headerAlign: 'center', align: 'left', - columnLabel: '属性模板', + columnLabel: '会计组', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 100 + columnWidth: 80 }, { userId: this.$store.state.user.name, functionId: 104001, - serialNumber: '104001Table1ManufacturerName', + serialNumber: '104001Table1OtherGroup4', tableId: '104001Table1', tableName: '物料信息表', - columnProp: 'manufacturerName', + columnProp: 'productGroupName4', headerAlign: 'center', align: 'left', - columnLabel: '制造商', + columnLabel: '计划员', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 160 + columnWidth: 80 }, { userId: this.$store.state.user.name, functionId: 104001, - serialNumber: '104001Table1AgentName', + serialNumber: '104001Table1ItemNo', tableId: '104001Table1', tableName: '物料信息表', - columnProp: 'agentName', + columnProp: 'codeDesc', headerAlign: 'center', align: 'left', - columnLabel: '代理商', + columnLabel: '属性模板', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 160 + columnWidth: 100 }, { userId: this.$store.state.user.name, @@ -1257,6 +1493,127 @@ fixed: '', } ], + columnManufacturerList: [ + { + userId: this.$store.state.user.name, + functionId: 104001, + serialNumber: '104001Table3ManufacturerId', + tableId: "104001Table3", + tableName: "物料制造商表", + columnProp: 'manufacturerId', + headerAlign: "center", + align: "center", + columnLabel: '制造商编码', + columnHidden: false, + columnImage: false, + columnSortable: true, + sortLv: 0, + status: true, + fixed: '', + }, + { + userId: this.$store.state.user.name, + functionId: 104001, + serialNumber: '104001Table3ManufacturerName', + tableId: "104001Table3", + tableName: "物料制造商表", + columnProp: 'manufacturerName', + headerAlign: "center", + align: "center", + columnLabel: '制造商名称', + columnHidden: false, + columnImage: false, + columnSortable: true, + sortLv: 0, + status: true, + fixed: '', + }, + { + userId: this.$store.state.user.name, + functionId: 104001, + serialNumber: '104001Table3Active', + tableId: '104001Table3', + tableName: '物料制造商表', + columnProp: 'active', + headerAlign: 'center', + align: 'center', + columnLabel: '是否在用', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + }, + { + userId: this.$store.state.user.name, + functionId: 104001, + serialNumber: '104001Table3CreateDate', + tableId: '104001Table3', + tableName: '物料制造商表', + columnProp: 'createDate', + headerAlign: 'center', + align: 'center', + columnLabel: '创建时间', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + }, + { + userId: this.$store.state.user.name, + functionId: 104001, + serialNumber: '104001Table3CreateBy', + tableId: '104001Table3', + tableName: '物料制造商表', + columnProp: 'createBy', + headerAlign: 'center', + align: 'center', + columnLabel: '创建人', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + }, + { + userId: this.$store.state.user.name, + functionId: 104001, + serialNumber: '104001Table3UpdateDate', + tableId: '104001Table3', + tableName: '物料制造商表', + columnProp: 'updateDate', + headerAlign: 'center', + align: 'center', + columnLabel: '更新时间', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + }, + { + userId: this.$store.state.user.name, + functionId: 104001, + serialNumber: '104001Table3UpdateBy', + tableId: '104001Table3', + tableName: '物料制造商表', + columnProp: 'updateBy', + headerAlign: 'center', + align: 'center', + columnLabel: '更新人', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + } + ], columnFileList: [ { userId: this.$store.state.user.name, @@ -1439,6 +1796,41 @@ trigger: 'change' } ], + weightNet: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + uomForWeightNet: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + volumeNet: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + uomForVolumeNet: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + lotTrackingCode: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], }, // ======== 复选数据集 ======== partSelections: [], @@ -1452,7 +1844,8 @@ itemNumberDisableFlag: false, itemModalDisableFlag: false, itemModalFlag: false, - agentModelFlag: false + agentModelFlag: false, + manufacturerModelFlag: false } }, mounted () { @@ -1525,6 +1918,8 @@ this.getPartAgent() } else if (this.activeTable === 'part_file') { this.getFileContentData() + } else if (this.activeTable === 'part_manufacturer') { + this.getPartManufacturer() } }, @@ -1564,7 +1959,23 @@ } }) }, - + /** + * 查询物料制造商 + */ + getPartManufacturer () { + let tempData = { + site: this.$store.state.user.site, + partNo: this.partCurrentRow.partNo, + //agentId: this.partCurrentRow.agentId + } + getPartManufacturer(tempData).then(({data}) => { + if (data && data.code === 0) { + this.partManufacturerList = data.rows + } else { + this.partManufacturerList = [] + } + }) + }, // ======== 列表数据刷新方法 ======== /** * 获取数据列表 @@ -1612,6 +2023,11 @@ groupName: '', umId: '', umName: '', + weightNet: '', + uomForWeightNet: '', + volumeNet: '', + uomForVolumeNet: '', + lotTrackingCode: 'Order Based', active: 'Y', remark: '', supplierId: '', @@ -1656,6 +2072,11 @@ groupName: row.groupName, umId: row.umId, umName: row.umName, + weightNet: row.weightNet, + uomForWeightNet: row.uomForWeightNet, + volumeNet: row.volumeNet, + uomForVolumeNet: row.uomForVolumeNet, + lotTrackingCode: row.lotTrackingCode, active: row.active, remark: row.remark, supplierId: row.supplierId, @@ -1849,9 +2270,178 @@ }).catch(() => { }) }, + /** + * 选择制造商 + */ + getManufacturerList () { + // // 先清空缓存选中 + // this.$nextTick(() => this.$refs.agentTable.clearSelection()) + // // 拿到选中的代理商id + // let tempDataList = this.modalData.agentId.split(';') + // 查询所有代理商 + getManufacturerListBy(this.manufacturerData).then(({data}) => { + if (data && data.code === 0) { + this.manufacturerList1 = data.rows + // this.agentList.forEach(val => { + // // 回显选中的代理商 + // if (tempDataList.includes(val.agentId)) { + // this.$nextTick(() => this.$refs.agentTable.toggleRowSelection(val, true)) + // } + // }) + // this.agentModelFlag = true + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + /** + * 制造商多选 + * @param row + */ + manufacturerClickRow (row) { + this.$refs.manufacturerTable.toggleRowSelection(row); + }, + /** + * 获得选中的制造商 + * @param val + */ + selectionManufacturer (val) { + this.manufacturerSelections = val + }, + /** + * 返回列表唯一值 + * @param row + * @returns {string|[{trigger: string, message: string, required: boolean}]|*} + */ + getRowKeys2 (row) { + // 唯一值,一般都为id + return row.manufacturerId + }, + /** + * 确认多选制造商 + * @returns {boolean} + */ + confirmManufacturer () { + this.modalData.manufacturerId = '' + this.modalData.manufacturerName = '' + for (let i = 0; i < this.manufacturerSelections.length; i++) { + this.modalData.manufacturerId = this.modalData.manufacturerId + ";" + this.manufacturerSelections[i].manufacturerId + this.modalData.manufacturerName = this.modalData.manufacturerName + ";" + this.agentSelections[i].manufacturerName + } + this.modalData.manufacturerId = this.modalData.manufacturerId.substring(1) + this.modalData.manufacturerName = this.modalData.manufacturerName.substring(1) + this.manufacturerModelFlag = false + }, + + savePartManufacturer () { + this.manufacturerSelections1 = null + this.manufacturerSelections2 = null + getManufacturerList(this.partCurrentRow).then(({data}) => { + this.manufacturerList1 = data.row1 + this.manufacturerList2 = data.row2 + }) + this.manufacturerData = { + site: this.$store.state.user.site, + manufacturerId: '', + manufacturerName: '', + } + this.manufacturerModelFlag = true + }, + // 可选制造商 + manufacturerClickRow1 (row) { + this.$refs.manufacturerTable1.toggleRowSelection(row); + }, + // 已有制造商 + manufacturerClickRow2 (row) { + this.$refs.manufacturerTable2.toggleRowSelection(row); + }, + selectionManufacturer1 (val) { + this.manufacturerSelections1 = val + }, + selectionManufacturer2 (val) { + this.manufacturerSelections2 = val + }, + // 添加制造商 + addManufacturer () { + if(this.manufacturerSelections1 == null || this.manufacturerSelections1.length === 0){ + this.$message.warning('请选择可选制造商!') + return + } + let inData = { + site: this.$store.state.user.site, + partNo: this.partCurrentRow.partNo, + manufacturerList: this.manufacturerSelections1 + } + addPartManufacturer(inData).then(({data}) => { + if (data && data.code === 0) { + getManufacturerList(this.partCurrentRow).then(({data}) => { + this.manufacturerList1 = data.row1 + this.manufacturerList2 = data.row2 + }) + this.manufacturerSelections1 = [] + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + // 删除物料制造商 + deleteManufacturer () { + if(this.manufacturerSelections2 == null || this.manufacturerSelections2.length === 0){ + this.$message.warning('请选择已有制造商!') + return + } + let inData = { + site: this.$store.state.user.site, + partNo: this.partCurrentRow.partNo, + manufacturerList: this.manufacturerSelections2 + } + deletePartManufacturer(inData).then(({data}) => { + if (data && data.code === 0) { + getManufacturerList(this.partCurrentRow).then(({data}) => { + this.manufacturerList1 = data.row1 + this.manufacturerList2 = data.row2 + }) + this.manufacturerSelections2 = [] + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + // 单删 + deleteManufacturer2 (row) { + this.$confirm(`是否删除该制造商?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + deleteManufacturer(row).then(({data}) => { + if (data && data.code === 0) { + this.getPartManufacturer() + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }).catch(() => { + }) + }, // 关闭后刷新列表 refreshDetailList(){ this.getPartAgent() + this.getPartManufacturer() }, // ======== 新增/编辑/删除方法 ======== @@ -1883,6 +2473,26 @@ this.$message.warning('请选择计量单位!') return } + if ( this.modalData.weightNet === '' || this.modalData.weightNet == null) { + this.$message.warning('请填写净重!') + return + } + if (this.modalData.uomForWeightNet === '' || this.modalData.uomForWeightNet == null) { + this.$message.warning('请选择净重单位!') + return + } + if (this.modalData.volumeNet === '' || this.modalData.volumeNet == null) { + this.$message.warning('请填写净体积!') + return + } + if (this.modalData.uomForVolumeNet === '' || this.modalData.uomForVolumeNet == null) { + this.$message.warning('请选择净体积单位!') + return + } + if (this.modalData.lotTrackingCode === '' || this.modalData.lotTrackingCode == null) { + this.$message.warning('请选择批次追踪!') + return + } if (this.modalData.familyId === '' || this.modalData.familyId == null) { this.$message.warning('请选择分类!') return