From a70cb5f965f872e484cde9a33571db9ef541a0a6 Mon Sep 17 00:00:00 2001
From: xy <271556543@qq.com>
Date: Mon, 15 Jan 2024 17:29:23 +0800
Subject: [PATCH] 1
---
src/router/index.js | 5 -
.../bigScreen/component/detailTransfer.vue | 41 +-
.../bigScreen/component/transferBoard.vue | 15 +-
src/views/component/test.vue | 32 -
src/views/order/component/createDispatch.vue | 734 +++++++++++------
src/views/order/component/quickCreate.vue | 4 +-
src/views/order/create.vue | 20 +-
src/views/order/handle.vue | 755 ++++++++++++++++++
8 files changed, 1292 insertions(+), 314 deletions(-)
delete mode 100644 src/views/component/test.vue
create mode 100644 src/views/order/handle.vue
diff --git a/src/router/index.js b/src/router/index.js
index d0ccbd2..3ce2c97 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -42,11 +42,6 @@ export const constantRoutes = [
component: () => import("@/views/404"),
hidden: true,
},
- {
- path: "/test",
- component: () => import("@/views/component/test.vue"),
- hidden: true,
- },
{
path: "/info",
component: Layout,
diff --git a/src/views/bigScreen/component/detailTransfer.vue b/src/views/bigScreen/component/detailTransfer.vue
index 0d2942e..69a0ccb 100644
--- a/src/views/bigScreen/component/detailTransfer.vue
+++ b/src/views/bigScreen/component/detailTransfer.vue
@@ -43,7 +43,12 @@
| 执行状态 |
-
+
+
+
+
+
+
@@ -118,18 +123,34 @@ export default {
this.data = data
},
async esignConfirm () {
- const base64 = await this.$refs['esign'].generate({ format:'image/png', quality: 0.7 });
- const file = base64toFile(base64,`${new Date().getTime()}.png`)
- const form = new FormData();
- form.append('file',file)
- const fileInfo = await axios.post(process.env.VUE_APP_UPLOAD_API,form,{
- headers: {
- Authorization: "Bearer " + getToken()
- }
- })
+ let fileInfo;
+ if (this.data.status !== 2) {
+ const base64 = await this.$refs['esign'].generate({ format:'image/png', quality: 0.7 });
+ const file = base64toFile(base64,`${new Date().getTime()}.png`)
+ const form = new FormData();
+ form.append('file',file)
+ fileInfo = await axios.post(process.env.VUE_APP_UPLOAD_API,form,{
+ headers: {
+ Authorization: "Bearer " + getToken()
+ }
+ })
+ }
let copyData = deepCopy(this.data)
if (this.data.status === 2) {
+ copyData.status = 3;
+ for (let key in copyData) {
+ if (/_relation/g.test(key)) {
+ delete copyData[key]
+ }
+ }
+ save({
+ table_name: 'transfers',
+ ...copyData
+ }).then(_ => {
+ })
+ }
+ if (this.data.status === 3) {
copyData.status = 4;
copyData.start_sign = fileInfo.data?.id;
copyData.act_start_time = this.$moment().format('YYYY-MM-DD HH:mm');
diff --git a/src/views/bigScreen/component/transferBoard.vue b/src/views/bigScreen/component/transferBoard.vue
index 39adb43..ab94854 100644
--- a/src/views/bigScreen/component/transferBoard.vue
+++ b/src/views/bigScreen/component/transferBoard.vue
@@ -13,8 +13,7 @@
- {{typeMap.get(item.status)}}
- {{ item.equipment_id_equipments_id_relation ? item.equipment_id_equipments_id_relation.name : '' }}
+ {{ item.equipment_id_equipments_id_relation ? item.equipment_id_equipments_id_relation.name : '' }}
@@ -27,7 +26,7 @@
{{setStatusText}}
+ >{{setStatusText(item.status)}}
@@ -201,8 +200,14 @@ export default {
},
computed: {
setStatusText () {
- if (this.setTransferStatusNumber === 4) return '执行';
- if (this.setTransferStatusNumber === 6) return '关闭';
+ return function (status) {
+ const textMap = new Map([
+ [2,'接收'],
+ [3,'确认'],
+ [4,'关闭']
+ ])
+ return textMap.get(status)
+ }
},
lastTimeColor () {
return function (min) {
diff --git a/src/views/component/test.vue b/src/views/component/test.vue
deleted file mode 100644
index 05740c4..0000000
--- a/src/views/component/test.vue
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/order/component/createDispatch.vue b/src/views/order/component/createDispatch.vue
index a4d8078..b7c17be 100644
--- a/src/views/order/component/createDispatch.vue
+++ b/src/views/order/component/createDispatch.vue
@@ -10,14 +10,20 @@
:picker-options="pickerOptions"
placeholder="日期选择"
:format="createType === 1 ? 'yyyy-MM-dd' : 'yyyy第WW周'"
- style="width: 160px;"
+ style="width: 160px"
@input="pickDate"
>
您正在为
{{ date }}
创建
- {{ abilities.find(i => i.value === ability) ? abilities.find(i => i.value === ability).key : '' }}
+
+ {{
+ abilities.find((i) => i.value === ability)
+ ? abilities.find((i) => i.value === ability).key
+ : ""
+ }}
+
调令
@@ -46,10 +52,14 @@
选择类别
- data.forEach(i => i.leibie = e)">
+ data.forEach((i) => (i.leibie = e))"
+ >
{{
- item.key
- }}
+ item.key
+ }}
@@ -57,10 +67,44 @@
+
+
+
+
+
+
+
+
+
+
+ h(
+ "Button",
+ {
+ props: {
+ type: "primary",
+ size: "small",
+ },
+ on: {
+ ["click"]: (_) => {
+ this.handleClone(JSON.parse(row.content))
+ },
+ },
+ },
+ "选择"
+ ),
+ },
+ ],
+
dispatches: [],
transferDispatches: [],
createType: 1,
pickerOptions: {
firstDayOfWeek: 1,
- shortcuts: [{
- text: '今天',
- onClick(picker) {
- picker.$emit('pick', new Date());
- }
- }, {
- text: '明天',
- onClick(picker) {
- const date = new Date();
- date.setTime(date.getTime() + 3600 * 1000 * 24);
- picker.$emit('pick', date);
- }
- }, {
- text: '下周',
- onClick(picker) {
- const date = new Date();
- date.setTime(date.getTime() + 3600 * 1000 * 24 * 7);
- picker.$emit('pick', date);
- }
- }]
+ shortcuts: [
+ {
+ text: "今天",
+ onClick(picker) {
+ picker.$emit("pick", new Date());
+ },
+ },
+ {
+ text: "明天",
+ onClick(picker) {
+ const date = new Date();
+ date.setTime(date.getTime() + 3600 * 1000 * 24);
+ picker.$emit("pick", date);
+ },
+ },
+ {
+ text: "下周",
+ onClick(picker) {
+ const date = new Date();
+ date.setTime(date.getTime() + 3600 * 1000 * 24 * 7);
+ picker.$emit("pick", date);
+ },
+ },
+ ],
},
areas: [],
types: [],
@@ -135,7 +221,7 @@ export default {
end_time: "",
content: "",
level: 1,
- leibie: this.ability
+ leibie: this.ability,
})) || [],
columns: [
// {
@@ -152,119 +238,155 @@ export default {
render: (h, { row, index }) => {
let text = row.equipment ? row.equipment.name : "";
return h("div", [
- h('el-popover',{
- props: {
- title: "今日调令",
- width: "400px"
- },
- on: {
- show: _ => {
- this.transferDispatches = this.dispatches.filter(i => (i.equipment_id === row.equipment_id))
- }
- }
- },[
- h('span',{
- slot: 'reference',
- // props: {
- // type: "ios-list-box"
- // },
- style: {
- 'border-radius': '100%',
- 'margin-right': '4px',
- 'cursor': 'pointer',
- 'width': '20px',
- 'height': '20px',
- 'display': 'inline-block',
- 'background': '#367bc7',
- 'color': '#fff'
- }
- },this.dispatches.reduce((pre,cur) => {
- return cur.equipment_id === row.equipment_id ? ++pre : pre
- },0)),
- h('Table',{
- style: {
- 'width': "480px"
+ h(
+ "el-popover",
+ {
+ props: {
+ placement: "top-start",
+ title: "今日调令",
+ width: "400px",
+ },
+ on: {
+ show: (_) => {
+ this.transferDispatches = this.dispatches.filter(
+ (i) => i.equipment_id === row.equipment_id
+ );
+ },
},
+ },
+ [
+ h(
+ "span",
+ {
+ slot: "reference",
+ // props: {
+ // type: "ios-list-box"
+ // },
+ style: {
+ "border-radius": "100%",
+ "margin-right": "4px",
+ cursor: "pointer",
+ width: "20px",
+ height: "20px",
+ display: "inline-block",
+ background: "#367bc7",
+ color: "#fff",
+ },
+ },
+ this.dispatches.reduce((pre, cur) => {
+ return cur.equipment_id === row.equipment_id
+ ? ++pre
+ : pre;
+ }, 0)
+ ),
+ h("Table", {
+ style: {
+ width: "480px",
+ },
+ props: {
+ size: "small",
+ data: this.transferDispatches,
+ columns: [
+ {
+ title: " ",
+ type: "index",
+ width: 46,
+ },
+ {
+ title: "开始时间",
+ key: "start_time",
+ align: "center",
+ render: (h, { row }) =>
+ h(
+ "span",
+ this.$moment(row.start_time).format(
+ "YYYY-MM-DD HH:mm"
+ )
+ ),
+ },
+ {
+ title: "结束时间",
+ key: "end_time",
+ align: "center",
+ render: (h, { row }) =>
+ h(
+ "span",
+ this.$moment(row.end_time).format(
+ "YYYY-MM-DD HH:mm"
+ )
+ ),
+ },
+ {
+ title: "内容",
+ key: "content",
+ },
+ ],
+ },
+ }),
+ ]
+ ),
+ h("span", text),
+ h(
+ "Button",
+ {
props: {
size: "small",
- data: this.transferDispatches,
- columns: [
- {
- title: " ",
- type: "index",
- width: 46
- },
- {
- title: '开始时间',
- key: 'start_time',
- align: 'center',
- render:(h, { row }) => (h('span',this.$moment(row.start_time).format('YYYY-MM-DD HH:mm')))
- },
- {
- title: '结束时间',
- key: 'end_time',
- align: 'center',
- render:(h, { row }) => (h('span',this.$moment(row.end_time).format('YYYY-MM-DD HH:mm')))
- },
- {
- title: '内容',
- key: 'content'
- }
- ]
- }
- })
- ]),
- h('span',text),
- h('Button',{
- props: {
- size: 'small',
- type: 'primary',
- icon: 'ios-add'
- },
- style: {
- 'margin-left': '6px'
+ type: "primary",
+ icon: "ios-add",
+ },
+ style: {
+ "margin-left": "6px",
+ },
+ on: {
+ ["click"]: (e) => {
+ this.data.splice(index, 0, deepCopy(row));
+ },
+ },
},
- on: {
- ['click']:e => {
- this.data.splice(index,0,deepCopy(row))
- }
- }
- },'新增')
+ "新增"
+ ),
]);
},
},
{
- title: '机组运行状态',
+ title: "机组运行状态",
width: 200,
- render: (h,{ row }) => {
+ render: (h, { row }) => {
const create = () => {
let dom = [];
- for (let i = 0;i<=row._random;i++) {
- dom.push(h('div',{
- style: {
- width: '14px',
- height: '14px',
- background: i === row._random-1 ? 'red' : 'green',
- 'border-radius': '100%',
- 'margin-left': '6px'
- }
- }))
+ for (let i = 0; i <= row._random; i++) {
+ dom.push(
+ h("div", {
+ style: {
+ width: "14px",
+ height: "14px",
+ background: i === row._random - 1 ? "red" : "green",
+ "border-radius": "100%",
+ "margin-left": "6px",
+ },
+ })
+ );
}
return dom;
- }
- return h('div',{
- style: {
- display: 'flex'
- }
- },create())
- }
+ };
+ return h(
+ "div",
+ {
+ style: {
+ display: "flex",
+ },
+ },
+ create()
+ );
+ },
},
{
- title: '类别',
- key: 'yinpaishui',
+ title: "类别",
+ key: "yinpaishui",
width: 100,
- align: 'center',
- render: (h,{ row }) => (h('span',this.abilities.find(i => i.value === row.leibie)?.key))
+ align: "center",
+ render: (h, { row }) =>
+ h("span", this.abilities.find((i) => i.value === row.leibie)?.key),
},
{
title: "开启时间",
@@ -278,23 +400,30 @@ export default {
type: "time",
size: "small",
transfer: true,
- format: "HH:mm"
+ format: "HH:mm",
},
on: {
["on-change"]: (e) => {
- this.data[index].start_time = e
+ this.data[index].start_time = e;
if (this.data[index]._last) {
- const [hour,min] = this.data[index].start_time.split(':').map(i => Number(i))
+ const [hour, min] = this.data[index].start_time
+ .split(":")
+ .map((i) => Number(i));
let addTime = {
hour: Math.floor(this.data[index]._last),
- min: (this.data[index]._last % 1) * 60
- }
+ min: (this.data[index]._last % 1) * 60,
+ };
let resTime = {
- hour: hour + addTime.hour + ((min + addTime.min) >= 60 ? 1 : 0),
- min: (min + addTime.min) % 60
- }
- this.data[index].end_time = `${resTime.hour}:${resTime.min}`
+ hour:
+ hour + addTime.hour + (min + addTime.min >= 60 ? 1 : 0),
+ min: (min + addTime.min) % 60,
+ };
+ this.data[index].end_time = `${resTime.hour
+ .toString()
+ .padStart(2, "0")}:${resTime.min
+ .toString()
+ .padStart(2, "0")}`;
}
},
},
@@ -306,32 +435,48 @@ export default {
width: 140,
align: "center",
key: "last",
- render: (h,{ row, index }) => {
- return h('InputNumber',{
+ render: (h, { row, index }) => {
+ const getValue = () => {
+ if (row.start_time && row.end_time) {
+ const [start_hour,start_min] = row.start_time.split(':')
+ const [end_hour,end_min] = row.end_time.split(':')
+ const diffMins = (Number(end_hour) - Number(start_hour)) * 60 + (Number(end_min) - Number(start_min))
+ return diffMins / 60
+ }
+ return 0
+ }
+ return h("InputNumber", {
props: {
- value: 0,
+ value: getValue(),
min: 0,
step: 0.5,
size: "small",
- precision: 1
+ precision: 1,
},
on: {
- ['on-change']:e => {
- this.data[index]._last = e
- const [hour,min] = this.data[index].start_time.split(':').map(i => Number(i))
+ ["on-change"]: (e) => {
+ this.data[index]._last = e;
+ const [hour, min] = this.data[index].start_time
+ .split(":")
+ .map((i) => Number(i));
let addTime = {
hour: Math.floor(e),
- min: (e % 1) * 60
- }
+ min: (e % 1) * 60,
+ };
let resTime = {
- hour: hour + addTime.hour + ((min + addTime.min) >= 60 ? 1 : 0),
- min: (min + addTime.min) % 60
- }
- this.data[index].end_time = `${resTime.hour}:${resTime.min}`
- }
- }
- })
- }
+ hour:
+ hour + addTime.hour + (min + addTime.min >= 60 ? 1 : 0),
+ min: (min + addTime.min) % 60,
+ };
+ this.data[index].end_time = `${resTime.hour
+ .toString()
+ .padStart(2, "0")}:${resTime.min
+ .toString()
+ .padStart(2, "0")}`;
+ },
+ },
+ });
+ },
},
{
title: "结束时间",
@@ -345,7 +490,7 @@ export default {
type: "time",
size: "small",
transfer: true,
- format: "HH:mm"
+ format: "HH:mm",
},
on: {
["on-change"]: (e) => (this.data[index].end_time = e),
@@ -451,33 +596,91 @@ export default {
};
},
methods: {
- clone () {
- let verify = true;
- const submitData = this.data.filter(i => (i.start_time || i.end_time || i.content));
- submitData.forEach(item => {
- if (!item.start_time || !item.end_time || !item.level) {
+ handleClone (content) {
+ if (!content) return;
+
+ const groupTemplateData = new Map();
+ content.sort((a, b) => a.equipment_id - b.equipment_id)
+ .forEach(item => {
+ const group = groupTemplateData.get(item.equipment_id) || [];
+ group.push(item);
+ groupTemplateData.set(item.equipment_id, group);
+ });
+
+ const dataMap = new Map(this.data.map((item, index) => [item.equipment_id, index]));
+
+ groupTemplateData.forEach((group, equipment_id) => {
+ const findIndex = dataMap.get(equipment_id);
+ if (findIndex !== undefined) {
+ const findData = this.data[findIndex];
+ this.data.splice(findIndex, 0, ...group.map(i => ({ ...findData, ...i })));
+ }
+ });
+ },
+
+ async getTemplates() {
+ this.templateLoading = true;
+ const res = await index(this.templateSelect);
+ this.templates = res.data;
+ this.templateTotal = res.total;
+ this.templateLoading = false;
+ },
+
+ clone() {
+ const submitData = this.data.filter(
+ (i) => i.start_time || i.end_time || i.content
+ );
+ let verify = submitData.length > 0;
+ submitData.forEach((item) => {
+ if (!item.start_time || !item.end_time) {
verify = false;
}
- })
+ });
if (!verify) {
this.$message({
- type: 'warning',
- message: '请填写完整信息'
- })
- return
+ type: "warning",
+ message: "请填写完整信息",
+ });
+ return;
}
- submitData.forEach(i => {
- delete i['equipment_id-span']
- delete i['_index']
- delete i['_rowKey']
- })
- console.log(JSON.stringify(submitData))
+ submitData.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(
+ submitData.map((i) => ({
+ equipment_id: i.equipment_id,
+ start_time: i.start_time,
+ end_time: i.end_time,
+ content: i.content,
+ level: i.level,
+ }))
+ ),
+ }).then((_) => {
+ this.$message({
+ type: "success",
+ message: "保存成功",
+ });
+ });
+ });
},
- clear () {
+ clear() {
this.select = {
area: [],
- type: []
+ type: [],
};
},
@@ -488,7 +691,7 @@ export default {
}
},
- reset () {
+ reset() {
this.clear();
this.data =
this.equipmentList?.map((i) => ({
@@ -498,76 +701,92 @@ export default {
end_time: "",
content: "",
level: 1,
- leibie: this.ability
+ leibie: this.ability,
})) || [];
},
- submit () {
- let verify = true;
- const submitData = this.data.filter(i => (i.start_time || i.end_time || i.content));
- submitData.forEach(item => {
+ submit() {
+ const submitData = this.data.filter(
+ (i) => i.start_time || i.end_time || i.content
+ );
+ let verify = submitData.length > 0;
+ submitData.forEach((item) => {
if (!item.start_time || !item.end_time || !item.level) {
verify = false;
}
- })
+ });
if (!verify) {
this.$message({
- type: 'warning',
- message: '请填写完整信息'
- })
- return
+ type: "warning",
+ message: "请填写完整信息",
+ });
+ return;
}
const uid = uuid();
let promiseAll = [];
- submitData.forEach(i => {
- delete i['equipment_id-span']
- delete i['_index']
- delete i['_rowKey']
+ submitData.forEach((i) => {
+ delete i["equipment_id-span"];
+ delete i["_index"];
+ delete i["_rowKey"];
if (this.createType === 2) {
- const startDay = this.$moment(this.date).startOf('week')
+ const startDay = this.$moment(this.date).startOf("week");
let weekArr = [];
- for(let a = 1;a <= 7;a++) {
- weekArr.push(this.$moment(startDay).add(a,'days').format('YYYY-MM-DD'))
+ for (let a = 1; a <= 7; a++) {
+ weekArr.push(
+ this.$moment(startDay).add(a, "days").format("YYYY-MM-DD")
+ );
}
- weekArr.forEach(j => {
- promiseAll.push(save({
- ...i,
- table_name: 'transfers',
- start_time: `${j} ${i.start_time}`,
- end_time: `${j} ${i.end_time}`,
- no: uid,
- status: 1
- },false))
- })
+ weekArr.forEach((j) => {
+ promiseAll.push(
+ save(
+ {
+ ...i,
+ table_name: "transfers",
+ start_time: `${j} ${i.start_time}`,
+ end_time: `${j} ${i.end_time}`,
+ no: uid,
+ status: 1,
+ },
+ false
+ )
+ );
+ });
} else {
i.start_time = `${this.date} ${i.start_time}`;
i.end_time = `${this.date} ${i.end_time}`;
i.no = uid;
i.status = 1;
- promiseAll.push(save({
- table_name: 'transfers',
- ...i
- },false))
+ promiseAll.push(
+ save(
+ {
+ table_name: "transfers",
+ ...i,
+ },
+ false
+ )
+ );
}
- })
+ });
let loadingInstance = this.$loading({
- lock:true,
- background:"rgba(0,0,0,0.4)",
- text:"正在加载中..."
- })
- Promise.all(promiseAll).then(res => {
- this.reset();
- loadingInstance.close();
- this.$message({
- type: 'success',
- message: `成功创建${res.length}条调令`
+ lock: true,
+ background: "rgba(0,0,0,0.4)",
+ text: "正在加载中...",
+ });
+ Promise.all(promiseAll)
+ .then((res) => {
+ this.reset();
+ loadingInstance.close();
+ this.$message({
+ type: "success",
+ message: `成功创建${res.length}条调令`,
+ });
+ this.$bus.$emit("createdTransfer");
})
- this.$bus.$emit('createdTransfer')
- }).catch(_ => {
- loadingInstance.close();
- })
+ .catch((_) => {
+ loadingInstance.close();
+ });
},
async getArea() {
@@ -583,7 +802,7 @@ export default {
});
}
}
- this.$bus.$emit('areas',this.areas)
+ this.$bus.$emit("areas", this.areas);
},
async getType() {
const obj = (await show({ id: 1 }, false))?.select_item;
@@ -599,7 +818,7 @@ export default {
}
}
},
- async getAbility () {
+ async getAbility() {
const obj = (await show({ id: 31 }, false))?.select_item;
if (obj && typeof obj === "object") {
let keys = Object.keys(obj);
@@ -612,12 +831,12 @@ export default {
});
}
}
- this.$bus.$emit('yinpaishui',this.abilities)
+ this.$bus.$emit("yinpaishui", this.abilities);
},
- pickDate () {
- this.$bus.$emit('pickDate',this.date)
- }
+ pickDate() {
+ this.$bus.$emit("pickDate", this.date);
+ },
},
computed: {
mergeData() {
@@ -633,7 +852,7 @@ export default {
},
equipmentList() {
return this.equipments() || [];
- }
+ },
},
watch: {
equipmentList(val) {
@@ -646,8 +865,9 @@ export default {
content: "",
level: 1,
leibie: this.ability,
- _random: Math.round(Math.random() * 8)
+ _random: Math.round(Math.random() * 8),
})) || [];
+ this.handleClone(this.$route.params.cloneTransfer)
},
select: {
handler: function (val) {
@@ -655,45 +875,56 @@ export default {
let list1 = [];
let list2 = [];
if (val.area.length > 0) {
- list1 = this.equipments().filter(i => val.area.find(j => j === i.area))
+ list1 = this.equipments().filter((i) =>
+ val.area.find((j) => j === i.area)
+ );
}
if (val.type.length > 0) {
- list2 = this.equipments().filter(i => val.type.find(j => j === i.type))
+ list2 = this.equipments().filter((i) =>
+ val.type.find((j) => j === i.type)
+ );
}
- this.data = Array.from(new Set([...list1,...list2].map(JSON.stringify))).map(JSON.parse).map((i) => ({
- equipment: i,
- equipment_id: i.id,
- start_time: "",
- end_time: "",
- content: "",
- level: 1,
- leibie: this.ability
- })) || [];
+ this.data =
+ Array.from(new Set([...list1, ...list2].map(JSON.stringify)))
+ .map(JSON.parse)
+ .map((i) => ({
+ equipment: i,
+ equipment_id: i.id,
+ start_time: "",
+ end_time: "",
+ content: "",
+ level: 1,
+ leibie: this.ability,
+ })) || [];
} else {
- this.data = this.equipments()?.map((i) => ({
- equipment: i,
- equipment_id: i.id,
- start_time: "",
- end_time: "",
- content: "",
- level: 1,
- leibie: this.ability
- })) || [];
+ this.data =
+ this.equipments()?.map((i) => ({
+ equipment: i,
+ equipment_id: i.id,
+ start_time: "",
+ end_time: "",
+ content: "",
+ level: 1,
+ leibie: this.ability,
+ })) || [];
}
},
- deep: true
- }
+ deep: true,
+ },
},
mounted() {},
created() {
- this.$bus.$on("getDispatches", dispatches => (this.dispatches = dispatches))
+ this.$bus.$on(
+ "getDispatches",
+ (dispatches) => (this.dispatches = dispatches)
+ );
this.getArea();
this.getType();
this.getAbility();
},
destroyed() {
- this.$bus.$off("getDispatches")
- }
+ this.$bus.$off("getDispatches");
+ },
};
@@ -727,7 +958,6 @@ export default {
}
}
.btns {
-
margin-top: 10px;
padding-left: 10px;
}
diff --git a/src/views/order/component/quickCreate.vue b/src/views/order/component/quickCreate.vue
index eb718a1..a99ac3b 100644
--- a/src/views/order/component/quickCreate.vue
+++ b/src/views/order/component/quickCreate.vue
@@ -173,12 +173,12 @@ export default {
cancelButtonText: '取消',
inputType: 'textarea',
closeOnClickModal: false,
- inputPlaceholder: '点位 开始时间 结束时间 调令内容,\n点位 开始时间 结束时间 调令内容 \n每个值以空格隔开,每条调令用","(英文逗号)分割',
+ inputPlaceholder: '点位 开始时间 结束时间 调令内容,\n点位 开始时间 结束时间 调令内容 \n每个值以空格隔开,每条调令用","分割',
beforeClose:(action, instance, done) => {
if (action === 'confirm') {
let value = instance._data.inputValue;
try {
- let group = value.split(',').map(i => i.replace(/\n/g,''));
+ let group = value.split(/,|,/).map(i => i.replace(/\n/g,''));
group.forEach((item,index) => {
let dataArr = item.split(/\s+/);
if (!this.equipments.find(i => i.name === dataArr[0])) {
diff --git a/src/views/order/create.vue b/src/views/order/create.vue
index 34400da..5e1b3c7 100644
--- a/src/views/order/create.vue
+++ b/src/views/order/create.vue
@@ -40,14 +40,18 @@ export default {
},
computed: {},
mounted() {
- this.$confirm('选择调令创建方式','调令方式',{
- confirmButtonText: '快速调令',
- cancelButtonText: '普通调令',
- type: 'info',
- closeOnPressEscape: false,
- closeOnClickModal: false,
- showClose: false
- }).then(_ => this.isQuick = true).catch(_ => this.isQuick = false)
+ if (this.$route.params.cloneTransfer) {
+ this.isQuick = false
+ } else {
+ this.$confirm('选择调令创建方式','调令方式',{
+ confirmButtonText: '快速调令',
+ cancelButtonText: '普通调令',
+ type: 'info',
+ closeOnPressEscape: false,
+ closeOnClickModal: false,
+ showClose: false
+ }).then(_ => this.isQuick = true).catch(_ => this.isQuick = false)
+ }
},
created() {
this.getEquipments();
diff --git a/src/views/order/handle.vue b/src/views/order/handle.vue
new file mode 100644
index 0000000..293848e
--- /dev/null
+++ b/src/views/order/handle.vue
@@ -0,0 +1,755 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ inputStartHandler(e, select.filter[0])"
+ />
+ 至
+ inputEndHandler(e, select.filter[0])"
+ />
+
+
+
+
+
+
+
+ 条件{{ index + 1 }}
+
+
+
+
+
+
+
+
+
+ inputStartHandler(e, item)"
+ />
+ 至
+ inputEndHandler(e, item)"
+ />
+
+
+
+
+
+
+ 新增一条
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {
+ $router.push({
+ path: $route.path + '/detail/' + row.id,
+ });
+ }
+ "
+ @editor="
+ (row) => {
+ $refs['dialog'].setId(row.id);
+ $refs['dialog'].setType('editor');
+ $refs['dialog'].show();
+ }
+ "
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|