From 742cf9974f20f08287682f5815cea32ec3406126 Mon Sep 17 00:00:00 2001 From: laozt <2721205210@qq.com> Date: Fri, 22 Dec 2023 09:46:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/yingji/enterprise.js | 48 ++++++++++++++----------- src/views/components/AddDialog/tab3.vue | 21 +++++++++-- src/views/yingji/enforcing.vue | 4 +-- 3 files changed, 49 insertions(+), 24 deletions(-) diff --git a/src/api/yingji/enterprise.js b/src/api/yingji/enterprise.js index af7af6b..4539da1 100644 --- a/src/api/yingji/enterprise.js +++ b/src/api/yingji/enterprise.js @@ -1,46 +1,54 @@ -import request from '@/utils/request' +import request from "@/utils/request"; // 查询计划企业列表 export function listEnterprise(query) { return request({ - url: '/pharmaceuticals/bPlanEnterprise/list', - method: 'get', - params: query - }) + url: "/pharmaceuticals/bPlanEnterprise/list", + method: "get", + params: query, + }); } // 查询计划企业详细 export function getEnterprise(id) { return request({ - url: '/system/enterprise/' + id, - method: 'get' - }) + url: "/system/enterprise/" + id, + method: "get", + }); } // 新增计划企业 export function addEnterprise(data) { return request({ - url: '/pharmaceuticals/bPlanEnterprise', - method: 'post', - data: data - }) + url: "/pharmaceuticals/bPlanEnterprise", + method: "post", + data: data, + }); } // 修改计划企业 export function updateEnterprise(data) { return request({ - url: '/pharmaceuticals/bPlanEnterprise', - method: 'put', - data: data - }) + url: "/pharmaceuticals/bPlanEnterprise", + method: "put", + data: data, + }); +} + +// 批量提交企业 +export function updateIdList(idList) { + return request({ + url: "/pharmaceuticals/bPlanEnterprise/updateIdList?idListStr=" + idList, + method: "post", + }); } // 删除计划企业 export function delEnterprise(id) { return request({ - url: '/pharmaceuticals/bPlanEnterprise?idList=' + id, - method: 'delete' - }) + url: "/pharmaceuticals/bPlanEnterprise?idList=" + id, + method: "delete", + }); } // 首页表格 @@ -50,4 +58,4 @@ export function treeEnterprise(params) { method: "get", params, }); -} \ No newline at end of file +} diff --git a/src/views/components/AddDialog/tab3.vue b/src/views/components/AddDialog/tab3.vue index 399c351..4e44d85 100644 --- a/src/views/components/AddDialog/tab3.vue +++ b/src/views/components/AddDialog/tab3.vue @@ -34,7 +34,11 @@ - + @@ -80,6 +84,7 @@ import { getEnterprise, delEnterprise, addEnterprise, + updateIdList, updateEnterprise, } from "@/api/yingji/enterprise"; @@ -149,6 +154,18 @@ export default { }); }, methods: { + onSubmit() { + console.log(); + let ids = [] + this.enterpriseList.map(item=>{ + ids.push( item.id) + + }) + updateIdList(ids.join(',')).then((response) => { + this.$modal.msgSuccess("提交成功"); + this.getList(); + }); + }, // 编辑月份 editMonth(row) { let _this = this; diff --git a/src/views/yingji/enforcing.vue b/src/views/yingji/enforcing.vue index b3ac64b..efd161c 100644 --- a/src/views/yingji/enforcing.vue +++ b/src/views/yingji/enforcing.vue @@ -481,7 +481,7 @@ export default { console.log(e); this.addShow = true; this.detailLoad = true; - enforcingGet(e.longId).then((res) => { + enforcingGet(e.checkId).then((res) => { for (let key in res.data) { this.listDes.forEach((value1, index1) => { if (key == value1.eng) { @@ -537,7 +537,7 @@ export default { getList() { this.loads = true; enforcingDetail(this.searchBefore).then((res) => { - console.log(res); + // console.log(res); this.tableData = res.rows; this.total = res.total; this.loads = false;