{"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\\basicDataManagement\\CostAccountManagementCopy.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\yhxt-web\\src\\views\\basicDataManagement\\CostAccountManagementCopy.vue","mtime":1667326394763},{"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 \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es6.regexp.split\";\nimport _defineProperty from \"D:/jenkins/workspace/yhxt-web/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\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\nimport req from '@/request.js';\nimport basicData from '@/api/basicData.js';\nimport eipOrgSelector from '@/components/eipControl/selector/EipOrgSelector.vue';\nimport companyInfoSelector from '@/components/selector/companyInfoSelector.vue';\nexport default {\n components: {\n // eipOrgSelector,\n companyInfoSelector: companyInfoSelector\n },\n data: function data() {\n return {\n props: {\n label: 'name',\n code: 'code',\n id: 'id',\n children: 'children',\n pcode: 'pcode',\n isLeaf: 'leaf' // 指定节点是否为叶子节点,仅在指定了 lazy 属性的情况下生效\n },\n\n data: [],\n pageResult: {\n page: 1,\n pageSize: 10,\n total: 0\n },\n pcode: '',\n //根据父节点获取子节点\n pcodeData: '',\n //添加时父节点数据,用于保存\n dialogVisible: false,\n type: '',\n //add, edit\n form: {\n pcode: '',\n pname: '',\n // companyName: '',\n roadSegmentId: ''\n },\n ishaveborder: false,\n //控制树形控件的边框颜色\n node: '',\n resolve: '',\n treeData: [],\n nodeKey: false,\n roadData: [],\n loading: false,\n companyObj: '',\n disabledSubCode: false,\n rules: {\n subjectCode: {\n required: true,\n message: '请输入科目编码',\n trigger: 'blur'\n },\n companyName: {\n required: true,\n message: '请选择所属公司',\n trigger: 'blur'\n },\n subjectName: {\n required: true,\n message: '请输入科目名称',\n trigger: 'blur'\n },\n pcode: {\n required: true,\n message: '请输入科目名称',\n trigger: 'blur'\n }\n },\n arrPcode: [{\n name: '成本科目汇总',\n code: 'root'\n }]\n };\n },\n computed: {\n deleteUrl: function deleteUrl() {\n return window.context.yhxt + '/bizCourseDetails/v1/updateCourseDetails';\n }\n },\n created: function created() {\n this.roadData = this.getroad();\n },\n methods: {\n getroad: function getroad() {\n var arr = [];\n basicData.getRoadManagement().then(function (res) {\n res.rows.forEach(function (item) {\n arr.push({\n name: item.name,\n id: item.id\n });\n });\n // console.log(arr, 'dddddddddd')\n });\n\n return arr;\n },\n loadNode: function loadNode(node, resolve) {\n //暂存\n if (node.level === 0) {\n this.node = node;\n this.resolve = resolve;\n return resolve(this.arrPcode);\n } else {\n //获取子节点\n this.getCostAccount(node.data.code, resolve);\n }\n // if (node && resolve) {\n // this.node = node\n // this.resolve = resolve\n // } else {\n // this.node.level = 0\n // node = this.node\n // resolve = this.resolve\n // }\n // //暂存\n // if (node.level === 0) {\n // // this.getCostAccount('root', resolve)\n // return resolve(this.arrPcode)\n // }\n // if (node.level >= 1) {\n // this.nodeKey = false\n // //获取子节点\n // // console.log(node)\n // this.getCostAccount(node.data.code, resolve)\n // return resolve([])\n // }\n },\n //获取第一层节点\n getCostAccount: function getCostAccount(query, resolve) {\n var _this = this;\n basicData.getCostAccountManagement(query).then(function (res) {\n var data = [];\n res.data.forEach(function (item) {\n if (item.hasChildren == 'true') {\n data.push({\n name: item.subjectName,\n code: item.subjectCode,\n id: item.id\n });\n } else {\n data.push({\n name: item.subjectName,\n code: item.subjectCode,\n id: item.id,\n leaf: true //没有子节点时为true\n });\n }\n });\n\n if (_this.nodeKey) {\n _this.treeData = data;\n } else {\n resolve(data);\n }\n });\n },\n loadData: function loadData(param, cb) {\n var _this2 = this;\n // console.log(param)\n if (this.pcode) {\n var querys = [];\n querys.push({\n group: 'main',\n operation: 'EQUAL',\n parentGroup: '',\n property: 'pcode',\n relation: 'AND',\n value: this.pcode\n });\n param.querys = querys;\n }\n this.$http.post('${yhxt}/bizCourseDetails/v1/getJson', param).then(function (res) {\n var result = res.data;\n _this2.data = result.rows;\n _this2.pageResult = {\n page: result.page,\n pageSize: result.pageSize,\n total: result.total\n };\n }).finally(function () {\n return cb();\n });\n },\n //根据id查询详情\n getById: function getById(id) {\n var _this3 = this;\n this.$http.get('${yhxt}/bizCourseDetails/v1/get/' + id).then(function (res) {\n _this3.data = [res.data];\n _this3.pageResult = {\n page: 1,\n pageSize: 10,\n total: 1\n };\n });\n },\n //点击节点\n handleNodeClick: function handleNodeClick(data) {\n this.nodeKey = false;\n //暂存父节点数据\n this.pcodeData = data;\n this.form.pcode = data.code;\n this.form.pname = data.name;\n this.pcode = data.code;\n // this.getById(data.id)\n if (data.leaf) {\n this.getById(data.id);\n } else {\n this.$refs.htTable.load();\n }\n // this.$refs.tree.setCurrentKey(data.id)\n },\n //节点展开触发事件\n handleExpand: function handleExpand(data) {\n // this.pcodeData = data\n // this.form.pcode = data.code\n // this.form.pname = data.name\n // this.pcode = data.code\n // this.$refs.htTable.load()\n },\n afterDelete: function afterDelete() {\n this.pcode = '';\n this.$refs.htTable.load();\n this.node.childNodes = [];\n this.loadNode(this.node, this.resolve);\n // this.nodeKey = true\n // this.$refs.tree.load()\n },\n //添加\n handleAdd: function handleAdd() {\n this.disabledSubCode = false;\n this.form = _objectSpread(_objectSpread({}, this.form), {}, {\n subjectCode: '',\n subjectName: '',\n // companyName: '',\n id: ''\n });\n this.type = 'add';\n this.form.roadSegmentId = this.roadData[0].id;\n this.form.roadSegmentName = this.roadData[0].name;\n if (this.pcodeData) {\n this.dialogVisible = true;\n } else {\n this.dialogVisible = true;\n this.form.pcode = 'root';\n this.form.pname = 'root';\n }\n },\n handleEdit: function handleEdit(data) {\n var form = {\n // companyName: ''\n };\n this.type = 'edit';\n this.dialogVisible = true;\n if (data.hasChildren == 'true') {\n this.disabledSubCode = true;\n }\n this.form = _objectSpread(_objectSpread({}, form), data);\n },\n handleClose: function handleClose() {\n this.dialogVisible = false;\n },\n handleCancel: function handleCancel() {\n this.dialogVisible = false;\n },\n handleSubmit: function handleSubmit() {\n var _this4 = this;\n console.log(this.form, '666666666666');\n this.$refs.form.validate(function (bool) {\n if (bool) {\n _this4.loading = true;\n _this4.dialogVisible = true;\n basicData.addCostAccountManagement(_this4.form).then(function (res) {\n _this4.$message.success(res.message);\n //将this.pcode清空\n _this4.pcode = '';\n _this4.dialogVisible = false;\n _this4.loading = false;\n _this4.$refs.htTable.load();\n _this4.node.childNodes = [];\n _this4.loadNode(_this4.node, _this4.resolve);\n if (res.state) {\n setTimeout(function () {\n _this4.loading = false;\n }, 10000);\n }\n });\n }\n });\n },\n //树形控件外围的盒子\n boxLeftClick: function boxLeftClick() {\n this.ishaveborder = true;\n this.form.pcode = 'root';\n this.form.pname = 'root';\n },\n boxRightClick: function boxRightClick() {\n this.ishaveborder = false;\n },\n //鼠标右键事件\n moreClick: function moreClick(node, data) {\n console.log(data);\n },\n remove: function remove(node, data) {},\n //公司赋值\n handleChanged: function handleChanged(obj) {\n // console.log(obj.valueInfo.join(','))\n this.form.companyIds = JSON.stringify(obj.valueInfo);\n this.form.companyName = obj.name;\n this.form.companyId = obj.id;\n },\n companyValue: function companyValue(obj) {\n this.companyObj = obj;\n this.form.companyName = obj.name;\n this.form.companyId = obj.id;\n this.form.companyIds = JSON.stringify(obj.id.split(' ')); //必须是空格\n },\n handleRoadNameChange: function handleRoadNameChange(id) {\n var _this5 = this;\n this.form.roadSegmentId = id;\n this.roadData.forEach(function (item) {\n if (item.id == id) {\n _this5.form.roadSegmentName = item.name;\n }\n });\n },\n handleRoadNameClear: function handleRoadNameClear() {\n this.form.roadSegmentId = '';\n this.form.roadSegmentName = '';\n }\n }\n};",null]}