From 7269e749a4b265f2c15babfdc38c695dbd5265b6 Mon Sep 17 00:00:00 2001 From: zelian_wu Date: Mon, 8 Jan 2024 14:31:24 +0800 Subject: [PATCH] =?UTF-8?q?2024-1-5=20=E9=A1=B9=E7=9B=AE=E7=89=A9=E6=96=99?= =?UTF-8?q?=E8=B0=83=E6=95=B4,=E5=AD=97=E5=85=B8=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86,=E6=98=AF=E5=90=A6=E4=BD=BF=E7=94=A8=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/dict.js | 1 + .../customerInformationManagement.vue | 2 +- .../projectInfo/com_project_info_part.vue | 382 ++++++++++++------ .../project/projectInfo/projectInfo.vue | 11 +- .../modules/quotation/sellForQuotation.vue | 4 +- src/views/modules/sys/dict-data-select.vue | 24 +- src/views/modules/sys/dict-data.vue | 79 +++- src/views/modules/sys/dict.vue | 50 ++- 8 files changed, 386 insertions(+), 167 deletions(-) diff --git a/src/api/dict.js b/src/api/dict.js index f939ccd..ba23b27 100644 --- a/src/api/dict.js +++ b/src/api/dict.js @@ -55,6 +55,7 @@ export const saveDictData = (data) => createAPI(`/sys/dictData/save`,'post',data * @returns {*} */ export const removeDictData = (data) => createAPI(`/sys/dictData/remove`,'post',data); +export const removeBatchDictData = (data) => createAPI(`/sys/dictData/removeBatch`,'post',data); /** * 删除字典数据 * @param data diff --git a/src/views/modules/customer/customerInformationManagement.vue b/src/views/modules/customer/customerInformationManagement.vue index 3402cc4..db1ff41 100644 --- a/src/views/modules/customer/customerInformationManagement.vue +++ b/src/views/modules/customer/customerInformationManagement.vue @@ -520,7 +520,7 @@ + width="160" label="项目号"> diff --git a/src/views/modules/project/projectInfo/com_project_info_part.vue b/src/views/modules/project/projectInfo/com_project_info_part.vue index 06e12f4..e1f6c78 100644 --- a/src/views/modules/project/projectInfo/com_project_info_part.vue +++ b/src/views/modules/project/projectInfo/com_project_info_part.vue @@ -55,51 +55,150 @@ - - - - + + + + - - 物料类别 - - - - 属性模板 - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 属性模板 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 物料分类 + + + + + + + + + + + + + 物料分组 + + + + + + + + + + + + + 商品组1 + + + + + + + + + + + + + 商品组2 + + + + + + + + + + + + + @@ -204,8 +303,10 @@ refreshItemModal, } from "@/api/base/properties.js" import Chooselist from '@/views/modules/common/Chooselist' + import DictDataSelect from "../../sys/dict-data-select.vue"; export default { components: { + DictDataSelect, Chooselist }, data() { @@ -289,6 +390,23 @@ fixed: '', columnWidth: 80 },{ + userId: this.$store.state.user.name, + functionId: 101002001, + serialNumber: '101002001Table4PartDesc', + tableId: "101002001Table4", + tableName: "项目物料", + columnProp: "partDesc", + headerAlign: "center", + align: "left", + columnLabel: "物料描述", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120 + },{ userId: this.$store.state.user.name, functionId: 101002001, serialNumber: '101002001Table4PartName', @@ -305,23 +423,6 @@ status: true, fixed: '', columnWidth: 120 - },{ - userId: this.$store.state.user.name, - functionId: 101002001, - serialNumber: '101002001Table4PartDesc', - tableId: "101002001Table4", - tableName: "项目物料", - columnProp: "partDesc", - headerAlign: "center", - align: "left", - columnLabel: "物料描述", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 120 },{ userId: this.$store.state.user.name, functionId: 101002001, @@ -492,9 +593,22 @@ username:'', codeNo:'', codeDesc:'', + groupId:undefined, + groupName:undefined, + productGroupId1:undefined, + productGroupName1:undefined, + productGroupId2:undefined, + productGroupName2:undefined, }, dataRole: { - partTypeDesc: [ + partType: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + groupId: [ { required: true, message: ' ', @@ -507,6 +621,12 @@ message: ' ', trigger: 'change' } + ],partDesc: [ + { + required: true, + message: ' ', + trigger: 'change' + } ], }, // 导出 start @@ -644,11 +764,20 @@ if(type==1) { strVal = this.dataForm.partType } - } - if (val === 19) { + }else if (val === 19) { if(type==1) { strVal = this.dataForm.codeNo } + }else if (val === 108) { + strVal = this.dataForm.partType + } else if (val === 109) { + strVal = this.dataForm.groupId + } else if (val === 110) { + strVal = this.dataForm.productGroupId1 + } else if (val === 111) { + strVal = this.dataForm.productGroupId2 + }else if (val === 20) { + strVal = this.dataForm.codeNo } this.$refs.baseList.init(val, strVal) }) @@ -660,12 +789,26 @@ this.dataForm.partType = val.Base_id this.dataForm.partTypeDesc = val.Base_desc } - } - if (this.tagNo === 19) { + }else if (this.tagNo === 19) { if(this.tagNo1==1) { this.dataForm.codeNo = val.Code_no this.dataForm.codeDesc = val.Code_desc } + } else if (this.tagNo === 108) { + this.dataForm.partType = val.family_id + this.dataForm.partTypeDesc = val.family_name + } else if (this.tagNo === 109) { + this.dataForm.groupId = val.group_id + this.dataForm.groupName = val.group_name + } else if (this.tagNo === 110) { + this.dataForm.productGroupId1 = val.product_group_id + this.dataForm.productGroupName1 = val.product_group_name + } else if (this.tagNo === 111) { + this.dataForm.productGroupId2 = val.product_group_id + this.dataForm.productGroupName2 = val.product_group_name + } else if (this.tagNo === 20) { + this.dataForm.codeNo = val.Code_no + this.dataForm.codeDesc = val.Code_desc } }, //初始化组件的参数 @@ -693,63 +836,49 @@ }) return false; } - this.dataForm={ - id:0, - site: this.searchData.site, - projectId: this.searchData.projectId, - testPartNo:'', - partType:'', - partTypeDesc:'', - partName:'', - partDesc:'', - partSpec:'', - remark:'', - materialNumber:'', - username:this.$store.state.user.name, - codeNo:'', - codeDesc:'', - } this.visible=true; }, updateModel(row){ - this.dataForm={ - id:row.id, - site: row.site, - projectId: row.projectId, - testPartNo:row.testPartNo, - partType:row.partType, - partTypeDesc:row.partTypeDesc, - partName:row.partName, - partDesc:row.partDesc, - partSpec:row.partSpec, - remark:row.remark, - materialNumber:row.materialNumber, - codeNo:row.codeNo, - codeDesc:row.codeDesc, - username:this.$store.state.user.name, - } + this.dataForm = {...row} this.visible=true; }, saveData(){ - if(this.dataForm.partType==''||this.dataForm.partType==null){ - this.$alert('请选择物料类别!', '错误', { - confirmButtonText: '确定' - }) - return false; - } - if(this.dataForm.partName==''||this.dataForm.partName==null){ - this.$alert('请输入物料名称!', '错误', { - confirmButtonText: '确定' - }) - return false; - } - saveProjectPart(this.dataForm).then(({data}) => { - if (data && data.code === 0) { - this.$message.success( '操作成功') - this.visible = false - this.searchTable(); - } else { - this.$message.error(data.msg) + this.$refs.dataFrom.validate((vaildate)=>{ + if (vaildate){ + saveProjectPart(this.dataForm).then(({data}) => { + if (data && data.code === 0) { + this.$message.success( '操作成功') + this.visible = false + this.searchTable(); + } else { + this.$message.error(data.msg) + } + }) + }else { + // if(this.dataForm.partName==''||this.dataForm.partName==null){ + // this.$alert('请输入物料名称!', '错误', { + // confirmButtonText: '确定' + // }) + // return false; + // } + if (!this.dataForm.partType){ + this.$alert('请选择物料分类!', '错误', { + confirmButtonText: '确定' + }) + return false; + } + if (!this.dataForm.groupId){ + this.$alert('请选择物料分组!', '错误', { + confirmButtonText: '确定' + }) + return false; + } + if(!this.dataForm.partDesc){ + this.$alert('请输入物料描述!', '错误', { + confirmButtonText: '确定' + }) + return false; + } } }) }, @@ -905,6 +1034,31 @@ return s }, + closeDataFromDialog(){ + this.dataForm={ + id:0, + site: this.searchData.site, + projectId: this.searchData.projectId, + testPartNo:'', + partType:'', + partTypeDesc:'', + partName:'', + partDesc:'', + partSpec:'', + remark:'', + materialNumber:'', + username:this.$store.state.user.name, + codeNo:'', + codeDesc:'', + groupId:undefined, + groupName:undefined, + productGroupId1:undefined, + productGroupName1:undefined, + productGroupId2:undefined, + productGroupName2:undefined, + } + this.$refs.dataFrom.resetFields(); + }, }, } diff --git a/src/views/modules/project/projectInfo/projectInfo.vue b/src/views/modules/project/projectInfo/projectInfo.vue index aca3145..eea4dde 100644 --- a/src/views/modules/project/projectInfo/projectInfo.vue +++ b/src/views/modules/project/projectInfo/projectInfo.vue @@ -2,11 +2,12 @@
- + - - 项目类型 - + + + + @@ -371,9 +372,11 @@ import purchase from "./com_project_info_purchase_request";/*組件*/ import technicalSpecification from "./com_project_technicalSpecification"; import quotationHeader from "./com_project_info_quotation.vue"; + import DictDataSelect from "../../sys/dict-data-select.vue"; /*組件*/ export default { components: { + DictDataSelect, Chooselist, AddOrUpdate, projectUploadFile, diff --git a/src/views/modules/quotation/sellForQuotation.vue b/src/views/modules/quotation/sellForQuotation.vue index e19f18c..a4ade41 100644 --- a/src/views/modules/quotation/sellForQuotation.vue +++ b/src/views/modules/quotation/sellForQuotation.vue @@ -314,10 +314,10 @@ - + 确定 关闭 - + diff --git a/src/views/modules/sys/dict-data-select.vue b/src/views/modules/sys/dict-data-select.vue index 039d700..ab71d48 100644 --- a/src/views/modules/sys/dict-data-select.vue +++ b/src/views/modules/sys/dict-data-select.vue @@ -20,6 +20,10 @@ export default { }, value:{ required: true, + }, + useDefaultValue:{ + type:Boolean, + default:true, } }, data () { @@ -35,7 +39,7 @@ export default { // 当value值不存在 并且查询的下拉框存在默认值列,将value赋值为默认 if (!this.value && this.options.length > 0){ let find = this.options.find(item=>item.isDefault === 'Y'); - if (find){ + if (find && find.status === 'Y'){ this.$emit("change",find.dictValue); } } @@ -47,13 +51,19 @@ export default { site:this.$store.state.user.site, dictType:this.dictType } - // 等待返回值 - let {data} = await selectDictDataList(params); - // 参数赋值 - if (data && data.code === 0){ - this.options = data.rows; + try { + // 等待返回值 + let {data} = await selectDictDataList(params); + // 参数赋值 + if (data && data.code === 0){ + this.options = data.rows; + } + if (this.useDefaultValue){ + this.dictDefaultValue(); + } + }catch (e) { + return Promise.reject(e) } - this.dictDefaultValue(); }, // el-select @change事件,修改父组件值 changeDictData(val){ diff --git a/src/views/modules/sys/dict-data.vue b/src/views/modules/sys/dict-data.vue index 6233311..6670303 100644 --- a/src/views/modules/sys/dict-data.vue +++ b/src/views/modules/sys/dict-data.vue @@ -1,7 +1,9 @@