{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!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\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"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":["import \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/bzzgj-fvue/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\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 { ExtendParamsMixin } from '@/mixins/extendParams.js';\nimport { mapState } from 'vuex';\nexport default {\n name: 'FormDialog',\n mixins: [ExtendParamsMixin],\n data: function data() {\n return {\n visible: false,\n params: {\n contractCode: '',\n //合同编码\n contractName: '',\n //合同名称\n contractStatus: '',\n //合同状态(1:进行中,2:已完成)\n contractType: '',\n //合同类型(1:采购合同,2:建设合同,3:运维合同)\n endDate: '',\n //结束时间\n memo: '',\n //备注\n personLiable: '',\n //责任人\n signDate: '',\n //签订日期\n startDate: '',\n //开始时间\n companyName: '',\n relationSupplierContract: {\n companyId: ''\n },\n id: null\n },\n fileARRList: [],\n title: '新增',\n userId: '',\n //当前登录人的ID\n activeCollapse: '1',\n contractTypes: [],\n contractStatusList: [{\n value: '1',\n name: '进行中'\n }, {\n value: '2',\n name: '已完成'\n }],\n uploadUrl: window.context.portal + '/file/v1/uploadFileForConfig',\n // 服务器上传地址\n accept: '.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 fileList: [],\n arrList: [],\n supplierList: [],\n // 供应商数据列表\n rules: {\n contractCode: [{\n required: true,\n message: '请输入合同编码',\n trigger: 'blur'\n }],\n contractType: [{\n required: true,\n message: '请选择合同类型',\n trigger: 'blur'\n }],\n contractName: [{\n required: true,\n message: '请输入合同名称',\n trigger: 'blur'\n }],\n personLiable: [{\n required: true,\n message: '请输入责任人',\n trigger: 'blur'\n }],\n signDate: [{\n required: true,\n message: '请选择合同签订时间',\n trigger: 'blur'\n }],\n contractStatus: [{\n required: true,\n message: '请选择合同状态',\n trigger: 'blur'\n }],\n startDate: [{\n required: true,\n message: '请选择合同开始时间',\n trigger: 'blur'\n }],\n endDate: [{\n required: true,\n message: '请选择合同结束时间',\n trigger: 'blur'\n }],\n companyName: [{\n required: true,\n message: '请选择供应商',\n trigger: 'blur'\n }]\n },\n queryParmas: {\n pageBean: {\n page: 1,\n pageSize: -1,\n showTotal: true\n },\n querys: [{\n group: 'main',\n operation: 'EQUAL',\n property: 'biz_id_',\n relation: 'AND',\n value: ''\n }]\n }\n };\n },\n created: function () {\n var _created = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n this.contractTypes = dictContracts.getDictItemsFromCache('htlx');\n this.companyType = dictContracts.getDictItemsFromCache('dwlx'); // await this.getExtendParams(3)\n\n case 2:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function created() {\n return _created.apply(this, arguments);\n }\n\n return created;\n }(),\n mounted: function mounted() {\n this.getSupplierInfo();\n },\n computed: mapState({\n header: function header(state) {\n return {\n Authorization: \"Bearer \".concat(state.login.currentUser.token)\n };\n }\n }),\n methods: {\n add: function add() {\n // this.handleExtendParamsMixin()\n this.visible = true;\n this.params.contractType = this.contractTypes[0].value;\n this.params.contractStatus = this.contractStatusList[0].value;\n },\n // removeUpload(val) {\n // console.log(val)\n // },\n uploadSuccess: function uploadSuccess(res) {\n if (res) {\n this.arrList.push({\n fileName: res.fileName,\n id: res.fileId\n });\n } else {\n // 提示信息,需引入Message\n this.$message.error('上传失败!');\n }\n },\n getAsyncData: function getAsyncData(ids) {\n return new Promise(function (resolve, reject) {\n req.get(window.context.form + '/file/v1/downloadFile?fileId=' + ids);\n });\n },\n //附件下载\n downloadText: function downloadText() {\n var _this = this;\n\n if (this.fileList.length == 0) {\n this.$message.error('没有附件内容');\n } else {\n this.fileList.forEach(function (item) {\n return _this.getAsyncData(item.bizId);\n });\n }\n },\n beforeRemove: function beforeRemove(file, fileList) {\n if (file.createBy == this.userId) {\n this.fileARRList.push(file.bizId);\n } else {\n this.$message({\n message: '您没有权限',\n type: 'warning'\n });\n return false;\n }\n },\n beforeUpload: function beforeUpload(file) {\n return true;\n },\n edit: function () {\n var _edit = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(row) {\n var _this2 = this;\n\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n this.fileList = []; //获取用户信息\n // 获取扩展字段值\n // await this.getExtendParamsData(3, row.id)\n // 扩展字段混入到表单绑定数据中\n // this.handleExtendParamsMixin()\n\n contractManage.contractDetail(row.id).then(function (res) {\n _this2.params.contractCode = res.contractCode;\n _this2.params.contractName = res.contractName;\n _this2.params.contractStatus = res.contractStatus;\n _this2.params.contractType = res.contractType;\n _this2.params.endDate = res.endDate;\n _this2.params.signDate = res.signDate;\n _this2.params.startDate = res.startDate;\n _this2.params.id = res.id;\n _this2.params.relationSupplierContract.companyId = res.relationSupplierContract.companyId;\n _this2.params.personLiable = res.personLiable;\n _this2.params.memo = res.memo;\n _this2.params.companyName = row.companyName;\n _this2.queryParmas.querys[0].value = res.id;\n contractManage.queryFile(_this2.queryParmas, function (rep) {\n if (rep.rows) {\n console.log(rep, 555);\n rep.rows.forEach(function (p) {\n var arr = {\n bizId: p.id,\n name: p.fileName + '.' + p.extensionName,\n createBy: p.createBy\n };\n\n _this2.fileList.push(arr);\n });\n }\n });\n });\n this.title = '修改';\n contractManage.getUserInfo().then(function (res) {\n _this2.userId = res.user.id;\n }); // console.log(this.userId, this.fileList,222)\n\n this.visible = true;\n\n case 5:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function edit(_x) {\n return _edit.apply(this, arguments);\n }\n\n return edit;\n }(),\n supplierChange: function supplierChange(value) {\n var _this3 = this;\n\n if (this.params.relationSupplierContract.companyId == '') {\n this.params.relationSupplierContract.companyId = value;\n } else {\n this.params.relationSupplierContract.companyId = value;\n }\n\n this.supplierList.forEach(function (item) {\n if (value == item.id && _this3.params.companyName == '') {\n _this3.params.companyName = item.companyName;\n }\n });\n },\n // 获取供应商信息\n getSupplierInfo: function getSupplierInfo() {\n var _this4 = this;\n\n var companyType = '';\n this.companyType.forEach(function (item) {\n if (item.name == '供应商') {\n companyType = item.value;\n }\n });\n var data = {\n pageBean: {\n page: 1,\n pageSize: -1,\n showTotal: true\n },\n querys: [{\n group: 'main',\n operation: 'LIKE',\n parentGroup: '',\n property: 'companyType',\n relation: 'AND',\n value: companyType\n }]\n };\n resourceManage.loadUnit(data, function (res) {\n _this4.supplierList = res.rows;\n\n _this4.$set(_this4.supplierList);\n });\n },\n // 保存合同信息\n goInfo: function goInfo() {\n var _this5 = this;\n\n contractManage.removeFile(this.fileARRList, function (res) {\n if (res.state) {\n _this5.$notify({\n type: 'success',\n message: '删除成功',\n duration: 2000\n });\n }\n });\n this.$refs.formInfo.validate(function (valid) {\n if (valid) {\n var tempData = utils.deepClone(_this5.params);\n tempData = _this5.handleExtendParamsSave(tempData, '3');\n var method;\n\n if (_this5.title === '新增') {\n method = contractManage.addContract;\n } else if (_this5.title === '修改') {\n method = contractManage.updateContract;\n }\n\n method(tempData).then(function (response) {\n if (_this5.title === '新增') {\n if (response.state) {\n if (response.message && response.state) {\n _this5.arrList.forEach(function (e) {\n e.bizId = response.message;\n });\n\n contractManage.fileUpload(_this5.arrList, function (res) {\n if (res.state) {\n _this5.$notify({\n type: 'success',\n message: _this5.title + '成功',\n duration: 2000\n });\n\n _this5.handleClose();\n\n _this5.$parent.loadData(1);\n }\n });\n } else {\n _this5.$notify({\n type: 'success',\n message: _this5.title + '成功',\n duration: 2000\n });\n\n _this5.handleClose();\n\n _this5.$parent.loadData(1);\n }\n } else {\n _this5.$message.warning(response.message);\n }\n } else if (_this5.title === '修改') {\n if (response.state) {\n _this5.arrList.forEach(function (e) {\n e.bizId = _this5.params.id;\n });\n\n contractManage.fileUpload(_this5.arrList, function (res) {\n if (res.state) {\n _this5.$notify({\n type: 'success',\n message: _this5.title + '成功',\n duration: 2000\n });\n\n _this5.handleClose();\n\n _this5.$parent.loadData(1);\n }\n });\n } else {// this.$message.warning(response.message)\n }\n }\n });\n } else {\n _this5.$notify({\n type: 'warning',\n message: '请完善表单信息!',\n duration: 2000\n });\n }\n });\n },\n // 关闭新增合同窗口\n handleClose: function handleClose() {\n this.params = {\n contractCode: '',\n //合同编码\n contractName: '',\n //合同名称\n contractStatus: '',\n //合同状态(1:进行中,2:已完成)\n contractType: '',\n //合同类型(1:采购合同,2:建设合同,3:运维合同)\n endDate: '',\n //结束时间\n memo: '',\n //备注\n personLiable: '',\n //责任人\n signDate: '',\n //签订日期\n startDate: '',\n //开始时间\n companyName: '',\n relationSupplierContract: {\n companyId: ''\n },\n id: null\n };\n this.title = '新增';\n this.activeCollapse = '1';\n this.visible = false;\n }\n }\n};",null]}