{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\resourceManage\\components\\contractManageDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\resourceManage\\components\\contractManageDialog.vue","mtime":1686792516249},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport dictContracts from '@/components/dict/DictSelectUtils.js'\nimport contractManage from '@/api/device/contractManage.js'\nimport resourceManage from '@/api/device/resourceManage.js'\nimport utils from '@/hotent-ui-util.js'\nimport req from '@/request.js'\nimport {\n\tExtendParamsMixin\n} from '@/mixins/extendParams.js'\nimport {\n\tmapState\n} from 'vuex'\nexport default {\n\tname: 'FormDialog',\n\tmixins: [ExtendParamsMixin],\n\tdata() {\n\t\treturn {\n\t\t\tvisible: false,\n\t\t\tparams: {\n\t\t\t\tcontractCode: '', //合同编码\n\t\t\t\tcontractName: '', //合同名称\n\t\t\t\tcontractStatus: '', //合同状态(1:进行中,2:已完成)\n\t\t\t\tcontractType: '', //合同类型(1:采购合同,2:建设合同,3:运维合同)\n\t\t\t\tendDate: '', //结束时间\n\t\t\t\tmemo: '', //备注\n\t\t\t\tpersonLiable: '', //责任人\n\t\t\t\tsignDate: '', //签订日期\n\t\t\t\tstartDate: '', //开始时间\n\t\t\t\tcompanyName: '',\n\t\t\t\trelationSupplierContract: {\n\t\t\t\t\tcompanyId: '',\n\t\t\t\t},\n\t\t\t\tid: null,\n\t\t\t},\n\t\t\tfileARRList: [],\n\t\t\ttitle: '新增',\n\t\t\tuserId: '', //当前登录人的ID\n\t\t\tactiveCollapse: '1',\n\t\t\tcontractTypes: [],\n\t\t\tcontractStatusList: [{\n\t\t\t\t\tvalue: '1',\n\t\t\t\t\tname: '进行中',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tvalue: '2',\n\t\t\t\t\tname: '已完成',\n\t\t\t\t},\n\t\t\t],\n\t\t\tuploadUrl: window.context.portal + '/file/v1/uploadFileForConfig', // 服务器上传地址\n\t\t\taccept: '.bmp,.jpg,.png,.tif,.gif,.pcx,.tga,.exif,.fpx,.svg,.psd,.cdr,.pcd,.dxf,.ufo,.eps,.ai,.raw,.WMF,.webp,.avif,.apng,.xls,.docx,.docm,.doc,.dotx,.pptx,.pptm,.ppt,.pdf,.xps,.potx,.txt,.xls,.xlsx,.xps,.zip,.rar,.7z',\n\t\t\tfileList: [],\n\t\t\tarrList: [],\n\t\t\tsupplierList: [], // 供应商数据列表\n\t\t\trules: {\n\t\t\t\tcontractCode: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请输入合同编码',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t\tcontractType: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请选择合同类型',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t\tcontractName: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请输入合同名称',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t\tpersonLiable: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请输入责任人',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t\tsignDate: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请选择合同签订时间',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t\tcontractStatus: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请选择合同状态',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t\tstartDate: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请选择合同开始时间',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t\tendDate: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请选择合同结束时间',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t\tcompanyName: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请选择供应商',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t},\n\t\t\tqueryParmas: {\n\t\t\t\tpageBean: {\n\t\t\t\t\tpage: 1,\n\t\t\t\t\tpageSize: -1,\n\t\t\t\t\tshowTotal: true,\n\t\t\t\t},\n\t\t\t\tquerys: [{\n\t\t\t\t\tgroup: 'main',\n\t\t\t\t\toperation: 'EQUAL',\n\t\t\t\t\tproperty: 'biz_id_',\n\t\t\t\t\trelation: 'AND',\n\t\t\t\t\tvalue: '',\n\t\t\t\t}, ],\n\t\t\t},\n\t\t}\n\t},\n\tasync created() {\n\t\tthis.contractTypes = dictContracts.getDictItemsFromCache('htlx')\n\t\tthis.companyType = dictContracts.getDictItemsFromCache('dwlx')\n\t\t// await this.getExtendParams(3)\n\t},\n\tmounted() {\n\t\tthis.getSupplierInfo()\n\t},\n\tcomputed: mapState({\n\t\theader: (state) => {\n\t\t\treturn {\n\t\t\t\tAuthorization: `Bearer ${state.login.currentUser.token}`,\n\t\t\t}\n\t\t},\n\t}),\n\tmethods: {\n\t\tadd() {\n\t\t\t// this.handleExtendParamsMixin()\n\t\t\tthis.visible = true\n\t\t\tthis.params.contractType = this.contractTypes[0].value\n\t\t\tthis.params.contractStatus = this.contractStatusList[0].value\n\t\t},\n\t\t// removeUpload(val) {\n\t\t// console.log(val)\n\t\t// },\n\t\tuploadSuccess(res) {\n\t\t\tif (res) {\n\t\t\t\tthis.arrList.push({\n\t\t\t\t\tfileName: res.fileName,\n\t\t\t\t\tid: res.fileId,\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\t// 提示信息,需引入Message\n\t\t\t\tthis.$message.error('上传失败!')\n\t\t\t}\n\t\t},\n\t\tgetAsyncData(ids) {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\treq.get(window.context.form + '/file/v1/downloadFile?fileId=' + ids)\n\t\t\t})\n\t\t},\n\t\t//附件下载\n\t\tdownloadText() {\n\t\t\tif (this.fileList.length == 0) {\n\t\t\t\tthis.$message.error('没有附件内容')\n\t\t\t} else {\n\t\t\t\tthis.fileList.forEach((item) => {\n\t\t\t\t\treturn this.getAsyncData(item.bizId)\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\tbeforeRemove(file, fileList) {\n\t\t\tif (file.createBy == this.userId) {\n\t\t\t\tthis.fileARRList.push(file.bizId)\n\t\t\t} else {\n\t\t\t\tthis.$message({\n\t\t\t\t\tmessage: '您没有权限',\n\t\t\t\t\ttype: 'warning',\n\t\t\t\t})\n\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\t\tbeforeUpload(file) {\n\t\t\treturn true\n\t\t},\n\t\tasync edit(row) {\n\t\t\tthis.fileList = []\n\t\t\t//获取用户信息\n\t\t\t// 获取扩展字段值\n\t\t\t// await this.getExtendParamsData(3, row.id)\n\t\t\t// 扩展字段混入到表单绑定数据中\n\t\t\t// this.handleExtendParamsMixin()\n\t\t\tcontractManage.contractDetail(row.id).then((res) => {\n\t\t\t\tthis.params.contractCode = res.contractCode\n\t\t\t\tthis.params.contractName = res.contractName\n\t\t\t\tthis.params.contractStatus = res.contractStatus\n\t\t\t\tthis.params.contractType = res.contractType\n\t\t\t\tthis.params.endDate = res.endDate\n\t\t\t\tthis.params.signDate = res.signDate\n\t\t\t\tthis.params.startDate = res.startDate\n\t\t\t\tthis.params.id = res.id\n\t\t\t\tthis.params.relationSupplierContract.companyId =\n\t\t\t\t\tres.relationSupplierContract.companyId\n\t\t\t\tthis.params.personLiable = res.personLiable\n\t\t\t\tthis.params.memo = res.memo\n\t\t\t\tthis.params.companyName = row.companyName\n\t\t\t\tthis.queryParmas.querys[0].value = res.id\n\t\t\t\tcontractManage.queryFile(this.queryParmas, (rep) => {\n\t\t\t\t\tif (rep.rows) {\n\t\t\t\t\t\tconsole.log(rep, 555)\n\t\t\t\t\t\trep.rows.forEach((p) => {\n\t\t\t\t\t\t\tlet arr = {\n\t\t\t\t\t\t\t\tbizId: p.id,\n\t\t\t\t\t\t\t\tname: p.fileName + '.' + p.extensionName,\n\t\t\t\t\t\t\t\tcreateBy: p.createBy,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.fileList.push(arr)\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t\t\tthis.title = '修改'\n\t\t\tcontractManage.getUserInfo().then((res) => {\n\t\t\t\tthis.userId = res.user.id\n\t\t\t})\n\t\t\t// console.log(this.userId, this.fileList,222)\n\t\t\tthis.visible = true\n\t\t},\n\t\tsupplierChange(value) {\n\t\t\tif (this.params.relationSupplierContract.companyId == '') {\n\t\t\t\tthis.params.relationSupplierContract.companyId = value\n\t\t\t} else {\n\t\t\t\tthis.params.relationSupplierContract.companyId = value\n\t\t\t}\n\t\t\tthis.supplierList.forEach((item) => {\n\t\t\t\tif (value == item.id && this.params.companyName == '') {\n\t\t\t\t\tthis.params.companyName = item.companyName\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\t// 获取供应商信息\n\t\tgetSupplierInfo() {\n\t\t\tlet companyType = ''\n\t\t\tthis.companyType.forEach((item) => {\n\t\t\t\tif (item.name == '供应商') {\n\t\t\t\t\tcompanyType = item.value\n\t\t\t\t}\n\t\t\t})\n\t\t\tlet data = {\n\t\t\t\tpageBean: {\n\t\t\t\t\tpage: 1,\n\t\t\t\t\tpageSize: -1,\n\t\t\t\t\tshowTotal: true,\n\t\t\t\t},\n\t\t\t\tquerys: [{\n\t\t\t\t\tgroup: 'main',\n\t\t\t\t\toperation: 'LIKE',\n\t\t\t\t\tparentGroup: '',\n\t\t\t\t\tproperty: 'companyType',\n\t\t\t\t\trelation: 'AND',\n\t\t\t\t\tvalue: companyType,\n\t\t\t\t}, ],\n\t\t\t}\n\t\t\tresourceManage.loadUnit(data, (res) => {\n\t\t\t\tthis.supplierList = res.rows\n\t\t\t\tthis.$set(this.supplierList)\n\t\t\t})\n\t\t},\n\t\t// 保存合同信息\n\t\tgoInfo() {\n\t\t\tcontractManage.removeFile(this.fileARRList, (res) => {\n\t\t\t\tif (res.state) {\n\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\tmessage: '删除成功',\n\t\t\t\t\t\tduration: 2000,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis.$refs.formInfo.validate((valid) => {\n\t\t\t\tif (valid) {\n\t\t\t\t\tlet tempData = utils.deepClone(this.params)\n\t\t\t\t\ttempData = this.handleExtendParamsSave(tempData, '3')\n\t\t\t\t\tlet method\n\t\t\t\t\tif (this.title === '新增') {\n\t\t\t\t\t\tmethod = contractManage.addContract\n\t\t\t\t\t} else if (this.title === '修改') {\n\t\t\t\t\t\tmethod = contractManage.updateContract\n\t\t\t\t\t}\n\t\t\t\t\tmethod(tempData).then((response) => {\n\t\t\t\t\t\tif (this.title === '新增') {\n\t\t\t\t\t\t\tif (response.state) {\n\t\t\t\t\t\t\t\tif (response.message && response.state) {\n\t\t\t\t\t\t\t\t\tthis.arrList.forEach((e) => {\n\t\t\t\t\t\t\t\t\t\te.bizId = response.message\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\tcontractManage.fileUpload(this.arrList, (res) => {\n\t\t\t\t\t\t\t\t\t\tif (res.state) {\n\t\t\t\t\t\t\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t\t\t\t\t\tmessage: this.title + '成功',\n\t\t\t\t\t\t\t\t\t\t\t\tduration: 2000,\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\tthis.handleClose()\n\t\t\t\t\t\t\t\t\t\t\tthis.$parent.loadData(1)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t\t\t\tmessage: this.title + '成功',\n\t\t\t\t\t\t\t\t\t\tduration: 2000,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\tthis.handleClose()\n\t\t\t\t\t\t\t\t\tthis.$parent.loadData(1)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.$message.warning(response.message)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (this.title === '修改') {\n\t\t\t\t\t\t\tif (response.state) {\n\t\t\t\t\t\t\t\tthis.arrList.forEach((e) => {\n\t\t\t\t\t\t\t\t\te.bizId = this.params.id\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tcontractManage.fileUpload(this.arrList, (res) => {\n\t\t\t\t\t\t\t\t\tif (res.state) {\n\t\t\t\t\t\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t\t\t\t\tmessage: this.title + '成功',\n\t\t\t\t\t\t\t\t\t\t\tduration: 2000,\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\tthis.handleClose()\n\t\t\t\t\t\t\t\t\t\tthis.$parent.loadData(1)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// this.$message.warning(response.message)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\ttype: 'warning',\n\t\t\t\t\t\tmessage: '请完善表单信息!',\n\t\t\t\t\t\tduration: 2000,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\t// 关闭新增合同窗口\n\t\thandleClose() {\n\t\t\tthis.params = {\n\t\t\t\tcontractCode: '', //合同编码\n\t\t\t\tcontractName: '', //合同名称\n\t\t\t\tcontractStatus: '', //合同状态(1:进行中,2:已完成)\n\t\t\t\tcontractType: '', //合同类型(1:采购合同,2:建设合同,3:运维合同)\n\t\t\t\tendDate: '', //结束时间\n\t\t\t\tmemo: '', //备注\n\t\t\t\tpersonLiable: '', //责任人\n\t\t\t\tsignDate: '', //签订日期\n\t\t\t\tstartDate: '', //开始时间\n\t\t\t\tcompanyName: '',\n\t\t\t\trelationSupplierContract: {\n\t\t\t\t\tcompanyId: '',\n\t\t\t\t},\n\t\t\t\tid: null,\n\t\t\t}\n\t\t\tthis.title = '新增'\n\t\t\tthis.activeCollapse = '1'\n\t\t\tthis.visible = false\n\t\t},\n\t},\n}\n",null]}