From f16c91bc9b96c415b7129e3eccf29b5b9f93d7a3 Mon Sep 17 00:00:00 2001 From: zhuo <2089219845@qq.com> Date: 星期三, 26 三月 2025 08:29:13 +0800 Subject: [PATCH] 工时查询修改, 样品搜索问题修复 --- src/views/system/customer/index.vue | 68 +++++++++++++++++++++++++++------- 1 files changed, 54 insertions(+), 14 deletions(-) diff --git a/src/views/system/customer/index.vue b/src/views/system/customer/index.vue index bdd5b8f..d7dd187 100644 --- a/src/views/system/customer/index.vue +++ b/src/views/system/customer/index.vue @@ -8,8 +8,8 @@ @keyup.enter.native="getList"></el-input> </el-form-item> <el-form-item> - <el-button type="primary" icon="el-icon-search" size="mini" @click="getList">鏌� 璇�</el-button> - <el-button icon="el-icon-refresh" size="mini" @click="refresh">閲� 缃�</el-button> + <el-button type="primary" size="mini" @click="getList">鏌ヨ</el-button> + <el-button size="mini" @click="refresh">閲嶇疆</el-button> </el-form-item> </el-form> </div> @@ -18,7 +18,10 @@ </div> </div> <div> - <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading"></lims-table> + <lims-table :tableData="tableData" :column="column" + :height="'calc(100vh - 250px)'" + :page="page" :tableLoading="tableLoading" + @pagination="pagination"></lims-table> </div> <el-dialog :title="formTitle" :visible.sync="addDia" width="450px"> <el-form ref="userForm" :model="user" :rules="userRules" label-position="right" label-width="100px"> @@ -59,8 +62,9 @@ <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 { + name: 'Customer', components: { limsTable }, @@ -90,13 +94,19 @@ clickFun: (row) => { this.openFormDia('edit', row); }, + },{ + name: '鍒犻櫎', + type: 'text', + clickFun: (row) => { + this.delete(row); + }, }, ] } ], page: { total:0, - size:10, + size:20, current:0 }, tableLoading: false, @@ -106,13 +116,13 @@ addDia: false, addPower: true, user: { - name: null + company: '' }, userRules: { company: [{ required: true, message: '璇疯緭鍏ュ鎴峰悕绉�', trigger: 'blur' }], companyEn: [{ required: true, message: '璇疯緭鍏ュ鎴峰悕绉癊N', trigger: 'blur' }], address: [{ required: true, message: '璇疯緭鍏ュ崟浣嶅湴鍧�', trigger: 'blur' }], - addressEn: [{ required: true, message: '璇疯緭鍗曚綅鍦板潃EN', trigger: 'blur' }], + addressEn: [{ required: true, message: '璇疯緭鍏ュ崟浣嶅湴鍧�EN', trigger: 'blur' }], num: [{ required: true, message: '璇疯緭鍏ュ姞鎬ラ搴�', trigger: 'blur' }], code2: [{ required: true, message: '璇疯緭鍏ュ鎴风紪鍙�', trigger: 'blur' }], }, @@ -130,8 +140,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 @@ -142,10 +152,18 @@ this.queryParams.company = '' this.getList() }, + pagination (page) { + this.page.size = page.limit + this.getList() + }, openFormDia (type, row) { this.addDia = true + this.user = {} this.formTitle = type === 'add' ? '鏂板瀹㈡埛' : '缂栬緫瀹㈡埛' this.operationType = type + if (type === 'edit') { + this.user = this.HaveJson(row) + } }, customAdd() { this.$refs['userForm'].validate((valid) => { @@ -153,27 +171,49 @@ this.loading = true if (this.operationType === 'add') { addCustom(this.user).then(res => { - if (res.code === 201) return + this.loading = false + if (res.code !== 200) return this.$message.success('鏂板鎴愬姛') this.getList() - this.loading = false this.reset() + }).catch(err => { + this.loading = false }) } else { upCustom(this.user).then(res => { - if (res.code === 201) return + this.loading = false + if (res.code !== 200) return this.$message.success('淇敼鎴愬姛') this.getList() - this.loading = false this.reset() + }).catch(err => { + this.loading = false }) } } }) }, reset () { - this.addDia = false + this.user = {} this.resetForm("userForm"); + this.addDia = false + }, + 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(() => {}) } } } -- Gitblit v1.9.3