|
|
|
|
@ -8,7 +8,7 @@
|
|
|
|
|
>
|
|
|
|
|
<template #content>
|
|
|
|
|
<Button type="primary" style="width: 120px;" @click="$emit('normalCreate')">普通调令</Button>
|
|
|
|
|
<Button type="primary" style="width: 120px;" @click="add">添加</Button>
|
|
|
|
|
<Button type="primary" style="width: 120px;" @click="showModal = true">添加</Button>
|
|
|
|
|
</template>
|
|
|
|
|
</LxHeader>
|
|
|
|
|
|
|
|
|
|
@ -20,6 +20,21 @@
|
|
|
|
|
<Button type="primary" ghost long style="max-width: 260px;margin-right: 40px;" @click="data = []">清空</Button>
|
|
|
|
|
<Button type="primary" long style="max-width: 260px;" @click="submit">提交</Button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<Modal v-model="showModal" title="快速调令" @on-ok="add">
|
|
|
|
|
<div>
|
|
|
|
|
<el-form label-position="top">
|
|
|
|
|
<el-form-item label="日期">
|
|
|
|
|
<el-date-picker v-model="bindDate" value-format="yyyy-MM-dd"></el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="内容">
|
|
|
|
|
<el-input v-model="bindValue" type="textarea" :autosize="{ minRows:2 }" placeholder='点位 开始时间 结束时间 调令内容 闸门数量 水泵数量 类别 调令类型,
|
|
|
|
|
点位 开始时间 结束时间 调令内容 闸门数量 水泵数量 类别 调令类型
|
|
|
|
|
每个值以空格隔开,每条调令用","分割'></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
|
</Modal>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -83,16 +98,17 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '开启时间',
|
|
|
|
|
width: 140,
|
|
|
|
|
width: 220,
|
|
|
|
|
align: 'center',
|
|
|
|
|
key: 'start_time',
|
|
|
|
|
render: (h,{ row }) => {
|
|
|
|
|
return h('TimePicker',{
|
|
|
|
|
return h('DatePicker',{
|
|
|
|
|
props: {
|
|
|
|
|
value: row.start_time,
|
|
|
|
|
type: 'time',
|
|
|
|
|
type: 'datetime',
|
|
|
|
|
size: 'small',
|
|
|
|
|
transfer: true
|
|
|
|
|
transfer: true,
|
|
|
|
|
format: "yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
},
|
|
|
|
|
on: {
|
|
|
|
|
['on-change']:e => row.start_time = e
|
|
|
|
|
@ -102,16 +118,17 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '结束时间',
|
|
|
|
|
width: 140,
|
|
|
|
|
width: 220,
|
|
|
|
|
align: 'center',
|
|
|
|
|
key: 'end_time',
|
|
|
|
|
render: (h,{ row }) => {
|
|
|
|
|
return h('TimePicker',{
|
|
|
|
|
return h('DatePicker',{
|
|
|
|
|
props: {
|
|
|
|
|
value: row.end_time,
|
|
|
|
|
type: 'time',
|
|
|
|
|
type: 'datetime',
|
|
|
|
|
size: 'small',
|
|
|
|
|
transfer: true
|
|
|
|
|
transfer: true,
|
|
|
|
|
format: "yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
},
|
|
|
|
|
on: {
|
|
|
|
|
['on-change']:e => row.end_time = e
|
|
|
|
|
@ -234,7 +251,10 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
data: []
|
|
|
|
|
data: [],
|
|
|
|
|
showModal: false,
|
|
|
|
|
bindValue: '',
|
|
|
|
|
bindDate: new Date()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
@ -277,37 +297,57 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
add () {
|
|
|
|
|
this.$prompt('请输入内容','快速调令', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
inputType: 'textarea',
|
|
|
|
|
closeOnClickModal: false,
|
|
|
|
|
inputPlaceholder: '点位 开始时间 结束时间 调令内容 闸门数量 水泵数量 类别 调令类型,\n点位 开始时间 结束时间 调令内容 闸门数量 水泵数量 类别 调令类型 \n每个值以空格隔开,每条调令用","分割',
|
|
|
|
|
}).then(({ value, action }) => {
|
|
|
|
|
if (action === 'confirm') {
|
|
|
|
|
let uid = uuid();
|
|
|
|
|
let group = value.split(/;|;/)?.filter(i => i)?.map(i => i.replace(/\n/g,''));
|
|
|
|
|
group.forEach((item,index) => {
|
|
|
|
|
let dataArr = item.split(/\s+/);
|
|
|
|
|
if (dataArr.length === 8 && this.equipments.find(i => i.name === dataArr[0]) && (this.isTimeFormat(dataArr[1]) && this.isTimeFormat(dataArr[2]))) {
|
|
|
|
|
this.data.push({
|
|
|
|
|
no: uid,
|
|
|
|
|
equipment_id: this.equipments.find(i => i.name === dataArr[0])?.id,
|
|
|
|
|
start_time: `${dataArr[1]}`,
|
|
|
|
|
end_time: `${dataArr[2]}`,
|
|
|
|
|
content: dataArr[3] ?? '',
|
|
|
|
|
kaiqishuliang: dataArr[4] ?? 0,
|
|
|
|
|
kaiqishuliang1: dataArr[5] ?? 0,
|
|
|
|
|
leibie: this.abilities.find(j => j.key === dataArr[6])?.value,
|
|
|
|
|
diaolingleixing: this.diaolingleixing.find(j => j.key === dataArr[7])?.value,
|
|
|
|
|
level: 1,
|
|
|
|
|
status: 1
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
let uid = uuid();
|
|
|
|
|
let group = this.bindValue.split(/;|;/)?.filter(i => i)?.map(i => i.replace(/\n/g,''));
|
|
|
|
|
group.forEach((item,index) => {
|
|
|
|
|
let dataArr = item.split(/\s+/);
|
|
|
|
|
if (dataArr.length === 8 && this.equipments.find(i => i.name === dataArr[0]) && (this.isTimeFormat(dataArr[1]) && this.isTimeFormat(dataArr[2]))) {
|
|
|
|
|
this.data.push({
|
|
|
|
|
no: uid,
|
|
|
|
|
equipment_id: this.equipments.find(i => i.name === dataArr[0])?.id,
|
|
|
|
|
start_time: `${this.bindDate} ${dataArr[1]}`,
|
|
|
|
|
end_time: `${this.bindDate} ${dataArr[2]}`,
|
|
|
|
|
content: dataArr[3] ?? '',
|
|
|
|
|
kaiqishuliang: dataArr[4] ?? 0,
|
|
|
|
|
kaiqishuliang1: dataArr[5] ?? 0,
|
|
|
|
|
leibie: this.abilities.find(j => j.key === dataArr[6])?.value,
|
|
|
|
|
diaolingleixing: this.diaolingleixing.find(j => j.key === dataArr[7])?.value,
|
|
|
|
|
level: 1,
|
|
|
|
|
status: 1
|
|
|
|
|
})
|
|
|
|
|
console.log(this.data)
|
|
|
|
|
}
|
|
|
|
|
}).catch(_ => {})
|
|
|
|
|
})
|
|
|
|
|
// this.$prompt('请输入内容','快速调令', {
|
|
|
|
|
// confirmButtonText: '确定',
|
|
|
|
|
// cancelButtonText: '取消',
|
|
|
|
|
// inputType: 'textarea',
|
|
|
|
|
// closeOnClickModal: false,
|
|
|
|
|
// inputPlaceholder: '点位 开始时间 结束时间 调令内容 闸门数量 水泵数量 类别 调令类型,\n点位 开始时间 结束时间 调令内容 闸门数量 水泵数量 类别 调令类型 \n每个值以空格隔开,每条调令用","分割',
|
|
|
|
|
// }).then(({ value, action }) => {
|
|
|
|
|
// if (action === 'confirm') {
|
|
|
|
|
// let uid = uuid();
|
|
|
|
|
// let group = value.split(/;|;/)?.filter(i => i)?.map(i => i.replace(/\n/g,''));
|
|
|
|
|
// group.forEach((item,index) => {
|
|
|
|
|
// let dataArr = item.split(/\s+/);
|
|
|
|
|
// if (dataArr.length === 8 && this.equipments.find(i => i.name === dataArr[0]) && (this.isTimeFormat(dataArr[1]) && this.isTimeFormat(dataArr[2]))) {
|
|
|
|
|
// this.data.push({
|
|
|
|
|
// no: uid,
|
|
|
|
|
// equipment_id: this.equipments.find(i => i.name === dataArr[0])?.id,
|
|
|
|
|
// start_time: `${dataArr[1]}`,
|
|
|
|
|
// end_time: `${dataArr[2]}`,
|
|
|
|
|
// content: dataArr[3] ?? '',
|
|
|
|
|
// kaiqishuliang: dataArr[4] ?? 0,
|
|
|
|
|
// kaiqishuliang1: dataArr[5] ?? 0,
|
|
|
|
|
// leibie: this.abilities.find(j => j.key === dataArr[6])?.value,
|
|
|
|
|
// diaolingleixing: this.diaolingleixing.find(j => j.key === dataArr[7])?.value,
|
|
|
|
|
// level: 1,
|
|
|
|
|
// status: 1
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// console.log(this.data)
|
|
|
|
|
// }
|
|
|
|
|
// }).catch(_ => {})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
submit () {
|
|
|
|
|
@ -316,8 +356,8 @@ export default {
|
|
|
|
|
return save({
|
|
|
|
|
table_name: 'transfers',
|
|
|
|
|
...form,
|
|
|
|
|
start_time: `${this.$moment().format('YYYY-MM-DD')} ${form.start_time}`,
|
|
|
|
|
end_time: `${this.$moment().format('YYYY-MM-DD')} ${form.end_time}`,
|
|
|
|
|
start_time: form.start_time,
|
|
|
|
|
end_time: form.end_time,
|
|
|
|
|
},false)
|
|
|
|
|
})
|
|
|
|
|
let loadingInstance = this.$loading({
|
|
|
|
|
|