From d3eb58a1a7fb9329289ccd750f39dc1d3f2d2e6b Mon Sep 17 00:00:00 2001 From: TiaStars Date: Wed, 27 Sep 2023 11:43:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/yingji/index.js | 25 +- src/views/components/dialog/index.vue | 120 ++++--- src/views/components/dialogInfo/index.vue | 380 +++++++++++++++++++++- src/views/components/dialogTwo/index.vue | 269 +++++++-------- src/views/yingji/planManage.vue | 89 ++--- 5 files changed, 660 insertions(+), 223 deletions(-) diff --git a/src/api/yingji/index.js b/src/api/yingji/index.js index e1ea78a..ca5328a 100644 --- a/src/api/yingji/index.js +++ b/src/api/yingji/index.js @@ -4,7 +4,7 @@ * @Author: JC9527 * @Date: 2023-09-11 15:38:21 * @LastEditors: JC9527 - * @LastEditTime: 2023-09-25 13:17:19 + * @LastEditTime: 2023-09-27 09:30:39 */ import request from '@/utils/request' @@ -63,4 +63,27 @@ export default { params }); }, + // 查看计划明细 + planmx(data){ + return request({ + url: `/pharmaceuticals/bPlanEnterprise/planmx`, + method:'post', + data, + }); + }, + // 查询计划企业列表 + bPlanEnterpriseList(){ + return request({ + url: `/pharmaceuticals/bPlanEnterprise/list`, + method:'get', + }); + }, + // 根据行政区划查询重点企业数量 + getBydistrict(params){ + return request({ + url: `/pharmaceuticals/bKeyEnterprise/getBydistrict`, + method:'get', + params + }); + }, }; \ No newline at end of file diff --git a/src/views/components/dialog/index.vue b/src/views/components/dialog/index.vue index fe72a4c..62d9cad 100644 --- a/src/views/components/dialog/index.vue +++ b/src/views/components/dialog/index.vue @@ -69,8 +69,8 @@
行业类型:
@@ -81,7 +81,7 @@
是否重点:
- +
@@ -202,7 +202,7 @@ :class="scope.row.isPoint == '1' ? 'isStyle' : ''" > - +
@@ -334,7 +334,7 @@ export default { loading: false, isamend: false, amendId: "", - // count: 0, + count: 0, // unCount: 0, // unselected: 0, selectList: [], @@ -346,6 +346,20 @@ export default { dept: (state) => state.user.dept, }), }, + watch:{ + tableData:{ + handler(newData,oldData){ + newData.map((item)=>{ + if(item.isPoint == 1) { + this.$nextTick(() => { + this.$refs.multipleTable.toggleRowSelection(item,false); + }); + } + }) + }, + deep:true, + } + }, methods: { // 搜索 filtrate() { @@ -359,11 +373,11 @@ export default { if(this.form.subdistrict.length > 0){ if(this.form.subdistrict.length == 2) { this.form.subdistrict = this.form.subdistrict[1] - this.subdistrict = this.form.subdistrict.slice(0, 11); + this.subdistrict = this.form.subdistrict.slice(1, 11); obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict }; } else if(this.form.subdistrict.length == 1) { this.form.subdistrict = this.form.subdistrict[0] - this.subdistrict = this.form.subdistrict.slice(0, 7); + this.subdistrict = this.form.subdistrict.slice(1, 8); obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict }; } } else { @@ -371,11 +385,11 @@ export default { } } else { // 不是苏州市是区县 - if(this.dept.parentId == 100) { - this.subdistrict = this.form.subdistrict.slice(0, 7); + if(this.dept.ancestors.split(',').length == 2) { + this.subdistrict = this.form.subdistrict.slice(1, 8); obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict }; - } else if(this.dept.parentId == 101){ - this.subdistrict = this.form.subdistrict.slice(0, 11); + } else if(this.dept.ancestors.split(',').length == 3){ + this.subdistrict = this.form.subdistrict.slice(1, 11); obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict }; } } @@ -419,41 +433,41 @@ export default { return row.unselected; }, // 选中企业的获取 - // async bPlanEnterprise() { - // let count = 0; - // let data = await this.$api.yingji.bPlanEnterprise(); - // this.selectList = data.data; - // console.log(data) - // data.data.map((item) => { - // item["uscCode"] = item.enterpriseId; - // this.$nextTick(() => { - // this.$refs.multipleTable.toggleRowSelection(item, false); - // }); - // if (item.isPoint == 1) { - // count += 1; - // } - // }); - // console.log(count,'count') - // this.unselected = count; - // }, + async bPlanEnterprise() { + let count = 0; + let data = await this.$api.yingji.bPlanEnterpriseList(); + this.selectList = data.data; + console.log(data) + data.data.map((item) => { + item["uscCode"] = item.enterpriseId; + this.$nextTick(() => { + this.$refs.multipleTable.toggleRowSelection(item, false); + }); + if (item.isPoint == '1') { + count += 1; + } + }); + // console.log(count,'count') + this.unselected = count; + }, + // 乡镇获取企业重点总数 + async gettownNumbers(){ + let data = await this.$api.yingji.getBydistrict({district:this.form.subdistrict}) + this.count = data.data; + }, // 打开 async open(item,dept) { this.dialogVisible = true; // this.dept = dept let data = await this.$api.yingji.tree(); // 行政区划 this.commentData(data.data,dept); + this.bPlanEnterprise(); this.filtrate() if (item == "newlyIncreased") { // 判断如若是镇级即将所有重点企业全选 - // if(dept.parentId == 101){ - // this.tableData.map((item)=>{ - // if(item.isPoint == 1) { - // this.$nextTick(() => { - // this.$refs.multipleTable.toggleRowSelection(item); - // }); - // } - // }) - // } + if(dept.ancestors.split(',').length == 3){ + this.gettownNumbers(); + } // this.getTable(this.pages); } else { this.amendId = item.id; @@ -520,8 +534,14 @@ export default { }, // 页码,当前页切换事件 pagesChange(pages) { - this.getTable(pages); this.pages = pages; + console.log(this.form) + if(this.dept.ancestors.split(',').length == 2){ + this.subdistrict = this.form.subdistrict.slice(1, 8); + } else if(this.dept.ancestors.split(',').length == 3){ + this.subdistrict = this.form.subdistrict.slice(1, 11); + } + this.getTable({...pages,...this.form,subdistrict:this.subdistrict}); }, // 选中的数据 handleSelectionChange(val) { @@ -557,14 +577,14 @@ export default { this.$message.error("请至少选择一家企业"); return; } - // if (this.dept.parentId == 101) { - // if (this.count == this.unselected + keyCount) { - // this.nextStep = true; - // this.nextText = "发布计划"; - // } else { - // this.$message.error("请将重点企业全选"); - // } - // } + if (this.dept.ancestors.split(',').length == 3) { + if (this.count == this.unselected + keyCount) { + this.nextStep = true; + this.nextText = "发布计划"; + } else { + this.$message.error("请将重点企业全选"); + } + } else { this.nextStep = true; this.nextText = "发布计划"; @@ -613,6 +633,8 @@ export default { type: "success", }); this.Close("newsuccess"); + } else { + downloadLoadingInstance.close(); } } } else { @@ -643,7 +665,7 @@ export default { } }) this.listOne = item - if(dept.parentId == 100) { + if(dept.ancestors.split(',').length == 2) { this.listOne = this.listOne.filter((item)=>{ return item.institutionName == dept.deptName }) @@ -655,7 +677,7 @@ export default { } }) this.disabled = true; - } else if(dept.parentId == 101) { + } else if(dept.ancestors.split(',').length == 3) { this.listOne.map((item)=>{ if(item.institutionName == dept.deptName) { this.form.subdistrict = item.subdistrict @@ -791,7 +813,7 @@ export default { } ::v-deep .el-select { background-color: transparent; - width: 160px; + width: 180px; .el-input__inner { height: 33px; } diff --git a/src/views/components/dialogInfo/index.vue b/src/views/components/dialogInfo/index.vue index 0e3a7b2..57d624f 100644 --- a/src/views/components/dialogInfo/index.vue +++ b/src/views/components/dialogInfo/index.vue @@ -6,7 +6,7 @@ :close-on-click-modal="false" append-to-body custom-class="dialog-boxed" - width="70%" + width="60%" >
@@ -19,7 +19,7 @@
- + diff --git a/src/views/components/dialogTwo/index.vue b/src/views/components/dialogTwo/index.vue index 94c2655..9ae6db7 100644 --- a/src/views/components/dialogTwo/index.vue +++ b/src/views/components/dialogTwo/index.vue @@ -1,141 +1,148 @@ @@ -456,12 +463,18 @@ justify-content: center; flex: 1; .area-span { - font-size: 20px; + // font-size: 20px; + // font-family: 'Alibaba PuHuiTi'; + // font-weight: bold; + // color: #525966; + // line-height: 40px; + // margin-right: 100px; + font-size: 14px; font-family: 'Alibaba PuHuiTi'; - font-weight: bold; + font-weight: 400; color: #525966; line-height: 40px; - margin-right: 100px; + margin-right: 10px; } ::v-deep .el-cascader { background-color: transparent; @@ -590,7 +603,7 @@ .look,.change,.delete { display: flex; align-items: center; - // margin-right: 30px; + margin-right: 30px; cursor: pointer; img { width: 20px;