{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceManage\\components\\productTypeDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceManage\\components\\productTypeDialog.vue","mtime":1686644136983},{"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\r\nimport utils from '@/hotent-ui-util.js'\r\nimport productType from '@/api/device/productType.js'\r\nexport default {\r\n name: 'FormDialog',\r\n data() {\r\n return {\r\n params: {\r\n code: '',\r\n name: '',\r\n memo: '',\r\n parentId: '',\r\n },\r\n activeCollapse1: '1',\r\n visible: false,\r\n title: '新增',\r\n rules: {\r\n name: [\r\n {\r\n required: true,\r\n message: '请输入产品名称',\r\n trigger: 'blur',\r\n },\r\n ],\r\n code: [\r\n {\r\n required: true,\r\n message: '请输入产品编码',\r\n trigger: 'blur',\r\n },\r\n ],\r\n },\r\n }\r\n },\r\n created() {},\r\n methods: {\r\n // 产品类型新增弹窗\r\n add(row) {\r\n console.log(row)\r\n this.params.parentId = row.id\r\n this.visible = true\r\n },\r\n // 产品类型修改弹窗\r\n edit(row) {\r\n console.log(row)\r\n this.params = utils.deepClone(row)\r\n this.visible = true\r\n this.title = '修改'\r\n },\r\n // 关闭弹窗\r\n handleClose() {\r\n this.params = {\r\n name: '',\r\n code: '',\r\n memo: '',\r\n parentId: '',\r\n }\r\n this.title = '新增'\r\n this.visible = false\r\n this.activeCollapse = '1'\r\n },\r\n // 保存产品类型\r\n handleSave() {\r\n this.$refs.formInfo.validate((valid) => {\r\n if (valid) {\r\n let method\r\n if (this.title === '新增') {\r\n method = productType.addType\r\n }\r\n if (this.title === '修改') {\r\n method = productType.updateType\r\n }\r\n method(this.params, (response) => {\r\n if (response.state) {\r\n this.$notify({\r\n type: 'success',\r\n message: this.title + '成功',\r\n duration: 2000,\r\n })\r\n this.handleClose()\r\n this.$emit('reload')\r\n } else {\r\n this.$message.warning(response.message)\r\n }\r\n })\r\n }else{\r\n this.$notify({\r\n type: 'warning',\r\n message: \"请完善表单信息!\",\r\n duration: 2000,\r\n })\r\n }\r\n })\r\n },\r\n },\r\n}\r\n",null]}