diff --git a/src/api/project/project.js b/src/api/project/project.js index e2a6b53..affdd6e 100644 --- a/src/api/project/project.js +++ b/src/api/project/project.js @@ -26,6 +26,7 @@ export const deleteProjectFile= data => createAPI(`sys/file/deleteProjectFile`,' export const uploadProjectFile= data => createAPI(`sys/file/upload`,'post',data) export const getCustomerContactData = data => createAPI(`/project/getCustomerContactData`,'post',data) export const getContactChooseData= data => createAPI(`/project/getContactChooseData`,'post',data) +export const getContactChooseData2= data => createAPI(`/project/getContactChooseData2`,'post',data) export const saveProjectContactList= data => createAPI(`/project/saveProjectContactList`,'post',data) export const deleteProjectInfo= data => createAPI(`/project/deleteProjectInfo`,'post',data) export const getProjectInfoPartList= data => createAPI(`/project/getProjectInfoPartList`,'post',data) diff --git a/src/views/modules/project/projectInfo/projectInfo.vue b/src/views/modules/project/projectInfo/projectInfo.vue index 86a99d3..cfc408e 100644 --- a/src/views/modules/project/projectInfo/projectInfo.vue +++ b/src/views/modules/project/projectInfo/projectInfo.vue @@ -337,6 +337,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -360,6 +459,7 @@ downLoadProjectFile, getCustomerContactData, getContactChooseData, + getContactChooseData2, saveProjectContactList, deleteProjectInfo, getProjectUserRole, @@ -1014,17 +1114,22 @@ fixed: false }, ], - + contactSelections1: [], + contactSelections2: [], + contactData: { + site: this.$store.state.user.site, + contactId: '', + contactName: '', + }, } }, watch: { - // columnList1: { - // deep: true, - // handler: function (newV, oldV) { - // debugger - // - // } - // } + contactData: { + deep: true, + handler: function (newV, oldV) { + this.contactData.contactId = this.contactData.contactId.toUpperCase() + } + }, }, mounted() { this.$nextTick(() => { @@ -1493,6 +1598,126 @@ }); this.contactChooseFlag=true; }, + // contactChooseModal () { + // if (this.currentRow == null || this.currentRow === '') { + // this.$alert('请选择项目!', '错误', { + // confirmButtonText: '确定' + // }) + // return false + // } + // let inData = { + // site: this.currentRow.site, + // customerId: this.currentRow.customerId, + // projectId: this.currentRow.projectId + // } + // this.contactSelections1 = null + // this.contactSelections2 = null + // this.contactData.contactId = '' + // this.contactData.contactName = '' + // getContactChooseData2(inData).then(({data}) => { + // //区分请求成功和失败的状况 + // if (data && data.code === 0) { + // this.contactChooseList1 = data.rows1 + // this.contactChooseList2 = data.rows2 + // } + // }) + // this.contactChooseFlag = true + // }, + + // // 查询物料项目 + // queryCustomerContact () { + // queryCustomerContact(this.contactData).then(({data}) => { + // if (data && data.code === 0) { + // this.contactChooseList1 = data.rows + // } else { + // this.contactChooseList1 = [] + // } + // }) + // }, + + // // 可选联系人 + // contactClickRow1 (row) { + // this.$refs.contactTable1.toggleRowSelection(row) + // }, + // + // // 已有联系人 + // contactClickRow2 (row) { + // this.$refs.contactTable2.toggleRowSelection(row) + // }, + // + // selectionContact1 (val) { + // this.contactSelections1 = val + // }, + // + // selectionContact2 (val) { + // this.contactSelections2 = val + // }, + + // // 客户联系人新增 + // addContact () { + // if (this.contactSelections1 == null || this.contactSelections1.length === 0) { + // this.$message.warning('请选择可选属性!') + // return + // } + // let inData = { + // site: this.currentRow.site, + // customerId: this.currentRow.customerId, + // projectId: this.currentRow.projectId, + // contactList: this.contactSelections1 + // } + // addContact(inData).then(({data}) => { + // if (data && data.code === 0) { + // getContactChooseData(inData).then(({data}) => { + // //区分请求成功和失败的状况 + // if (data && data.code === 0) { + // this.contactChooseList1 = data.rows1 + // this.contactChooseList2 = data.rows2 + // } + // }) + // this.getCustomerContactData() + // this.contactSelections1 = [] + // } else { + // this.$alert(data.msg, '错误', { + // confirmButtonText: '确定' + // }) + // } + // }) + // }, + + // // 客户联系人删除 + // deleteContact () { + // if (this.contactSelections2 == null || this.contactSelections2.length === 0) { + // this.$alert("请选择已有属性!", '提示', { + // confirmButtonText: '确定' + // }) + // return false + // } + // let inData = { + // site: this.currentRow.site, + // customerId: this.currentRow.customerId, + // projectId: this.currentRow.projectId, + // contactList: this.contactSelections2 + // } + // deleteContact(inData).then(({data}) => { + // if (data && data.code === 0) { + // getContactChooseData(inData).then(({data}) => { + // //区分请求成功和失败的状况 + // if (data && data.code === 0) { + // this.contactChooseList1 = data.rows1 + // this.contactChooseList2 = data.rows2 + // } + // }) + // this.getCustomerContactData() + // this.contactSelections2 = [] + // } else { + // this.$alert(data.msg, '错误', { + // confirmButtonText: '确定' + // }) + // } + // }) + // }, + + saveProjectContactList(){ let data={ site:this.currentRow.site,