{"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\\budgetManagement\\CostBudget.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\yhxt-web\\src\\views\\budgetManagement\\CostBudget.vue","mtime":1719857604636},{"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 _toConsumableArray from \"D:/jenkins/workspace/yhxt-web/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";\nimport \"core-js/modules/es6.object.keys\";\nimport _typeof from \"D:/jenkins/workspace/yhxt-web/node_modules/@babel/runtime/helpers/esm/typeof.js\";\nimport \"core-js/modules/es6.string.iterator\";\nimport \"core-js/modules/es6.map\";\nimport \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/es6.function.name\";\nimport _defineProperty from \"D:/jenkins/workspace/yhxt-web/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.regexp.to-string\";\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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 basicData from '@/api/basicData.js';\nimport eipOrgSelector from '@/components/eipControl/selector/EipOrgSelector.vue';\nimport eipDetailedDialog from '@/components/dialog/EipDetailedDialog.vue';\nimport companyInfoSelector from '@/components/selector/companyInfoSelector.vue';\nimport CascaderCompany from '@/components/selector/CascaderCompany.vue';\nimport { Facet } from '@antv/g2';\nexport default {\n components: {\n // eipOrgSelector,\n eipDetailedDialog: eipDetailedDialog,\n // companyInfoSelector,\n CascaderCompany: CascaderCompany\n },\n data: function data() {\n return {\n roadData: [],\n activeName: 'first',\n company: [],\n searchForm: {\n ascriptionYear: new Date().getFullYear().toString()\n },\n companyOptions: [],\n key: '',\n options: [{\n label: '是',\n value: 1\n }, {\n label: '否',\n value: 0\n }],\n querySearch: [{\n label: '公司名称',\n prop: 'company_name_'\n }, {\n label: '预算单状态',\n prop: 'STATUS_'\n }],\n permission: 'b',\n YStable: [],\n YSWtable: [],\n dialogVisible: false,\n data: [],\n pageResult: {\n page: 1,\n pageSize: 20,\n total: 0\n },\n rules: {\n ascriptionYear: [{\n required: true,\n message: '请选择年限',\n trigger: 'blur'\n }],\n roadSegmentName: [{\n required: true,\n message: '请选择路段名称',\n trigger: 'blur'\n }],\n // budgetSum: [\n // {\n // required: true,\n // message: '预算总额',\n // trigger: 'blur',\n // },\n // ],\n status: [{\n required: true,\n message: '预算单状态',\n trigger: 'blur'\n }],\n startTime: [{\n required: true,\n message: '开始时间',\n trigger: 'blur'\n }],\n endTime: [{\n required: true,\n message: '结束时间',\n trigger: 'blur'\n }]\n // alreadyCount: [\n // {\n // required: true,\n // message: '已用总额',\n // trigger: 'blur',\n // },\n // ],\n },\n\n titles: '添加',\n form: {\n companyName: ' ',\n budgetSum: '',\n roadSegmentName: '',\n alreadyMeteringCount: ''\n },\n saveMethod: 'POST',\n expendOp: [],\n budgetOp: [],\n budgetItemOp: [],\n loading: false,\n total: {}\n };\n },\n mounted: function mounted() {\n this.$validator = this.$root.$validator;\n // this.$nextTick(() => {\n // this.findinfo()\n // })\n },\n created: function created() {\n this.company = this.getCompany();\n this.roadData = this.getroad();\n },\n methods: {\n handleClick: function handleClick(tab, event) {\n console.log(tab, event);\n },\n Editdetails: function Editdetails(row) {\n this.$refs.detaild.open(row);\n },\n handleEdit: function handleEdit(data) {\n var _this = this;\n this.titles = '修改';\n // this.form = {...data}\n this.dialogVisible = true;\n // this.form = data\n this.$http.get('${form}/yearBudget/v1/get/' + data.id).then(function (res) {\n console.log(res);\n _this.form = res.data.yearBudget;\n if (res.data.yearBudgetDetaileds) {\n var index = 1;\n res.data.yearBudgetDetaileds.forEach(function (item) {\n if (item.addTo == 0) {\n _this.YStable.push(item);\n } else if (item.addTo == 1) {\n _this.YSWtable.push(item);\n }\n });\n console.log(_this.YStable);\n console.log(_this.YSWtable);\n var sum = 0;\n _this.YStable.map(function (item, index) {\n item['key'] = index++;\n return item;\n });\n _this.YStable.forEach(function (item, index) {\n // sum += item.totalPrice\n item.key = index++;\n sum = _this.accAdd(sum, item.totalPrice).toFixed(2);\n if (item.expenditureType != '') {\n _this.expendchange(item.expenditureType, item.key);\n }\n if (item.budgetType != '') {\n _this.flchange(item.budgetType, item.key, item, index);\n }\n });\n console.log(_this.YStable, '555');\n _this.YSWtable.forEach(function (item, index) {\n // sum += item.totalPrice\n item.key = index++;\n sum = _this.accAdd(sum, item.totalPrice).toFixed(2);\n if (item.expenditureType != '') {\n _this.expendchange(item.expenditureType, item.key);\n }\n if (item.budgetType != '') {\n _this.flchange(item.budgetType, item.key, item, index);\n }\n });\n _this.form.budgetSum = sum;\n _this.$set(_this.form, 'budgetSum', sum);\n } else {\n _this.YStable = [];\n _this.YSWtable = [];\n }\n if (_this.expendOp.length == 0) {\n var _data = 'YSGL';\n basicData.getCostAccountManagement(_data).then(function (res) {\n res.data.forEach(function (item) {\n _this.expendOp.push({\n label: item.subjectName,\n value: item.subjectCode\n });\n });\n });\n }\n });\n },\n showDialog: function showDialog() {\n var _this2 = this;\n this.form.roadSegmentName = this.roadData[0].key;\n this.dialogVisible = true;\n this.titles = '添加';\n var nowDate = new Date();\n var date = {\n year: nowDate.getFullYear(),\n month: nowDate.getMonth() + 1,\n date: nowDate.getDate()\n };\n var systemTime = date.year + '-' + 1 + '-' + 1;\n var sysendTime = date.year + '-' + 12 + '-' + 31;\n this.form = {\n startTime: systemTime,\n endTime: sysendTime,\n ascriptionYear: date.year,\n companyName: ' '\n };\n if (this.expendOp.length == 0) {\n var data = 'YSGL';\n basicData.getCostAccountManagement(data).then(function (res) {\n res.data.forEach(function (item) {\n _this2.expendOp.push({\n label: item.subjectName,\n value: item.subjectCode\n });\n });\n });\n }\n },\n dialogopen: function dialogopen() {},\n expendchange: function expendchange(val, key) {\n var _this3 = this;\n this.budgetOp = [];\n var data = val;\n var arr = [];\n basicData.getCostAccountManagement(data).then(function (res) {\n if (res.data.length > 0) {\n res.data.forEach(function (item) {\n if (item.pcode == val) {\n arr.push({\n label: item.subjectName,\n value: item.subjectCode\n });\n }\n });\n _this3.YStable.forEach(function (item, index) {\n // console.log(item)\n if (item.key == key) {\n _this3.budgetOp = arr;\n if (!item.budgetType) {\n item.budgetType = _this3.budgetOp[0].value;\n }\n _this3.flchange(item.budgetType, item.key, item, index);\n }\n });\n _this3.YSWtable.forEach(function (item, index) {\n console.log(item);\n if (item.key == key) {\n _this3.budgetOp = arr;\n if (!item.budgetType) {\n item.budgetType = _this3.budgetOp[0].value;\n }\n _this3.flchange(item.budgetType, item.key, item, index);\n }\n });\n } else {\n _this3.YStable.forEach(function (item) {\n if (item.key == key) {\n _this3.budgetOp = [];\n item.budgetType = '';\n }\n });\n _this3.YSWtable.forEach(function (item) {\n if (item.key == key) {\n _this3.budgetOp = [];\n item.budgetType = '';\n }\n });\n }\n });\n },\n flchange: function flchange(val, key, row, $index) {\n var _this4 = this;\n console.log(val, 'val', key, row, $index);\n var keyVal = 'YHKM';\n if (this.budgetItemOp.length) {\n row.budgetType = val;\n row.budgetItem = this.budgetItemOp[0].value;\n this.YStable.splice($index, 1, row);\n this.YSWtable.splice($index, 1, row);\n } else {\n var arr = [];\n basicData.getCostAccountManagement(keyVal).then(function (res) {\n // console.log(res, val)\n if (res.data.length == 0) {\n _this4.YStable.forEach(function (item) {\n if (item.key == key) {\n _this4.budgetItemOp = [];\n item.budgetItem = '';\n }\n });\n _this4.YSWtable.forEach(function (item) {\n if (item.key == key) {\n _this4.budgetItemOp = [];\n item.budgetItem = '';\n }\n });\n } else {\n res.data.forEach(function (item) {\n if (item.pcode == keyVal) {\n arr.push({\n label: item.subjectName,\n value: item.subjectCode\n });\n }\n });\n _this4.YStable.forEach(function (item) {\n if (item.key == key) {\n _this4.budgetItemOp = arr;\n if (!item.budgetItem) {\n item.budgetItem = _this4.budgetItemOp[0].value;\n }\n }\n });\n _this4.YSWtable.forEach(function (item) {\n if (item.key == key) {\n _this4.budgetItemOp = arr;\n if (!item.budgetItem) {\n item.budgetItem = _this4.budgetItemOp[0].value;\n }\n }\n });\n }\n });\n }\n },\n isDisabled: function isDisabled(row) {},\n Xmchange: function Xmchange(val) {\n var _this5 = this;\n console.log(val);\n // this.$forceUpdate()\n if (val) {\n this.YStable.forEach(function (item) {\n _this5.$set(item, item.budgetItem, val);\n });\n this.YSWtable.forEach(function (item) {\n _this5.$set(item, item.budgetItem, val);\n });\n } else {\n this.YStable.forEach(function (item) {\n _this5.$set(item, item.budgetItem, '');\n });\n this.YSWtable.forEach(function (item) {\n _this5.$set(item, item.budgetItem, '');\n });\n }\n },\n handleSubmit: function handleSubmit(d) {\n var _this6 = this;\n // //验证表单是否填写完\n this.$refs.form.validate(function (bool) {\n if (bool) {\n var arr = [];\n _this6.YStable = _this6.YStable.map(function (item) {\n delete item.budgetOp;\n console.log(item.key, '66666');\n return _objectSpread(_objectSpread({}, item), {}, {\n sort: item.key\n });\n });\n var data = {\n yearBudget: _this6.form,\n yearBudgetDetaileds: arr = _this6.YStable.concat(_this6.YSWtable)\n };\n //请求保存提交\n // console.log(data, 'form')\n // return\n _this6.loading = true;\n _this6.$http.post('${form}/yearBudget/v1/saveYearBudget', data).then(function (res) {\n _this6.loading = false;\n if (res.status == 200) {\n _this6.$message({\n message: res.data.message,\n type: 'success'\n });\n if (d != 1) {\n console.log('没进删除');\n _this6.dialogVisible = false;\n _this6.YStable = [];\n _this6.YSWtable = [];\n } else {\n console.log('进删除');\n }\n _this6.$refs.htTable.load();\n }\n });\n }\n });\n },\n handleCancel: function handleCancel() {\n this.form = {\n companyName: ''\n };\n this.YStable = [];\n this.YSWtable = [];\n this.dialogVisible = false;\n this.titles = '';\n },\n //公司赋值\n handleChanged: function handleChanged(obj) {\n // console.log(obj.valueInfo.join(','))\n this.form.companyIds = JSON.stringify(obj.valueInfo);\n this.form.companyName = obj.name;\n this.form.companyId = obj.id;\n },\n companyValue: function companyValue(obj) {\n // console.log(obj)\n this.form.companyName = obj.name;\n this.form.companyId = obj.id;\n this.form.companyIds = JSON.stringify(obj.id.split(' ')); //必须是空格\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 handleReset: function handleReset() {\n this.searchForm = {\n companyId: ['1419863231459102720']\n };\n this.findinfo();\n },\n findinfo: function findinfo(param, cb) {\n var _this7 = this;\n typeof this.$refs.filterTable !== 'undefined' && this.$refs.filterTable.clearFilter();\n var query = [];\n var search = {\n company_id_: this.searchForm.companyIds,\n ascription_year_: this.searchForm.ascriptionYear,\n start_time_: this.searchForm.startTime,\n end_time_: this.searchForm.endTime,\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 if (i == 'ascription_year_') {\n query.push({\n group: 'advance',\n operation: 'EQUAL',\n property: i,\n relation: 'AND',\n value: search[i]\n });\n }\n }\n }\n query = this.uniqueFunc(query, 'property');\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('${form}/yearBudget/v1/getJson', data).then(function (res) {\n console.log(res, '11');\n _this7.data = res.data.rows;\n _this7.pageResult = {\n page: res.data.page,\n pageSize: res.data.pageSize,\n total: res.data.total\n };\n }).finally(function () {\n if (cb) {\n cb();\n }\n });\n this.$http.post('${form}/yearBudget/v1/getMoneyCount', data).then(function (res) {\n if (res && res.data && res.data.value) {\n var _data2 = res.data.value || {};\n _this7.total = {\n budgetSum: _data2.totalBudget || 0,\n alreadyCount: _data2.contractSum || 0,\n alreadyMeteringCount: _data2.totalMeasurement || 0\n };\n }\n });\n },\n getroad: function getroad() {\n var arr = [];\n basicData.getRoadManagement().then(function (res) {\n // console.log(res, 'dddddddddd')\n res.rows.forEach(function (item) {\n arr.push({\n value: item.name,\n key: item.id,\n companyId: item.companyId,\n companyName: item.companyName\n });\n });\n // console.log(arr, '12')\n });\n\n return arr;\n },\n handleRoadNameChange: function handleRoadNameChange(data) {\n this.form.roadSegmentName = data.label;\n this.form.roadSegmentId = data.value;\n this.form.companyId = data.companyId;\n this.form.companyName = data.companyName;\n },\n getCompany: function getCompany() {\n var _this8 = this;\n this.$http.post('${yhxt}/Company/v1/getCompany').then(function (res) {\n res.data.forEach(function (item) {\n _this8.companyOptions.push({\n id: item.id,\n name: item.name\n });\n });\n });\n },\n //深层拷贝回去公司名称\n deepClone: function deepClone(obj) {\n var objClone = Array.isArray(obj) ? [] : {};\n if (obj && _typeof(obj) === 'object') {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n //判断ojb子元素是否为对象,如果是,递归复制\n if (obj[key] && _typeof(obj[key]) === 'object') {\n objClone[key] = this.deepClone(obj[key]);\n } else {\n if (obj[key] == obj.name) {\n this.companyOptions.push({\n id: obj.id,\n name: obj.name\n });\n } //如果不是,简单复制\n objClone[key] = obj[key];\n }\n }\n }\n }\n },\n loadData: function loadData(param, cb) {\n var _this9 = 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('${form}/yearBudget/v1/getJson', param).then(function (resp) {\n var response = resp.data;\n _this9.data = response.rows;\n // const formatDate = (timestamp) => {\n // return timestamp.replace(/T/g, ' ').replace(/Z/g, '')\n // }\n _this9.pageResult = {\n page: response.page,\n pageSize: response.pageSize,\n total: response.total\n };\n }, function (error) {\n reject(error);\n }).finally(function () {\n if (cb) {\n if (Object.keys(_this9.$route.params).length !== 0 && Object.keys(_this9.$route.params.value).length !== 0 && _this9.$route.params.value.roadSegmentId && !_this9.isFindinfo) {\n _this9.searchForm = {\n roadSegmentId: _this9.$route.params.value.roadSegmentId,\n ascriptionYear: _this9.$route.params.value.ascriptionYear.toString()\n };\n _this9.isFindinfo = true;\n _this9.findinfo();\n }\n cb();\n }\n });\n },\n calculation: function calculation(row) {\n var _this10 = this;\n // console.log(row)\n // this.YStable[row.key].totalPrice=row.quantities*row.unitPrice\n this.YStable.forEach(function (item) {\n if (item.quantities != null && item.unitPrice != null) {\n item.totalPrice = item.quantities * item.unitPrice;\n }\n });\n this.YSWtable.forEach(function (item) {\n if (item.quantities != null && item.unitPrice != null) {\n item.totalPrice = item.quantities * item.unitPrice;\n }\n });\n var sum = 0;\n this.YStable.forEach(function (item) {\n if (item.totalPrice) {\n sum = _this10.accAdd(sum, item.totalPrice).toFixed(2);\n }\n });\n this.YSWtable.forEach(function (item) {\n if (item.totalPrice) {\n sum = _this10.accAdd(sum, item.totalPrice).toFixed(2);\n }\n });\n console.log(sum);\n // this.form.budgetSum = sum\n //解决实时更新数据\n this.$set(this.form, 'budgetSum', sum);\n },\n // 添加表格数据\n AddTableData: function AddTableData(key, id) {\n if (this.activeName == 'first') {\n var _this$YStable;\n var obj = {\n key: key + 1,\n budgetOp: [],\n addTo: 0\n };\n var data = [];\n if (key !== this.YStable.length) {\n data = this.YStable.splice(key);\n data.forEach(function (item) {\n item.key = item.key + 1;\n });\n }\n (_this$YStable = this.YStable).push.apply(_this$YStable, [obj].concat(_toConsumableArray(data)));\n } else {\n var _this$YSWtable;\n var _obj = {\n key: key + 1,\n budgetOp: [],\n addTo: 0\n };\n var _data3 = [];\n if (key !== this.YSWtable.length) {\n _data3 = this.YSWtable.splice(key);\n _data3.forEach(function (item) {\n item.key = item.key + 1;\n });\n }\n (_this$YSWtable = this.YSWtable).push.apply(_this$YSWtable, [_obj].concat(_toConsumableArray(_data3)));\n }\n },\n addWtable: function addWtable() {},\n //删除表格数据\n delTableData: function delTableData(key, id) {\n var _this11 = this;\n //判断是否存在key值\n //删除时调用保存接口\n if (this.activeName == 'first') {\n this.YStable = this.YStable.filter(function (item) {\n return item.key !== key;\n });\n } else {\n this.YSWtable = this.YSWtable.filter(function (item) {\n return item.key !== key;\n });\n }\n if (this.titles == '修改') {\n this.$http.remove('${form}/yearBudgetDetailed/v1/updateYearBudgetDetailed?ids=' + id).then(function (res) {\n _this11.$message.success('删除成功');\n var sum = 0;\n var sums = 0;\n _this11.YStable.forEach(function (item) {\n if (item.totalPrice) {\n // sum += item.totalPrice\n sum = _this11.accAdd(sum, item.totalPrice).toFixed(2);\n }\n });\n _this11.YSWtable.forEach(function (item) {\n if (item.totalPrice) {\n // sum += item.totalPrice\n sums = _this11.accAdd(sums, item.totalPrice).toFixed(2);\n }\n });\n sum = _this11.accAdd(sum, sums).toFixed(2);\n console.log(sum);\n _this11.$set(_this11.form, 'budgetSum', sum);\n _this11.handleSubmit(1);\n });\n }\n //调用接口\n },\n accAdd: function accAdd(arg1, arg2) {\n var r1, r2, m;\n try {\n r1 = arg1.toString().split('.')[1].length;\n } catch (e) {\n r1 = 0;\n }\n try {\n r2 = arg2.toString().split('.')[1].length;\n } catch (e) {\n r2 = 0;\n }\n m = Math.pow(10, Math.max(r1, r2));\n return (arg1 * m + arg2 * m) / m;\n },\n addTableData: function addTableData() {\n if (this.activeName == 'first') {\n this.YStable.push({\n key: this.YStable.length + 1,\n budgetOp: [],\n addTo: 0\n });\n } else {\n this.YSWtable.push({\n key: this.YSWtable.length + 1,\n budgetOp: [],\n addTo: 1\n });\n }\n } // afterSaveData() {\n // setTimeout(() => {\n // this.beforeCloseDialog()\n // this.$refs.htTable.load()\n // }, 500)\n // },\n }\n};",null]}