{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Manage\\material\\components\\MaterialClassDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Manage\\material\\components\\MaterialClassDialog.vue","mtime":1690541169611},{"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\r\nimport utils from '@/hotent-ui-util.js'\r\nimport classManage from '@/api/manager/material/materialInfoManage.js'\r\nimport ebsTreeSelect from '@/views/Manage/components/SelectTree.vue'\r\nimport PY from '@/views/Manage/components/PY.js'\r\nexport default {\r\n name: 'ClassFormDialog',\r\n components: {\r\n ebsTreeSelect\r\n },\r\n props: {\r\n showFormDias: {\r\n type: Boolean,\r\n default: false\r\n },\r\n titles: {\r\n type: String,\r\n default: ''\r\n },\r\n treeNode: {\r\n type: Object,\r\n default: null\r\n },\r\n pOptions:{\r\n type:Array,\r\n default:[]\r\n }\r\n },\r\n data() {\r\n return {\r\n params: {\r\n // id: null,\r\n name: '',\r\n code: '',\r\n parentId: '',\r\n memo: ''\r\n },\r\n treeData: [\r\n {\r\n code: '0',\r\n id: '0',\r\n name: '物资分类信息',\r\n parentId: null,\r\n children: []\r\n }\r\n ],\r\n treeSelectProps: {\r\n value: 'id', // ID字段名\r\n label: 'name', // 显示名称\r\n children: 'children' // 子级字段名\r\n },\r\n activeCollapse: '1',\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 },\r\n optionsList:[]\r\n }\r\n },\r\n watch: {\r\n treeNode: function(newVal, oldVal) {\r\n console.log('watch===================', newVal)\r\n this.params = newVal\r\n }\r\n },\r\n created(){\r\n if(this.titles === '修改'){\r\n classManage.getClassByID(this.pOptions[0].id,(res => {\r\n console.log(res);\r\n this.params = res\r\n this.optionsList = [{id:res.parentId,name:res.parentName}]\r\n }))\r\n }else if(this.titles === '新增'){\r\n this.optionsList = this.pOptions\r\n this.params.parentId = this.optionsList[0].id\r\n }\r\n\r\n },\r\n mounted() {\r\n // this.getTree()\r\n },\r\n // destroyed() {\r\n // \tthis.params = {\r\n // \t\t\tid: null,\r\n // \t typeName: '',\r\n // \t code: '',\r\n // \t parentId: null\r\n // \t}\r\n // },\r\n methods: {\r\n getTree() {\r\n classManage.loadAllClass({}, res => {\r\n this.treeData[0].children = res\r\n // this.$set(this.treeData)\r\n if (this.treeNode) {\r\n this.params = this.treeNode\r\n console.log('params====mounted============', this.treeNode)\r\n }\r\n })\r\n },\r\n changeType() {\r\n this.$forceUpdate()\r\n },\r\n handleClose() {\r\n this.params = {\r\n id: null,\r\n name: '',\r\n code: '',\r\n parentId: null\r\n }\r\n this.$refs.formInfo.clearValidate()\r\n this.$emit('closeFormDiaos')\r\n this.$emit('refList')\r\n },\r\n handleSave() {\r\n this.$refs.formInfo.validate(valid => {\r\n if (valid) {\r\n let method\r\n if (!this.params.id) {\r\n method = classManage.addClass\r\n if (this.params.code == null || this.params.code === '') {\r\n this.params.code = PY.getCamelChars(this.params.name)\r\n }\r\n }\r\n if (this.params.id) {\r\n // 修改\r\n method = classManage.editClass\r\n }\r\n // 父分类是物资分类时parentId\r\n if (this.params.parentId === 0) {\r\n this.params.parentId = null\r\n }\r\n console.log(method)\r\n method(this.params, response => {\r\n if (response.state) {\r\n this.$notify({\r\n type: 'success',\r\n message: this.titles + '成功',\r\n duration: 2000\r\n })\r\n this.$emit('closeFormDiaos')\r\n this.$emit('refList')\r\n } else {\r\n this.$message.warning(response.message)\r\n }\r\n })\r\n } else {\r\n return false\r\n }\r\n })\r\n }\r\n }\r\n}\r\n",null]}