{"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\\contractManagement\\children\\DailyMaintenanceContract.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\yhxt-web\\src\\views\\contractManagement\\children\\DailyMaintenanceContract.vue","mtime":1681382736776},{"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":315532800000},{"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.object.keys\";\nimport \"core-js/modules/es6.string.iterator\";\nimport \"core-js/modules/es6.map\";\nimport \"core-js/modules/es6.function.name\";\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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 { mapState } from 'vuex';\nimport basicData from '@/api/basicData.js';\nimport BridgeDialog from '@/components/dialog/BridgeDialog.vue';\nimport sctionInfoSelector from '@/components/selector/sctionInfoSelector.vue';\nimport companyInfoSelector from '@/components/selector/companyInfoSelector.vue';\nimport req from '@/request.js';\nimport fileUpload from '@/components/upload/fileUpload.vue';\nimport InputSearch from '@/components/inputSearch/InputSearch.vue';\nimport { rotate } from '@antv/g2/lib/util/transform';\nimport CascaderCompany from '@/components/selector/CascaderCompany.vue';\nexport default {\n components: {\n BridgeDialog: BridgeDialog,\n // sctionInfoSelector,\n // companyInfoSelector,\n fileUpload: fileUpload,\n InputSearch: InputSearch,\n CascaderCompany: CascaderCompany\n },\n computed: mapState({\n // submitUrl: function () {\n // return `${window.context.portal}/portal/commonBasic/v1/`\n // },\n downLoad: function downLoad() {\n return \"\".concat(window.context.portal, \"/contract/v1/minioDrawingUpload?sourceId=\").concat(this.sourceId);\n },\n deleteUrl: function deleteUrl() {\n return window.context.yhxt + '/contract/v1/removesContract';\n },\n headers: function headers(state) {\n return {\n Authorization: \"Bearer \".concat(state.login.currentUser.token)\n };\n }\n }),\n data: function data() {\n return {\n dadToSon: {\n bizPath: 'contract',\n fileList: []\n },\n roadData: [],\n searchForm: {},\n options: [],\n //附件数据\n enclosureData: [],\n //附件管理所需id\n sourceId: '',\n //删除附件管理ids\n ids: [],\n loading: false,\n //上传附件加载控制\n disabled: false,\n //按钮禁用控制\n downLoading: false,\n //文件导出加载控制\n accept: '.jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.PBG,.BMP,.PDF,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.rtf,.txt,.zip,.rar,.vsd,.dwg,',\n dialogVisibleEnclosure: false,\n files: [],\n url: '',\n paymentList: [],\n itemList: [],\n activeName: 'first',\n form: {\n roadSegmentName: '',\n isTemporary: 1,\n contractDate: '',\n roadSegmentName_: {}\n },\n dialogVisible: false,\n title: '',\n data: [],\n pageResult: {\n page: 1,\n pageSize: 20,\n total: 0\n },\n rules: {\n roadSegmentName: {\n required: true,\n message: '所属路段',\n trigger: 'blur'\n },\n officeName: {\n required: true,\n message: '管养部门',\n trigger: 'blur'\n },\n name: {\n required: true,\n message: '合同名称',\n trigger: 'blur'\n },\n type: {\n required: true,\n message: '合同类别',\n trigger: 'blur'\n },\n firstParty: {\n required: true,\n message: '第一方',\n trigger: 'blur'\n },\n secondParty: {\n required: true,\n message: '第二方',\n trigger: 'blur'\n },\n isTemporary: {\n required: true,\n message: '合同类型',\n trigger: 'blur'\n },\n contractAmount: {\n required: true,\n message: '合同金额',\n trigger: 'blur'\n },\n contractDate: {\n required: true,\n message: '合同日期',\n trigger: 'blur'\n }\n },\n accessories: [],\n roadDisabled: false,\n keyIndex: 20,\n paymentLoading: false\n };\n },\n created: function created() {\n this.roadData = this.getroad();\n },\n watch: {\n 'form.type': function formType(val) {\n if (val == 2) {\n this.getContractOptions();\n } else {\n this.getByRoadSegmentId();\n }\n }\n },\n mounted: function mounted() {\n window.addEventListener('scroll', this.handleScroll, true);\n },\n destroyed: function destroyed() {\n //离开页面时删除该监听\n window.removeEventListener('scroll', this.handleScroll, true);\n },\n methods: {\n handleScroll: function handleScroll(event) {\n var scrollDistance = event.target.scrollHeight - event.target.scrollTop - event.target.clientHeight; // console.log(scrollDistance, 'scrollDistance')\n\n if (scrollDistance <= 0) {\n if (this.itemList_.length - 1 > this.keyIndex) {\n this.itemList = this.itemList.concat(this.itemList_.slice(this.keyIndex, this.keyIndex + 10));\n this.keyIndex += 10; // this.$refs['refContractTable'].scrollTop = 100\n }\n }\n },\n handleScroll_: function handleScroll_(event) {\n var scrollDistance = event.target.scrollHeight - event.target.scrollTop - event.target.clientHeight; // console.log(scrollDistance, 'scrollDistance')\n\n if (scrollDistance <= 0) {\n if (this.paymentList_.length - 1 > this.keyIndex_) {\n this.paymentList = this.paymentList.concat(this.paymentList_.slice(this.keyIndex_, this.keyIndex_ + 10));\n this.keyIndex_ += 10; // this.$refs['refContractTable_'].scrollTop = 100\n }\n }\n },\n getContractOptions: function getContractOptions() {\n var _this = this;\n\n this.options = [];\n this.$http.get('${yhxt}/bizCourseDetails/v1/get/getByParentId?pCode=XF').then(function (res) {\n _this.options = [];\n\n if (res.data.length !== 0) {\n res.data.forEach(function (item) {\n _this.options.push({\n label: item.subjectName,\n value: item.subjectCode,\n roadSegmentId: item.roadSegmentId,\n roadSegmentName: item.roadSegmentName\n });\n });\n }\n });\n },\n handleRoadNameChange: function handleRoadNameChange(data) {\n this.form.roadSegmentName_ = 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 this.form.officeName = data.companyName;\n this.form.officeId = data.companyId;\n\n if (this.form.type == 2) {\n this.getContractOptions();\n } else {\n this.getByRoadSegmentId();\n }\n },\n sonToDad: function sonToDad(data) {\n console.log(data);\n this.accessories = data;\n this.form.dadToSon = data;\n },\n //路段信息赋值\n changed: function changed(obj) {\n this.form.roadSegmentName = obj.name;\n this.form.roadSegmentId = obj.id;\n },\n //默认赋值为第一条数据的值\n value: function value(obj) {\n if (this.title == '【添加合同】') {\n this.form.roadSegmentName = obj.name;\n this.form.roadSegmentId = obj.id;\n }\n },\n handleSelectionChangeEnclosure: function handleSelectionChangeEnclosure(rows) {\n var _this2 = this;\n\n rows.forEach(function (item) {\n _this2.ids.push(item.id);\n });\n },\n //去重\n unique: function unique(arr) {\n for (var i = 0; i < arr.length; i++) {\n for (var j = i + 1; j < arr.length; j++) {\n if (arr[i] == arr[j]) {\n //第一个等同于第二个,splice方法删除第二个\n arr.splice(j, 1);\n j--;\n }\n }\n }\n\n return arr;\n },\n //附件管理删除\n handleEnclosureDel: function handleEnclosureDel() {\n var _this3 = this;\n\n this.downLoading = true;\n var ids = this.unique(this.ids); // console.log(ids.join(','))\n\n var strs = ids.join(',');\n basicData.deleteEnclosureManagement(strs).then(function (res) {\n if (res.state) {\n _this3.$message.success('附件删除成功');\n\n _this3.downLoading = false;\n } else {\n _this3.$message.error('附件删除失败');\n\n _this3.downLoading = false;\n }\n\n _this3.getEnclosureData(_this3.sourceId); //清空ids\n\n\n _this3.ids = [];\n });\n },\n //附件导出\n downLoadImg: function downLoadImg() {\n var _this4 = this;\n\n this.downLoading = true;\n var ids = this.unique(this.ids);\n var strs = ids.join(',');\n req.download(window.context.portal + '/contract/v1/downloadContractUpload?ids=' + strs).then(function (res) {\n _this4.downLoading = false;\n\n _this4.$refs.multipleTable.clearSelection();\n\n _this4.ids = [];\n }); // basicData.downLoadEnclosureManagement(strs).then(res => {\n // //清空ids\n // this.ids = []\n // })\n },\n progress: function progress(event, file, fileList) {\n //将图标改成加载图标\n this.loading = true; //将按钮禁用\n\n this.disabled = true;\n },\n error: function error(response, file, fileList) {\n this.$message.error('文件上传失败');\n delete this.uploadingFiles[Base64.encode(file.name)];\n },\n success: function success(response, file, fileList) {\n this.$message.success('文件上传成功'); //重新加载数据\n\n this.getEnclosureData(this.sourceId); //将图标改成上传图标\n\n this.loading = false; //将按钮解禁\n\n this.disabled = false;\n },\n additemList: function additemList() {\n this.itemList.push({\n key: this.itemList.length + 1,\n subOption: [],\n childOption: [],\n fineSubjectCode: '',\n fineSubjectName: '',\n sonSubjectName: ''\n });\n console.log(this.itemList, 'w'); //根据路段id查询科目数据\n\n if (this.form.type == 2) {\n this.getContractOptions();\n } else {\n this.getByRoadSegmentId();\n }\n },\n getByRoadSegmentId: function getByRoadSegmentId() {\n var _this5 = this;\n\n var pcdoe = '';\n var roadSegmentId = this.form.roadSegmentId;\n this.$http.get('${yhxt}/bizCourseDetails/v1/get/getByParentIdRoad?pCode=' + pcdoe + '&roadSegmentId=' + roadSegmentId).then(function (res) {\n if (res.data.length !== 0) {\n pcdoe = res.data[0].subjectCode;\n\n _this5.$http.get('${yhxt}/bizCourseDetails/v1/get/getByParentIdRoad?pCode=' + pcdoe + '&roadSegmentId=' + roadSegmentId).then(function (res) {\n _this5.options = [];\n\n if (res.data.length !== 0) {\n res.data.forEach(function (item) {\n _this5.options.push({\n label: item.subjectName,\n value: item.subjectCode,\n roadSegmentId: item.roadSegmentId,\n roadSegmentName: item.roadSegmentName\n });\n });\n }\n });\n } else {\n _this5.options = [];\n var data = 'CBKM';\n basicData.getCostAccountManagement(data).then(function (res) {\n res.data.forEach(function (item) {\n _this5.options.push({\n label: item.subjectName,\n value: item.subjectCode\n });\n });\n });\n }\n });\n },\n addpaymentList: function addpaymentList() {\n console.log(this.paymentList, 'this.paymentList');\n this.paymentList.push({\n key: this.paymentList.length + 1,\n payDate: '',\n stage: '',\n name: '',\n amount: '',\n deposit: '',\n explain: ''\n });\n console.log(333333333);\n },\n handleClick: function handleClick(tab, event) {\n console.log(tab, event);\n },\n handleSelectRoute: function handleSelectRoute(data) {\n // console.log(data, '路线信息')\n this.form.roadSegmentName = data.name;\n this.form.roadSegmentId = data.id; // console.log(this.form.roadSegmentName,'进来了')\n\n this.$refs.routeName.focus();\n this.$refs.routeName.blur(); // console.log(this.form.routeName)\n },\n //所属路段获取焦点触发事件\n handleFocusRouter: function handleFocusRouter() {\n this.$refs.route.open();\n },\n //所属路段打开弹框\n openRoute: function openRoute() {\n this.$refs.route.open();\n },\n beforeCloseDialog: function beforeCloseDialog() {\n this.form = {\n isTemporary: 1\n };\n this.dadToSon = {\n bizPath: 'contract',\n fileList: []\n };\n this.itemList = [];\n this.paymentList = [];\n this.dialogVisible = false;\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 findinfo: function findinfo() {\n var _this6 = this;\n\n typeof this.$refs.filterTable !== 'undefined' && this.$refs.filterTable.clearFilter();\n var query = [];\n var search = {\n company_id_: this.searchForm.companyIds,\n road_segment_id_: this.searchForm.roadSegmentId,\n contract_date_: this.searchForm.contractDate,\n name: this.searchForm.name,\n type: this.searchForm.type\n };\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\n query.push({\n group: 'main',\n operation: 'GREAT_EQUAL',\n property: 'contract_date_limit_',\n relation: 'AND',\n value: this.getDate()\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}/contract/v1/getJson', data).then(function (res) {\n console.log(res, '11');\n _this6.data = res.data.rows;\n _this6.pageResult = {\n page: res.data.page,\n pageSize: res.data.pageSize,\n total: res.data.total\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 }); // console.log(arr, '12')\n });\n return arr;\n },\n loadData: function loadData(param, cb) {\n var _this7 = this;\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.push({\n group: 'main',\n operation: 'GREAT_EQUAL',\n property: 'contractDateLimit',\n relation: 'AND',\n value: this.getDate()\n });\n param.querys = this.uniqueFunc(param.querys, 'property');\n }\n\n this.$http.post('${form}/contract/v1/getJson', param).then(function (resp) {\n var response = resp.data;\n _this7.data = response.rows;\n _this7.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(_this7.$route.params).length !== 0 && Object.keys(_this7.$route.params.value).length !== 0 && _this7.$route.params.value.roadSegmentId) {\n _this7.searchForm = {\n roadSegmentId: _this7.$route.params.value.roadSegmentId\n };\n\n _this7.findinfo();\n }\n\n cb();\n }\n });\n },\n delitemList: function delitemList(key, id) {\n var _this8 = this;\n\n console.log(id);\n\n if (id) {\n this.itemList = this.itemList.filter(function (item) {\n return item.id !== id;\n });\n this.itemList_ = this.itemList_.filter(function (item) {\n return item.id !== id;\n });\n this.$http.remove('${form}/contractItem/v1/' + id).then(function (res) {\n _this8.$message.success('删除成功');\n }); // this.$http.get('${form}/contract/v1/get/' + this.form.id).then(res => {\n // console.log(res, 'ressssss')\n // this.itemList_ = res.data.itemList\n // })\n } else {\n this.itemList = this.itemList.filter(function (item) {\n return item.key !== key;\n });\n }\n },\n delpaymentList: function delpaymentList(key, id) {\n if (id) {\n this.paymentList = this.paymentList.filter(function (item) {\n return item.id !== id;\n });\n } else {\n this.paymentList = this.paymentList.filter(function (item) {\n return item.key !== key;\n });\n }\n },\n handleEdit: function handleEdit(data) {\n var _this9 = this;\n\n this.keyIndex = 20;\n this.paymentLoading = true; //禁止修改路段信息\n\n this.roadDisabled = true;\n this.form = data;\n this.title = '【修改合同】';\n this.dialogVisible = true; // this.BizBridgeInformation = {...form, ...data}\n\n this.$http.get('${form}/contract/v1/get/' + data.id).then(function (res) {\n console.log(res, 'res');\n var index = 0;\n _this9.paymentLoading = false;\n\n _this9.$nextTick(function () {\n var scrollview = _this9.$refs.refContractTable;\n scrollview.addEventListener('scroll', _this9.handleScroll, true);\n var scrollview_ = _this9.$refs.refContractTable_;\n scrollview_.addEventListener('scroll', _this9.handleScroll_, true);\n });\n\n _this9.dadToSon.fileList = res.data.accessories;\n _this9.form = res.data.contract;\n _this9.form.roadSegmentName_ = {\n value: _this9.form.roadSegmentId,\n label: _this9.form.roadSegmentName,\n companyId: _this9.form.companyId,\n companyName: _this9.form.companyName\n };\n _this9.form.dadToSon = _this9.dadToSon.fileList;\n console.log(_this9.dadToSon, 'this.form.accessories');\n console.log(_this9.form, 'this.form');\n var sum = 0;\n _this9.itemList_ = res.data.itemList;\n _this9.itemList = res.data.itemList.slice(0, _this9.keyIndex);\n\n _this9.itemList.map(function (item, index) {\n item['key'] = index++;\n return item;\n });\n\n if (res.data.paymentList) {\n _this9.paymentList_ = res.data.paymentList;\n _this9.paymentList = res.data.paymentList;\n _this9.paymentList = res.data.paymentList_.slice(0, _this9.keyIndex_);\n } else {\n _this9.paymentList = [];\n }\n\n if (_this9.itemList) {\n _this9.itemList.forEach(function (item) {\n item.key = index++;\n item.subOption = [];\n item.childOption = [];\n sum += item.totalPrice;\n });\n } else {\n _this9.itemList = []; //没有则赋值为空数组,防止添加数据报错\n } //根据路段id查询科目数据\n\n\n if (_this9.form.type == 2) {\n _this9.getContractOptions();\n } else {\n _this9.getByRoadSegmentId();\n } //获取细科目名称\n\n\n _this9.itemList.forEach(function (item) {\n basicData.getCostAccountManagement(item.code).then(function (res) {\n item.subOption = [];\n res.data.forEach(function (item1) {\n item.subOption.push({\n label: item1.subjectName,\n value: item1.subjectCode\n });\n });\n });\n basicData.getCostAccountManagement(item.fineSubjectCode).then(function (res) {\n item.childOption = [];\n res.data.forEach(function (item1) {\n item.childOption.push({\n label: item1.subjectName,\n value: item1.subjectCode\n });\n });\n });\n }); // this.itemList.forEach((item,index) => {\n // if (item.subjectName != '') {\n // this.changesele(item.code, index)\n // }\n // })\n\n });\n },\n changesele: function changesele(value, key) {\n var _this10 = this;\n\n console.log(value);\n var arr1 = [];\n var arr2 = [];\n basicData.getCostAccountManagement(value).then(function (res) {\n if (res.data.length > 0) {\n res.data.forEach(function (item) {\n if (item.pcode == value) {\n arr1.push({\n label: item.subjectName,\n value: item.subjectCode\n });\n }\n }); //默然赋值细科目的第一条数据\n\n _this10.itemList.forEach(function (item) {\n if (item.key == key) {\n item.subOption = arr1;\n item.fineSubjectName = item.subOption[0].label;\n item.fineSubjectCode = item.subOption[0].value;\n basicData.getCostAccountManagement(item.fineSubjectCode).then(function (res) {\n if (res.data.length > 0) {\n res.data.forEach(function (item1) {\n if (item1.pcode == item.fineSubjectCode) {\n arr2.push({\n label: item1.subjectName,\n value: item1.subjectCode\n });\n }\n });\n\n _this10.itemList.forEach(function (item) {\n if (item.key == key) {\n item.childOption = arr2;\n item.sonSubjectName = item.childOption[0].label;\n item.sonSubjectCode = item.childOption[0].value;\n }\n });\n } else {\n _this10.$message.info('暂无子科目数据');\n\n _this10.itemList.forEach(function (item) {\n if (item.key == key) {\n item.childOption = [];\n item.sonSubjectName = '';\n item.sonSubjectCode = '';\n }\n });\n }\n });\n }\n }); //赋值科目名称\n\n\n _this10.options.forEach(function (item) {\n if (item.value == value) {\n _this10.itemList.forEach(function (item1) {\n if (item1.key == key) {\n item1.subjectName = item.label;\n item1.subjectCode = item.value;\n item1.code = item.value;\n }\n });\n }\n });\n } else {\n _this10.itemList.forEach(function (item) {\n if (item.key == key) {\n item.subOption = [];\n item.fineSubjectCode = '';\n item.fineSubjectName = '';\n }\n });\n }\n });\n },\n calculation: function calculation(row) {\n console.log(row); // this.YStable[row.key].totalPrice=row.quantities*row.unitPrice\n\n this.itemList.forEach(function (item) {\n if (item.price != null && item.amount != null) {\n item.monty = item.price * item.amount;\n item.monty = item.monty.toFixed(2);\n }\n });\n var sum = 0;\n this.itemList.forEach(function (item) {\n if (item.totalPrice) {\n sum += item.totalPrice;\n }\n });\n },\n //细科目改变事件,赋值细科目名称\n subSubChange: function subSubChange(val, obj) {\n var _this11 = this;\n\n var value;\n\n if (obj.subOption) {\n obj.subOption.forEach(function (item) {\n if (item.value == val) {\n _this11.itemList.forEach(function (item1) {\n if (item1.key == obj.key) {\n item1.fineSubjectName = item.label;\n item1.fineSubjectCode = item.value;\n value = item.value;\n var arr = [];\n var key = obj.key;\n basicData.getCostAccountManagement(value).then(function (res) {\n if (res.data.length > 0) {\n res.data.forEach(function (item) {\n if (item.pcode == value) {\n arr.push({\n label: item.subjectName,\n value: item.subjectCode\n });\n }\n }); //默然赋值子科目的第一条数据\n\n _this11.itemList.forEach(function (item) {\n console.log(item, 'oooooooooooooo');\n\n if (item.key == key) {\n item.childOption = arr;\n item.sonSubjectName = item.childOption[0].label;\n item.sonSubjectCode = item.childOption[0].value;\n }\n });\n } else {\n _this11.$message.info('暂无子科目数据');\n\n _this11.itemList.forEach(function (item) {\n if (item.key == key) {\n item.childOption = [];\n item.sonSubjectName = '';\n item.sonSubjectCode = '';\n }\n });\n }\n });\n }\n });\n }\n });\n }\n },\n //子科目名称赋值\n childSubChange: function childSubChange(val, obj) {\n var _this12 = this;\n\n if (obj.childOption) {\n obj.childOption.forEach(function (item) {\n if (item.value == val) {\n _this12.itemList.forEach(function (item1) {\n if (item1.key == obj.key) {\n item1.sonSubjectName = item.label;\n item1.sonSubjectCode = item.value;\n }\n });\n }\n });\n }\n },\n afterDelete: function afterDelete() {// this.$refs.htTable.load()\n },\n showDialog: function showDialog() {\n this.roadDisabled = false;\n this.dadToSon.fileList = [];\n this.paymentList = [];\n var myDate = new Date(); // let date = myDate.toLocaleDateString()\n // 获取当前登录用户名\n\n var currentUser = JSON.parse(window.sessionStorage.getItem('currentUser'));\n this.form = {\n roadSegmentName_: {\n value: this.roadData[0].key,\n label: this.roadData[0].value,\n companyId: this.roadData[0].companyId,\n companyName: this.roadData[0].companyName\n },\n roadSegmentName: this.roadData[0].value,\n roadSegmentId: this.roadData[0].key,\n officeName: this.roadData[0].companyName,\n officeId: this.roadData[0].companyId,\n companyId: this.roadData[0].companyId,\n companyName: this.roadData[0].companyName,\n isTemporary: 1,\n initiator: currentUser.username,\n contractDate: new Date(),\n dadToSon: []\n };\n this.title = '【添加合同】';\n this.dialogVisible = true;\n },\n handleCloseEnclosure: function handleCloseEnclosure(done) {\n this.enclosureData = [];\n done();\n },\n handleChange: function handleChange(file, fileList) {\n console.log(file, fileList, 'dddd');\n },\n handleCancel: function handleCancel() {\n this.dialogVisible = false;\n this.form = {\n roadSegmentName: '',\n isTemporary: 1\n };\n this.dadToSon = {\n bizPath: 'contract',\n fileList: []\n };\n this.itemList = [];\n this.paymentList = [];\n },\n handleSubmit: function handleSubmit() {\n var _this13 = this;\n\n //验证表单是否填写完\n this.$refs.ruleForm.validate(function (bool) {\n delete _this13.form.roadSegmentName_;\n delete _this13.form.dadToSon;\n\n if (bool) {\n //请求保存提交\n var data = {\n contract: _this13.form,\n itemList: _this13.itemList,\n paymentList: _this13.paymentList,\n accessories: _this13.accessories\n };\n\n if (_this13.title == '【修改合同】') {\n if (_this13.itemList_ == undefined || _this13.itemList_.length < 20) {\n data.itemList = _this13.itemList;\n } else {\n data.itemList = _this13.itemList_;\n }\n }\n\n console.log(data, 'data');\n basicData.saveContractInfo(data).then(function (res) {\n _this13.$message.success(res.message);\n\n _this13.form = {\n roadSegmentName: '',\n isTemporary: 1\n }; //清空表单\n\n _this13.itemList = [];\n _this13.itemList_ = [];\n _this13.dialogVisible = false;\n\n _this13.$refs.htTable.load(); //重新获取数据\n\n });\n }\n });\n }\n }\n};",null]}