{"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\\unitManageDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\resourceManage\\components\\unitManageDialog.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\nimport resourceManage from '@/api/device/resourceManage.js'\nimport utils from '@/hotent-ui-util.js'\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\nimport {\n\tExtendParamsMixin\n} from '@/mixins/extendParams.js'\nexport default {\n\tname: 'unitManageModal',\n\tmixins: [ExtendParamsMixin],\n\tdata() {\n\t\tvar checkPhone = (rule, value, callback) => {\n\t\t\tlet moblie = /^1(3|4|5|6|7|8|9)\\d{9}$/ // 手机\n\t\t\tlet tel = /^([2-9][0-9]{4,7})+(\\-[0-9]{1,4})?$/ //座机\n\t\t\tif (!moblie.test(value) && !tel.test(value)) {\n\t\t\t\tcallback(new Error('联系电话不合规则'))\n\t\t\t} else {\n\t\t\t\tcallback()\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tvisible: false,\n\t\t\ttitle: '新增',\n\t\t\tactiveCollapse: '1',\n\t\t\tparams: {\n\t\t\t\tcompanyAddress: '',\n\t\t\t\tcompanyCode: '',\n\t\t\t\tcompanyFax: '',\n\t\t\t\tcompanyMail: '',\n\t\t\t\tcompanyMan: '',\n\t\t\t\tcompanyName: '',\n\t\t\t\tcompanyShortName: '',\n\t\t\t\tcompanyTel: '',\n\t\t\t\tcompanyTypeShow: ['1'],\n\t\t\t\tcompanyType: '',\n\t\t\t\tmemo: '',\n\t\t\t},\n\t\t\tcompanyType: [], //单位类型\n\t\t\trules: {\n\t\t\t\tcompanyName: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请输入单位名称',\n\t\t\t\t\ttrigger: 'change',\n\t\t\t\t}, ],\n\t\t\t\tcompanyShortName: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请输入单位简称',\n\t\t\t\t\ttrigger: 'change',\n\t\t\t\t}, ],\n\t\t\t\tcompanyCode: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请输入单位编码',\n\t\t\t\t\ttrigger: 'change',\n\t\t\t\t}, ],\n\t\t\t\tcompanyTypeShow: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请选择单位类型',\n\t\t\t\t\ttrigger: 'change',\n\t\t\t\t}, ],\n\t\t\t\tcompanyTel: [{\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\t\tvalidator: checkPhone,\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}],\n\t\t\t},\n\t\t}\n\t},\n\tasync created() {\n\t\tthis.companyType = dictUtils.getDictItemsFromCache('dwlx')\n\t\tawait this.getExtendParams(1)\n\t},\n\tmethods: {\n\t\tchangeType() {\n\t\t\tthis.$forceUpdate()\n\t\t},\n\t\tadd() {\n\t\t\t// 扩展字段混入到表单绑定数据中\n\t\t\t// this.handleExtendParamsMixin()\n\t\t\tthis.visible = true\n\t\t},\n\t\tedit(row) {\n\t\t\tconsole.log(row)\n\t\t\tthis.params = utils.deepClone(row)\n\t\t\tthis.params.companyTypeShow = this.params.companyType ?\n\t\t\t\tthis.params.companyType.split(',') :\n\t\t\t\t['1']\n\t\t\t// 获取扩展字段值\n\t\t\t// await this.getExtendParamsData(1, this.params.id)\n\t\t\t// 扩展字段混入到表单绑定数据中\n\t\t\t// this.handleExtendParamsMixin()\n\t\t\tthis.visible = true\n\t\t\tthis.title = '修改'\n\t\t},\n\t\thandleClose() {\n\t\t\tthis.params = {\n\t\t\t\tcompanyAddress: '',\n\t\t\t\tcompanyCode: '',\n\t\t\t\tcompanyFax: '',\n\t\t\t\tcompanyMail: '',\n\t\t\t\tcompanyMan: '',\n\t\t\t\tcompanyName: '',\n\t\t\t\tcompanyShortName: '',\n\t\t\t\tcompanyTel: '',\n\t\t\t\tcompanyTypeShow: ['1'],\n\t\t\t\tcompanyType: '',\n\t\t\t\tmemo: '',\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\thandleSave() {\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.companyType = tempData.companyTypeShow.length ?\n\t\t\t\t\t\ttempData.companyTypeShow.join(',') :\n\t\t\t\t\t\t''\n\t\t\t\t\tdelete tempData.companyTypeShow\n\t\t\t\t\t// 扩展字段提交前预处理数据\n\t\t\t\t\ttempData = this.handleExtendParamsSave(tempData, '1')\n\t\t\t\t\tlet method\n\t\t\t\t\tif (this.title === '新增') {\n\t\t\t\t\t\tmethod = resourceManage.addUnit\n\t\t\t\t\t\t// console.log('新增')\n\t\t\t\t\t} else if (this.title === '修改') {\n\t\t\t\t\t\tmethod = resourceManage.editUnit\n\t\t\t\t\t\t// console.log('修改')\n\t\t\t\t\t}\n\t\t\t\t\t// console.log(tempData, 'tempData')\n\t\t\t\t\tmethod(tempData, (response) => {\n\t\t\t\t\t\tif (response.state) {\n\t\t\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t\tmessage: this.title + '成功',\n\t\t\t\t\t\t\t\tduration: 2000,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tthis.handleClose()\n\t\t\t\t\t\t\tthis.$parent.loadData(1)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.$message.warning(response.message)\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},\n}\n",null]}