{"remainingRequest":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\jd_cgpt_fvue\\src\\views\\Normal\\BasicDataManagement\\materialManagement\\component\\materialClassification.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\src\\views\\Normal\\BasicDataManagement\\materialManagement\\component\\materialClassification.vue","mtime":1719002418494},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_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//\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 pagination from '@/components/pagination'\r\nimport {TableMixin} from '@/mixins/tableMixin'\r\nimport basicData from '@/api/basicData'\r\nexport default {\r\n name: 'DemandEntry',\r\n components: {\r\n pagination\r\n },\r\n mixins: [TableMixin],\r\n data() {\r\n return {\r\n tableData: [],\r\n tableHeight: 1000,\r\n handleDeleteActive: true,\r\n handleDeleteId: [],\r\n tableLoading: false,\r\n queryParam: {\r\n pageBean: {\r\n page: 1,\r\n pageSize: 20,\r\n total: 0\r\n }\r\n },\r\n querys: [\r\n {\r\n group: 'main',\r\n operation: 'LIKE',\r\n parentGroup: '',\r\n property: 'code',\r\n relation: 'AND',\r\n value: ''\r\n },\r\n {\r\n group: 'main',\r\n operation: 'LIKE',\r\n parentGroup: '',\r\n property: 'name',\r\n relation: 'AND',\r\n value: ''\r\n }\r\n ]\r\n }\r\n },\r\n mounted() {\r\n this.calcTableHeight()\r\n //页面缩放从新计算表格的高度\r\n window.addEventListener('resize', this.calcTableHeight)\r\n },\r\n created() {\r\n this.loadData()\r\n },\r\n beforeDestroy() {\r\n window.removeEventListener('resize', this.calcTableHeight)\r\n },\r\n methods: {\r\n //改变列表状态\r\n switchChange(val, row) {\r\n console.log(row)\r\n let statusValue = {\r\n ids: [row.id],\r\n status: val\r\n }\r\n function recursivefilter(arr) {\r\n for (let item of arr) {\r\n if (item.id) {\r\n statusValue.ids.push(item.id)\r\n }\r\n if (item.children.length > 0) {\r\n recursivefilter(item.children)\r\n }\r\n }\r\n return arr\r\n }\r\n recursivefilter(row.children)\r\n basicData.bizMaterialCategoryUpdateStatus(statusValue).then(res => {\r\n if (res.state) {\r\n this.$message.success(res.message)\r\n this.loadData()\r\n }\r\n })\r\n },\r\n // 动态计算表格的高度,自适应当前容器\r\n calcTableHeight() {\r\n this.tableHeight = this.$refs.tableContent.offsetHeight\r\n },\r\n //导出数据\r\n dataExport() {\r\n this.queryParam.querys = []\r\n if (this.querys[0].value) {\r\n this.queryParam.querys.push(this.querys[0])\r\n }\r\n if (this.querys[1].value) {\r\n this.queryParam.querys.push(this.querys[1])\r\n }\r\n basicData\r\n .bizMaterialCategoryExportExcelData(this.queryParam)\r\n .then(res => {\r\n console.log(res)\r\n })\r\n },\r\n //字典翻译\r\n getDictName(code, value) {\r\n return utils.getDictName(code, value)\r\n },\r\n //获取数据\r\n loadData() {\r\n this.tableLoading = true\r\n this.queryParam.querys = []\r\n if (this.querys[0].value) {\r\n this.queryParam.querys.push(this.querys[0])\r\n }\r\n if (this.querys[1].value) {\r\n this.queryParam.querys.push(this.querys[1])\r\n }\r\n basicData.bizMaterialCategorySelectTree(this.queryParam).then(res => {\r\n this.tableLoading = false\r\n // res.value = res.value.filter(function(item) {\r\n // if (item.hasChildren) {\r\n // return delete item.hasChildren\r\n // }\r\n // })\r\n function recursivefilter(arr) {\r\n for (let item of arr) {\r\n if (item.hasChildren) {\r\n item['edit'] = false\r\n delete item.hasChildren\r\n }\r\n \r\n if (item.children.length > 0) {\r\n item['edit'] = true\r\n recursivefilter(item.children)\r\n }\r\n }\r\n return arr\r\n }\r\n recursivefilter(res.value)\r\n this.tableData = res.value\r\n this.tableData.forEach(item=>{\r\n this.$set(item,'edit',true)\r\n })\r\n console.log(this.tableData,'111111111');\r\n })\r\n // basicData.bizMaterialCategoryQuery(this.queryParam).then(res => {\r\n // this.tableLoading = false\r\n // this.tableData = res.rows\r\n // })\r\n },\r\n //添加\r\n handleAdd() {\r\n this.$router.push('materialeditAddDialog')\r\n },\r\n // 编辑\r\n handleEdit(rows) {\r\n this.$refs.form.clearValidate()\r\n this.$router.push({\r\n name: 'materialeditAddDialog',\r\n query: {editRows: rows, pageBean: this.queryParam}\r\n })\r\n },\r\n // 详情\r\n handleDetail(rows) {\r\n this.$router.push({\r\n name: 'materialDetail',\r\n query: {detailRows: rows, pageBean: this.queryParam}\r\n })\r\n },\r\n //添加下级\r\n LowerBtn(rows) {\r\n this.$router.push({\r\n name: 'materialeditAddDialog',\r\n query: {code: rows, pageBean: this.queryParam}\r\n })\r\n },\r\n // 删除\r\n handleDelete() {\r\n this.$confirm('确定删除选中数据?', '提示', {\r\n confirmButtonText: '确 定',\r\n cancelButtonText: '取 消',\r\n type: 'warning'\r\n })\r\n .then(() => {\r\n basicData\r\n .bizMaterialCategoryDeletCategory(this.handleDeleteId)\r\n .then(res => {\r\n if (res.state) {\r\n this.$notify({\r\n type: 'success',\r\n message: '删除成功',\r\n duration: 2000\r\n })\r\n this.loadData()\r\n }\r\n })\r\n .catch(res => {\r\n this.$notify({\r\n type: 'error',\r\n message: res.message,\r\n duration: 2000,\r\n offset: 80\r\n })\r\n })\r\n })\r\n .catch(() => {})\r\n },\r\n //重置\r\n clearSearchForm() {\r\n this.querys[0].value = ''\r\n this.querys[1].value = ''\r\n this.loadData()\r\n },\r\n // 顶部搜索\r\n handleSearch() {\r\n this.loadData()\r\n },\r\n handleSelectionChange(val) {\r\n if (val.length !== 0) {\r\n this.handleDeleteActive = false\r\n this.handleDeleteId = val.map(item => {\r\n return item.id\r\n })\r\n } else {\r\n this.handleDeleteActive = true\r\n }\r\n },\r\n handleCurrentChange(page) {\r\n this.queryParam.pageBean = {...this.queryParam.pageBean, page}\r\n this.loadData(this.queryParam)\r\n },\r\n handleSizeChange(pageSize) {\r\n this.queryParam.pageBean = {...this.queryParam.pageBean, pageSize}\r\n this.loadData(this.queryParam)\r\n }\r\n },\r\n computed: {\r\n SearchPanel() {\r\n return {\r\n '--searchPanel': this.searchPanel + 'px'\r\n }\r\n }\r\n }\r\n}\r\n",null]}