逻辑调令统计

master
xy 1 year ago
parent 257007bdd2
commit faa18d72d9

@ -50,7 +50,7 @@
<tbody>
<tr>
<td>
<div style="padding: 0 20px;overflow-y: scroll;max-height: 60rem;">
<div style="padding: 0 20px;overflow-y: scroll;max-height: 19vh;">
<div v-if="data.receive_time">{{ $moment(data.receive_time).format("YYYY-MM-DD HH:mm") }}</div>
<div v-if="data.notice_open_time">{{ $moment(data.notice_open_time).format("YYYY-MM-DD HH:mm") }}</div>
<div v-if="data.open_time">{{ $moment(data.open_time).format("YYYY-MM-DD HH:mm") }}</div>
@ -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;
}
}

@ -28,7 +28,7 @@
</div>
</div>
<el-card>
<el-card id="docx-content">
<div class="title">{{ selectDate[0] ? $moment(selectDate[0]).format('YYYY-MM-DD') : "-" }} ~ {{ selectDate[1] ? $moment(selectDate[1]).format('YYYY-MM-DD') : "-" }}调度指令执行情况</div>
<p style="text-indent: 30px;line-height: 1.2;padding: 20px 0;">{{ weather.weather }}</p>
@ -44,6 +44,9 @@
<div v-for="(item2, index2) in item1[1].sort((a,b) => new Date(a.act_start_time).valueOf() - new Date(b.act_start_time).valueOf())" :key="item2.id" style="display: flex;">
<div style="text-indent: 60px;">{{index1+1}}.{{index2+1}}</div>
<div>
<div>
{{ diaolingleixing.get(item2.diaolingleixing) }}{{ type(item2.leibie) }}
</div>
<div class="time">
<span>时间</span>
<span>{{ 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') : "-" }}</span>
@ -52,6 +55,9 @@
<span>内容</span>
<span>{{ item2.to_transfer_id ? "[调整]" : "" }}{{ item2.content }}</span>
</div>
<div class="content" v-if="item2.diaolingleixing === 4">
<p v-for="log in item2.id_logs_transfer_id_relation">{{ $moment(log.created_at).format('HH:mm') }} {{ log.content }}</p>
</div>
</div>
</div>
</div>
@ -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 = `<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:w='urn:schemas-microsoft-com:office:word' xmlns='http://www.w3.org/TR/REC-html40'><head><meta charset='utf-8'><title></title></head><body>${innerHTML}</body></html>`
// 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()

Loading…
Cancel
Save