提交 e3f449f6 编写于 作者: 刘英杰's avatar 刘英杰

V20241031 系统配置》值班时间》更换为Table配置

上级 674a0bd3
[data-v-325ffd3e] .ivu-form-item-content{position:relative;font-size:14px}[data-v-325ffd3e] .ivu-divider-horizontal{display:block;height:1px;width:100%;min-width:100%;margin:0;clear:both}.ivu-form-item[data-v-325ffd3e]{padding-right:15px}.fileRow[data-v-325ffd3e]{display:flex;justify-content:space-between;align-items:center}.fileRow .delIcon[data-v-325ffd3e]{color:#ed4014}.fileRow .delIcon[data-v-325ffd3e]:hover{color:#f16643;cursor:pointer}
\ No newline at end of file
.index[data-v-a1485b70]{width:100%;box-sizing:border-box;padding:10px;background-color:#fff}table[data-v-a1485b70]{width:100%;background-color:#fff;border-color:#e3e8ee;text-align:center;border-radius:4px;border-top:1px solid #e3e8ee;border-left:1px solid #e3e8ee}tr[data-v-a1485b70]{border:none;text-align:center}td[data-v-a1485b70]{border-bottom:1px solid #e3e8ee;border-right:1px solid #e3e8ee;text-align:center;box-sizing:border-box;padding:6px;cursor:pointer;max-width:150px}td[data-v-a1485b70]:hover{background:#e7f7f4}td:hover .dis[data-v-a1485b70]{display:block;text-align:center;margin:0 auto;cursor:pointer}tr[data-v-a1485b70]:first-child{height:30px;background-color:#f3f3f3;border:none;color:#525252;font-weight:700;width:50px}.sepacialy[data-v-a1485b70]{border-top:1px solid #e3e8ee;border-left:1px solid #e3e8ee}.table-heard[data-v-a1485b70]{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;box-sizing:border-box;padding:10px 10px}.table-heard .center[data-v-a1485b70]{display:flex;justify-content:center;align-items:center}.table-heard .center p[data-v-a1485b70]{font-size:20px;margin:0 30px}.course-item[data-v-a1485b70]{display:flex;justify-content:center;flex-direction:column;gap:6px;align-items:center;min-height:80px;border-radius:4px;box-sizing:border-box;padding:10px 0}.course-item p[data-v-a1485b70]{color:#3a3a3a}.time[data-v-a1485b70]{background:#f7f7f7;color:#707070;font-weight:700} .index[data-v-79a0ce69]{width:100%;box-sizing:border-box;padding:10px;background-color:#fff}table[data-v-79a0ce69]{width:100%;background-color:#fff;border-color:#e3e8ee;text-align:center;border-radius:4px;border-top:1px solid #e3e8ee;border-left:1px solid #e3e8ee}tr[data-v-79a0ce69]{border:none;text-align:center}td[data-v-79a0ce69]{border-bottom:1px solid #e3e8ee;border-right:1px solid #e3e8ee;text-align:center;box-sizing:border-box;padding:6px;cursor:pointer;max-width:150px}td[data-v-79a0ce69]:hover{background:#e7f7f4}td:hover .dis[data-v-79a0ce69]{display:block;text-align:center;margin:0 auto;cursor:pointer}tr[data-v-79a0ce69]:first-child{height:30px;background-color:#f3f3f3;border:none;color:#525252;font-weight:700;width:50px}.sepacialy[data-v-79a0ce69]{border-top:1px solid #e3e8ee;border-left:1px solid #e3e8ee}.table-heard[data-v-79a0ce69]{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;box-sizing:border-box;padding:10px 10px}.table-heard .center[data-v-79a0ce69]{display:flex;justify-content:center;align-items:center}.table-heard .center p[data-v-79a0ce69]{font-size:20px;margin:0 30px}.course-item[data-v-79a0ce69]{display:flex;justify-content:center;flex-direction:column;gap:6px;align-items:center;min-height:80px;border-radius:4px;box-sizing:border-box;padding:10px 0}.course-item p[data-v-79a0ce69]{color:#3a3a3a}.time[data-v-79a0ce69]{background:#f7f7f7;color:#707070;font-weight:700}
\ No newline at end of file \ No newline at end of file
[data-v-5ff263ac] .ivu-modal-mask{position:fixed;top:0;bottom:0;left:0;right:0;background-color:rgba(55,55,55,.6);height:100%;z-index:1050!important}[data-v-5ff263ac] .ivu-modal-wrap{position:fixed;overflow:auto;top:0;right:0;bottom:0;left:0;z-index:1050!important;-webkit-overflow-scrolling:touch;outline:0}[data-v-5ff263ac] .ivu-drawer-mask{position:fixed;top:0;bottom:0;left:0;right:0;background-color:rgba(55,55,55,.6);height:100%;z-index:1100!important}[data-v-5ff263ac] .ivu-drawer-wrap{position:fixed;overflow:auto;top:0;right:0;bottom:0;left:0;z-index:1100!important;-webkit-overflow-scrolling:touch;outline:0}.ivu-form-item[data-v-5ff263ac]{padding-right:15px}.fileRow[data-v-5ff263ac]{display:flex;justify-content:space-between;align-items:center}.fileRow .delIcon[data-v-5ff263ac]{color:#ed4014}.fileRow .delIcon[data-v-5ff263ac]:hover{color:#f16643;cursor:pointer}.class-drawer[data-v-5ff263ac]{height:"calc(100% - 55px)";overflow:"auto";padding-bottom:"53px";position:"static";z-index:1100!important}.class-drawer .subTitle[data-v-5ff263ac]{margin-top:20px;font-size:14px;color:#191f25;font-weight:700}.class-drawer .drawer-footer[data-v-5ff263ac]{width:100%;position:absolute;bottom:0;left:0;border-top:1px solid #e8e8e8;padding:10px 16px;text-align:right;background:#fff}.class-drawer[data-v-5ff263ac] .ivu-drawer-header-inner{font-size:20px;font-weight:600}
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><title>值班管理</title><link href=css/chunk-vendors.cc1990b1.css rel=stylesheet><link href=css/app.a786022a.css rel=stylesheet></head><body><script src=/a/manager/identify/identify.js></script><noscript><strong>请开启 JavaScript 功能来使用 值班管理。</strong></noscript><div id=app></div><script src=js/chunk-vendors.9ae50470.js></script><script src=js/app.45920677.js></script></body></html> <!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><title>值班管理</title><link href=css/chunk-vendors.cc1990b1.css rel=stylesheet><link href=css/app.a786022a.css rel=stylesheet></head><body><script src=/a/manager/identify/identify.js></script><noscript><strong>请开启 JavaScript 功能来使用 值班管理。</strong></noscript><div id=app></div><script src=js/chunk-vendors.e6e588ad.js></script><script src=js/app.f2f673a9.js></script></body></html>
\ No newline at end of file \ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
"> ">
<Col span="14"> 值班时间范围限制</Col> <Col span="14"> 值班时间范围限制</Col>
</Row> </Row>
<Row style="margin-bottom: 10px"> <Row style="margin-bottom: 10px" :key="aaa">
<Col v-for="(item,index) in formDataTimeTable.time" :key="index" span="24" <Col v-for="(item,index) in formDataTimeTable.time" :key="index" span="24"
style="margin-bottom: 10px;display: flex;align-items: center"> style="margin-bottom: 10px;display: flex;align-items: center">
<TimePicker v-model="item.timeRange" :clearable="false" format="HH:mm" <TimePicker v-model="item.timeRange" :clearable="false" format="HH:mm"
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
type="timerange" type="timerange"
@on-open-change="onOpenChangeTimeTable($event,item,index)"/> @on-open-change="onOpenChangeTimeTable($event,item,index)"/>
<!--&nbsp;可预约座位--> <!--&nbsp;可预约座位-->
<i-switch v-model="item.morrow" :false-value="0" :true-value="1" class="ivu-ml-8" size="large"> <i-switch @on-change="onSwitchChangeTimeTable($event,item,index)" v-model="item.morrow" :false-value="0" :true-value="1" class="ivu-ml-8" size="large">
<template #open> <template #open>
<span>次日</span> <span>次日</span>
</template> </template>
...@@ -514,31 +514,94 @@ export default { ...@@ -514,31 +514,94 @@ export default {
console.log("🚀🚀event, item, index🚀,", event, item, index) console.log("🚀🚀event, item, index🚀,", event, item, index)
if (!event) { if (!event) {
// 关闭浮层时触发 // 关闭浮层时触发
let deleteEventArray = this.formDataTimeTable.time.map(cur => {
return cur.timeRange.join('~'); let strategy = {
}) //当日|次日,执行不同对比策略
if (deleteEventArray.indexOf(item.timeRange.join('~')) !== -1) deleteEventArray.splice(deleteEventArray.indexOf(item.timeRange.join('~')), 1); 0:()=>{
if (!(this.checkTimes(deleteEventArray, item.timeRange))) { let deleteEventArrayCurrentDay = this.formDataTimeTable.time.map(cur => {
//当日
if (cur.morrow === 0)return cur.timeRange.join('~');
}).filter(cur=>cur!==undefined)
if (deleteEventArrayCurrentDay.indexOf(item.timeRange.join('~')) !== -1) deleteEventArrayCurrentDay.splice(deleteEventArrayCurrentDay.indexOf(item.timeRange.join('~')), 1);//删除刚添加的元素,不在对比数据内
if (!(this.checkTimes(deleteEventArrayCurrentDay, item.timeRange))) {
//对比算法 ,大于、小于且不在已有时间段内,返回则删除
this.formDataTimeTable.time.splice(index, 1);
this.$Message.error('当日配置时间重叠,请重新配置时间');
this.aaa ++
}
},
1:()=>{
let deleteEventArrayMorrowDay = this.formDataTimeTable.time.map(cur => {
//次日
if (cur.morrow === 1)return cur.timeRange.join('~');
}).filter(cur=>cur!==undefined)
if (deleteEventArrayMorrowDay.indexOf(item.timeRange.join('~')) !== -1) deleteEventArrayMorrowDay.splice(deleteEventArrayMorrowDay.indexOf(item.timeRange.join('~')), 1);//删除刚添加的元素,不在对比数据内
if (!(this.checkTimes(deleteEventArrayMorrowDay, item.timeRange))) {
//对比算法 ,大于、小于且不在已有时间段内,返回则删除 //对比算法 ,大于、小于且不在已有时间段内,返回则删除
this.formDataTimeTable.time.splice(index, 1); this.formDataTimeTable.time.splice(index, 1);
this.$Message.error('配置时间重叠,请重新配置时间'); this.$Message.error('次日配置时间重叠,请重新配置时间');
this.aaa ++
}
} }
} }
strategy[item.morrow]()
}
},
onSwitchChangeTimeTable(event, item, index) {
if (item.timeRange !== void 0){
console.log("🚀🚀event, item, index🚀,", event, item, index)
let strategy = {
//当日|次日,执行不同对比策略
0:()=>{
let deleteEventArrayCurrentDay = this.formDataTimeTable.time.map(cur => {
//当日
if (cur.morrow === 0)return cur.timeRange.join('~');
}).filter(cur=>cur!==undefined)
if (deleteEventArrayCurrentDay.indexOf(item.timeRange.join('~')) !== -1) deleteEventArrayCurrentDay.splice(deleteEventArrayCurrentDay.indexOf(item.timeRange.join('~')), 1);//删除刚添加的元素,不在对比数据内
if (!(this.checkTimes(deleteEventArrayCurrentDay, item.timeRange))) {
//对比算法 ,大于、小于且不在已有时间段内,返回则删除
this.formDataTimeTable.time.splice(index, 1);
this.$Message.error('当日配置时间重叠,请重新配置时间');
this.aaa ++
}
}, },
1:()=>{
let deleteEventArrayMorrowDay = this.formDataTimeTable.time.map(cur => {
//次日
if (cur.morrow === 1)return cur.timeRange.join('~');
}).filter(cur=>cur!==undefined)
if (deleteEventArrayMorrowDay.indexOf(item.timeRange.join('~')) !== -1) deleteEventArrayMorrowDay.splice(deleteEventArrayMorrowDay.indexOf(item.timeRange.join('~')), 1);//删除刚添加的元素,不在对比数据内
if (!(this.checkTimes(deleteEventArrayMorrowDay, item.timeRange))) {
//对比算法 ,大于、小于且不在已有时间段内,返回则删除
this.formDataTimeTable.time.splice(index, 1);
this.$Message.error('次日配置时间重叠,请重新配置时间');
this.aaa ++
}
}
}
strategy[item.morrow]()
}
},
save() { save() {
//深拷贝,防止污染 1~7天的数据 //深拷贝,防止污染 1~7天的数据
let array = _.cloneDeep(this.formItem.find(cur => cur.type === 'timeTable').data); let array = _.cloneDeep(this.formItem.find(cur => cur.type === 'timeTable').data);
function getFormatData(data) { function getFormatData(data) {
//获取开放时间段,格式化 //获取开放时间段,格式化
return data.map(cur => { return data.map(cur => {
return { if (cur.timeRange!== void 0)return {
"Begin": cur.timeRange[0], "Begin": cur.timeRange[0],
"End": cur.timeRange[1], "End": cur.timeRange[1],
"Morrow": cur.morrow, "Morrow": cur.morrow,
} }
}) }).filter(cur=>cur!==undefined)
} }
let info = { let info = {
...@@ -563,6 +626,7 @@ export default { ...@@ -563,6 +626,7 @@ export default {
"six": array[5].time, "six": array[5].time,
"seven": array[6].time, "seven": array[6].time,
}; };
this.formData['sign_daytime'] = JSON.stringify(data) //格式化为后端接口格式 this.formData['sign_daytime'] = JSON.stringify(data) //格式化为后端接口格式
// timeTable // timeTable
...@@ -581,7 +645,7 @@ export default { ...@@ -581,7 +645,7 @@ export default {
return { return {
/* begin: cur.split('~')[0], /* begin: cur.split('~')[0],
end: cur.split('~')[1],*/ end: cur.split('~')[1],*/
morrow:cur.Morrow, morrow: cur.Morrow,
timeRange: [cur.Begin, cur.End] timeRange: [cur.Begin, cur.End]
} }
}) })
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</div> </div>
</div> </div>
<div style="width: 100%;display: flex;"> <div v-if="isAdmin" style="width: 100%;display: flex;">
<Button icon="ios-download-outline" style="margin:0 5px 0 0;" @click="importDuty.show = true">导出值班日志 <Button icon="ios-download-outline" style="margin:0 5px 0 0;" @click="importDuty.show = true">导出值班日志
</Button> </Button>
<Button icon="ios-download-outline" style="margin:0 5px;" @click="importDutySheet.show = true">导出值班表 <Button icon="ios-download-outline" style="margin:0 5px;" @click="importDutySheet.show = true">导出值班表
...@@ -77,20 +77,21 @@ ...@@ -77,20 +77,21 @@
<FormItem label="值班日期"> <FormItem label="值班日期">
<Input v-model="selectDate" disabled></Input> <Input v-model="selectDate" disabled></Input>
</FormItem> </FormItem>
<FormItem label="白天值班人员"> <FormItem label="值班人员">
<Select v-model="duty_daytime_people_id" filterable multiple> <Select v-model="duty_daytime_people_id" filterable multiple>
<Option v-for="item in peopleOption" :key="item.id" :label="item.name" :value="item.id"> <Option v-for="(item,index) in peopleOption" :key="index" :label="item.name" :value="item.id">
<slot name="label">
<div style="display:flex;justify-content: space-between;"> <div style="display:flex;justify-content: space-between;">
<p>{{ item.name }} <p>{{ item.name }}
<span style="color:#9a9a9a">({{ item.card }})</span> <span style="color:#9a9a9a">({{ item.card }})</span>
</p> </p>
<p style="color:#ccc">{{ item.dept_name }}</p> <p style="color:#ccc">{{ item.dept_name }}</p>
</div> </div>
</slot>
</Option> </Option>
</Select> </Select>
</FormItem> </FormItem>
<FormItem label="晚上值班人员"> <!-- <FormItem label="晚上值班人员">
<Select v-model="duty_night_people_id" filterable multiple> <Select v-model="duty_night_people_id" filterable multiple>
<Option v-for="item in peopleOption" :key="item.id" :label="item.name" :value="item.id"> <Option v-for="item in peopleOption" :key="item.id" :label="item.name" :value="item.id">
<div style="display:flex;justify-content: space-between;"> <div style="display:flex;justify-content: space-between;">
...@@ -101,7 +102,7 @@ ...@@ -101,7 +102,7 @@
</div> </div>
</Option> </Option>
</Select> </Select>
</FormItem> </FormItem>-->
</Form> </Form>
</Modal> </Modal>
...@@ -380,11 +381,14 @@ export default { ...@@ -380,11 +381,14 @@ export default {
page_size: 10000 page_size: 10000
} }
GetPersonByCondiction(params).then(resp => { GetPersonByCondiction(params).then(resp => {
console.log("🚀🚀resp🚀,",resp)
this.peopleOption = resp.data; this.peopleOption = resp.data;
}) })
}, },
// 点击日期进行值班安排 // 点击日期进行值班安排
clickCell(data, date) { clickCell(data, date) {
if (this.isAdmin){
//管理员执行
this.selectDate = date; this.selectDate = date;
this.selectItem = data; this.selectItem = data;
this.duty_daytime_people_id = data.duty_daytime_people_list.map(x => { this.duty_daytime_people_id = data.duty_daytime_people_list.map(x => {
...@@ -394,6 +398,8 @@ export default { ...@@ -394,6 +398,8 @@ export default {
return x.id return x.id
}); });
this.showModal = true; this.showModal = true;
}
}, },
// 点击确认排班 // 点击确认排班
handleConfirm() { handleConfirm() {
...@@ -430,7 +436,13 @@ export default { ...@@ -430,7 +436,13 @@ export default {
} }
}, },
computed: {} computed: {
isAdmin(){
//是否是管理员
let admin = JSON.parse(window.localStorage.getItem('admin'))
return admin.sys.user['ghost-uuid'].user.info.role_list.includes('超管')
}
}
}; };
</script> </script>
......
...@@ -642,9 +642,7 @@ export default { ...@@ -642,9 +642,7 @@ export default {
id: row.id, id: row.id,
...res, ...res,
attandence_area: JSON.parse(res.attendance_area), attandence_area: JSON.parse(res.attendance_area),
day_time: res.day_time.split('~'), day_time: res.day_time.split('~'),
effect_beginAndEffect_end: [ effect_beginAndEffect_end: [
dayjs(res.effect_begin).format('YYYY-MM-DD hh:mm'), dayjs(res.effect_begin).format('YYYY-MM-DD hh:mm'),
...@@ -655,7 +653,6 @@ export default { ...@@ -655,7 +653,6 @@ export default {
}).finally(() => { }).finally(() => {
this.editModalLoading = false this.editModalLoading = false
}) })
}, },
// 新增 // 新增
add() { add() {
...@@ -697,7 +694,7 @@ export default { ...@@ -697,7 +694,7 @@ export default {
api.getApiDutyConfigGetDutyConfigDetail({id: row.id}).then(res => { api.getApiDutyConfigGetDutyConfigDetail({id: row.id}).then(res => {
//值班时间区间 //值班时间区间
this.defaultOpeningHours(res.sign_daytime) this.defaultOpeningHours(res.sign_daytime)
this.$refs.ceditmodal.aaa ++ this.$refs.ceditmodal.aaa++
//值班时间区间 //值班时间区间
this.$refs.ceditmodal.modalInit('edit', { this.$refs.ceditmodal.modalInit('edit', {
id: row.id, id: row.id,
...@@ -746,6 +743,8 @@ export default { ...@@ -746,6 +743,8 @@ export default {
//配置生效范围 //配置生效范围
effect_begin: dayjs(val.effect_beginAndEffect_end[0]).format('YYYY-MM-DD hh:mm'), effect_begin: dayjs(val.effect_beginAndEffect_end[0]).format('YYYY-MM-DD hh:mm'),
effect_end: dayjs(val.effect_beginAndEffect_end[1]).format('YYYY-MM-DD hh:mm'), effect_end: dayjs(val.effect_beginAndEffect_end[1]).format('YYYY-MM-DD hh:mm'),
//
sign_daytime: JSON.parse(val.sign_daytime),
} }
delete val.effect_beginAndEffect_end; delete val.effect_beginAndEffect_end;
delete val.day_time_end; delete val.day_time_end;
...@@ -759,8 +758,8 @@ export default { ...@@ -759,8 +758,8 @@ export default {
delete val.duty_daytime delete val.duty_daytime
delete val.duty_night_num delete val.duty_night_num
delete val.duty_night_time delete val.duty_night_time
console.log('modal111提交', val); /* console.log('modal111提交', val);
return return*/
let strategy = { let strategy = {
'add': () => { 'add': () => {
//新增值班配置 //新增值班配置
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或