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 { - +