From d73f643144694aa5176c0bfa0466296c3dad69e4 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期六, 15 二月 2025 10:54:02 +0800 Subject: [PATCH] 客户管理联调 --- src/views/system/user/index.vue | 4 ++-- src/api/system/user.js | 2 +- src/views/system/customer/index.vue | 32 +++++++++++++++++++++++++++++--- src/api/system/customer.js | 12 ++++++------ 4 files changed, 38 insertions(+), 12 deletions(-) diff --git a/src/api/system/customer.js b/src/api/system/customer.js index a218cfb..2399a5f 100644 --- a/src/api/system/customer.js +++ b/src/api/system/customer.js @@ -3,7 +3,7 @@ // 鏌ヨ瀹㈡埛鍒楄〃 export function selectCustomPageList(query) { return request({ - url: '/system/user/selectCustomPageList', + url: '/system/custom/selectCustomPageList', method: 'get', params: query }) @@ -11,23 +11,23 @@ // 鏂板瀹㈡埛 export function addCustom(query) { return request({ - url: '/system/user/addCustom', + url: '/system/custom/addCustom', method: 'post', - params: query + data: query }) } // 淇敼瀹㈡埛 export function upCustom(query) { return request({ - url: '/system/user/upCustom', + url: '/system/custom/upCustom', method: 'post', - params: query + data: query }) } // 鍒犻櫎瀹㈡埛 export function delCustomById(query) { return request({ - url: '/system/user/delCustomById', + url: '/system/custom/delCustomById', method: 'post', params: query }) diff --git a/src/api/system/user.js b/src/api/system/user.js index 13fb049..403ace7 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -168,7 +168,7 @@ // 鑾峰彇鍗曚綅 export function selectCustomEnum() { return request({ - url: '/user/selectCustomEnum', + url: '/system/custom/selectCustomEnum', method: 'get', }) } diff --git a/src/views/system/customer/index.vue b/src/views/system/customer/index.vue index 169b755..b6d0e30 100644 --- a/src/views/system/customer/index.vue +++ b/src/views/system/customer/index.vue @@ -59,7 +59,7 @@ <script> import limsTable from '@/components/Table/lims-table.vue' -import {addCustom, selectCustomPageList, upCustom} from "@/api/system/customer"; +import {addCustom, delCustomById, selectCustomPageList, upCustom} from "@/api/system/customer"; export default { components: { limsTable @@ -89,6 +89,12 @@ type: 'text', clickFun: (row) => { this.openFormDia('edit', row); + }, + },{ + name: '鍒犻櫎', + type: 'text', + clickFun: (row) => { + this.delete(row); }, }, ] @@ -128,8 +134,8 @@ selectCustomPageList({...this.queryParams, ...this.page}).then(res => { this.tableLoading = false if (res.code === 200) { - this.tableData = res.data - this.page.total = res.total + this.tableData = res.data.records + this.page.total = res.data.total } }).catch(err => { this.tableLoading = false @@ -144,6 +150,9 @@ this.addDia = true this.formTitle = type === 'add' ? '鏂板瀹㈡埛' : '缂栬緫瀹㈡埛' this.operationType = type + if (type === 'edit') { + this.user = row + } }, customAdd() { this.$refs['userForm'].validate((valid) => { @@ -176,6 +185,23 @@ reset () { this.addDia = false this.resetForm("userForm"); + }, + delete (row) { + this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }).then(() => { + delCustomById({id: row.id}).then(res => { + if (res.code === 500) { + return + } + this.$message.success('鍒犻櫎鎴愬姛') + this.getList() + }).catch(e => { + this.$message.error('鍒犻櫎澶辫触') + }) + }).catch(() => {}) } } } diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 601da3b..dcfc2e9 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -127,8 +127,8 @@ <el-row> <el-col :span="12"> <el-form-item label="鍗曚綅" prop="company"> - <el-select v-model="form.company" placeholder="璇烽�夋嫨宀椾綅" style="width: 100%" clearable> - <el-option v-for="item in postOptions" :key="item.postId" :label="item.postName" :value="item.postId"></el-option> + <el-select v-model="form.company" placeholder="璇烽�夋嫨鍗曚綅" style="width: 100%" clearable> + <el-option v-for="item in postOptions" :key="item.id" :label="item.company" :value="item.id"></el-option> </el-select> </el-form-item> </el-col> -- Gitblit v1.9.3