调令修改

master
xy 7 months ago
parent 60fe452416
commit 49f500464b

@ -863,6 +863,7 @@ export default {
kaiqishuliang1: i.kaiqishuliang1,
diaolingleixing: i.diaolingleixing,
leibie: i.leibie,
yinpaishui: i.yinpaishui,
situations: this.equipmentList.find((j) => j.id === i.equipment_id)?.id_equip_situation_relations_equipment_id_relation
})) || [];
@ -880,6 +881,7 @@ export default {
diaolingleixing: "",
kaiqishuliang1: 0,
leibie: "",
yinpaishui: "",
situations: i.id_equip_situation_relations_equipment_id_relation
})) || [];
@ -958,7 +960,8 @@ export default {
kaiqishuliang: i.kaiqishuliang,
kaiqishuliang1: i.kaiqishuliang1,
diaolingleixing: i.diaolingleixing,
leibie: i.leibie
leibie: i.leibie,
yinpaishui: i.yinpaishui,
}))
),
}).then((_) => {

@ -43,6 +43,7 @@ import { uuid } from "@/utils";
import { index, save } from "@/api/system/baseForm";
import LxHeader from "@/components/LxHeader";
import {show} from "@/api/system/customFormField";
import {checkTransfer} from "@/api/other";
export default {
components: {
LxHeader
@ -320,7 +321,8 @@ export default {
leibie: this.abilities.find(j => j.key === dataArr[6])?.value,
diaolingleixing: this.diaolingleixing.find(j => j.key === dataArr[7])?.value,
level: 1,
status: 1
status: 1,
is_adjust: -1
})
}
console.log(this.data)
@ -358,27 +360,40 @@ export default {
// }).catch(_ => {})
},
submit () {
async submit () {
console.log(this.data)
let promiseAll = this.data.map(form => {
return save({
table_name: 'transfers',
...form,
},false)
})
let promiseAll = []
let loadingInstance = this.$loading({
lock:true,
background:"rgba(0,0,0,0.4)",
text:"正在加载中..."
})
for (let i = 0;i < this.data.length;i++) {
const item = this.data[i]
try {
const res = await checkTransfer({
start_time: item.start_time,
end_time: item.end_time,
equipment_id: item.equipment_id,
diaolingleixing: item.diaolingleixing
})
promiseAll.push(save({
table_name: 'transfers',
...item,
},false))
} catch (err) {
console.error(err)
}
}
Promise.all(promiseAll).then(res => {
this.data = [];
loadingInstance.close();
this.$message({
type: 'success',
message: '添加成功'
message: `添加成功${res.length}`
})
}).catch(_ => {
}).finally(_ => {
loadingInstance.close()
})
}

@ -47,7 +47,24 @@
>导出</Button
>
</template>
<Button type="primary" @click="cloneTransfer"></Button>
<Button type="primary" @click="showClone"></Button>
<el-popover
placement="bottom"
title="点位"
width="400"
trigger="click">
<Button style="margin-left: 10px;" slot="reference" type="primary">点位筛选</Button>
<template>
<el-tree :data="equipments"
node-key="id"
:style="{ 'max-height': treeHeight, 'overflow': 'scroll' }"
ref="elTree"
:props="{ children: 'children', label: 'name' }"
show-checkbox
@check="handleCheckChange">
</el-tree>
</template>
</el-popover>
<template #distribute>
<Button type="primary" @click="pickNoDistribute"></Button>
<Button type="primary" @click="distributeTransfers"></Button>
@ -57,107 +74,192 @@
</LxHeader>
</div>
</div>
<!--$refs['drawer'].setId(row.id);
$refs['drawer'].show();-->
<el-row :gutter="10">
<el-col :span="4">
<el-tree :data="equipments"
node-key="id"
:style="{ 'max-height': treeHeight, 'overflow': 'scroll' }"
ref="elTree"
:props="{ children: 'children', label: 'name' }"
show-checkbox
@check="handleCheckChange">
</el-tree>
</el-col>
<el-col :span="20">
<xy-table
:btnCondition="btnCondition"
:span-method="objectSpanMethod"
:format-list-data="mergeData"
:is-page="false"
:btn-width="360"
:auths="auths_auth_mixin"
:delay-req="true"
:destroy-action="destroy"
ref="xyTable"
:border="true"
:row-key="row => row.id"
:action="index"
:req-opt="tableSelect"
:destroy-req-opt="select"
:table-item="table"
@detail="
<xy-table
:btnCondition="btnCondition"
:span-method="objectSpanMethod"
:format-list-data="mergeData"
:is-page="false"
:btn-width="360"
:auths="auths_auth_mixin"
:delay-req="true"
:destroy-action="destroy"
ref="xyTable"
:border="true"
:row-key="row => row.id"
:action="index"
:req-opt="tableSelect"
:destroy-req-opt="select"
:table-item="table"
@detail="
(row) => {
$router.push({
path: $route.path + '/detail/' + row.id,
});
}
"
@editor="
@editor="
(row) => {
$refs['dialog'].setId(row.id);
$refs['dialog'].setType('editor');
$refs['dialog'].show();
}
"
>
<template #adjust="{ row }">
<template v-if="[2,3,4,5,6].find(i => i === row.status)">
<Button
size="small"
type="primary"
@click="
>
<template #adjust="{ row }">
<template v-if="[2,3,4,5,6].find(i => i === row.status)">
<Button
size="small"
type="primary"
@click="
$refs['adjust'].setId(row.id),
$refs['adjust'].setType('editor'),
$refs['adjust'].show()
"
>调整</Button
>
</template>
</template>
<template #callback="{ row }">
<Button
size="small"
type="primary"
@click="
>调整</Button
>
</template>
</template>
<template #callback="{ row }">
<Button
size="small"
type="primary"
@click="
$refs['callback'].setId(row.id),
$refs['callback'].setType('add'),
$refs['callback'].show()
"
>反馈</Button
>
</template>
<template #oa="{ row }">
<Button
size="small"
type="primary"
@click="toOa(row)"
>发起流程</Button
>
</template>
<template #distribute="{ row }">
<Button
v-if="row.status === 1 || row.status === 0"
size="small"
type="primary"
@click="setTransferStatus(2,row)"
>下发</Button
>
</template>
<template #cancel="{ row }">
<Button
v-if="row.status === 2 || row.status === 3"
size="small"
type="primary"
ghost
@click="setTransferStatus(0,row)"
>取消</Button
>
</template>
</xy-table>
</el-col>
</el-row>
>反馈</Button
>
</template>
<template #oa="{ row }">
<Button
size="small"
type="primary"
@click="toOa(row)"
>发起流程</Button
>
</template>
<template #distribute="{ row }">
<Button
v-if="row.status === 1 || row.status === 0"
size="small"
type="primary"
@click="setTransferStatus(2,row)"
>下发</Button
>
</template>
<template #cancel="{ row }">
<Button
v-if="row.status === 2 || row.status === 3"
size="small"
type="primary"
ghost
@click="setTransferStatus(0,row)"
>取消</Button
>
</template>
</xy-table>
<!--$refs['drawer'].setId(row.id);
$refs['drawer'].show();-->
<!-- <el-row :gutter="10">-->
<!-- <el-col :span="4">-->
<!-- <el-tree :data="equipments"-->
<!-- node-key="id"-->
<!-- :style="{ 'max-height': treeHeight, 'overflow': 'scroll' }"-->
<!-- ref="elTree"-->
<!-- :props="{ children: 'children', label: 'name' }"-->
<!-- show-checkbox-->
<!-- @check="handleCheckChange">-->
<!-- </el-tree>-->
<!-- </el-col>-->
<!-- <el-col :span="20">-->
<!-- <xy-table-->
<!-- :btnCondition="btnCondition"-->
<!-- :span-method="objectSpanMethod"-->
<!-- :format-list-data="mergeData"-->
<!-- :is-page="false"-->
<!-- :btn-width="360"-->
<!-- :auths="auths_auth_mixin"-->
<!-- :delay-req="true"-->
<!-- :destroy-action="destroy"-->
<!-- ref="xyTable"-->
<!-- :border="true"-->
<!-- :row-key="row => row.id"-->
<!-- :action="index"-->
<!-- :req-opt="tableSelect"-->
<!-- :destroy-req-opt="select"-->
<!-- :table-item="table"-->
<!-- @detail="-->
<!-- (row) => {-->
<!-- $router.push({-->
<!-- path: $route.path + '/detail/' + row.id,-->
<!-- });-->
<!-- }-->
<!-- "-->
<!-- @editor="-->
<!-- (row) => {-->
<!-- $refs['dialog'].setId(row.id);-->
<!-- $refs['dialog'].setType('editor');-->
<!-- $refs['dialog'].show();-->
<!-- }-->
<!-- "-->
<!-- >-->
<!-- <template #adjust="{ row }">-->
<!-- <template v-if="[2,3,4,5,6].find(i => i === row.status)">-->
<!-- <Button-->
<!-- size="small"-->
<!-- type="primary"-->
<!-- @click="-->
<!-- $refs['adjust'].setId(row.id),-->
<!-- $refs['adjust'].setType('editor'),-->
<!-- $refs['adjust'].show()-->
<!-- "-->
<!-- >调整</Button-->
<!-- >-->
<!-- </template>-->
<!-- </template>-->
<!-- <template #callback="{ row }">-->
<!-- <Button-->
<!-- size="small"-->
<!-- type="primary"-->
<!-- @click="-->
<!-- $refs['callback'].setId(row.id),-->
<!-- $refs['callback'].setType('add'),-->
<!-- $refs['callback'].show()-->
<!-- "-->
<!-- >反馈</Button-->
<!-- >-->
<!-- </template>-->
<!-- <template #oa="{ row }">-->
<!-- <Button-->
<!-- size="small"-->
<!-- type="primary"-->
<!-- @click="toOa(row)"-->
<!-- >发起流程</Button-->
<!-- >-->
<!-- </template>-->
<!-- <template #distribute="{ row }">-->
<!-- <Button-->
<!-- v-if="row.status === 1 || row.status === 0"-->
<!-- size="small"-->
<!-- type="primary"-->
<!-- @click="setTransferStatus(2,row)"-->
<!-- >下发</Button-->
<!-- >-->
<!-- </template>-->
<!-- <template #cancel="{ row }">-->
<!-- <Button-->
<!-- v-if="row.status === 2 || row.status === 3"-->
<!-- size="small"-->
<!-- type="primary"-->
<!-- ghost-->
<!-- @click="setTransferStatus(0,row)"-->
<!-- >取消</Button-->
<!-- >-->
<!-- </template>-->
<!-- </xy-table>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <dialoger-->
<!-- :table-name="customForm.tableName"-->
@ -179,6 +281,24 @@
></imports>
<callback ref="callback"></callback>
<adjust :areas="areas" :abilities="abilities" ref="adjust" @refresh="$refs['xyTable'].getTableData()"></adjust>
<el-dialog title="克隆调令" width="78%" :visible.sync="dialogVisible">
<div>
<xy-table
:list="clones"
:is-page="false"
ref="xyTable"
:height="490"
:border="true"
:table-item="cloneTable"
>
</xy-table>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="cloneTransfer"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -223,6 +343,61 @@ export default {
},
data() {
return {
dialogVisible: false,
clones: [],
cloneTable: [
{
label: '范围',
prop: 'equipment_area',
width: 140,
formatter:(data,row,val) => {
return this.areas.find(i => i.value === val)?.key
}
},
{
label: '点位',
prop: 'equipment_name',
width: 140
},
{
label: '调令类型',
prop: 'diaolingleixing',
width: 140,
customFn: row => this.table?.find(i => i.prop === 'diaolingleixing')?.customFn(row)
},
{
label: '闸门开启数量',
prop: 'kaiqishuliang',
width: 100
},
{
label: '水泵开启数量',
prop: 'kaiqishuliang1',
width: 100
},
{
label: '类别',
prop: 'leibie',
width: 100,
customFn: row => this.table?.find(i => i.prop === 'leibie')?.customFn(row)
},
{
label: '开始时间',
prop: 'start_time',
width: 100
},
{
label: '结束时间',
prop: 'end_time',
width: 100
},
{
label: '内容',
prop: 'content',
minWidth: 140
},
],
equipments: [],
areas: [],
abilities: [],
@ -434,21 +609,28 @@ export default {
this.$refs['xyTable'].getTableData()
},
showClone() {
this.clones = this.$refs['xyTable'].getSelection().map(i => ({
equipment_area: i.equipment_id_equipments_id_relation?.area,
equipment_name: i.equipment_id_equipments_id_relation?.name,
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'),
kaiqishuliang: i.kaiqishuliang,
kaiqishuliang1: i.kaiqishuliang1,
yinpaishui: i.yinpaishui,
diaolingleixing: i.diaolingleixing,
content: i.content,
level: i.level,
leibie: i.leibie
}))
this.dialogVisible = true
},
cloneTransfer () {
this.$router.push({
name: 'menu_14',
params: {
cloneTransfer: this.$refs['xyTable'].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'),
kaiqishuliang: i.kaiqishuliang,
kaiqishuliang1: i.kaiqishuliang1,
yinpaishui: i.yinpaishui,
diaolingleixing: i.diaolingleixing,
content: i.content,
level: i.level,
}))
cloneTransfer: this.clones
}
})
},
@ -778,6 +960,7 @@ export default {
)
}
})
console.log(this.table)
},
},

@ -12,7 +12,7 @@
<header-content :auths="auths_auth_mixin">
<template #search>
<div style="display: flex">
<el-date-picker v-model="weekSelect" format="yyyy 第 WW 周" type="week" size="small" style="width: 150px;"></el-date-picker>
<el-date-picker v-model="weekSelect" :format="'yyyy 第 WW 周' + $moment(weekRange.at(0)).format('MM-DD') + ' 至 ' + $moment(weekRange.at(-1)).format('MM-DD')" type="week" size="small" style="width: 250px;" @change="weekChange"></el-date-picker>
<Select clearable v-model="selectArea" placeholder="请选择范围" style="width: 140px;margin-left: 6px;">
<Option v-for="item in Array.from(areas)" :value="item[0]">{{ item[1] }}</Option>
</Select>
@ -40,7 +40,7 @@
<el-col :span="4">
<el-tree :data="equipments"
node-key="id"
:style="{ 'max-height': (tableHeight || 630) + 'px', 'overflow': 'scroll' }"
:style="{ 'max-height': (tableHeight || 620) + 'px', 'overflow': 'scroll' }"
ref="elTree"
:props="{ children: 'children', label: 'name' }"
show-checkbox
@ -128,6 +128,13 @@
}
},
methods: {
weekChange() {
this.weekRange = [this.$moment(this.weekSelect).startOf('week').format('YYYY-MM-DD')]
for (let i = 1;i <= 6;i++) {
this.weekRange.push(this.$moment(this.weekRange[0]).add(i,'day').format('YYYY-MM-DD'))
}
this.getData()
},
handleCheckChange (data, checked, indeterminate) {
this.treeValue = this.$refs['elTree'].getCheckedNodes(true)?.filter(i => !i.children)?.map(i => i.name).toString()
this.equipmentIds = this.$refs['elTree'].getCheckedNodes(true)?.filter(i => !i.children)?.map(i => i.id)
@ -176,10 +183,6 @@
},
async getData () {
this.weekRange = [this.$moment(this.weekSelect).startOf('week').format('YYYY-MM-DD')]
for (let i = 1;i <= 6;i++) {
this.weekRange.push(this.$moment(this.weekRange[0]).add(i,'day').format('YYYY-MM-DD'))
}
const res = await index({
table_name: 'transfers',
page: 1,

@ -11,8 +11,14 @@
<slot>
<header-content :auths="auths_auth_mixin">
<template #search>
<div style="display: flex">
<el-date-picker type="daterange" v-model="selectDate" size="small" :clearable="false" style="width: 220px;" @change="search"></el-date-picker>
<div class="search-bar">
<div>开始日期</div>
<el-date-picker style="width: 140px;" size="small" type="date" v-model="selectDate[0]"></el-date-picker>
<div>结束日期</div>
<el-date-picker style="width: 140px;" size="small" type="date" v-model="selectDate[1]"></el-date-picker>
<el-button type="primary" size="small" icon="el-icon-search" @click="search"></el-button>
<!-- <el-date-picker type="daterange" v-model="selectDate" size="small" :clearable="false" style="width: 220px;" @change="search"></el-date-picker>-->
<!-- <Button-->
<!-- style="margin-left: 10px"-->
<!-- type="primary"-->
@ -570,4 +576,12 @@ export default {
}
}
.search-bar {
display: flex;
align-items: center;
& > * + * {
margin-left: 10px;
}
}
</style>

Loading…
Cancel
Save