{"remainingRequest":"D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xypm-web-prod\\src\\views\\ProcessManagement\\ScheduleManagement\\MonthlyEngineeringReport.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\src\\views\\ProcessManagement\\ScheduleManagement\\MonthlyEngineeringReport.vue","mtime":1687291764412},{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\babel.config.js","mtime":1667333346259},{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web-prod\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.array.find\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 ProjectInfoDialog from '@/components/dialog/ProjectInfoDialog.vue';\nimport req from '@/request.js';\nimport utils from '@/utils.js';\nexport default {\n name: 'MonthlyEngineeringReport',\n components: {\n ProjectInfoDialog: ProjectInfoDialog\n },\n props: {\n pid: {\n type: String,\n default: ''\n },\n isShow: {\n type: Boolean,\n default: true\n }\n },\n data: function data() {\n return {\n importData: {\n title: '工程月报导入',\n templateName: '工程月报模板.xls',\n downloadUrl: '/../fvue/static/excel/MonthlyEngineeringReport.xlsx',\n importUrl: window.context.cqxy + '/biz/processManagement/progressManageReport/v1/importExcelData',\n showProject: true,\n projectId: '' // params: {\n // portDate: '',\n // portType: '',\n // portUnit: '',\n // // portUserId: '',\n // portUserName: '',\n // },\n\n },\n loading: false,\n projectObj: [],\n //获取的所有项目数组\n labelPosition: 'right',\n //表单对齐方式\n searchForm: {\n projectId: '',\n portDate: '',\n portType: '',\n portUserName: ''\n },\n //顶部搜索参数\n data: [],\n //表格数据\n pageResult: {\n page: 1,\n pageSize: 20,\n total: 0\n },\n form: {\n portUserId: '',\n portUserName: '',\n imageProgress: 0,\n investmentRatio: '0.75',\n engineeringChange: 0,\n projectOvervie: 0,\n projectInfo: {\n projectName: '',\n projectCode: ''\n },\n accessoryInfo: []\n },\n projectMoney: '',\n totalMoney: '',\n dialogVisible: false,\n dialogTitle: '添加',\n //表单验证\n rules: {\n 'projectInfo.projectName': {\n required: true,\n message: '项目名称不能为空',\n trigger: 'blur'\n } // 'projectInfo.projectCode': {\n // required: true,\n // message: '项目代码不能为空',\n // trigger: 'blur',\n // },\n // portDate: {\n // required: true,\n // message: '填报日期不能为空',\n // trigger: 'blur',\n // },\n // portType: {\n // required: true,\n // message: '填报类型不能为空',\n // trigger: 'blur',\n // },\n // portUnit: {\n // required: true,\n // message: '填报方不能为空',\n // trigger: 'blur',\n // },\n // portUserName: {\n // required: true,\n // message: '经办人不能为空',\n // trigger: 'blur',\n // },\n\n }\n };\n },\n computed: {\n deleteUrl: function deleteUrl() {\n return window.context.cqxy + '/biz/processManagement/progressManageReport/v1/delete';\n } //计算工程进度的值\n // \"form.imageProgress\": {\n // get:function() {\n // let num =\n // Math.round(\n // (this.form.progressDescription / this.projectMoney) * 100\n // ) / 100\n // return Number.isNaN(num) ? 0 : num == 'Infinity' ? 100 : num\n // },\n // set: function(newValue) {\n // this.form.imageProgress = newValue + '%'\n // }\n // },\n //计算累计总投资的值\n // 'form.projectOvervie': {\n // get: () => {\n // let num =\n // Number(this.form.progressDescription) + Number(this.totalMoney)\n // return Number.isNaN(num) ? 0 : num !== 'undefined' ? num : 0\n // },\n // set: newValue => {\n // this.form.projectOvervie = newValue\n // }\n // },\n // //计算本月产值的值\n // 'form.engineeringChange': {\n // get: () => {\n // let num = Math.round((this.form.progressDescription / 75) * 100) / 100\n // return Number.isNaN(num) ? 0 : num\n // },\n // set: newValue => {\n // this.form.engineeringChange = newValue + '%'\n // }\n // }\n\n },\n watch: {\n // 'form.progressDescription': function(newValue, oldValue) {\n // newValue = newValue ? newValue : 0\n // let num1 = FormMath.toNumber(newValue)\n // let num2 = FormMath.toNumber(this.projectMoney) * 10000\n // num2 = num2 == 0 ? 1 : num2 //解决可能出现的inifity,例2/0 = inifity\n // let num3 = FormMath.toNumber(this.totalMoney)\n // this.form.imageProgress = FormMath.tofixed((num1 / num2) * 100, 2)\n // let ary = [num1, num3]\n // this.form.projectOvervie = FormMath.tofixed(FormMath.sum(ary), 2)\n // this.form.engineeringChange = FormMath.tofixed(num1 / 0.75, 2)\n // },\n projectMoney: function projectMoney(newValue, oldValue) {\n newValue = newValue == 0 ? 1 : newValue;\n var num1 = FormMath.toNumber(this.form.progressDescription);\n num1 = num1 ? num1 : 0;\n var num2 = FormMath.toNumber(newValue) * 10000;\n var num3 = FormMath.toNumber(this.totalMoney);\n this.form.imageProgress = FormMath.tofixed(num1 / num2 * 100, 2); // let ary = [num1, num3]\n // this.form.projectOvervie = FormMath.tofixed(FormMath.sum(ary), 2)\n\n this.form.projectOvervie = num3; // this.form.engineeringChange = FormMath.tofixed(num1 / 0.75, 2)\n\n var num4 = this.form.investmentRatio;\n this.form.engineeringChange = FormMath.tofixed(num1 / num4, 2);\n },\n totalMoney: function totalMoney(newValue, oldValue) {\n var num1 = FormMath.toNumber(this.form.progressDescription);\n num1 = num1 ? num1 : 0;\n var num2 = FormMath.toNumber(this.projectMoney) * 10000;\n num2 = num2 == 0 ? 1 : num2;\n var num3 = FormMath.toNumber(newValue);\n this.form.imageProgress = FormMath.tofixed(num1 / num2 * 100, 2); // let ary = [num1, num3]\n // this.form.projectOvervie = FormMath.tofixed(FormMath.sum(ary), 2)\n\n this.form.projectOvervie = num3;\n var num4 = this.form.investmentRatio;\n this.form.engineeringChange = FormMath.tofixed(num1 / num4, 2);\n }\n },\n mounted: function mounted() {\n this.initProjectAll();\n },\n methods: {\n //获取投资总和\n gettotalMoney: function gettotalMoney(projectId) {\n var _this = this;\n\n var params = {\n projectId: projectId,\n // registerDate: this.getDate(),\n registerDate: this.form.portDate\n };\n this.$http.post('${cqxy}/biz/processManagement/progressManageReport/v1/getInvestmentTotal', params).then(function (res) {\n _this.totalMoney = res.data.value;\n });\n },\n //重置\n handleReset: function handleReset() {\n var _this2 = this;\n\n this.searchForm.projectId = '';\n this.searchForm.portDate = '';\n this.searchForm.portType = '';\n this.searchForm.portUserName = '';\n this.$refs['searchForm'].resetFields();\n this.pageResult = {\n page: 1,\n pageSize: 20,\n total: 0\n };\n this.$refs['searchForm'].resetFields();\n this.$nextTick(function () {\n _this2.$refs.AtTable.load();\n });\n },\n handleSelectProject: function handleSelectProject(data) {\n this.form.portUserName = data.projectManager;\n this.form.projectInfo.projectName = data.projectName;\n this.form.projectInfo.projectCode = data.projectCode;\n this.form.projectId = data.id;\n this.gettotalMoney(this.form.projectId);\n this.projectMoney = data.projectMoney;\n this.$refs.ruleForm.clearValidate();\n },\n //打开选择项目弹框\n handleFocusProject: function handleFocusProject() {\n this.$refs.project.open();\n },\n //导入后重新加载数据\n load: function load() {\n this.$refs.AtTable.load();\n },\n //导出\n handleExport: function handleExport() {\n var _this3 = this;\n\n var query = [];\n var search = {\n 'pm.ID_': this.searchForm.projectId,\n port_type_: this.searchForm.portType,\n port_date_: this.searchForm.portDate\n };\n\n if (!this.isShow) {\n search['pm.ID_'] = this.pid;\n }\n\n for (var 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\n var param = {\n pageBean: {\n page: 1,\n pageSize: -1,\n showTotal: true\n },\n querys: query,\n sorter: []\n };\n req.downloadPostCopy('${cqxy}/biz/processManagement/progressManageReport/v1/exportDataToExcel', param).then(function (res) {\n if (res.status == 200) {\n _this3.$message.success('导出成功');\n } else {\n _this3.$message.error('导出失败');\n }\n });\n },\n //获取附件信息\n accessoryInfo: function accessoryInfo(info) {\n this.form.accessoryInfo = info;\n },\n initProjectAll: function initProjectAll() {\n var _this4 = this;\n\n //初始获取所有项目数据\n if (this.isShow) {\n this.$http.post('${cqxy}/biz/projectManagement/pm/v1/All').then(function (res) {\n _this4.projectObj = res.data.value;\n }, function (error) {\n reject(error);\n });\n } else {\n var params = {\n pageBean: {\n page: 1,\n pageSize: 500,\n total: 0\n },\n querys: [{\n group: 'main',\n operation: 'EQUAL',\n property: 'id',\n relation: 'AND',\n value: this.pid\n }]\n };\n this.$http.post('${cqxy}/biz/projectManagement/pm/v1/page', params).then(function (res) {\n if (res.data.state) {\n var resp = res.data.value;\n _this4.projectObj = resp.rows;\n }\n });\n }\n },\n //查询\n handleSearch: function handleSearch() {\n this.$refs.AtTable.load();\n },\n afterSaveData: function afterSaveData() {\n var _this5 = this;\n\n setTimeout(function () {\n _this5.form = {\n projectId: '',\n portDate: '',\n portType: '',\n // portUserId: '',\n portUserName: '',\n projectInfo: {\n projectName: '',\n projectCode: ''\n },\n accessoryInfo: []\n };\n _this5.dialogVisible = false;\n\n _this5.$refs.AtTable.load();\n }, 500);\n },\n handleAdd: function handleAdd() {\n this.isEdit = false;\n this.dialogTitle = '添加';\n this.dialogVisible = true;\n var date = new Date(); // let currentUser = JSON.parse(window.sessionStorage.currentUser)\n\n this.form = {\n projectId: '',\n portDate: utils.formatDateYear(date),\n portType: 2,\n // portUserId: currentUser.userId,\n // portUserName: currentUser.username,\n portUserName: '',\n imageProgress: 0,\n investmentRatio: '0.75',\n engineeringChange: 0,\n projectOvervie: 0,\n projectInfo: {\n projectName: '',\n projectCode: ''\n },\n accessoryInfo: []\n };\n\n if (this.isShow) {\n var selectedProject = this.projectObj.find(function (item) {\n if (item.currentProject && item.currentProject == 1) {\n return item.currentProject == 1;\n }\n });\n this.form.portUserName = selectedProject.portUserName;\n this.form.projectInfo.projectName = selectedProject.projectName;\n this.form.projectInfo.projectCode = selectedProject.projectCode;\n this.form.projectId = selectedProject.id;\n this.form.portUserName = selectedProject.projectManager;\n this.projectMoney = selectedProject.projectMoney;\n this.gettotalMoney(this.form.projectId);\n } else {\n //根据项目id查询\n this.form.portUserName = this.projectObj[0].portUserName;\n this.form.projectInfo.projectName = this.projectObj[0].projectName;\n this.form.projectInfo.projectCode = this.projectObj[0].projectCode;\n this.form.projectId = this.projectObj[0].id;\n this.form.portUserName = this.projectObj[0].projectManager;\n this.projectMoney = this.projectObj[0].projectMoney;\n this.gettotalMoney(this.form.projectId);\n }\n },\n handleRowDBClick: function handleRowDBClick(data) {\n var _this6 = this;\n\n this.isEdit = true;\n\n if (this.isShow) {\n var selectedProject = this.projectObj.find(function (item) {\n if (item.currentProject && item.currentProject == 1) {\n return item.currentProject == 1;\n }\n });\n this.form.portUserName = selectedProject.portUserName;\n this.form.projectInfo.projectName = selectedProject.projectName;\n this.form.projectInfo.projectCode = selectedProject.projectCode;\n this.form.projectId = selectedProject.id;\n this.form.portUserName = selectedProject.projectManager;\n this.projectMoney = selectedProject.projectMoney;\n this.gettotalMoney(this.form.projectId);\n } else {\n //根据项目id查询\n this.form.portUserName = this.projectObj[0].portUserName;\n this.form.projectInfo.projectName = this.projectObj[0].projectName;\n this.form.projectInfo.projectCode = this.projectObj[0].projectCode;\n this.form.projectId = this.projectObj[0].id;\n this.form.portUserName = this.projectObj[0].projectManager;\n this.projectMoney = this.projectObj[0].projectMoney;\n this.gettotalMoney(this.form.projectId);\n }\n\n this.dialogTitle = '修改';\n this.$http.post('${cqxy}/biz/processManagement/progressManageReport/v1/detail/' + data.id).then(function (res) {\n _this6.dialogVisible = true;\n var resp = res.data.value;\n _this6.form = resp;\n });\n },\n handleSelect: function handleSelect(selection) {},\n //取消\n handleDialogCancel: function handleDialogCancel() {\n this.dialogVisible = false;\n this.form = {\n projectId: '',\n portDate: '',\n portType: '',\n portUserId: '',\n investmentRatio: '0.75',\n portUserName: '',\n projectInfo: {\n projectName: '',\n projectCode: ''\n },\n accessoryInfo: []\n };\n },\n //关闭窗口\n handleDialogClose: function handleDialogClose(val) {\n this.dialogVisible = false;\n this.form = {\n projectId: '',\n portDate: '',\n portType: '',\n portUserId: '',\n portUserName: '',\n projectInfo: {\n projectName: '',\n projectCode: ''\n },\n accessoryInfo: []\n };\n },\n //提交保存\n handleDialogSubmit: function handleDialogSubmit(formName) {\n var _this7 = this;\n\n this.$refs[formName].validate(function (valid) {\n if (valid) {\n if (_this7.form.accessoryInfo && _this7.form.accessoryInfo.length > 0) {\n _this7.loading = true;\n _this7.form.decisionBasisType = _this7.form.decisionBasisType + '';\n\n _this7.form.accessoryInfo.forEach(function (item) {\n if (item.id) {\n delete item.id;\n }\n });\n }\n\n _this7.form.imageProgress = _this7.form.imageProgress + '%';\n\n _this7.$http.post('${cqxy}/biz/processManagement/progressManageReport/v1/save', _this7.form).then(function (res) {\n if (res.status == 200) {\n setTimeout(function () {\n _this7.$message.success(res.data.message);\n\n _this7.afterSaveData();\n }, 500);\n } else {\n _this7.$message.error(res.data.message);\n }\n\n _this7.loading = false;\n });\n } // else if (this.form.accessoryInfo.length === 0) {\n // this.$message.error('至少上传一个附件')\n // }\n else {\n _this7.$message({\n message: '*号必填项,不能为空!',\n type: 'warning'\n });\n\n return false;\n }\n });\n },\n loadData: function loadData(param, cb) {\n var _this8 = this;\n\n var query = [];\n var search = {\n 'pm.ID_': this.searchForm.projectId,\n port_type_: this.searchForm.portType,\n port_date_: this.searchForm.portDate\n };\n\n if (!this.isShow) {\n search['pm.ID_'] = this.pid;\n this.importData.projectId = this.pid;\n }\n\n for (var 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\n if (param.querys && param.querys.length) {\n var _param$querys;\n\n (_param$querys = param.querys).push.apply(_param$querys, query);\n } else {\n param.querys = query;\n }\n\n this.$http.post('${cqxy}/biz/processManagement/progressManageReport/v1/page', param).then(function (resp) {\n var response = resp.data.value;\n _this8.data = response.rows;\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 handleInput: function handleInput(val) {\n val = val ? val : 0;\n var num1 = FormMath.toNumber(val);\n var num2 = FormMath.toNumber(this.projectMoney) * 10000;\n num2 = num2 == 0 ? 1 : num2; //解决可能出现的inifity,例2/0 = inifity\n\n var num3 = FormMath.toNumber(this.totalMoney);\n this.form.imageProgress = FormMath.tofixed(num1 / num2 * 100, 2); // let ary = [num1, num3]\n // this.form.projectOvervie = FormMath.tofixed(FormMath.sum(ary), 2)\n\n this.form.projectOvervie = num3;\n var num4 = this.form.investmentRatio;\n this.form.engineeringChange = FormMath.tofixed(num1 / num4, 2);\n },\n handleInvestmentRatio: function handleInvestmentRatio(val) {\n var num1 = FormMath.toNumber(this.form.progressDescription);\n num1 = num1 ? num1 : 0;\n this.form.engineeringChange = FormMath.tofixed(num1 / val, 2);\n }\n }\n};",null]}