{"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\\BudgetQuery.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\yhxt-web\\src\\views\\budgetManagement\\BudgetQuery.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 _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 \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.regexp.to-string\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 CascaderCompany from '@/components/selector/CascaderCompany.vue';\nexport default {\n components: {\n CascaderCompany: CascaderCompany\n },\n data: function data() {\n return {\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 };\n },\n mounted: function mounted() {\n var _this = this;\n this.$validator = this.$root.$validator;\n this.$nextTick(function () {\n _this.findinfo();\n });\n },\n created: function created() {\n this.yearChange();\n this.company = this.getCompany();\n this.roadData = this.getroad();\n },\n methods: {\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 return arr;\n },\n handleEdit: function handleEdit(data) {\n var _this2 = this;\n this.$router.push({\n name: 'BudgetQueryDetail',\n params: {\n row: data\n }\n });\n return;\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 _this2.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 _this2.YStable.push(item);\n } else if (item.addTo == 1) {\n _this2.YSWtable.push(item);\n }\n });\n console.log(_this2.YStable);\n console.log(_this2.YSWtable);\n var sum = 0;\n _this2.YStable.forEach(function (item) {\n // sum += item.totalPrice\n item.key = index++;\n sum = _this2.accAdd(sum, item.totalPrice).toFixed(2);\n if (item.expenditureType != '') {\n _this2.expendchange(item.expenditureType, item.key);\n }\n if (item.budgetType != '') {\n _this2.flchange(item.budgetType, item.key);\n }\n });\n _this2.YSWtable.forEach(function (item) {\n // sum += item.totalPrice\n item.key = index++;\n sum = _this2.accAdd(sum, item.totalPrice).toFixed(2);\n if (item.expenditureType != '') {\n _this2.expendchange(item.expenditureType, item.key);\n }\n if (item.budgetType != '') {\n _this2.flchange(item.budgetType, item.key);\n }\n });\n _this2.form.budgetSum = sum;\n _this2.$set(_this2.form, 'budgetSum', sum);\n } else {\n _this2.YStable = [];\n _this2.YSWtable = [];\n }\n if (_this2.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 },\n showDialog: function showDialog() {\n var _this3 = 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 _this3.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 _this4 = 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 _this4.YStable.forEach(function (item) {\n console.log(item);\n if (item.key == key) {\n _this4.budgetOp = arr;\n if (!item.budgetType) {\n item.budgetType = _this4.budgetOp[0].value;\n }\n _this4.flchange(item.budgetType, item.key);\n }\n });\n } else {\n _this4.YStable.forEach(function (item) {\n if (item.key == key) {\n _this4.budgetOp = [];\n item.budgetType = '';\n }\n });\n }\n });\n },\n flchange: function flchange(val, key) {\n var _this5 = this;\n var arr = [];\n basicData.getCostAccountManagement(val).then(function (res) {\n console.log(res, val);\n if (res.data.length == 0) {\n _this5.YStable.forEach(function (item) {\n if (item.key == key) {\n _this5.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 _this5.YStable.forEach(function (item) {\n if (item.key == key) {\n _this5.budgetItemOp = arr;\n if (!item.budgetItem) {\n item.budgetItem = _this5.budgetItemOp[0].value;\n }\n }\n });\n }\n });\n },\n Xmchange: function Xmchange(val) {\n var _this6 = this;\n console.log(val);\n // this.$forceUpdate()\n if (val) {\n this.YStable.forEach(function (item) {\n _this6.$set(item, item.budgetItem, val);\n });\n } else {\n this.YStable.forEach(function (item) {\n _this6.$set(item, item.budgetItem, '');\n });\n }\n },\n handleSubmit: function handleSubmit() {\n var _this7 = this;\n // //验证表单是否填写完\n this.$refs.form.validate(function (bool) {\n if (bool) {\n _this7.dialogVisible = false;\n var data = {\n yearBudget: _this7.form,\n yearBudgetDetaileds: _this7.YStable\n };\n //请求保存提交\n _this7.$http.post('${form}/yearBudget/v1/saveYearBudget', data).then(function (res) {\n if (res.status == 200) {\n _this7.$message({\n message: res.data.message,\n type: 'success'\n });\n _this7.$refs.htTable.load();\n }\n _this7.form = {\n status: 0\n }; //清空表单\n _this7.loadData(); //重新获取数据\n });\n }\n });\n\n console.log(this.YStable);\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 _this8 = this;\n // let r = JSON.stringify(param.pageBean)\n // let l = JSON.stringify(this.pageResult)\n // console.log(r, l)\n // if (r == l) {\n // console.log('一样')\n // param\n // } else {\n // console.log('不一样')\n // let query = []\n // let search = {\n // company_id_: this.searchForm.companyId,\n // ascription_year_: this.searchForm.ascriptionYear,\n // start_time_: this.searchForm.startTime,\n // end_time_: this.searchForm.endTime,\n // }\n // for (let i in search) {\n // if (search[i]) {\n // query.push({\n // group: 'advance',\n // operation: 'LIKE',\n // property: i,\n // relation: 'AND',\n // value: search[i],\n // })\n // }\n // }\n // param.querys = query\n // }\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 _this8.data = response.rows;\n // const formatDate = (timestamp) => {\n // return timestamp.replace(/T/g, ' ').replace(/Z/g, '')\n // }\n _this8.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 _this9 = 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 = _this9.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 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 _this10 = 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 _this10.$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 = {\n companyId: ['1419863231459102720']\n };\n this.findinfo();\n },\n findinfo: function findinfo() {\n var _this11 = 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.roadSegmentName\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: 'LIKE',\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);\n _this11.data = res.data.rows;\n _this11.pageResult = {\n page: res.data.page,\n pageSize: res.data.pageSize,\n total: res.data.total\n };\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 _this12 = this;\n this.$http.post('${yhxt}/Company/v1/getCompany').then(function (res) {\n res.data.forEach(function (item) {\n _this12.companyOptions.push({\n id: item.id,\n name: item.name\n });\n });\n });\n // basicData.getCompanyInfo('1258608622670319616').then((res) => {\n // this.deepClone(res[0])\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 } // afterSaveData() {\n // setTimeout(() => {\n // this.beforeCloseDialog()\n // this.$refs.htTable.load()\n // }, 500)\n // },\n }\n};",null]}