{"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\\children\\BudgetQueryDetail.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\yhxt-web\\src\\views\\budgetManagement\\children\\BudgetQueryDetail.vue","mtime":1719944004367},{"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/es6.regexp.to-string\";\nimport \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/web.dom.iterable\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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';\nexport default {\n name: 'BudgetQueryDetail',\n data: function data() {\n return {\n form: {},\n YStable: [],\n YSWtable: [],\n rules: {\n ascriptionYear: [{\n required: true,\n message: '里程(千米)',\n trigger: 'blur'\n }],\n companyName: [{\n required: true,\n message: '必填',\n trigger: 'blur'\n }],\n budgetSum: [{\n required: true,\n message: '预算总额',\n trigger: 'blur'\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 required: true,\n message: '结束时间',\n trigger: 'blur'\n }]\n },\n activeName: 'first',\n expendOp: [],\n budgetOp: [],\n budgetItemOp: [],\n key: ''\n };\n },\n created: function created() {},\n mounted: function mounted() {\n if (this.$route.params && this.$route.params.row) {\n this.handleInit(this.$route.params.row);\n }\n },\n methods: {\n handleBack: function handleBack() {\n this.$router.push({\n path: '/frontPlat/budgetQuery'\n });\n },\n handleInit: function handleInit(data) {\n var _this = this;\n this.titles = '修改';\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 = 0;\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.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.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 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 expendchange: function expendchange(val, key) {\n var _this2 = 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 _this2.YStable.forEach(function (item, index) {\n console.log(item);\n if (item.key == key) {\n _this2.budgetOp = arr;\n if (!item.budgetType) {\n item.budgetType = _this2.budgetOp[0].value;\n }\n _this2.flchange(item.budgetType, item.key, item, index);\n }\n });\n } else {\n _this2.YStable.forEach(function (item) {\n if (item.key == key) {\n _this2.budgetOp = [];\n item.budgetType = '';\n }\n });\n }\n });\n },\n flchange: function flchange(val, key, row, $index) {\n var _this3 = 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 _this3.YStable.forEach(function (item) {\n if (item.key == key) {\n _this3.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 _this3.YStable.forEach(function (item) {\n if (item.key == key) {\n _this3.budgetItemOp = arr;\n if (!item.budgetItem) {\n item.budgetItem = _this3.budgetItemOp[0].value;\n }\n }\n });\n }\n });\n }\n },\n Xmchange: function Xmchange(val) {\n var _this4 = this;\n console.log(val);\n // this.$forceUpdate()\n if (val) {\n this.YStable.forEach(function (item) {\n _this4.$set(item, item.budgetItem, val);\n });\n } else {\n this.YStable.forEach(function (item) {\n _this4.$set(item, item.budgetItem, '');\n });\n }\n },\n calculation: function calculation(row) {\n var _this5 = 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 var sum = 0;\n this.YStable.forEach(function (item) {\n if (item.totalPrice) {\n sum = _this5.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};",null]}