From 5e3cb2339ac7d38eb9dcde4cee9e590434d5c360 Mon Sep 17 00:00:00 2001 From: zyn Date: Tue, 25 Apr 2023 15:21:49 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=A0=87=E5=87=86=E7=B1=BB=E5=88=AB?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/myFun.js | 17 ++ src/components/abc/selectTree/selectTree.vue | 215 ++++++++++++++++++ .../pages/creatProcess/qbfs/step1.vue | 66 +++++- .../components/EnterpriseStandardDatabase.vue | 87 ++++++- 4 files changed, 365 insertions(+), 20 deletions(-) create mode 100644 src/common/myFun.js create mode 100644 src/components/abc/selectTree/selectTree.vue diff --git a/src/common/myFun.js b/src/common/myFun.js new file mode 100644 index 000000000..0a34d4ae9 --- /dev/null +++ b/src/common/myFun.js @@ -0,0 +1,17 @@ +function getTreeItem(tree, id){ + let result = {} + tree.map(item => { + if(item.id === id){ + result = item + }else{ + if(item.children.length > 0){ + getTreeItem(item.children) + } + } + }) + return result +} + +export { + getTreeItem +} diff --git a/src/components/abc/selectTree/selectTree.vue b/src/components/abc/selectTree/selectTree.vue new file mode 100644 index 000000000..ccca7a5eb --- /dev/null +++ b/src/components/abc/selectTree/selectTree.vue @@ -0,0 +1,215 @@ + + + + + diff --git a/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue b/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue index ade3fe271..b3cb8d26f 100644 --- a/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue +++ b/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue @@ -533,13 +533,14 @@ clearable :maxlength="100"> - - - + + 0){ this.replaceLawsNumForm.issueTimeStart = this.replaceLawsNumForm.issueTimeArr[0] || null this.replaceLawsNumForm.issueTimeEnd = this.replaceLawsNumForm.issueTimeArr[1] || null @@ -978,6 +989,10 @@ export default { }) }, getReplaceLawsNumRowFirst () { + this.replaceLawsNumForm.userId = this.$store.getters.userInfo.userId + let currentTreeItem = getTreeItem(this.selectTreeList, this.replaceLawsNumForm.menuId) + this.replaceLawsNumForm.treeType = currentTreeItem.treeType + this.replaceLawsNumForm.page = 1 this.replacePage = 1 if(this.replaceLawsNumForm.issueTimeArr && this.replaceLawsNumForm.issueTimeArr.length > 0){ @@ -1058,9 +1073,40 @@ export default { handleTabs(name) { this.active = name; }, - choiceShow(){ + async choiceShow(){ this.getReplaceLawsNumRow() this.replaceLawsNumModel = true; + // 标准类别树 + const list1 = await this.getMenuListOne() + const list2 = await this.getMenuListTwo() + this.selectTreeList = list1.concat(list2) + }, + // 企业标准树 + getMenuListOne() { + return new Promise((resolve, reject) => { + this.$http._getData('sarResource/ts-resource/getListStandLimitData', { + sorDivide: 'BUSINESS_STAND', + userId: this.$store.getters.userInfo.userId + }).then(res=>{ + if(res && res.data) + resolve(res.data) + }).catch(e=>{ + console.log(e) + }) + }) + }, + // 技术体系树 + getMenuListTwo() { + return new Promise((resolve, reject) => { + this.$http._getData('lawss/sarMenuStandardLimit/getListStandLimit', { + dicId: '9m4qqqaansxmox5e82zm' + }).then(res=>{ + if(res && res.data) + resolve(res.data) + }).catch(e=>{ + console.log(e) + }) + }) }, getStandDataBtns(){ this.$http.get('lawss/sarBussionessStand/getSarBussionStandPage',{ diff --git a/src/pages/regulatoryRepository/enterpriseStandardDatabase/components/EnterpriseStandardDatabase.vue b/src/pages/regulatoryRepository/enterpriseStandardDatabase/components/EnterpriseStandardDatabase.vue index 6f649b5b1..ff9e11d62 100644 --- a/src/pages/regulatoryRepository/enterpriseStandardDatabase/components/EnterpriseStandardDatabase.vue +++ b/src/pages/regulatoryRepository/enterpriseStandardDatabase/components/EnterpriseStandardDatabase.vue @@ -1509,13 +1509,14 @@ clearable :maxlength="100"> - - - + + { + this.$http._getData('sarResource/ts-resource/getListStandLimitData', { + sorDivide: 'BUSINESS_STAND', + userId: this.$store.getters.userInfo.userId + }).then(res=>{ + if(res && res.data) + resolve(res.data) + }).catch(e=>{ + console.log(e) + }) + }) + }, + // 技术体系树 + getMenuListTwo() { + return new Promise((resolve, reject) => { + this.$http._getData('lawss/sarMenuStandardLimit/getListStandLimit', { + dicId: '9m4qqqaansxmox5e82zm' + }).then(res=>{ + if(res && res.data) + resolve(res.data) + }).catch(e=>{ + console.log(e) + }) + }) }, replaceLawsNumModelCancel () { // this.replaceLawsNumModel = false @@ -2690,11 +2726,16 @@ export default { total: 0, validFlag: '0', QCDW: '', - menuId: '' + // menuId: '' } + this.$refs.selectTreeRef.clear() this.getReplaceLawsNumRow() }, getReplaceLawsNumRow () { + this.replaceLawsNumForm.userId = this.$store.getters.userInfo.userId + let currentTreeItem = getTreeItem(this.selectTreeList, this.replaceLawsNumForm.menuId) + this.replaceLawsNumForm.treeType = currentTreeItem.treeType + if(this.replaceLawsNumForm.issueTimeArr && this.replaceLawsNumForm.issueTimeArr.length > 0){ this.replaceLawsNumForm.issueTimeStart = this.replaceLawsNumForm.issueTimeArr[0] || null this.replaceLawsNumForm.issueTimeEnd = this.replaceLawsNumForm.issueTimeArr[1] || null @@ -2728,6 +2769,10 @@ export default { }) }, getReplaceLawsNumRowFirst () { + this.replaceLawsNumForm.userId = this.$store.getters.userInfo.userId + let currentTreeItem = getTreeItem(this.selectTreeList, this.replaceLawsNumForm.menuId) + this.replaceLawsNumForm.treeType = currentTreeItem.treeType + this.replaceLawsNumForm.page = 1 this.replacePage = 1 if(this.replaceLawsNumForm.issueTimeArr && this.replaceLawsNumForm.issueTimeArr.length > 0){ @@ -5456,6 +5501,9 @@ export default { } }, watch: { + // selectTreeFilterText (val) { + // this.$refs.selectTree.filter(val); + // }, 'sarBussionessStandEO.standSort':{ handler:function(val){ this.QCBFC = !!(val && val.indexOf("QCBFC") !== -1); @@ -5850,4 +5898,23 @@ export default { /deep/.el-table__fixed-body-wrapper .el-table__body { padding-bottom: 20px; } +// +//.sel-input { +// width: 96%; +// margin: 5px; +// height: 30px; +// /deep/ .el-input__inner{ +// height: 30px; +// line-height: 30px; +// } +//} +//.sel-option { +// width: 100%; +// height: 200px; +// overflow: auto; +// background-color: #fff; +// cursor: pointer; +// font-weight: normal!important; +// padding: 0 5px; +//} From 6a07ca83555c7e5aad2cc1d66a43ab7f7ace5041 Mon Sep 17 00:00:00 2001 From: zyn Date: Tue, 25 Apr 2023 15:40:07 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=87=E5=87=86?= =?UTF-8?q?=E7=B1=BB=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/flow/index.js | 19 +++++++++++++++++-- .../pages/creatProcess/qbfs/step1.vue | 18 +++++------------- .../components/EnterpriseStandardDatabase.vue | 18 +++++------------- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/api/flow/index.js b/src/api/flow/index.js index 33ad55b3a..0e03639d9 100644 --- a/src/api/flow/index.js +++ b/src/api/flow/index.js @@ -1,7 +1,22 @@ import axios from '@/common/axios' // 根据企标编号查找文件 -export function selectByIdAtt(id){ - return axios._getData('/lawss/sarBussionessStand/selectByIdAtt', { id }) +function selectByIdAtt(id){ + return axios._getData('lawss/sarBussionessStand/selectByIdAtt', { id }) } +// 企业标准树 +function getMenuListOne(sorDivide, userId){ + return axios._getData('sarResource/ts-resource/getListStandLimitData', { sorDivide, userId }) +} + +// 技术体系树 +function getMenuListTwo(dicId){ + return axios._getData('lawss/sarMenuStandardLimit/getListStandLimit', { dicId }) +} + +export { + selectByIdAtt, + getMenuListOne, + getMenuListTwo +} diff --git a/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue b/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue index b3cb8d26f..a23dece6a 100644 --- a/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue +++ b/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue @@ -668,6 +668,7 @@ import ProcessTitle from "../../components/ProcessTitle"; import {saveTaskFirst,queryTaskFirst, inboundLiaisonDetail,taskDel,startProcessRollBack, completeTask } from "api/process"; import selectTree from "@/components/abc/selectTree/selectTree" import { getTreeItem } from "@/common/myFun.js" +import { getMenuListOne, getMenuListTwo } from "@/api/flow" export default { name: "qbfsStep1", @@ -1084,28 +1085,19 @@ export default { // 企业标准树 getMenuListOne() { return new Promise((resolve, reject) => { - this.$http._getData('sarResource/ts-resource/getListStandLimitData', { - sorDivide: 'BUSINESS_STAND', - userId: this.$store.getters.userInfo.userId - }).then(res=>{ + getMenuListOne('BUSINESS_STAND', this.$store.getters.userInfo.userId).then(res=>{ if(res && res.data) resolve(res.data) - }).catch(e=>{ - console.log(e) - }) + }).catch(e => reject(e)) }) }, // 技术体系树 getMenuListTwo() { return new Promise((resolve, reject) => { - this.$http._getData('lawss/sarMenuStandardLimit/getListStandLimit', { - dicId: '9m4qqqaansxmox5e82zm' - }).then(res=>{ + getMenuListTwo('9m4qqqaansxmox5e82zm').then(res=>{ if(res && res.data) resolve(res.data) - }).catch(e=>{ - console.log(e) - }) + }).catch(e => reject(e)) }) }, getStandDataBtns(){ diff --git a/src/pages/regulatoryRepository/enterpriseStandardDatabase/components/EnterpriseStandardDatabase.vue b/src/pages/regulatoryRepository/enterpriseStandardDatabase/components/EnterpriseStandardDatabase.vue index ff9e11d62..2d228c66a 100644 --- a/src/pages/regulatoryRepository/enterpriseStandardDatabase/components/EnterpriseStandardDatabase.vue +++ b/src/pages/regulatoryRepository/enterpriseStandardDatabase/components/EnterpriseStandardDatabase.vue @@ -1772,6 +1772,7 @@ import ProcessTitle from "@/pages/processCenter/pages/components/ProcessTitle"; import treeSelectModule from "@/components/treeSelect/treeSelectModule.vue"; import selectTree from "@/components/abc/selectTree/selectTree" import { getTreeItem } from "@/common/myFun.js" +import { getMenuListOne, getMenuListTwo } from "@/api/flow" import {mapGetters} from "vuex"; import store from "@/store"; @@ -2670,28 +2671,19 @@ export default { // 企业标准树 getMenuListOne() { return new Promise((resolve, reject) => { - this.$http._getData('sarResource/ts-resource/getListStandLimitData', { - sorDivide: 'BUSINESS_STAND', - userId: this.$store.getters.userInfo.userId - }).then(res=>{ + getMenuListOne('BUSINESS_STAND', this.$store.getters.userInfo.userId).then(res=>{ if(res && res.data) resolve(res.data) - }).catch(e=>{ - console.log(e) - }) + }).catch(e => reject(e)) }) }, // 技术体系树 getMenuListTwo() { return new Promise((resolve, reject) => { - this.$http._getData('lawss/sarMenuStandardLimit/getListStandLimit', { - dicId: '9m4qqqaansxmox5e82zm' - }).then(res=>{ + getMenuListTwo('9m4qqqaansxmox5e82zm').then(res=>{ if(res && res.data) resolve(res.data) - }).catch(e=>{ - console.log(e) - }) + }).catch(e => reject(e)) }) }, replaceLawsNumModelCancel () { From 42c074c210790882a033e4837df7e8bbe8c91a1e Mon Sep 17 00:00:00 2001 From: zyn Date: Tue, 25 Apr 2023 17:12:55 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=A0=87=E5=87=86=E7=B1=BB=E5=88=AB?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/myFun.js | 26 ++++++++++++++++--- .../pages/creatProcess/qbfs/step1.vue | 6 +++-- .../components/EnterpriseStandardDatabase.vue | 6 +++-- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/common/myFun.js b/src/common/myFun.js index 0a34d4ae9..68df75b1b 100644 --- a/src/common/myFun.js +++ b/src/common/myFun.js @@ -1,11 +1,31 @@ function getTreeItem(tree, id){ - let result = {} - tree.map(item => { + // 方法1 返回数组 + // let result = [] + // tree.forEach(item => { + // if(item.id === id){ + // result.push(item) + // }else{ + // if(item.children.length > 0){ + // // 内部函数返回值需要传递给最外层函数 + // let res = getTreeItem(item.children, id) + // result = result.concat(res) + // } + // } + // }) + // return result + // 方法2 返回对象 + let result = null + tree.forEach(item => { if(item.id === id){ result = item + // result.push(item) }else{ if(item.children.length > 0){ - getTreeItem(item.children) + // 内部函数返回值需要传递给最外层函数 + let res = getTreeItem(item.children, id) + if(res !== null){ + result = res + } } } }) diff --git a/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue b/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue index a23dece6a..636c840c1 100644 --- a/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue +++ b/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue @@ -948,7 +948,8 @@ export default { getReplaceLawsNumRow () { this.replaceLawsNumForm.userId = this.$store.getters.userInfo.userId let currentTreeItem = getTreeItem(this.selectTreeList, this.replaceLawsNumForm.menuId) - this.replaceLawsNumForm.treeType = currentTreeItem.treeType + if(currentTreeItem && currentTreeItem.treeType) + this.replaceLawsNumForm.treeType = currentTreeItem.treeType if(this.replaceLawsNumForm.issueTimeArr && this.replaceLawsNumForm.issueTimeArr.length > 0){ this.replaceLawsNumForm.issueTimeStart = this.replaceLawsNumForm.issueTimeArr[0] || null @@ -992,7 +993,8 @@ export default { getReplaceLawsNumRowFirst () { this.replaceLawsNumForm.userId = this.$store.getters.userInfo.userId let currentTreeItem = getTreeItem(this.selectTreeList, this.replaceLawsNumForm.menuId) - this.replaceLawsNumForm.treeType = currentTreeItem.treeType + if(currentTreeItem && currentTreeItem.treeType) + this.replaceLawsNumForm.treeType = currentTreeItem.treeType this.replaceLawsNumForm.page = 1 this.replacePage = 1 diff --git a/src/pages/regulatoryRepository/enterpriseStandardDatabase/components/EnterpriseStandardDatabase.vue b/src/pages/regulatoryRepository/enterpriseStandardDatabase/components/EnterpriseStandardDatabase.vue index 2d228c66a..39b2a643c 100644 --- a/src/pages/regulatoryRepository/enterpriseStandardDatabase/components/EnterpriseStandardDatabase.vue +++ b/src/pages/regulatoryRepository/enterpriseStandardDatabase/components/EnterpriseStandardDatabase.vue @@ -2726,7 +2726,8 @@ export default { getReplaceLawsNumRow () { this.replaceLawsNumForm.userId = this.$store.getters.userInfo.userId let currentTreeItem = getTreeItem(this.selectTreeList, this.replaceLawsNumForm.menuId) - this.replaceLawsNumForm.treeType = currentTreeItem.treeType + if(currentTreeItem && currentTreeItem.treeType) + this.replaceLawsNumForm.treeType = currentTreeItem.treeType if(this.replaceLawsNumForm.issueTimeArr && this.replaceLawsNumForm.issueTimeArr.length > 0){ this.replaceLawsNumForm.issueTimeStart = this.replaceLawsNumForm.issueTimeArr[0] || null @@ -2763,7 +2764,8 @@ export default { getReplaceLawsNumRowFirst () { this.replaceLawsNumForm.userId = this.$store.getters.userInfo.userId let currentTreeItem = getTreeItem(this.selectTreeList, this.replaceLawsNumForm.menuId) - this.replaceLawsNumForm.treeType = currentTreeItem.treeType + if(currentTreeItem && currentTreeItem.treeType) + this.replaceLawsNumForm.treeType = currentTreeItem.treeType this.replaceLawsNumForm.page = 1 this.replacePage = 1 From e5a5691987a0d23da39cf19d407e8f76bc38a904 Mon Sep 17 00:00:00 2001 From: zyn Date: Tue, 25 Apr 2023 17:27:26 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B5=B7=E8=8D=89?= =?UTF-8?q?=E4=BA=BA=E3=80=81=E8=B5=B7=E8=8D=89=E5=8D=95=E4=BD=8D=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/EnterpriseStandardDatabase.vue | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/pages/regulatoryRepository/enterpriseStandardDatabase/components/EnterpriseStandardDatabase.vue b/src/pages/regulatoryRepository/enterpriseStandardDatabase/components/EnterpriseStandardDatabase.vue index 39b2a643c..db99ba5c4 100644 --- a/src/pages/regulatoryRepository/enterpriseStandardDatabase/components/EnterpriseStandardDatabase.vue +++ b/src/pages/regulatoryRepository/enterpriseStandardDatabase/components/EnterpriseStandardDatabase.vue @@ -1466,7 +1466,7 @@ @@ -1576,6 +1576,24 @@ {{ filterOp(scope.row.reviewResults) }} + + + + + + {{$t('m.dataAcquisition')}}