|
|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<div class="select-content">
|
|
|
|
|
<Button type="primary" @click="cloneTemplate">创建模板</Button>
|
|
|
|
|
<Button type="primary" @click="cloneTemplate">克隆调令</Button>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
size="small"
|
|
|
|
|
:clearable="false"
|
|
|
|
|
@ -481,38 +481,43 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
cloneTemplate () {
|
|
|
|
|
this.$refs['listTable']?.getSelection()?.forEach((i) => {
|
|
|
|
|
delete i["equipment_id-span"];
|
|
|
|
|
delete i["_index"];
|
|
|
|
|
delete i["_rowKey"];
|
|
|
|
|
});
|
|
|
|
|
this.$prompt("请输入模板名称", "模板", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
inputValidator: (value) => {
|
|
|
|
|
return !!value;
|
|
|
|
|
},
|
|
|
|
|
inputErrorMessage: "请输入模板名称",
|
|
|
|
|
}).then(({ value }) => {
|
|
|
|
|
save({
|
|
|
|
|
table_name: "transfer_templates",
|
|
|
|
|
name: value,
|
|
|
|
|
content: JSON.stringify(
|
|
|
|
|
this.$refs['listTable']?.getSelection()?.map((i) => ({
|
|
|
|
|
let select = this.$refs['listTable']?.getSelection()?.map((i) => (
|
|
|
|
|
{
|
|
|
|
|
equipment_id: i.equipment_id,
|
|
|
|
|
start_time: this.$moment(i.start_time).format("HH:mm"),
|
|
|
|
|
end_time: this.$moment(i.end_time).format("HH:mm"),
|
|
|
|
|
start_time: this.$moment(i.start_time).format('HH:mm'),
|
|
|
|
|
end_time: this.$moment(i.end_time).format('HH:mm'),
|
|
|
|
|
content: i.content,
|
|
|
|
|
level: i.level,
|
|
|
|
|
}))
|
|
|
|
|
),
|
|
|
|
|
}).then((_) => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
|
message: "保存成功",
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
));
|
|
|
|
|
this.$emit("cloneTransfers", select)
|
|
|
|
|
// this.$prompt("请输入模板名称", "模板", {
|
|
|
|
|
// confirmButtonText: "确定",
|
|
|
|
|
// cancelButtonText: "取消",
|
|
|
|
|
// inputValidator: (value) => {
|
|
|
|
|
// return !!value;
|
|
|
|
|
// },
|
|
|
|
|
// inputErrorMessage: "请输入模板名称",
|
|
|
|
|
// }).then(({ value }) => {
|
|
|
|
|
// save({
|
|
|
|
|
// table_name: "transfer_templates",
|
|
|
|
|
// name: value,
|
|
|
|
|
// content: JSON.stringify(
|
|
|
|
|
// this.$refs['listTable']?.getSelection()?.map((i) => ({
|
|
|
|
|
// equipment_id: i.equipment_id,
|
|
|
|
|
// start_time: this.$moment(i.start_time).format("HH:mm"),
|
|
|
|
|
// end_time: this.$moment(i.end_time).format("HH:mm"),
|
|
|
|
|
// content: i.content,
|
|
|
|
|
// level: i.level,
|
|
|
|
|
// }))
|
|
|
|
|
// ),
|
|
|
|
|
// }).then((_) => {
|
|
|
|
|
// this.$message({
|
|
|
|
|
// type: "success",
|
|
|
|
|
// message: "保存成功",
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async distributeTransfers () {
|
|
|
|
|
|