{"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\\SelectMaterialDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Manage\\material\\components\\SelectMaterialDialog.vue","mtime":1686644136998},{"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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 classManage from '@/api/manager/material/materialInfoManage.js'\r\nimport {TableMixin} from '@/mixins/tableMixin'\r\n\r\nexport default {\r\n name: 'SelectMaterialDialog',\r\n components: {},\r\n mixins: [TableMixin],\r\n props: {\r\n // pageName: String,\r\n purchasingDetailList: {\r\n type: Array,\r\n default: function() {\r\n return []\r\n }\r\n }\r\n },\r\n data() {\r\n return {\r\n titles: '',\r\n tableData: [],\r\n showDia: false,\r\n isEdit: false,\r\n treeData: [\r\n {code: '0', id: 0, name: '物资分类信息', parentId: 0, children: []}\r\n ],\r\n defaultProps: {\r\n value: 'id',\r\n label: 'name',\r\n parentId: 'parentId',\r\n code: 'code',\r\n children: 'children'\r\n },\r\n data: [],\r\n treeNode: {\r\n code: '0',\r\n id: 0,\r\n name: '物资分类信息',\r\n parentId: 0,\r\n children: []\r\n },\r\n updateTreeNode: null,\r\n url: {},\r\n materialSelection: [],\r\n sorter: [\r\n {\r\n direction: 'ASC',\r\n property: 'sn_'\r\n }\r\n ],\r\n querys: [\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 group: 'main',\r\n operation: 'LIKE',\r\n parentGroup: '',\r\n property: 'warehouse_',\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: 'manufacturer_',\r\n relation: 'AND',\r\n value: ''\r\n },\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 'class_Id_',\r\n relation: 'AND',\r\n value: ''\r\n }\r\n ]\r\n }\r\n },\r\n created() {},\r\n mounted() {\r\n this.getTreen()\r\n },\r\n methods: {\r\n // 指定一个key标识这一行的数据\r\n getRowKey(row) {\r\n return row.id\r\n },\r\n selectionEcho() {\r\n this.$nextTick(function() {\r\n this.purchasingDetailList.forEach(key => {\r\n this.tableData.forEach(row => {\r\n console.log(row.id == key)\r\n if (row.id == key.materialInfoId) {\r\n this.$refs.multipleSelection.toggleRowSelection(row, true)\r\n }\r\n if (row.id == key.id) {\r\n this.$refs.multipleSelection.toggleRowSelection(row, true)\r\n }\r\n })\r\n })\r\n })\r\n },\r\n // 树查询\r\n getTreen() {\r\n classManage.loadAllClass({}, res => {\r\n // console.log(res)\r\n this.treeData[0].children = res.value\r\n this.$set(this.treeData)\r\n })\r\n },\r\n reload() {\r\n this.treeData = [\r\n {code: '', id: 0, name: '物资管理', parentId: 0, children: []}\r\n ]\r\n this.$set(this.treeData)\r\n this.getTreen()\r\n this.loadData()\r\n },\r\n // 重置\r\n clearQuerys() {\r\n this.querys[0].value = ''\r\n this.querys[1].value = ''\r\n this.querys[2].value = ''\r\n },\r\n // 分页查询物资信息\r\n loadData(page) {\r\n // console.log(this.pageName)\r\n // let method = 'sdfs'\r\n // if (this.pageName == '领用申请') {\r\n // // 新增\r\n // method = classManage.materialInfoPageQuery\r\n // }\r\n // if (this.pageName == '采购需求申请') {\r\n // // 修改\r\n // method = classManage.materialInfoQuery\r\n // }\r\n if (page) {\r\n this.queryParam.pageBean.page = page\r\n }\r\n this.loading = true\r\n this.tableData = []\r\n this.queryParam.querys = []\r\n // this.queryParam.sorter = this.sorter\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 if (this.querys[2].value) {\r\n this.queryParam.querys.push(this.querys[2])\r\n }\r\n if (this.querys[3].value) {\r\n this.queryParam.querys.push(this.querys[3])\r\n }\r\n classManage.materialInfoPageQuery(this.queryParam).then(res => {\r\n console.log(res)\r\n this.total = res.total\r\n this.tableData = res.rows\r\n this.$set(this.tableData)\r\n this.loading = false\r\n this.selectionEcho()\r\n })\r\n },\r\n handleNodeClick(data) {\r\n // 点击分类树节点\r\n this.treeNode = data\r\n if (data.id == '0') {\r\n this.querys[3].value = this.treeNode.id\r\n this.loadData(1)\r\n } else {\r\n this.querys[3].value = this.treeNode.id\r\n this.loadData(1)\r\n }\r\n },\r\n handleSelectChange(val) {\r\n console.log('val', val)\r\n this.materialSelection = val\r\n },\r\n handleClose() {\r\n this.materialSelection = []\r\n this.$refs.multipleSelection.clearSelection()\r\n // done()\r\n this.showDia = false\r\n },\r\n saveMaterial() {\r\n // 获取选中数据\r\n var materials = []\r\n this.materialSelection.forEach(r => {\r\n console.log(r)\r\n materials.push({\r\n remainingQuantity: r.quantity,\r\n quantity: r.num,\r\n sn: r.sn,\r\n name: r.name,\r\n model: r.model,\r\n memo: r.memo,\r\n id: null,\r\n price: r.price,\r\n amount: r.num * r.price,\r\n warehouseInoutId: null,\r\n // materialInfoId: r.id,\r\n materialInfoId: r.id,\r\n supplier: r.supplier,\r\n unit: r.unit,\r\n description: ''\r\n })\r\n })\r\n console.log(materials)\r\n this.$emit('saveSelectMaterial', materials)\r\n this.$refs.multipleSelection.clearSelection()\r\n\r\n // this.showDia = false\r\n },\r\n editCell() {\r\n this.isEdit = true\r\n },\r\n editCellCancel() {\r\n this.isEdit = false\r\n }\r\n }\r\n}\r\n",null]}