|
|
|
|
@ -59,7 +59,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template #kaiqishuliang v-if="form.tiaozhengleixing !== 0 || equipmentType === 1">
|
|
|
|
|
<template #kaiqishuliang v-if="equipmentType === 1">
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">调整数量 :</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
@ -151,48 +151,54 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
submit() {
|
|
|
|
|
const leixingLabel = this.tiaozhengleixings.find(i => i.id === this.form.tiaozhengleixing)?.value
|
|
|
|
|
const leixingLabel = this.types.find(i => i.id === this.form.tiaozhengleixing)?.value
|
|
|
|
|
if (leixingLabel === '关闭') {
|
|
|
|
|
this.form.kaiqishuliang = this.originalData.kaiqishuliang
|
|
|
|
|
} else if (leixingLabel === '新开') {
|
|
|
|
|
} else if (leixingLabel === '增开') {
|
|
|
|
|
this.form.kaiqishuliang = Number(this.detail?.kaiqishuliang) + this.form.kaiqishuliang
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
let updateData = JSON.stringify(this.form);
|
|
|
|
|
if (this.type === "add") {
|
|
|
|
|
if (this.form.hasOwnProperty("id")) {
|
|
|
|
|
delete this.form.id;
|
|
|
|
|
let text = ""
|
|
|
|
|
if (updateData !== this.originalData) {
|
|
|
|
|
let originalData = JSON.parse(this.originalData)
|
|
|
|
|
let nowData = JSON.parse(updateData)
|
|
|
|
|
let kv = new Map([
|
|
|
|
|
['content','调令内容'],
|
|
|
|
|
['tiaozhengleixing','调整状态'],
|
|
|
|
|
['kaiqishuliang','调整数量'],
|
|
|
|
|
])
|
|
|
|
|
for (let key of kv.keys()) {
|
|
|
|
|
if (key === 'kaiqishuliang') {
|
|
|
|
|
text += nowData[key] === originalData[key] ? "" : (`【${kv.get(key)}】从"${originalData[key] || "0"}"更改为"${nowData[key]}"` || " ")
|
|
|
|
|
} else {
|
|
|
|
|
text += nowData[key] === originalData[key] ? "" : (`【${kv.get(key)}】从"${this.types.find(i => i.id === originalData[key])?.value || originalData[key] || " "}"更改为"${this.types.find(i => i.id === nowData[key])?.value || nowData[key]}"` || " ")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (this.type === "editor") {
|
|
|
|
|
Object.defineProperty(this.form, "id", {
|
|
|
|
|
value: this.id,
|
|
|
|
|
enumerable: true,
|
|
|
|
|
configurable: true,
|
|
|
|
|
writable: true,
|
|
|
|
|
});
|
|
|
|
|
this.form.to_transfer_id = this.detail.id;
|
|
|
|
|
this.form.is_adjust = 1;
|
|
|
|
|
this.form.id_logs_transfer_id_relation = this.detail.id_logs_transfer_id_relation.map(i => ({
|
|
|
|
|
transfer_id: i.transfer_id,
|
|
|
|
|
content: i.content
|
|
|
|
|
}))
|
|
|
|
|
this.form.id_logs_transfer_id_relation.push({
|
|
|
|
|
transfer_id: this.detail.id,
|
|
|
|
|
content: text
|
|
|
|
|
})
|
|
|
|
|
for (let key in this.detail) {
|
|
|
|
|
if (/_relation|_at/g.test(key)) {
|
|
|
|
|
delete this.detail[key]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
delete this.detail.id;
|
|
|
|
|
save({
|
|
|
|
|
table_name: "transfers",
|
|
|
|
|
...this.detail,
|
|
|
|
|
...this.form,
|
|
|
|
|
status: 2
|
|
|
|
|
status: 2,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
if (updateData !== this.originalData) {
|
|
|
|
|
let originalData = JSON.parse(this.originalData)
|
|
|
|
|
let nowData = JSON.parse(updateData)
|
|
|
|
|
let kv = new Map([
|
|
|
|
|
['content','调令内容'],
|
|
|
|
|
['tiaozhengleixing','调整状态'],
|
|
|
|
|
['kaiqishuliang','调整数量'],
|
|
|
|
|
])
|
|
|
|
|
let text = ""
|
|
|
|
|
for (let key in nowData) {
|
|
|
|
|
if (key === 'kaiqishuliang') {
|
|
|
|
|
text += nowData[key] === originalData[key] ? "" : (`【${kv.get(key)}】从"${originalData[key] || "0"}"更改为"${nowData[key]}"` || " ")
|
|
|
|
|
} else {
|
|
|
|
|
text += nowData[key] === originalData[key] ? "" : (`【${kv.get(key)}】从"${this.tiaozhengleixings.find(i => i.id === originalData[key])?.value || originalData[key] || " "}"更改为"${this.tiaozhengleixings.find(i => i.id === nowData[key])?.value || nowData[key]}"` || " ")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
save({
|
|
|
|
|
table_name: "logs",
|
|
|
|
|
transfer_id: this.getId(),
|
|
|
|
|
@ -238,7 +244,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
value: "新开"
|
|
|
|
|
value: "增开"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
} else {
|
|
|
|
|
|