调令修改

master
xy 8 months ago
parent 60fe452416
commit 49f500464b

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

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

@ -47,7 +47,24 @@
>导出</Button >导出</Button
> >
</template> </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> <template #distribute>
<Button type="primary" @click="pickNoDistribute"></Button> <Button type="primary" @click="pickNoDistribute"></Button>
<Button type="primary" @click="distributeTransfers"></Button> <Button type="primary" @click="distributeTransfers"></Button>
@ -57,107 +74,192 @@
</LxHeader> </LxHeader>
</div> </div>
</div> </div>
<!--$refs['drawer'].setId(row.id); <xy-table
$refs['drawer'].show();--> :btnCondition="btnCondition"
<el-row :gutter="10"> :span-method="objectSpanMethod"
<el-col :span="4"> :format-list-data="mergeData"
<el-tree :data="equipments" :is-page="false"
node-key="id" :btn-width="360"
:style="{ 'max-height': treeHeight, 'overflow': 'scroll' }" :auths="auths_auth_mixin"
ref="elTree" :delay-req="true"
:props="{ children: 'children', label: 'name' }" :destroy-action="destroy"
show-checkbox ref="xyTable"
@check="handleCheckChange"> :border="true"
</el-tree> :row-key="row => row.id"
</el-col> :action="index"
<el-col :span="20"> :req-opt="tableSelect"
<xy-table :destroy-req-opt="select"
:btnCondition="btnCondition" :table-item="table"
:span-method="objectSpanMethod" @detail="
: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) => { (row) => {
$router.push({ $router.push({
path: $route.path + '/detail/' + row.id, path: $route.path + '/detail/' + row.id,
}); });
} }
" "
@editor=" @editor="
(row) => { (row) => {
$refs['dialog'].setId(row.id); $refs['dialog'].setId(row.id);
$refs['dialog'].setType('editor'); $refs['dialog'].setType('editor');
$refs['dialog'].show(); $refs['dialog'].show();
} }
" "
> >
<template #adjust="{ row }"> <template #adjust="{ row }">
<template v-if="[2,3,4,5,6].find(i => i === row.status)"> <template v-if="[2,3,4,5,6].find(i => i === row.status)">
<Button <Button
size="small" size="small"
type="primary" type="primary"
@click=" @click="
$refs['adjust'].setId(row.id), $refs['adjust'].setId(row.id),
$refs['adjust'].setType('editor'), $refs['adjust'].setType('editor'),
$refs['adjust'].show() $refs['adjust'].show()
" "
>调整</Button >调整</Button
> >
</template> </template>
</template> </template>
<template #callback="{ row }"> <template #callback="{ row }">
<Button <Button
size="small" size="small"
type="primary" type="primary"
@click=" @click="
$refs['callback'].setId(row.id), $refs['callback'].setId(row.id),
$refs['callback'].setType('add'), $refs['callback'].setType('add'),
$refs['callback'].show() $refs['callback'].show()
" "
>反馈</Button >反馈</Button
> >
</template> </template>
<template #oa="{ row }"> <template #oa="{ row }">
<Button <Button
size="small" size="small"
type="primary" type="primary"
@click="toOa(row)" @click="toOa(row)"
>发起流程</Button >发起流程</Button
> >
</template> </template>
<template #distribute="{ row }"> <template #distribute="{ row }">
<Button <Button
v-if="row.status === 1 || row.status === 0" v-if="row.status === 1 || row.status === 0"
size="small" size="small"
type="primary" type="primary"
@click="setTransferStatus(2,row)" @click="setTransferStatus(2,row)"
>下发</Button >下发</Button
> >
</template> </template>
<template #cancel="{ row }"> <template #cancel="{ row }">
<Button <Button
v-if="row.status === 2 || row.status === 3" v-if="row.status === 2 || row.status === 3"
size="small" size="small"
type="primary" type="primary"
ghost ghost
@click="setTransferStatus(0,row)" @click="setTransferStatus(0,row)"
>取消</Button >取消</Button
> >
</template> </template>
</xy-table> </xy-table>
</el-col> <!--$refs['drawer'].setId(row.id);
</el-row> $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--> <!-- <dialoger-->
<!-- :table-name="customForm.tableName"--> <!-- :table-name="customForm.tableName"-->
@ -179,6 +281,24 @@
></imports> ></imports>
<callback ref="callback"></callback> <callback ref="callback"></callback>
<adjust :areas="areas" :abilities="abilities" ref="adjust" @refresh="$refs['xyTable'].getTableData()"></adjust> <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> </div>
</template> </template>
@ -223,6 +343,61 @@ export default {
}, },
data() { data() {
return { 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: [], equipments: [],
areas: [], areas: [],
abilities: [], abilities: [],
@ -434,21 +609,28 @@ export default {
this.$refs['xyTable'].getTableData() 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 () { cloneTransfer () {
this.$router.push({ this.$router.push({
name: 'menu_14', name: 'menu_14',
params: { params: {
cloneTransfer: this.$refs['xyTable'].getSelection().map(i => ({ cloneTransfer: this.clones
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,
}))
} }
}) })
}, },
@ -778,6 +960,7 @@ export default {
) )
} }
}) })
console.log(this.table)
}, },
}, },

@ -12,7 +12,7 @@
<header-content :auths="auths_auth_mixin"> <header-content :auths="auths_auth_mixin">
<template #search> <template #search>
<div style="display: flex"> <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;"> <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> <Option v-for="item in Array.from(areas)" :value="item[0]">{{ item[1] }}</Option>
</Select> </Select>
@ -40,7 +40,7 @@
<el-col :span="4"> <el-col :span="4">
<el-tree :data="equipments" <el-tree :data="equipments"
node-key="id" node-key="id"
:style="{ 'max-height': (tableHeight || 630) + 'px', 'overflow': 'scroll' }" :style="{ 'max-height': (tableHeight || 620) + 'px', 'overflow': 'scroll' }"
ref="elTree" ref="elTree"
:props="{ children: 'children', label: 'name' }" :props="{ children: 'children', label: 'name' }"
show-checkbox show-checkbox
@ -128,6 +128,13 @@
} }
}, },
methods: { 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) { handleCheckChange (data, checked, indeterminate) {
this.treeValue = this.$refs['elTree'].getCheckedNodes(true)?.filter(i => !i.children)?.map(i => i.name).toString() 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) this.equipmentIds = this.$refs['elTree'].getCheckedNodes(true)?.filter(i => !i.children)?.map(i => i.id)
@ -176,10 +183,6 @@
}, },
async getData () { 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({ const res = await index({
table_name: 'transfers', table_name: 'transfers',
page: 1, page: 1,

@ -11,8 +11,14 @@
<slot> <slot>
<header-content :auths="auths_auth_mixin"> <header-content :auths="auths_auth_mixin">
<template #search> <template #search>
<div style="display: flex"> <div class="search-bar">
<el-date-picker type="daterange" v-model="selectDate" size="small" :clearable="false" style="width: 220px;" @change="search"></el-date-picker> <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--> <!-- <Button-->
<!-- style="margin-left: 10px"--> <!-- style="margin-left: 10px"-->
<!-- type="primary"--> <!-- type="primary"-->
@ -570,4 +576,12 @@ export default {
} }
} }
.search-bar {
display: flex;
align-items: center;
& > * + * {
margin-left: 10px;
}
}
</style> </style>

Loading…
Cancel
Save