Compare commits

...

5 Commits

  1. 152
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/components/ModifyDutyInformationTable.vue
  2. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/components/OperateRecord.vue
  3. 11
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/index.vue
  4. 72
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/jurisdictionalManagement/data.js
  5. 7
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/jurisdictionalManagement/index.vue

152
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/components/ModifyDutyInformationTable.vue

@ -20,8 +20,9 @@
<div :class="['line', { active: active == 'dayShift' }]"> <div :class="['line', { active: active == 'dayShift' }]">
<p @click="active = 'dayShift'">白天值班:</p> <p @click="active = 'dayShift'">白天值班:</p>
<div> <div>
<p v-for="(item, index) in dayShift" :key="`${item.id}_${index}`" @click="removeDutyPerson(item)">{{ <p v-for="(item, index) in dayShift" :key="`${item.id}_${index}`" @click="removeDutyPerson(item)">
item.name }}</p> {{ item.name }}
</p>
<div class="no-data" v-if="!dayShift.length">未添加人员</div> <div class="no-data" v-if="!dayShift.length">未添加人员</div>
</div> </div>
</div> </div>
@ -29,8 +30,9 @@
<div :class="['line', { active: active == 'graveyardShift' }]"> <div :class="['line', { active: active == 'graveyardShift' }]">
<p @click="active = 'graveyardShift'">晚上值班:</p> <p @click="active = 'graveyardShift'">晚上值班:</p>
<div> <div>
<p v-for="(item, index) in graveyardShift" :key="`${index}_${item.id}`" @click="removeDutyPerson(item)">{{ <p v-for="(item, index) in graveyardShift" :key="`${index}_${item.id}`" @click="removeDutyPerson(item)">
item.name }}</p> {{ item.name }}
</p>
<div class="no-data" v-if="!graveyardShift.length">未添加人员</div> <div class="no-data" v-if="!graveyardShift.length">未添加人员</div>
</div> </div>
</div> </div>
@ -141,7 +143,8 @@ export default {
}, },
methods: { methods: {
chooseDutyPerson(item) { chooseDutyPerson(item) {
const hasInserted = this[this.active].find(_item => _item.id === item.id);
const hasInserted = this[this.active].find(_item => _item.employeesId === item.id || _item.id === item.id);
if (hasInserted) return Message.warning("人员已存在"); if (hasInserted) return Message.warning("人员已存在");
@ -150,11 +153,11 @@ export default {
removeDutyPerson(item) { removeDutyPerson(item) {
const index = this[this.active].findIndex(_item => _item.id === item.id); const index = this[this.active].findIndex(_item => _item.id === item.id);
if (index === -1) return Message.warning("人员不存在"); if (index === -1) return;//Message.warning("");
this[this.active].splice(index, 1); this[this.active].splice(index, 1);
}, },
getPeopleList(id) { getPeopleList(stationId) {
this.peopleList = []; this.peopleList = [];
this.dayShift = []; this.dayShift = [];
@ -163,32 +166,44 @@ export default {
const closeMessage = loadingMessage({ message: "人员获取中..." }); const closeMessage = loadingMessage({ message: "人员获取中..." });
request({ request({
// url: `/business/employees/list`, url: `/business/employees/list`,
// method: "GET", method: "GET",
// params: { params: {
// organizationId: id organizationId: stationId
// } }
}).then((result) => {
if (result.code != 200) return Message.error("人员获取失败");
if (!result.rows?.length) return Message.warning("该驻点下暂无人员");
// Message.success("")
this.peopleList = result.rows;
}).catch((err) => {
Message.error("人员获取失败")
}).finally(() => {
closeMessage();
})
//,
if (this.data) {
request({
url: `/business/shifts/byStation`, url: `/business/shifts/byStation`,
method: "POST", method: "POST",
data: { data: {
station: this.data.station, station: this.data.station,
date: this.data.date, date: this.data.date,
} }
}) }).then((result) => {
.then((result) => { console.log("result.data:", result.data);
if (result.code != 200) return Message.error("人员获取失败"); this.dayShift = result.data.filter(item => item.scheduling === "1");
if (!result.data?.length) return Message.warning("该驻点下暂无人员"); console.log("this.dayShift11:", this.dayShift);
this.graveyardShift = result.data.filter(item => item.scheduling === "2");
Message.success("人员获取成功") }).catch((err) => {
this.peopleList = result.data;
})
.catch((err) => {
Message.error("人员获取失败") Message.error("人员获取失败")
}) }).finally(() => {
.finally(() => {
closeMessage(); closeMessage();
}) })
}
}, },
updateData(data) { updateData(data) {
return request({ return request({
@ -197,13 +212,14 @@ export default {
data: { data: {
date: data.date, date: data.date,
employeesJson: [ employeesJson: [
...this.dayShift.map(({ id }) => ({ ...this.dayShift.map((item) => ({
employeesId: id, //,id
employeesId: item.employeesId ? item.employeesId : item.id,
scheduling: 1, scheduling: 1,
station: data.station station: data.station
})), })),
...this.graveyardShift.map(({ id }) => ({ ...this.graveyardShift.map((item) => ({
employeesId: id, employeesId: item.employeesId ? item.employeesId : item.id,
scheduling: 2, scheduling: 2,
station: data.station station: data.station
})), })),
@ -214,26 +230,24 @@ export default {
async submit() { async submit() {
let data = this.data; let data = this.data;
if (this.$refs.FormRef) if (this.$refs.FormRef) {
data = await this.$refs.FormRef.validate(); data = await this.$refs.FormRef.validate();
console.log("%c [ data ]-202-「ModifyDutyInformationTable.vue」", "font-size:15px; background:#9afce6; color:#deffff;", data, this.value2); }
// console.log("%c [ data ]-202-ModifyDutyInformationTable.vue", "font-size:15px; background:#9afce6; color:#deffff;", data, this.value2);
const closeMessage = loadingMessage({ message: "正在保存值班信息..." }); const closeMessage = loadingMessage({ message: "正在保存值班信息111..." });
if (!this.data) { if (!this.data) {
this.updateData(data) this.updateData(data).then((result) => {
.then((result) => { // console.log("%c [ result ]-217-ModifyDutyInformationTable.vue", "font-size:15px; background:#335cf6; color:#77a0ff;", result);
console.log("%c [ result ]-217-「ModifyDutyInformationTable.vue」", "font-size:15px; background:#335cf6; color:#77a0ff;", result);
if (result.code != 200) return Message.error("保存失败"); if (result.code != 200) return Message.error("保存失败");
Message.success("保存成功"); Message.success("保存成功");
this.$emit('close') this.$emit('close')
}) }).catch((err) => {
.catch((err) => {
Message.error("保存失败") Message.error("保存失败")
}) }).finally(() => {
.finally(() => {
closeMessage(); closeMessage();
}) })
return; return;
@ -244,32 +258,72 @@ export default {
(this.data.dayShift || []).forEach(item => { (this.data.dayShift || []).forEach(item => {
const findIndex = this.dayShift.findIndex(_item => _item.id === item.id); const findIndex = this.dayShift.findIndex(_item => _item.id === item.id);
if (findIndex === -1) deleteIds.push(item.delId) if (findIndex === -1) deleteIds.push(item.id)
}); });
(this.data.graveyardShift || []).forEach(item => { (this.data.graveyardShift || []).forEach(item => {
const findIndex = this.graveyardShift.findIndex(_item => _item.id === item.id); const findIndex = this.graveyardShift.findIndex(_item => _item.id === item.id);
if (findIndex === -1) deleteIds.push(item.delId)
if (findIndex === -1) deleteIds.push(item.id)
}) })
Promise.allSettled([
deleteIds?.length ? request({ // Promise.allSettled([
// deleteIds?.length ? request({
// url: `/business/shifts/${deleteIds.join()}`,
// method: "DELETE",
// data: {}
// }) : Promise.resolve(),
// this.updateData(this.data)
// ]).then(([del, update]) => {
// if (del.status === 'rejected' && update.status === 'rejected') return Message.error("");
// if (del.value?.code != '200' && update.value?.code != '200') return Message.error("");
// this.$emit('close')
// }).finally(() => {
// closeMessage();
// })
//,,
if(deleteIds?.length){
request({
url: `/business/shifts/${deleteIds.join()}`, url: `/business/shifts/${deleteIds.join()}`,
method: "DELETE", method: "DELETE",
data: {} data: {}
}) : Promise.resolve(), }).then((result) => {
this.updateData(this.data) if (result.code != 200) return Message.error("修改失败");
])
.then(([del, update]) => { this.updateData(this.data).then((result) => {
if (del.status === 'rejected' && update.status === 'rejected') return Message.error("修改失败"); if (result.code != 200) return Message.error("修改失败");
if (del.value?.code != '200' && update.value?.code != '200') return Message.error("修改失败");
Message.success("修改成功");
this.$emit('close') this.$emit('close')
}).catch((err) => {
Message.error("修改失败")
}).finally(() => {
closeMessage();
})
}).catch((err) => {
Message.error("删除失败")
}).finally(() => {
closeMessage();
}) })
.finally(() => { }else{
this.updateData(this.data).then((result) => {
if (result.code != 200) return Message.error("修改失败");
Message.success("修改成功");
this.$emit('close')
}).catch((err) => {
Message.error("修改失败")
}).finally(() => {
closeMessage(); closeMessage();
}) })
} }
}
} }
} }
} }

4
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/components/OperateRecord.vue

@ -6,8 +6,8 @@
<div class="no-data" v-else>暂无操作记录</div> <div class="no-data" v-else>暂无操作记录</div>
<div class="bottom"> <div class="bottom">
<Button>确认</Button> <Button @click.native="$emit('close')">确认</Button>
<Button :style="{ backgroundColor: '#C9C9C9' }"> 取消</Button> <Button :style="{ backgroundColor: '#C9C9C9' }" @click.native="$emit('close')"> 取消</Button>
</div> </div>
</div> </div>
</Dialog> </Dialog>

11
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/index.vue

@ -217,11 +217,12 @@ export default {
this.modifyDutyInformationTableVisible = bool; this.modifyDutyInformationTableVisible = bool;
this.dialogData = !data ? null : { // this.dialogData = !data ? null : {
...data, // ...data,
dayShift: (data.dayShift || []).map(item => ({ ...item, delId: item.id, id: item.employeesId })), // dayShift: (data.dayShift || []).map(item => ({ ...item, delId: item.id, id: item.employeesId })),
graveyardShift: (data.graveyardShift || []).map(item => ({ ...item, id: item.employeesId })) // graveyardShift: (data.graveyardShift || []).map(item => ({ ...item, id: item.employeesId }))
}; // };
this.dialogData = data;
}, },
handleExport() { handleExport() {
exportFile({ exportFile({

72
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/jurisdictionalManagement/data.js

@ -36,75 +36,13 @@ export const addEditFormList = [
required: true, required: true,
}, },
merge(cloneDeep(PresetFormItems.station), { merge(cloneDeep(PresetFormItems.startStation), {
required: false, required: true,
label: "起始桩号:",
options: {
options: [
{
rules: [
{
message: "请补全桩号",
callback(value, data) {
if (!value?.trim() && data.startStakeMark[1]?.trim())
return false;
else return true;
},
},
],
key: "startStakeMark[0]",
},
{
rules: [
{
message: "请补全桩号",
callback(value, data) {
if (!value?.trim() && data.startStakeMark[0]?.trim())
return false;
else return true;
},
},
],
key: "startStakeMark[1]",
},
],
},
}), }),
merge(cloneDeep(PresetFormItems.endStation), {
merge(cloneDeep(PresetFormItems.station), { required: true,
required: false,
label: "结束桩号:",
options: {
options: [
{
rules: [
{
message: "请补全桩号",
callback(value, data) {
if (!value?.trim() && data.endStakeMark[1]?.trim())
return false;
else return true;
},
},
],
key: "endStakeMark[0]",
},
{
rules: [
{
message: "请补全桩号",
callback(value, data) {
if (!value?.trim() && data.endStakeMark[0]?.trim())
return false;
else return true;
},
},
],
key: "endStakeMark[1]",
},
],
},
}), }),
{ {
label: "辖区路段编号:", label: "辖区路段编号:",
key: "roadCode", key: "roadCode",

7
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/jurisdictionalManagement/index.vue

@ -88,7 +88,7 @@ export default {
AddNEditDialog, AddNEditDialog,
Button Button
}, },
inject: ['getPagination', 'setTotal'], inject: ['getPagination', 'setTotal', "setCurrentPage"],
data() { data() {
return { return {
searchFormList, searchFormList,
@ -172,8 +172,9 @@ export default {
Message.success("删除成功") Message.success("删除成功")
}) })
.catch(() => { .catch((e) => {
Message.error("删除失败") console.log("辖段删除error:",e);
//Message.error("")
}) })
}, },
handleAddEdit(bool, data) { handleAddEdit(bool, data) {

Loading…
Cancel
Save