From 290ecb6823d9489ef0acfe6c585bbda82cf3d8d8 Mon Sep 17 00:00:00 2001 From: aixianling Date: Thu, 26 Dec 2024 11:57:58 +0800 Subject: [PATCH] =?UTF-8?q?(xfeatumu):=20=E4=BC=98=E5=8C=96=E8=80=B3?= =?UTF-8?q?=E6=A0=87=E7=99=BB=E8=AE=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 etAdd组件,增加耳标录入的增删功能 - 更新 etList - 重构 AiTable 组件组件,使机构选择框只读,优化表格列的渲染逻辑 --- project/xumu/AppEarTag/etAdd.vue | 58 ++++++++++++++----------------- project/xumu/AppEarTag/etList.vue | 2 +- ui/packages/basic/AiTable.vue | 33 +++++++++++++++--- 3 files changed, 57 insertions(+), 36 deletions(-) diff --git a/project/xumu/AppEarTag/etAdd.vue b/project/xumu/AppEarTag/etAdd.vue index 75307ce2..f2aea45d 100644 --- a/project/xumu/AppEarTag/etAdd.vue +++ b/project/xumu/AppEarTag/etAdd.vue @@ -4,14 +4,14 @@ import AiSelect from "dui/packages/basic/AiSelect.vue"; const columns = [ {label: "序号", type: "index"}, - {label: "生物芯片耳标号", prop: "biochipEarNumber"}, - {label: "电子耳标号", prop: "electronicEarNumber"}, - {label: "原厂耳标号", prop: "originalEarNumber"}, - {label: "戴耳标照片", prop: "picture", upload: 1}, - {label: "品种", prop: "variety", select: 1, dict: "variety"}, - {label: "类别", prop: "category", select: 1, dict: "category"}, - {label: "日龄/天", prop: "age", edit: 1}, - {label: "体重/公斤", prop: "weight", edit: 1}, + {label: "生物芯片耳标号", prop: "biochipEarNumber", edit: 1}, + {label: "电子耳标号", prop: "electronicEarNumber", edit: 1}, + {label: "原厂耳标号", prop: "originalEarNumber", edit: 1}, + {label: "戴耳标照片", prop: "picture", upload: {valueIsUrl: !0}}, + {label: "品种", prop: "variety", select: {dict: "variety"}}, + {label: "类别", prop: "category", select: {dict: "category"}}, + {label: "日龄/天", prop: "age", num: 1}, + {label: "体重/公斤", prop: "weight", num: 1}, ] export default { name: "etAdd", @@ -23,7 +23,7 @@ export default { }, data() { return { - detail: {}, + detail: {detailList: []}, columns, } }, @@ -43,24 +43,16 @@ export default { }, getDetail() { const {id} = this.$route.query - return this.instance.post("/api/breed/earTag/page", {id}).then(res => { + return id && this.instance.post("/api/breed/earTag/page", {id}).then(res => { if (res?.data?.records) { const detail = res.data.records[0] || {} - return this.detail = {...detail} - } - }) - }, - getList() { - const {penId} = this.detail - this.instance.post("/api/breed/earTag/getEarTagByPenId", null, {params: {penId}}).then(res => { - if (res?.data) { - this.$set(this.detail, 'detailList', res.data) + return this.detail = {detailList: [], ...detail} } }) }, handleDelete(index) { this.$confirm("确定删除该条数据?").then(() => { - this.detail.splice(index, 1) + this.detail.detailList.splice(index, 1) }) }, submit() { @@ -93,7 +85,7 @@ export default { - +