{"remainingRequest":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\yhxt-web\\src\\views\\basicDataManagement\\children\\EmergencySupplies.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\yhxt-web\\src\\views\\basicDataManagement\\children\\EmergencySupplies.vue","mtime":1706175429053},{"path":"D:\\jenkins\\workspace\\yhxt-web\\babel.config.js","mtime":1667326389982},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/es6.string.iterator\";\nimport \"core-js/modules/es6.map\";\nimport _defineProperty from \"D:/jenkins/workspace/yhxt-web/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 { mapState } from 'vuex';\nvar portal = window.context.portal;\nimport basicData from '@/api/basicData.js';\nimport req from '@/request.js';\nimport CascaderCompany from '@/components/selector/CascaderCompany.vue';\nexport default {\n components: {\n CascaderCompany: CascaderCompany\n },\n data: function data() {\n return {\n searchForm: {},\n roadData: [],\n companyOptions: [],\n data: [],\n pageResult: {\n page: 1,\n pageSize: 20,\n total: 0\n },\n type: '',\n dialogVisible: false,\n loading: false,\n form: {},\n rules: {},\n detailList: [],\n manId: ''\n };\n },\n created: function created() {\n this.roadData = this.getroad();\n this.getCompany();\n },\n computed: mapState({\n deleteUrl: function deleteUrl() {\n return window.context.yhxt + '/bizEmergeMaterialManagement/v1/';\n },\n action: function action() {\n return window.context.yhxt + \"/bizEmergeMaterialManagement/v1/importData?manId=\".concat(this.manId);\n },\n headers: function headers(state) {\n return {\n Authorization: \"Bearer \".concat(state.login.currentUser.token)\n };\n }\n }),\n methods: {\n downLoadTemplete: function downLoadTemplete() {\n var _this = this;\n this.loading = true;\n req.downloadGet(\"\".concat(portal, \"/yhxt/api/file/download?fileType=1\")).then(function (res) {\n _this.loading = false;\n var blob = new Blob([res.data], {\n type: 'application/vnd.ms-excel'\n });\n var link = document.createElement('a'); //定义一个a标签\n link.href = window.URL.createObjectURL(blob); //需要生成一个 URL 来实现下载,链接到blob上\n link.download = '文件'; //下载后的文件名称\n link.click(); //模拟在按钮上实现一次鼠标点击\n window.URL.revokeObjectURL(link.href); //释放 URL 对象\n }).catch(function () {\n _this.loading = false;\n });\n },\n addTableData: function addTableData() {\n this.detailList.push({\n id: this.detailList.length + 1\n });\n },\n delTableData: function delTableData(id) {\n this.detailList = this.detailList.filter(function (item) {\n return item.id !== id;\n });\n },\n handleUploadScucces: function handleUploadScucces(response, file) {\n var _this2 = this;\n this.$http.post('${yhxt}/bizEmergeMaterialManagement/v1/getByManId?id=' + this.manId).then(function (res) {\n _this2.loading = false;\n var data = res.data;\n _this2.detailList = data.materialsManagements;\n });\n },\n handleBeforeUpload: function handleBeforeUpload() {\n this.loading = true;\n },\n getCompany: function getCompany() {\n var _this3 = this;\n this.$http.post('${yhxt}/Company/v1/getCompany').then(function (res) {\n res.data.forEach(function (item) {\n _this3.companyOptions.push({\n id: item.id,\n name: item.name\n });\n });\n });\n },\n handleRoadSegmentChange: function handleRoadSegmentChange(id) {\n var _this4 = this;\n this.roadData.forEach(function (item) {\n if (item.id == id) {\n _this4.form.roadSegmentName = item.name;\n _this4.form.companyName = item.companyName;\n _this4.form.companyId = item.companyId;\n }\n });\n },\n handleCompanyChange: function handleCompanyChange(id) {\n var _this5 = this;\n this.companyOptions.forEach(function (item) {\n if (item.id == id) {\n _this5.form.companyName = item.name;\n }\n });\n },\n handleSubmit: function handleSubmit() {\n var _this6 = this;\n this.$refs.form.validate(function (bool) {\n if (bool) {\n _this6.loading = true;\n _this6.form.materialsManagements = _this6.detailList;\n var params = {\n bizEmergeMaterialManagement: _this6.form,\n detailList: _this6.detailList\n };\n _this6.$http.post('${yhxt}/bizEmergeMaterialManagement/v1/saveVo', params).then(function (res) {\n _this6.loading = false;\n _this6.dialogVisible = false;\n _this6.$refs.htTable.load(); //重新获取数据\n });\n }\n });\n },\n handleClose: function handleClose(done) {\n done();\n this.$refs.htTable.load(); //重新获取数据\n },\n handleCancel: function handleCancel() {\n this.dialogVisible = false;\n this.$refs.htTable.load(); //重新获取数据\n },\n afterDelete: function afterDelete() {\n this.$refs.htTable.load();\n },\n handleAdd: function handleAdd() {\n this.form = {};\n this.dialogVisible = true;\n this.type = 'add';\n this.detailList = [];\n },\n loadData: function loadData(param, cb) {\n var _this7 = this;\n if (typeof this.topQuery !== 'undefined' && this.topQuery.length !== 0) {\n param.querys = typeof param.querys !== 'undefined' ? param.querys : [];\n this.topQuery.forEach(function (item) {\n param.querys.push(item);\n });\n param.querys = this.uniqueFunc(param.querys, 'property');\n }\n this.$http.post('${yhxt}/bizEmergeMaterialManagement/v1/query', param).then(function (res) {\n var response = res.data;\n _this7.data = response.rows;\n _this7.pageResult = {\n page: response.page,\n pageSize: response.pageSize,\n total: response.total\n };\n }).finally(function () {\n if (cb) {\n if (Object.keys(_this7.$route.params).length !== 0 && Object.keys(_this7.$route.params.value).length !== 0 && _this7.$route.params.value.roadSegmentId && !_this7.isFindinfo) {\n _this7.searchForm = {\n roadSegmentId: _this7.$route.params.value.roadSegmentId\n };\n _this7.isFindinfo = true;\n _this7.findinfo();\n }\n cb();\n }\n });\n },\n handleEdit: function handleEdit(data) {\n this.manId = data.id;\n this.dialogVisible = true;\n this.type = 'edit';\n this.form = _objectSpread({}, data);\n this.detailList = data.materialsManagements;\n },\n findinfo: function findinfo() {\n var _this8 = this;\n var query = [];\n var search = {\n company_id_: this.searchForm.companyIds,\n road_segment_id_: this.searchForm.roadSegmentId\n };\n for (var i in search) {\n if (search[i]) {\n if (i == 'company_id_') {\n query.push({\n group: 'companyIds',\n operation: 'IN',\n parentGroup: '',\n property: 'COMPANY_ID_',\n relation: 'AND',\n value: search[i]\n });\n } else {\n query.push({\n group: 'advance',\n operation: 'EQUAL',\n property: i,\n relation: 'AND',\n value: search[i]\n });\n }\n }\n }\n var data = {\n pageBean: {\n page: 1,\n pageSize: 20,\n showTotal: true\n },\n querys: query\n };\n this.topQuery = query;\n this.$http.post('${yhxt}/bizEmergeMaterialManagement/v1/query', data).then(function (res) {\n var response = res.data;\n _this8.data = response.rows;\n _this8.pageResult = {\n page: response.page,\n pageSize: response.pageSize,\n total: response.total\n };\n });\n },\n uniqueFunc: function uniqueFunc(arr, uniId) {\n var res = new Map();\n return arr.filter(function (item) {\n return !res.has(item[uniId]) && res.set(item[uniId], 1);\n });\n },\n getroad: function getroad() {\n var arr = [];\n basicData.getRoadManagement().then(function (res) {\n res.rows.forEach(function (item) {\n arr.push({\n name: item.name,\n id: item.id,\n companyName: item.companyName,\n companyId: item.companyId\n });\n });\n });\n return arr;\n }\n }\n};",null]}