From 47b5bc602b1e2b76a7f55e11ab68488027cd73ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=A5=89=E6=BA=90?= <1976974459@qq.com> Date: Fri, 8 Sep 2023 14:11:18 +0800 Subject: [PATCH] =?UTF-8?q?2023-09-08=20plm=E5=AE=A2=E6=88=B7=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customerInformationManagement.vue | 1137 ++++++++++++----- 1 file changed, 797 insertions(+), 340 deletions(-) diff --git a/src/views/modules/customer/customerInformationManagement.vue b/src/views/modules/customer/customerInformationManagement.vue index e72c23e..767216e 100644 --- a/src/views/modules/customer/customerInformationManagement.vue +++ b/src/views/modules/customer/customerInformationManagement.vue @@ -31,7 +31,6 @@ - - - - + + - + - + - + - + - + - + - + @@ -125,41 +123,41 @@ - + - + - + - + - + - + - + - + @@ -167,10 +165,203 @@ - 保存 + 保存 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 保存 + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 保存 + 关闭 + + + + + + + + + + + + + + + + + 项目类型 + 项目类型 + + + + + + + + + + + + + + + + + + + + 项目来源 + 项目来源 + + + + + 优先级 + 优先级 + + + + + + + + + + + 项目经理 + 项目经理 + + + + + 项目负责人 + 项目负责人 + + + + + + + + + + + + + + + + + 项目权限 + 项目权限 + + + + + + 保存 + 关闭 + + @@ -327,149 +518,125 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 保存 - 关闭 - + + + + +
+ 确定 + 取消 +
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 保存 - 关闭 - + + + + +
+ 确定 + 取消 +
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 保存 - 关闭 - + + + + + + + + + + + + + + + + + + + + + + + + +
+ 确定 + 取消 +
+
+ + @@ -498,7 +665,17 @@ projectInformationEdit, // 客户项目信息编辑 projectInformationDelete, // 客户项目信息删除 } from '@/api/customer/projectInformation.js' + import { + searchOperatorWithSite, + searchProjectTeamStr, + searchUserRoll, + saveProjectInfo + } from "@/api/project/project.js" + import Chooselist from '@/views/modules/common/Chooselist' export default { + components: { + Chooselist + }, watch: { searchData: { deep: true, @@ -622,7 +799,8 @@ createDate: '', createBy: '', updateDate: '', - updateBy: '' + updateBy: '', + projectManagerList: [] }, // ======== 数据列表 ======== dataList: [], @@ -636,7 +814,7 @@ functionId: 101001, serialNumber: '101001Table1CustomerNo', tableId: '101001Table1', - tableName: 'common', + tableName: '客户信息表', columnProp: 'customerNo', headerAlign: 'center', align: 'center', @@ -653,7 +831,7 @@ functionId: 101001, serialNumber: '101001Table1CustomerDesc', tableId: '101001Table1', - tableName: 'common', + tableName: '客户信息表', columnProp: 'customerDesc', headerAlign: 'center', align: 'center', @@ -670,7 +848,7 @@ functionId: 101001, serialNumber: '101001Table1CustomerCurrency', tableId: '101001Table1', - tableName: 'common', + tableName: '客户信息表', columnProp: 'customerCurrency', headerAlign: 'center', align: 'center', @@ -687,7 +865,7 @@ functionId: 101001, serialNumber: '101001Table1TurnoverOfYear', tableId: '101001Table1', - tableName: 'common', + tableName: '客户信息表', columnProp: 'turnoverOfYear', headerAlign: 'center', align: 'center', @@ -704,7 +882,7 @@ functionId: 101001, serialNumber: '101001Table1PotentialRevenueOfYear', tableId: '101001Table1', - tableName: 'common', + tableName: '客户信息表', columnProp: 'potentialRevenueOfYear', headerAlign: 'center', align: 'center', @@ -721,7 +899,7 @@ functionId: 101001, serialNumber: '101001Table1ImportantCustomer', tableId: '101001Table1', - tableName: 'common', + tableName: '客户信息表', columnProp: 'importantCustomer', headerAlign: 'center', align: 'center', @@ -738,7 +916,7 @@ functionId: 101001, serialNumber: '101001Table1CustomerStatus', tableId: '101001Table1', - tableName: 'common', + tableName: '客户信息表', columnProp: 'customerStatus', headerAlign: 'center', align: 'center', @@ -755,7 +933,7 @@ functionId: 101001, serialNumber: '101001Table1CreateDate', tableId: '101001Table1', - tableName: 'common', + tableName: '客户信息表', columnProp: 'createDate', headerAlign: 'center', align: 'center', @@ -772,7 +950,7 @@ functionId: 101001, serialNumber: '101001Table1CreateBy', tableId: '101001Table1', - tableName: 'common', + tableName: '客户信息表', columnProp: 'createBy', headerAlign: 'center', align: 'center', @@ -789,7 +967,7 @@ functionId: 101001, serialNumber: '101001Table1UpdateDate', tableId: '101001Table1', - tableName: 'common', + tableName: '客户信息表', columnProp: 'updateDate', headerAlign: 'center', align: 'center', @@ -806,7 +984,7 @@ functionId: 101001, serialNumber: '101001Table1UpdateBy', tableId: '101001Table1', - tableName: 'common', + tableName: '客户信息表', columnProp: 'updateBy', headerAlign: 'center', align: 'center', @@ -825,7 +1003,7 @@ functionId: 101001, serialNumber: '101001Table2ContactName', tableId: '101001Table2', - tableName: 'common', + tableName: '客户联系人表', columnProp: 'contactName', headerAlign: 'center', align: 'center', @@ -842,7 +1020,7 @@ functionId: 101001, serialNumber: '101001Table2ContactPhoneNumber1', tableId: '101001Table2', - tableName: 'common', + tableName: '客户联系人表', columnProp: 'contactPhoneNumber1', headerAlign: 'center', align: 'center', @@ -859,7 +1037,7 @@ functionId: 101001, serialNumber: '101001Table2ContactLandlineNumber', tableId: '101001Table2', - tableName: 'common', + tableName: '客户联系人表', columnProp: 'contactLandlineNumber', headerAlign: 'center', align: 'center', @@ -876,7 +1054,7 @@ functionId: 101001, serialNumber: '101001Table2Position', tableId: '101001Table2', - tableName: 'common', + tableName: '客户联系人表', columnProp: 'position', headerAlign: 'center', align: 'center', @@ -893,7 +1071,7 @@ functionId: 101001, serialNumber: '101001Table2Mailbox', tableId: '101001Table2', - tableName: 'common', + tableName: '客户联系人表', columnProp: 'mailbox', headerAlign: 'center', align: 'center', @@ -910,7 +1088,7 @@ functionId: 101001, serialNumber: '101001Table2PrimaryContact', tableId: '101001Table2', - tableName: 'common', + tableName: '客户联系人表', columnProp: 'primaryContact', headerAlign: 'center', align: 'center', @@ -927,7 +1105,7 @@ functionId: 101001, serialNumber: '101001Table2ContactStatus', tableId: '101001Table2', - tableName: 'common', + tableName: '客户联系人表', columnProp: 'contactStatus', headerAlign: 'center', align: 'center', @@ -944,7 +1122,7 @@ functionId: 101001, serialNumber: '101001Table2CreateDate', tableId: '101001Table2', - tableName: 'common', + tableName: '客户联系人表', columnProp: 'createDate', headerAlign: 'center', align: 'center', @@ -961,7 +1139,7 @@ functionId: 101001, serialNumber: '101001Table2CreateBy', tableId: '101001Table2', - tableName: 'common', + tableName: '客户联系人表', columnProp: 'createBy', headerAlign: 'center', align: 'center', @@ -978,7 +1156,7 @@ functionId: 101001, serialNumber: '101001Table2UpdateDate', tableId: '101001Table2', - tableName: 'common', + tableName: '客户联系人表', columnProp: 'updateDate', headerAlign: 'center', align: 'center', @@ -995,7 +1173,7 @@ functionId: 101001, serialNumber: '101001Table2UpdateBy', tableId: '101001Table2', - tableName: 'common', + tableName: '客户联系人表', columnProp: 'updateBy', headerAlign: 'center', align: 'center', @@ -1014,7 +1192,7 @@ functionId: 101001, serialNumber: '101001Table3AddressName', tableId: '101001Table3', - tableName: 'common', + tableName: '客户联系地址表', columnProp: 'addressName', headerAlign: 'center', align: 'center', @@ -1031,7 +1209,7 @@ functionId: 101001, serialNumber: '101001Table3Unit', tableId: '101001Table3', - tableName: 'common', + tableName: '客户联系地址表', columnProp: 'unit', headerAlign: 'center', align: 'center', @@ -1048,7 +1226,7 @@ functionId: 101001, serialNumber: '101001Table3AddressType', tableId: '101001Table3', - tableName: 'common', + tableName: '客户联系地址表', columnProp: 'addressType', headerAlign: 'center', align: 'center', @@ -1065,7 +1243,7 @@ functionId: 101001, serialNumber: '101001Table3Active', tableId: '101001Table3', - tableName: 'common', + tableName: '客户联系地址表', columnProp: 'primaryAddress', headerAlign: 'center', align: 'center', @@ -1082,7 +1260,7 @@ functionId: 101001, serialNumber: '101001Table3AddressStatus', tableId: '101001Table3', - tableName: 'common', + tableName: '客户联系地址表', columnProp: 'addressStatus', headerAlign: 'center', align: 'center', @@ -1099,7 +1277,7 @@ functionId: 101001, serialNumber: '101001Table3CreateDate', tableId: '101001Table3', - tableName: 'common', + tableName: '客户联系地址表', columnProp: 'createDate', headerAlign: 'center', align: 'center', @@ -1116,7 +1294,7 @@ functionId: 101001, serialNumber: '101001Table3CreateBy', tableId: '101001Table3', - tableName: 'common', + tableName: '客户联系地址表', columnProp: 'createBy', headerAlign: 'center', align: 'center', @@ -1133,7 +1311,7 @@ functionId: 101001, serialNumber: '101001Table3UpdateDate', tableId: '101001Table3', - tableName: 'common', + tableName: '客户联系地址表', columnProp: 'updateDate', headerAlign: 'center', align: 'center', @@ -1150,7 +1328,7 @@ functionId: 101001, serialNumber: '101001Table3UpdateBy', tableId: '101001Table3', - tableName: 'common', + tableName: '客户联系地址表', columnProp: 'updateBy', headerAlign: 'center', align: 'center', @@ -1167,13 +1345,13 @@ { userId: this.$store.state.user.name, functionId: 101001, - serialNumber: '101001Table4AddressName', + serialNumber: '101001Table4ProjectId', tableId: '101001Table4', - tableName: 'common', - columnProp: 'addressName', + tableName: '客户项目信息表', + columnProp: 'projectId', headerAlign: 'center', align: 'center', - columnLabel: '地址', + columnLabel: '项目号', columnHidden: false, columnImage: false, columnSortable: false, @@ -1184,13 +1362,13 @@ { userId: this.$store.state.user.name, functionId: 101001, - serialNumber: '101001Table4Unit', + serialNumber: '101001Table4ProjectName', tableId: '101001Table4', - tableName: 'common', - columnProp: 'unit', + tableName: '客户项目信息表', + columnProp: 'projectName', headerAlign: 'center', align: 'center', - columnLabel: '单位', + columnLabel: '项目名称', columnHidden: false, columnImage: false, columnSortable: false, @@ -1201,13 +1379,13 @@ { userId: this.$store.state.user.name, functionId: 101001, - serialNumber: '101001Table4AddressType', + serialNumber: '101001Table4ProjectType', tableId: '101001Table4', - tableName: 'common', - columnProp: 'addressType', + tableName: '客户项目信息表', + columnProp: 'projectType', headerAlign: 'center', align: 'center', - columnLabel: '地址类型', + columnLabel: '项目类型', columnHidden: false, columnImage: false, columnSortable: false, @@ -1218,13 +1396,13 @@ { userId: this.$store.state.user.name, functionId: 101001, - serialNumber: '101001Table4Active', + serialNumber: '101001Table4ProjectDesc', tableId: '101001Table4', - tableName: 'common', - columnProp: 'primaryAddress', + tableName: '客户项目信息表', + columnProp: 'projectDesc', headerAlign: 'center', align: 'center', - columnLabel: '主要地址', + columnLabel: '项目描述', columnHidden: false, columnImage: false, columnSortable: false, @@ -1235,13 +1413,30 @@ { userId: this.$store.state.user.name, functionId: 101001, - serialNumber: '101001Table4AddressStatus', + serialNumber: '101001Table4Status', tableId: '101001Table4', - tableName: 'common', - columnProp: 'addressStatus', + tableName: '客户项目信息表', + columnProp: 'status', headerAlign: 'center', align: 'center', - columnLabel: '状态', + columnLabel: '项目状态', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '' + }, + { + userId: this.$store.state.user.name, + functionId: 101001, + serialNumber: '101001Table4ProjectOwnerName', + tableId: '101001Table4', + tableName: '客户项目信息表', + columnProp: 'projectOwnerName', + headerAlign: 'center', + align: 'center', + columnLabel: '项目负责人', columnHidden: false, columnImage: false, columnSortable: false, @@ -1254,7 +1449,7 @@ functionId: 101001, serialNumber: '101001Table4CreateDate', tableId: '101001Table4', - tableName: 'common', + tableName: '客户项目信息表', columnProp: 'createDate', headerAlign: 'center', align: 'center', @@ -1271,7 +1466,7 @@ functionId: 101001, serialNumber: '101001Table4CreateBy', tableId: '101001Table4', - tableName: 'common', + tableName: '客户项目信息表', columnProp: 'createBy', headerAlign: 'center', align: 'center', @@ -1288,7 +1483,7 @@ functionId: 101001, serialNumber: '101001Table4UpdateDate', tableId: '101001Table4', - tableName: 'common', + tableName: '客户项目信息表', columnProp: 'updateDate', headerAlign: 'center', align: 'center', @@ -1305,7 +1500,7 @@ functionId: 101001, serialNumber: '101001Table4UpdateBy', tableId: '101001Table4', - tableName: 'common', + tableName: '客户项目信息表', columnProp: 'updateBy', headerAlign: 'center', align: 'center', @@ -1438,28 +1633,56 @@ ] }, projectInformationRules: { - addressName: [ + projectType: [ { required: true, message: ' ', trigger: 'change' } ], - primaryAddress: [ + projectName: [ { required: true, message: ' ', trigger: 'change' } ], - addressStatus: [ + projectSourceDesc: [ { required: true, message: ' ', trigger: 'change' } ], - addressType: [ + priorityDesc: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + needDate: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + projectManagerName: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + projectOwnerName: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + userRoleName: [ { required: true, message: ' ', @@ -1487,13 +1710,21 @@ addressDetailModalFlag: false, projectInformationModalFlag: false, projectInformationDetailModalFlag: false, + // ======== 客户项目相关 ======== + operatorList:[], + projectManagerList:[], + projectOwnerList: [], + userRoleList: [], + managerFlag: false, + ownerFlag:false, + userRoleFlag:false, } }, mounted () { this.$nextTick(() => { this.height = window.innerHeight / 2 - 30; /*第二个表格高度的动态调整*/ - this.secondHeight = window.innerHeight / 2 - 190; + this.secondHeight = window.innerHeight / 2 - 206; }) }, created () { @@ -1520,7 +1751,7 @@ }, // ======== 列表选择相关方法 ======== - selectFlag(){ + selectFlag () { return true; }, @@ -1539,7 +1770,7 @@ * @param row * @param oldRow */ - changeCurrentRow(row, oldRow){ + changeCurrentRow (row, oldRow) { // 判断是否是获取焦点的事件 if(row){ this.customerCurrentRow = JSON.parse(JSON.stringify(row)); @@ -1586,7 +1817,7 @@ /** * 刷新客户联系人的列表 */ - getCustomerContactList() { + getCustomerContactList () { let tempData = { site: this.$store.state.user.site, customerNo: this.customerCurrentRow.customerNo @@ -1602,7 +1833,7 @@ /** * 刷新客户联系地址的列表 */ - getCustomerAddressList() { + getCustomerAddressList () { let tempData = { site: this.$store.state.user.site, customerNo: this.customerCurrentRow.customerNo @@ -1618,10 +1849,10 @@ /** * 刷新客户项目信息的列表 */ - getProjectInformationList() { + getProjectInformationList () { let tempData = { site: this.$store.state.user.site, - customerNo: this.customerCurrentRow.customerNo + customerId: this.customerCurrentRow.customerNo } projectInformationSearch(tempData).then(({data}) => { if (data && data.code === 0) { @@ -1723,18 +1954,31 @@ flag: '1', title: '项目信息新增', site: this.$store.state.user.site, - - customerNo: this.customerCurrentRow.customerNo, - addressId: '', - addressName: '', - unit: '', - primaryAddress: '', - addressStatus: '', - addressType: '', + id: 0, + projectLevel: '', + projectId: '', + projectType: '', + projectTypeDb: '', + customerId: this.customerCurrentRow.customerNo, + customerName: this.customerCurrentRow.customerDesc, + projectName: '', + projectDesc: '', + projectSource: '', + projectSourceDesc: '', + priority: '', + priorityDesc: '', + needDate: '', + projectManagerName: '', + projectOwnerName: '', + customerRemark: '', remark: '', - + status: '', + userRoleName: '', + projectManagerList: [], + projectOwnerList: [], + userRoleList: [], createDate: '', - createBy: this.$store.state.user.name, + createBy: this.$store.state.user.name } this.projectInformationDetailModalFlag = false this.projectInformationModalFlag = true @@ -1833,19 +2077,56 @@ flag: '2', title: '项目信息编辑', site: row.site, - - customerNo: row.customerNo, - addressId: row.addressId, - addressName: row.addressName, - unit: row.unit, - primaryAddress: row.primaryAddress, - addressStatus: row.addressStatus, - addressType: row.addressType, + id: row.id, + projectLevel: row.projectLevel, + projectId: row.projectId, + projectType: row.projectType, + projectTypeDb: row.projectTypeDb, + customerId: row.customerId, + customerName: row.customerName, + projectName: row.projectName, + projectDesc: row.projectDesc, + projectSource: row.projectSource, + projectSourceDesc: row.projectSourceDesc, + priority: row.priority, + priorityDesc: row.priorityDesc, + needDate: row.needDate, + projectManagerName: row.projectManagerName, + projectOwnerName: row.projectOwnerName, + customerRemark: row.customerRemark, remark: row.remark, - + status: row.status, + userRoleName: row.userRoleName, + projectManagerList: [], + projectOwnerList: [], + userRoleList: [], updateDate: '', updateBy: this.$store.state.user.name } + // 查询项目经理、负责人、权限列表 + let inData = { + site: this.projectInformationModalData.site, + projectId: this.projectInformationModalData.projectId, + type: 'manager' + } + searchProjectTeamStr(inData).then(({data}) => { + this.projectInformationModalData.projectManagerList = data.rows + }) + let inData2 = { + site: this.projectInformationModalData.site, + projectId: this.projectInformationModalData.projectId, + type: 'owner' + } + searchProjectTeamStr(inData2).then(({data}) => { + this.projectInformationModalData.projectOwnerList = data.rows + }) + let inData3 = { + site: this.projectInformationModalData.site, + projectId: this.projectInformationModalData.projectId + } + searchUserRoll(inData3).then(({data}) => { + this.projectInformationModalData.userRoleList = data.rows + }) this.projectInformationDetailModalFlag = false this.projectInformationModalFlag = true }, @@ -1937,18 +2218,28 @@ flag: '3', title: '项目信息详情', site: row.site, - - customerNo: row.customerNo, - addressId: row.addressId, - addressName: row.addressName, - unit: row.unit, - primaryAddress: row.primaryAddress, - addressStatus: row.addressStatus, - addressType: row.addressType, + projectLevel: row.projectLevel, + projectId: row.projectId, + projectType: row.projectType, + projectTypeDb: row.projectTypeDb, + customerId: row.customerId, + customerName: row.customerName, + projectName: row.projectName, + projectDesc: row.projectDesc, + projectSource: row.projectSource, + projectSourceDesc: row.projectSourceDesc, + priority: row.priority, + priorityDesc: row.priorityDesc, + needDate: row.needDate, + projectManagerName: row.projectManagerName, + projectOwnerName: row.projectOwnerName, + customerRemark: row.customerRemark, remark: row.remark, + status: row.status, + userRoleName: row.userRoleName } - this.addressDetailModalFlag = true - this.addressModalFlag = true + this.projectInformationDetailModalFlag = true + this.projectInformationModalFlag = true }, // ======== 删除方法 ======== @@ -2065,7 +2356,7 @@ /** * 客户信息新增/编辑 */ - saveData(){ + saveData () { if (this.modalData.customerNo === '' || this.modalData.customerNo == null) { this.$message.warning('请输入客户代码!') return @@ -2141,7 +2432,7 @@ /** * 客户联系人新增/编辑 */ - saveContactData(){ + saveContactData () { if (this.contactModalData.contactName === '' || this.contactModalData.contactName == null) { this.$message.warning('请输入联系人!') return @@ -2199,7 +2490,7 @@ /** * 客户联系地址新增/编辑 */ - saveAddressData(){ + saveAddressData () { if (this.addressModalData.addressName === '' || this.addressModalData.addressName == null) { this.$message.warning('请输入地址!') return @@ -2257,60 +2548,56 @@ /** * 客户项目信息新增/编辑 */ - saveProjectInformationData(){ - if (this.projectInformationModalData.addressName === '' || this.projectInformationModalData.addressName == null) { - this.$message.warning('请输入地址!') + saveProjectInformationData () { + if(this.projectInformationModalData.projectTypeDb === '' || this.projectInformationModalData.projectTypeDb == null){ + this.$message.warning('请选择项目类型!') return } - if (this.projectInformationModalData.primaryAddress === '' || this.projectInformationModalData.primaryAddress == null) { - this.$message.warning('请选择是否为主要地址!') + if(this.projectInformationModalData.projectName === '' || this.projectInformationModalData.projectName == null){ + this.$message.warning('请输入项目名称!') return } - if (this.projectInformationModalData.addressStatus === '' || this.projectInformationModalData.addressStatus == null) { - this.$message.warning('请选择状态!') + if(this.projectInformationModalData.projectSource === '' || this.projectInformationModalData.projectSource == null){ + this.$message.warning('请选择项目来源!') return } - if (this.projectInformationModalData.addressType === '' || this.projectInformationModalData.addressType == null) { - this.$message.warning('请选择地址类型!') + if(this.projectInformationModalData.priority === '' || this.projectInformationModalData.priority == null){ + this.$message.warning('请选择优先级!') return } - if(this.projectInformationModalData.flag === '1'){ - projectInformationSave(this.projectInformationModalData).then(({data}) => { - if (data && data.code === 0) { - this.getProjectInformationList() - this.projectInformationModalFlag = false - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => { - } - }) - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } - }) - }else { - projectInformationEdit(this.projectInformationModalData).then(({data}) => { - if (data && data.code === 0) { - this.getProjectInformationList() - this.projectInformationModalFlag = false - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => { - } - }) - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } - }) + if(this.projectInformationModalData.needDate === '' || this.projectInformationModalData.needDate == null){ + this.$message.warning('请选择要求日期!') + return + } + if(this.projectInformationModalData.projectManagerName === '' || this.projectInformationModalData.projectManagerName == null){ + this.$message.warning('请选择项目经理!') + return + } + if(this.projectInformationModalData.projectOwnerName === '' || this.projectInformationModalData.projectOwnerName == null){ + this.$message.warning('请选择项目负责人!') + return + } + if(this.projectInformationModalData.userRoleName === '' || this.projectInformationModalData.userRoleName == null){ + this.$message.warning('请选择权限!') + return } + saveProjectInfo(this.projectInformationModalData).then(({data}) => { + if (data && data.code === 0) { + this.getProjectInformationList() + this.projectInformationModalFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) }, // ======== 列表单机选中方法 ======== @@ -2318,7 +2605,7 @@ * 单机选中客户信息 * @param row */ - customerClickRow(row){ + customerClickRow (row) { //this.$refs.customerTable.toggleRowSelection(row); this.customerCurrentRow = JSON.parse(JSON.stringify(row)); }, @@ -2326,7 +2613,7 @@ * 单机选中客户联系人 * @param row */ - contactClickRow(row){ + contactClickRow (row) { this.$refs.contactTable.toggleRowSelection(row); this.contactCurrentRow = JSON.parse(JSON.stringify(row)); }, @@ -2334,7 +2621,7 @@ * 单机选中客户联系地址 * @param row */ - addressClickRow(row){ + addressClickRow (row) { this.$refs.addressTable.toggleRowSelection(row); this.addressCurrentRow = JSON.parse(JSON.stringify(row)); }, @@ -2342,7 +2629,7 @@ * 单机选中客户项目信息 * @param row */ - projectInformationClickRow(row){ + projectInformationClickRow (row) { this.$refs.projectInformationTable.toggleRowSelection(row); this.projectInformationCurrentRow = JSON.parse(JSON.stringify(row)); }, @@ -2352,31 +2639,229 @@ * 复选客户信息 * @param val */ - selectionCustomer(val){ + selectionCustomer (val) { this.customerSelections = val }, /** * 复选客户联系人 * @param val */ - selectionContact(val){ + selectionContact (val) { this.contactSelections = val }, /** * 复选客户联系人 * @param val */ - selectionAddress(val){ + selectionAddress (val) { this.addressSelections = val }, /** * 复选客户项目信息 * @param val */ - selectionProjectInformation(val){ + selectionProjectInformation (val) { this.projectInformationSelections = val }, + // ======== chooseList相关方法 ======== + /** + * 获取基础数据列表S + * @param val + * @param type + */ + getBaseList (val, type) { + this.tagNo = val + this.tagNo1 = type + this.$nextTick(() => { + let strVal = '' + if (val === 1010) { + if(type === 1) { + strVal = this.projectInformationModalData.projectTypeDb + } + } + if (val === 102) { + if(type === 1) { + strVal = this.projectInformationModalData.customerId + } + } + if (val === 1011) { + if(type === 1) { + strVal = this.projectInformationModalData.projectSource + } + } + if (val === 1012) { + if(type === 1) { + strVal = this.projectInformationModalData.priority + } + } + this.$refs.baseList.init(val, strVal) + }) + }, + /** + * 列表方法的回调 + * @param val + */ + getBaseData (val) { + if (this.tagNo === 1010) { + if(this.tagNo1 === 1) { + this.projectInformationModalData.projectTypeDb = val.Base_id + this.projectInformationModalData.projectType = val.Base_desc + } + } + if (this.tagNo === 102) { + if(this.tagNo1 === 1) { + this.projectInformationModalData.customerId = val.Customer_no + this.projectInformationModalData.customerName = val.Customer_desc + } + } + if (this.tagNo === 1011) { + if(this.tagNo1 === 1) { + this.projectInformationModalData.projectSource = val.Base_id + this.projectInformationModalData.projectSourceDesc = val.Base_desc + } + } + if (this.tagNo === 1012) { + if(this.tagNo1 === 1) { + this.projectInformationModalData.priority = val.Base_id + this.projectInformationModalData.priorityDesc = val.Base_desc + } + } + }, + /** + * 项目经理选择模态框 + */ + managerChooseModal () { + let inData = { + site: this.projectInformationModalData.site, + projectId: this.projectInformationModalData.projectId, + } + searchOperatorWithSite(inData).then(({data}) => { + this.operatorList = data.rows + }) + this.projectManagerList = JSON.parse(JSON.stringify(this.projectInformationModalData.projectManagerList)); + this.managerFlag = true + }, + /** + * 项目经理选择 + */ + saveManagerList () { + let projectManagerName = ''; + for (let i = 0; i < this.projectManagerList.length; i++) { + let select = this.operatorList.filter(item => item.operatorId === this.projectManagerList[i]) + if (select.length > 0) { + projectManagerName += select[0].operatorName + ';' + } + } + this.projectInformationModalData.projectManagerName = projectManagerName + this.projectInformationModalData.projectManagerList = JSON.parse(JSON.stringify(this.projectManagerList)); + this.managerFlag = false + }, + /** + * 项目负责人选择模态框 + */ + ownerChooseModal () { + let inData = { + site: this.projectInformationModalData.site, + projectId: this.projectInformationModalData.projectId, + } + searchOperatorWithSite(inData).then(({data}) => { + this.operatorList = data.rows + }) + this.projectOwnerList = JSON.parse(JSON.stringify(this.projectInformationModalData.projectOwnerList)); + this.ownerFlag = true + }, + /** + * 项目负责人选择 + */ + saveOwnerList () { + let projectOwnerName = ''; + for (let i = 0; i < this.projectOwnerList.length; i++) { + let select = this.operatorList.filter(item => item.operatorId === this.projectOwnerList[i]) + if(select.length > 0){ + projectOwnerName += select[0].operatorName + ';' + } + } + this.projectInformationModalData.projectOwnerName = projectOwnerName + this.projectInformationModalData.projectOwnerList = JSON.parse(JSON.stringify(this.projectOwnerList)); + this.ownerFlag = false + }, + /** + * 项目权限模态框 + */ + userRollModal () { + this.userRoleList = JSON.parse(JSON.stringify(this.projectInformationModalData.userRoleList)); + this.userRoleFlag = true + }, + changeAll (row) { + if (row.checkAll) { + row.searchCheck = true + row.updateCheck = true + row.downCheck = true + row.deleteCheck = true + row.searchFlag = 'Y' + row.updateFlag = 'Y' + row.downFlag = 'Y' + row.deleteFlag = 'Y' + } else { + row.searchCheck = false + row.updateCheck = false + row.downCheck = false + row.deleteCheck = false + row.searchFlag = 'N' + row.updateFlag = 'N' + row.downFlag = 'N' + row.deleteFlag = 'N' + } + }, + changeCheck (row,type) { + if (type === 1) { + if (row.searchCheck) { + row.searchFlag = 'Y' + } else { + row.searchFlag = 'N' + } + } + if (type === 2) { + if (row.updateCheck) { + row.updateFlag = 'Y' + } else { + row.updateFlag = 'N' + } + } + if (type === 3) { + if (row.downCheck) { + row.downFlag = 'Y' + } else { + row.downFlag = 'N' + } + } + if (type === 4) { + if (row.deleteCheck) { + row.deleteFlag = 'Y' + } else { + row.deleteFlag = 'N' + } + } + if (row.searchCheck && row.updateCheck && row.downCheck && row.deleteCheck) { + row.checkAll = true + } else { + row.checkAll = false + } + this.$forceUpdate(); + }, + saveUserList () { + let name = ''; + for (let i = 0; i < this.userRoleList.length; i++) { + if (this.userRoleList[i].searchCheck || this.userRoleList[i].updateCheck || this.userRoleList[i].downCheck || this.userRoleList[i].deleteCheck) { + name += this.userRoleList[i].userDisplay + ';' + } + } + this.projectInformationModalData.userRoleName = name + this.projectInformationModalData.userRoleList = JSON.parse(JSON.stringify(this.userRoleList)); + this.userRoleFlag = false + }, + // ======== 导出相关方法 ======== /** * 导出excel @@ -2414,33 +2899,5 @@ /deep/ .customer-tab .el-tabs__content { padding: 0px !important; } - -/*修改上传图标的样式*/ -.el-upload-dragger .el-icon-upload { - font-size: 36px; - color: #c0c4cc; - margin: 10px 10px; - line-height: 20px; -} -/*修改上传框的样式*/ -/deep/ .customer-upload .el-upload-dragger { - background-color: #fff; - border: 1px dashed #d9d9d9; - border-radius: 6px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - margin-left: 10px; - width: 240px; - height: 42px; - text-align: left; - position: relative; - overflow: hidden; -} -/*修改上传文字的样式*/ -.customer-upload .el-upload__text{ - margin-top: -32px; - margin-left: 40px; - -}