{"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\\budgetSumChild.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\yhxt-web\\src\\views\\budgetManagement\\children\\budgetSumChild.vue","mtime":1717611227376},{"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 _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.function.name\";\nimport \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.object.keys\";\nimport _defineProperty from \"D:/jenkins/workspace/yhxt-web/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\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\nimport utils from '@/utils'; // thousandBit格式化千分位\nimport basicData from '@/api/basicData.js';\nimport eipDetailedDialog from '@/components/dialog/EipDetailedDialog.vue';\nimport CascaderCompany from '@/components/selector/CascaderCompany.vue';\nexport default {\n name: 'budgetSumChild',\n components: {\n eipDetailedDialog: eipDetailedDialog,\n CascaderCompany: CascaderCompany\n },\n data: function data() {\n return _defineProperty({\n utils: utils,\n activeName: 'first',\n roadData: [],\n searchForm: {\n ascriptionYear: new Date().getFullYear().toString()\n },\n years: [],\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 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 titles: '添加',\n form: {\n status: 0\n },\n saveMethod: 'POST',\n expendOp: [],\n budgetOp: [],\n budgetItemOp: [],\n isQuestLoad: false,\n totalMoney: {\n imageProgress: 0,\n meteringMoney: 0,\n totalPrice: 0\n }\n }, \"budgetItemOp\", []);\n },\n mounted: function mounted() {\n var _this = this;\n this.$validator = this.$root.$validator;\n if (Object.keys(this.$route.params).length !== 0 && Object.keys(this.$route.params.value).length !== 0) {\n var roadSegmentId = this.$route.params.value.roadSegmentId;\n var path = this.$route.params.path;\n console.log(path.split(','));\n this.searchForm = _objectSpread(_objectSpread({}, this.searchForm), {}, {\n roadSegmentId: roadSegmentId,\n companyId: path.split(',') || ['1419863231459102720']\n });\n this.$nextTick(function () {\n _this.isQuestLoad = false; // 置位false表示不能请求loadData\n _this.findinfo();\n });\n }\n },\n created: function created() {\n this.yearChange();\n this.company = this.getCompany();\n this.roadData = this.getroad();\n this.getExpendOp();\n this.budgetOp = this.getByKeyData('FXCBXZC');\n },\n methods: {\n handleSearchChange: function handleSearchChange(val) {\n this.budgetItemOp = this.getByKeyData(val);\n },\n getName: function getName(source, key) {\n if (!source || source.length == 0) return '';\n var name = '';\n source.forEach(function (item) {\n if (item.value == key) {\n name = item.label;\n }\n });\n return name;\n },\n getExpendOp: function getExpendOp() {\n var _this2 = this;\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 getByKeyData: function getByKeyData(key) {\n var data = [];\n basicData.getCostAccountManagement(key).then(function (res) {\n res.data.forEach(function (item) {\n data.push({\n label: item.subjectName,\n value: item.subjectCode\n });\n });\n });\n return data;\n },\n getroad: function getroad() {\n var arr = [];\n basicData.getRoadManagement().then(function (res) {\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 });\n return arr;\n },\n Editdetails: function Editdetails(row) {\n this.$refs.detaild.open(row);\n },\n handleEdit: function handleEdit(data) {\n var _this3 = 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 _this3.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 _this3.YStable.push(item);\n } else if (item.addTo == 1) {\n _this3.YSWtable.push(item);\n }\n });\n var sum = 0;\n _this3.YStable.forEach(function (item) {\n // sum += item.totalPrice\n item.key = index++;\n sum = _this3.accAdd(sum, item.totalPrice).toFixed(2);\n if (item.expenditureType != '') {\n _this3.expendchange(item.expenditureType, item.key);\n }\n if (item.budgetType != '') {\n _this3.flchange(item.budgetType, item.key);\n }\n });\n _this3.YSWtable.forEach(function (item) {\n // sum += item.totalPrice\n item.key = index++;\n sum = _this3.accAdd(sum, item.totalPrice).toFixed(2);\n if (item.expenditureType != '') {\n _this3.expendchange(item.expenditureType, item.key);\n }\n if (item.budgetType != '') {\n _this3.flchange(item.budgetType, item.key);\n }\n });\n _this3.form.budgetSum = sum;\n _this3.$set(_this3.form, 'budgetSum', sum);\n } else {\n _this3.YStable = [];\n _this3.YSWtable = [];\n }\n if (_this3.expendOp.length == 0) {\n var _data = 'YSGL';\n basicData.getCostAccountManagement(_data).then(function (res) {\n res.data.forEach(function (item) {\n _this3.expendOp.push({\n label: item.subjectName,\n value: item.subjectCode\n });\n });\n });\n }\n });\n },\n showDialog: function showDialog() {\n var _this4 = this;\n this.dialogVisible = true;\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 status: 0,\n startTime: systemTime,\n endTime: sysendTime,\n ascriptionYear: date.year\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 _this4.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 _this5 = 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 _this5.YStable.forEach(function (item) {\n if (item.key == key) {\n _this5.budgetOp = arr;\n if (!item.budgetType) {\n item.budgetType = _this5.budgetOp[0].value;\n }\n _this5.flchange(item.budgetType, item.key);\n }\n });\n } else {\n _this5.YStable.forEach(function (item) {\n if (item.key == key) {\n _this5.budgetOp = [];\n item.budgetType = '';\n }\n });\n }\n });\n },\n flchange: function flchange(val, key) {\n var _this6 = this;\n var arr = [];\n basicData.getCostAccountManagement(val).then(function (res) {\n if (res.data.length == 0) {\n _this6.YStable.forEach(function (item) {\n if (item.key == key) {\n _this6.budgetItemOp = [];\n item.budgetItem = '';\n }\n });\n } else {\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 _this6.YStable.forEach(function (item) {\n if (item.key == key) {\n _this6.budgetItemOp = arr;\n if (!item.budgetItem) {\n item.budgetItem = _this6.budgetItemOp[0].value;\n }\n }\n });\n }\n });\n },\n Xmchange: function Xmchange(val) {\n var _this7 = this;\n if (val) {\n this.YStable.forEach(function (item) {\n _this7.$set(item, item.budgetItem, val);\n });\n } else {\n this.YStable.forEach(function (item) {\n _this7.$set(item, item.budgetItem, '');\n });\n }\n },\n handleSubmit: function handleSubmit() {\n var _this8 = this;\n // //验证表单是否填写完\n this.$refs.form.validate(function (bool) {\n if (bool) {\n _this8.dialogVisible = false;\n var data = {\n yearBudget: _this8.form,\n yearBudgetDetaileds: _this8.YStable\n };\n //请求保存提交\n _this8.$http.post('${form}/yearBudget/v1/saveYearBudget', data).then(function (res) {\n if (res.status == 200) {\n _this8.$message({\n message: res.data.message,\n type: 'success'\n });\n _this8.$refs.htTable.load();\n }\n _this8.form = {\n status: 0\n }; //清空表单\n _this8.loadData(); //重新获取数据\n });\n }\n });\n },\n handleCancel: function handleCancel() {\n this.form = {};\n this.YStable = [];\n this.dialogVisible = false;\n this.titles = '';\n },\n loadData: function loadData(param, cb) {\n var _this9 = this;\n if (param.pageBean.page === 1 && !this.isQuestLoad && Object.keys(this.$route.params).length !== 0 && Object.keys(this.$route.params.value).length !== 0) return cb();\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.getTotalMoney(param.querys);\n this.$http.post('${form}/yearBudgetDetailed/v1/getDetailPage', param).then(function (resp) {\n var response = resp.data;\n var data = response.rows;\n // data.forEach(async (i) => {\n // i.budgetOp = await this.getByKeyData(i.expenditureType)\n // i.budgetItemOp = await this.getByKeyData(i.budgetType)\n // })\n // console.log(data)\n _this9.data = data;\n _this9.isQuestLoad = true;\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 cb();\n }\n });\n },\n calculation: function calculation(row) {\n var _this10 = this;\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 = _this10.accAdd(sum, item.totalPrice).toFixed(2);\n }\n });\n\n //解决实时更新数据\n this.$set(this.form, 'budgetSum', sum);\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 //删除表格数据\n delTableData: function delTableData(key, id) {\n var _this11 = this;\n //判断是否存在key值\n //删除时调用保存接口\n this.YStable = this.YStable.filter(function (item) {\n return item.key !== key;\n });\n //调用接口\n basicData.deleteContractDetailInfo(id).then(function (res) {\n _this11.$message.success('删除成功');\n });\n },\n addTableData: function addTableData() {\n if (this.titles == '修改') {\n this.YStable.push({\n key: this.YStable.length + 1,\n budgetOp: [],\n addTo: 1\n });\n } else {\n this.YStable.push({\n key: this.YStable.length + 1,\n budgetOp: [],\n addTo: 0\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 handleReset: function handleReset() {\n this.searchForm = _objectSpread(_objectSpread({}, this.searchForm), {}, {\n companyId: ['1419863231459102720'],\n companyIds: '',\n startTime: '',\n endTime: '',\n roadSegmentId: '',\n budgetType: ''\n });\n this.findinfo();\n },\n findinfo: function findinfo() {\n var _this12 = 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 budget_type_: this.searchForm.budgetType\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 query = this.uniqueFunc(query, 'property');\n var data = {\n pageBean: {\n page: 1,\n pageSize: 20,\n showTotal: true\n },\n querys: query,\n sorter: [{\n direction: 'DESC',\n property: 'id_'\n }]\n };\n this.topQuery = query;\n this.$http.post('${form}/yearBudgetDetailed/v1/getDetailPage', data).then(function (res) {\n _this12.data = res.data.rows;\n _this12.pageResult = {\n page: res.data.page,\n pageSize: res.data.pageSize,\n total: res.data.total\n };\n });\n this.getTotalMoney(query);\n },\n getTotalMoney: function getTotalMoney(query) {\n var _this13 = this;\n var params = {\n pageBean: {\n page: -1\n },\n querys: query\n };\n this.$http.post('${form}/yearBudgetDetailed/v1/getDetailMoneyCount', params).then(function (res) {\n _this13.totalMoney = res.data || {};\n });\n },\n yearChange: function yearChange() {\n var myDate = new Date();\n var startYear = myDate.getFullYear() - 20; // 起始年份\n var endYear = myDate.getFullYear() + 20; // 结束年份\n\n this.years = [];\n for (var i = startYear; i <= endYear; i++) {\n this.years.push({\n value: i,\n label: i\n });\n }\n },\n getCompany: function getCompany() {\n var _this14 = this;\n this.$http.post('${yhxt}/Company/v1/getCompany').then(function (res) {\n res.data.forEach(function (item) {\n _this14.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 }\n};",null]}