From a1444ca06f12ee886ab6285507f96e184ebe6844 Mon Sep 17 00:00:00 2001 From: zty Date: Tue, 14 Oct 2025 16:48:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20ofm=20=E4=BF=AE=E6=94=B9=E8=BD=A6?= =?UTF-8?q?=E8=BE=86=20=E5=8D=B0=E7=AB=A0=E7=9A=84=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E7=AE=A1=E7=90=86=20=E4=BB=A5=E5=8F=8A=20=E5=8F=8D=E5=AD=98tic?= =?UTF-8?q?ket=5Fdata?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ofm/seal.vue | 6 +++- src/views/ofm/sealForm.vue | 46 ++++++++++++++++++---------- src/views/ofm/vehicle.vue | 31 ++++++++++--------- src/views/ofm/vehicleForm.vue | 56 ++++++++++++++++++++++------------- 4 files changed, 86 insertions(+), 53 deletions(-) diff --git a/src/views/ofm/seal.vue b/src/views/ofm/seal.vue index 656fb095..d0e61753 100644 --- a/src/views/ofm/seal.vue +++ b/src/views/ofm/seal.vue @@ -250,7 +250,11 @@ export default { this.mode = "view"; this.editId = row.id; this.limitedVisible = true; - this.lending_type = 'outer'; + if (row.is_lending) { + this.lending_type = "outer"; + } else { + this.lending_type = ""; + } this.addForm = Object.assign({}, row); if (row.lending_date && row.return_date) { this.timeRange = [row.lending_date, row.return_date]; diff --git a/src/views/ofm/sealForm.vue b/src/views/ofm/sealForm.vue index a4a2b26f..b932d2da 100644 --- a/src/views/ofm/sealForm.vue +++ b/src/views/ofm/sealForm.vue @@ -40,7 +40,7 @@ @change="handleDateChange"> - + @@ -76,7 +75,12 @@ - + @@ -85,6 +89,7 @@ :title="ticketTitle" :t_id="localForm.id" :ticket_="localForm.ticket_" + :ticket_data="ticket_data" :submit_b_func="submit_b_func" ref="ticketd_b_start" @success="$emit('success')" @@ -95,6 +100,7 @@ @@ -115,6 +121,7 @@ export default { emits: ["update:modelValue", "submit", "cancel"], data() { return { + ticket_data: {}, ticketTitle: "用印申请", localForm: { ...this.modelValue }, timeRange: [], @@ -125,24 +132,31 @@ export default { }, mounted() { this.initTimeRange(); - }, - watch: { - // 父组件数据变动 -> 同步到本地 - modelValue: { - handler(val) { - this.localForm = { ...val }; - this.initTimeRange(); - }, - deep: true, + if(this.lending_type === 'outer'){ + this.ticket_data = { + is_lending: true + }; + }else{ + this.ticket_data={is_lending: false} + }; }, - // 本地数据变动 -> 同步回父组件 - localForm: { - handler(val) { + watch: { + 'localForm.actual_return_date'(val) { + this.ticket_data.actual_return_date = val + console.log('ticket_data发生变化',this.ticket_data) + }, + }, + computed: { + addForm: { + get() { + return this.modelValue; + }, + set(val) { this.$emit("update:modelValue", val); }, - deep: true, }, }, + methods: { handleDateChange(val) { this.localForm.lending_date = val?.[0] || null diff --git a/src/views/ofm/vehicle.vue b/src/views/ofm/vehicle.vue index 7d14e64d..c4b4318d 100644 --- a/src/views/ofm/vehicle.vue +++ b/src/views/ofm/vehicle.vue @@ -66,17 +66,17 @@ min-width="100" > @@ -90,7 +90,7 @@ v-auth="'vehicle.update'" >详情 - + @@ -232,23 +232,22 @@ export default { this.$refs.table.refresh(); } }); - } - }, + }, async vehicleDel(row) { - var id = row.id; - var res = await this.$API.ofm.vehicle.delete.req(id); - if (res.err_msg) { - this.$message.error(res.err_msg); - } else { - this.$refs.table.refresh(); - this.$message.success("删除成功"); - } + var id = row.id; + var res = await this.$API.ofm.vehicle.delete.req(id); + if (res.err_msg) { + this.$message.error(res.err_msg); + } else { + this.$refs.table.refresh(); + this.$message.success("删除成功"); + } }, //搜索 handleQuery() { this.$refs.table.queryData(this.query); }, - + } };