From faa18d72d96b72f64197521e15393d06715ef6b1 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Fri, 14 Jun 2024 15:08:46 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=BB=E8=BE=91=E8=B0=83=E4=BB=A4=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bigScreen1/component/detailTransfer.vue | 4 +- src/views/order/orderSummary.vue | 63 ++++++++++++++++--- 2 files changed, 55 insertions(+), 12 deletions(-) diff --git a/src/views/bigScreen1/component/detailTransfer.vue b/src/views/bigScreen1/component/detailTransfer.vue index a1eb468..87ce8e2 100644 --- a/src/views/bigScreen1/component/detailTransfer.vue +++ b/src/views/bigScreen1/component/detailTransfer.vue @@ -50,7 +50,7 @@ -
+
接收时间:{{ $moment(data.receive_time).format("YYYY-MM-DD HH:mm") }}
通知开启:{{ $moment(data.notice_open_time).format("YYYY-MM-DD HH:mm") }}
开启时间:{{ $moment(data.open_time).format("YYYY-MM-DD HH:mm") }}
@@ -585,7 +585,7 @@ export default { } } if (this.data.diaolingleixing === 4) { - if (this.$moment().valueOf() > this.$moment(this.data.end_time).valueOf()) { + if (this.$moment().valueOf() < this.$moment(this.data.end_time).valueOf()) { copyData.status = 3; } } diff --git a/src/views/order/orderSummary.vue b/src/views/order/orderSummary.vue index ace413d..94adb94 100644 --- a/src/views/order/orderSummary.vue +++ b/src/views/order/orderSummary.vue @@ -28,7 +28,7 @@
- +
{{ selectDate[0] ? $moment(selectDate[0]).format('YYYY-MM-DD') : "-" }} ~ {{ selectDate[1] ? $moment(selectDate[1]).format('YYYY-MM-DD') : "-" }}调度指令执行情况

{{ weather.weather }}

@@ -44,6 +44,9 @@
{{index1+1}}.{{index2+1}}
+
+ 【{{ diaolingleixing.get(item2.diaolingleixing) }}】{{ type(item2.leibie) }} +
时间: {{ item2.act_start_time ? $moment(item2.act_start_time).format('YYYY-MM-DD HH:mm') : "-" }} ~ {{ item2.act_end_time ? $moment(item2.act_end_time).format('HH:mm') : "-" }} @@ -52,6 +55,9 @@ 内容: {{ item2.to_transfer_id ? "[调整]" : "" }}{{ item2.content }}
+
+

{{ $moment(log.created_at).format('HH:mm') }} {{ log.content }}

+
@@ -92,6 +98,12 @@ export default { transfers: [], showData: [], selectDate: [new Date(),new Date()], + diaolingleixing: new Map([ + [1,"水环境调令"], + [2,"防汛调令"], + [3,"船只过闸调令"], + [4,"逻辑调令"] + ]) } }, methods: { @@ -192,7 +204,7 @@ export default { }, async getType() { - const obj = (await show({ id: 1 }, false))?.select_item; + const obj = (await show({ id: 31 }, false))?.select_item; if (obj && typeof obj === "object") { let keys = Object.keys(obj); if (keys.length > 0) { @@ -250,6 +262,11 @@ export default { }, async exportDocx () { + // const innerHTML = document.querySelector("#docx-content").innerHTML; + // const exportHTML = `调令内容${innerHTML}` + // let blob = new Blob(["\ufeff", exportHTML], { + // type: "application/msword", + // }) const document = new Document({ sections: [ { @@ -300,7 +317,7 @@ export default { line: 300 }, indent: { - firstLine: convertInchesToTwip(0.5) + left: 200 }, children: [ new TextRun({ @@ -312,17 +329,37 @@ export default { ...i1[1].sort((a,b) => new Date(a.act_start_time).valueOf() - new Date(b.act_start_time).valueOf()).map((i2, index2) => { return new Paragraph({ indent: { - firstLine: convertInchesToTwip(0.8) + left: 400 }, + alignment: AlignmentType.LEFT, children: [ new TextRun({ - text: `${index1+1}.${index2+1}`, + text: `${index1+1}.${index2+1} 【${ this.diaolingleixing.get(i2.diaolingleixing) }】${ this.type(i2.leibie) }`, size: 20, + + break: 1, + }), + new TextRun({ + text: `时间: ${i2.act_start_time ? this.$moment(i2.act_start_time).format('YYYY-MM-DD HH:mm') : "-" } ~ ${ i2.act_end_time ? this.$moment(i2.act_end_time).format('HH:mm') : "-" }`, + size: 18, + break: 1, }), new TextRun({ - text: `时间: ${i2.act_start_time ? this.$moment(i2.act_start_time).format('YYYY-MM-DD HH:mm') : "-" } ~ ${ i2.act_end_time ? this.$moment(i2.act_end_time).format('HH:mm') : "-" }\n\t${ i2.to_transfer_id ? "[调整]" : "" }内容:${i2.content || ''}`, - size: 18 - }) + text: `${ i2.to_transfer_id ? "[调整]" : "" }内容:${i2.content || ''}`, + size: 18, + break: 1, + }), + ...(() => { + if (i2.diaolingleixing === 4) { + return i2.id_logs_transfer_id_relation.map(log => new TextRun({ + text: `${this.$moment(log.created_at).format('HH:mm')} ${log.content}`, + size: 18, + break: 1, + })) + } else { + return [] + } + })() ] }) }) @@ -336,17 +373,23 @@ export default { }) const blob = await Packer.toBlob(document) - saveAs(blob, `${this.selectDate[0] ? this.$moment(this.selectDate[0]).format('YYYY年MM月DD日') : "-"} ~ ${this.selectDate[1] ? this.$moment(this.selectDate[1]).format('YYYY年MM月DD日') : "-"}调度指令执行情况`) - } + saveAs(blob, `${this.selectDate[0] ? this.$moment(this.selectDate[0]).format('YYYY年MM月DD日') : "-"} ~ ${this.selectDate[1] ? this.$moment(this.selectDate[1]).format('YYYY年MM月DD日') : "-"}调度指令执行情况.docx`) + }, }, computed: { area () { return function (area) { return this.areas.find(i => i.value === area)?.key } + }, + type () { + return function (type) { + return this.types.find(i => i.value === type)?.key + } } }, created() { + this.getType() this.getArea() this.getTransfer() this.getWeather()