| | |
| | | <el-button |
| | | size="small" |
| | | type="primary" |
| | | v-if="listPower" |
| | | v-if="checkPermi(['performance:class:time'])" |
| | | @click="configTime" |
| | | :loading="downLoading" |
| | | >时间配置</el-button |
| | | > |
| | | <el-button |
| | | size="small" |
| | | type="primary" |
| | | v-if="downPower" |
| | | v-if="checkPermi(['performance:class:down'])" |
| | | @click="handleDown" |
| | | :loading="downLoading" |
| | | >导 出</el-button |
| | |
| | | size="small" |
| | | type="primary" |
| | | @click="schedulingVisible = true" |
| | | v-if="addPower" |
| | | v-if="checkPermi(['performance:class:add'])" |
| | | >排 班</el-button |
| | | > |
| | | </div> |
| | |
| | | v-on:mouseenter="onMouseEnter(index)" |
| | | v-on:mouseleave="currentUserIndex = null" |
| | | > |
| | | <div class="user-pic">{{ item.name.charAt(0) }}</div> |
| | | <div class="user-pic"> |
| | | {{ item.name ? item.name.charAt(0) : "" }} |
| | | </div> |
| | | <div class="user-info"> |
| | | <p style="font-size: 14px; color: #3a7bfa; line-height: 24px"> |
| | | <p |
| | | style=" |
| | | font-size: 14px; |
| | | color: #3a7bfa; |
| | | line-height: 24px; |
| | | margin: 0; |
| | | " |
| | | > |
| | | {{ item.name }} |
| | | </p> |
| | | <p |
| | |
| | | white-space: nowrap; |
| | | width: 150px; |
| | | overflow-x: show; |
| | | margin: 0; |
| | | " |
| | | > |
| | | 早:{{ item.day0 }},中:{{ item.day1 }},夜:{{ item.day2 }},休:{{ |
| | | item.day3 |
| | | }},假:{{ item.day4 }},差:{{ item.day6 }} |
| | | </p> |
| | | <p style="margin-top: 4px"> |
| | | <p style="margin-top: 4px; margin: 0"> |
| | | <span |
| | | style=" |
| | | color: #999999; |
| | |
| | | > |
| | | <span |
| | | class="month" |
| | | style="position: absolute; top: 4px" |
| | | style="position: absolute; top: 0px" |
| | | v-if="item.week == '周日'" |
| | | >{{ item.weekNum }}周</span |
| | | > |
| | |
| | | trigger="click" |
| | | placement="bottom" |
| | | @command="(e) => handleCommand(e, m)" |
| | | :disabled="!upPower" |
| | | :disabled="!checkPermi(['performance:class:edit'])" |
| | | style="width: 100%; height: 100%; cursor: pointer" |
| | | > |
| | | <div |
| | |
| | | <el-dropdown-item |
| | | v-for="(n, j) in classType" |
| | | :key="'h' + j" |
| | | :command="n.value" |
| | | >{{ n.label }}</el-dropdown-item |
| | | :command="n.dictValue" |
| | | >{{ n.dictLabel }}</el-dropdown-item |
| | | > |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | |
| | | v-on:mouseenter="onMouseEnter(index)" |
| | | v-on:mouseleave="currentUserIndex = null" |
| | | > |
| | | <div class="user-pic">{{ item.name.charAt(0) }}</div> |
| | | <div class="user-pic"> |
| | | {{ item.name ? item.name.charAt(0) : "" }} |
| | | </div> |
| | | <div class="user-info"> |
| | | <p style="font-size: 14px; color: #3a7bfa; line-height: 24px"> |
| | | <p |
| | | style=" |
| | | font-size: 14px; |
| | | color: #3a7bfa; |
| | | line-height: 24px; |
| | | margin: 0; |
| | | " |
| | | > |
| | | {{ item.name }} |
| | | </p> |
| | | <p |
| | |
| | | white-space: nowrap; |
| | | width: 150px; |
| | | overflow-x: show; |
| | | margin: 0; |
| | | " |
| | | > |
| | | 早:{{ item.day0 }},中:{{ item.day1 }},夜:{{ item.day2 }},休:{{ |
| | | item.day3 |
| | | }},假:{{ item.day4 }},差:{{ item.day6 }} |
| | | </p> |
| | | <p style="margin-top: 4px"> |
| | | <p style="margin-top: 4px; margin: 0"> |
| | | <span |
| | | style=" |
| | | color: #999999; |
| | |
| | | > |
| | | <el-option |
| | | v-for="obj in timeTypeList" |
| | | :key="obj.value" |
| | | :label="obj.label" |
| | | :value="obj.value" |
| | | :key="obj.dictValue" |
| | | :label="obj.dictLabel" |
| | | :value="obj.dictValue" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | > |
| | | <el-option |
| | | v-for="item in classType" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | :key="item.dictValue" |
| | | :label="item.dictLabel" |
| | | :value="item.dictValue" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | exportFile, |
| | | obtainItemParameterList, |
| | | update, |
| | | selectUserList, |
| | | selectUserCondition, |
| | | } from "@/api/performance/class"; |
| | | export default { |
| | | data() { |
| | | return { |
| | | addPower: true, |
| | | upPower: true, |
| | | downPower: true, |
| | | query: { |
| | | userName: "", |
| | | laboratory: "", |
| | |
| | | configTimeVisibleLoading: false, // 时间配置弹框loading |
| | | timeTypeList: [], |
| | | timeQuery: [], |
| | | listPower: false, |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | this.monthList.push(i); |
| | | } |
| | | this.monthList.reverse(); |
| | | this.getPower(); |
| | | // this.getPower(); |
| | | }, |
| | | methods: { |
| | | refresh() { |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | getPower() { |
| | | let power = JSON.parse(sessionStorage.getItem("power")); |
| | | let add = false; |
| | | let up = false; |
| | | let down = false; |
| | | let listPower = false; |
| | | for (var i = 0; i < power.length; i++) { |
| | | if (power[i].menuMethod == "performanceShiftUpdate") { |
| | | up = true; |
| | | } |
| | | if (power[i].menuMethod == "delDeviceParameter") { |
| | | down = true; |
| | | } |
| | | if (power[i].menuMethod == "performanceShiftAdd") { |
| | | add = true; |
| | | } |
| | | if (power[i].menuMethod == "shiftTimeList") { |
| | | listPower = true; |
| | | } |
| | | } |
| | | this.addPower = add; |
| | | this.upPower = up; |
| | | this.downPower = down; |
| | | this.listPower = listPower; |
| | | }, |
| | | onMouseEnter(index) { |
| | | this.currentUserIndex = index; |
| | | }, |
| | |
| | | endWeek, |
| | | userId: this.schedulingQuery.userId.join(","), |
| | | shift: this.schedulingQuery.shift, |
| | | }).then((res) => { |
| | | }) |
| | | .then((res) => { |
| | | this.loading = false; |
| | | if (res.code == 201) return; |
| | | this.$message.success("操作成功"); |
| | |
| | | shift: "", |
| | | }; |
| | | this.refresh(); |
| | | }) |
| | | .catch((err) => { |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | configTime() { |
| | |
| | | res.data.forEach((item) => { |
| | | item.isEdit = false; |
| | | const index = this.timeTypeList.findIndex( |
| | | (val) => val.value === item.shift |
| | | (val) => val.dictValue === item.shift |
| | | ); |
| | | if (index > -1) { |
| | | item.type = this.timeTypeList[index].label; |
| | | item.type = this.timeTypeList[index].dictLabel; |
| | | } |
| | | }); |
| | | this.timeQuery = res.data; |
| | |
| | | saveEdit(item, index) { |
| | | if (item.shift) { |
| | | const index = this.timeTypeList.findIndex( |
| | | (val) => val.value === item.shift |
| | | (val) => val.dictValue === item.shift |
| | | ); |
| | | if (index > -1) { |
| | | item.type = this.timeTypeList[index].label; |
| | | item.type = this.timeTypeList[index].dictLabel; |
| | | } |
| | | } |
| | | delete item.orderBy; |
| | |
| | | userName: this.query.userName, |
| | | laboratory: this.query.laboratory, |
| | | isMonth: this.query.month ? true : false, |
| | | }).then((res) => { |
| | | }) |
| | | .then((res) => { |
| | | this.$message.success("下载成功"); |
| | | this.downLoading = false; |
| | | const blob = new Blob([res], { |
| | |
| | | fileName = year + " 班次汇总"; |
| | | } |
| | | this.$download.saveAs(blob, fileName + ".xlsx"); |
| | | }) |
| | | .catch((err) => { |
| | | this.downLoading = false; |
| | | }); |
| | | }, |
| | | selectEnumByCategory() { |
| | |
| | | } |
| | | }, |
| | | getUsers() { |
| | | selectUserList({ |
| | | current: -1, |
| | | size: -1, |
| | | }).then((res) => { |
| | | selectUserCondition().then((res) => { |
| | | if (res.code === 201) { |
| | | return; |
| | | } |
| | | let arr = res.data.body.records; |
| | | let arr = res.data; |
| | | this.personList = arr; |
| | | }); |
| | | }, |
| | | getDayByDic(e) { |
| | | let obj = this.classType.find((m) => m.label == e); |
| | | let obj = this.classType.find((m) => m.dictLabel == e); |
| | | if (obj) { |
| | | return obj.value; |
| | | return obj.dictValue; |
| | | } |
| | | }, |
| | | getShiftByDic(e) { |
| | | let obj = this.classType.find((m) => m.value == e); |
| | | let obj = this.classType.find((m) => m.dictValue == e); |
| | | if (obj) { |
| | | return obj.label; |
| | | return obj.dictLabel; |
| | | } |
| | | return "无"; |
| | | }, |
| | | scrollInit() { |
| | | // 获取要绑定事件的元素 |
| | | const nav = document.getElementById("nav"); |
| | | var flag; // 鼠标按下 |
| | | var downX; // 鼠标点击的x下标 |
| | | var scrollLeft; // 当前元素滚动条的偏移量 |
| | | nav.addEventListener("mousedown", function (event) { |
| | | flag = true; |
| | | downX = event.clientX; // 获取到点击的x下标 |
| | | scrollLeft = this.scrollLeft; // 获取当前元素滚动条的偏移量 |
| | | }); |
| | | nav.addEventListener("mousemove", function (event) { |
| | | if (flag) { |
| | | // 判断是否是鼠标按下滚动元素区域 |
| | | var moveX = event.clientX; // 获取移动的x轴 |
| | | var scrollX = moveX - downX; // 当前移动的x轴下标减去刚点击下去的x轴下标得到鼠标滑动距离 |
| | | this.scrollLeft = scrollLeft - scrollX; // 鼠标按下的滚动条偏移量减去当前鼠标的滑动距离 |
| | | } |
| | | }); |
| | | // 鼠标抬起停止拖动 |
| | | nav.addEventListener("mouseup", function () { |
| | | flag = false; |
| | | }); |
| | | // 鼠标离开元素停止拖动 |
| | | nav.addEventListener("mouseleave", function (event) { |
| | | flag = false; |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .class-page { |
| | | padding: 10px; |
| | | } |
| | | .form_title { |
| | | height: 36px; |
| | | display: flex; |
| | |
| | | } |
| | | .center { |
| | | width: 100%; |
| | | height: calc(100% - 100px); |
| | | height: calc(100vh - 220px); |
| | | background-color: #fff; |
| | | overflow-y: auto; |
| | | display: flex; |
| | |
| | | min-height: calc(100% - 10px); /* 视口高度 */ |
| | | } |
| | | .content-title { |
| | | height: 52px; |
| | | line-height: 52px; |
| | | height: 58px; |
| | | line-height: 58px; |
| | | border-bottom: 1px solid #eeeeee; |
| | | } |
| | | .content-title-right { |
| | |
| | | .content-title-item .day { |
| | | font-size: 14px; |
| | | color: #333333; |
| | | margin-right: 4px; |
| | | } |
| | | .content-title-item .week { |
| | | font-size: 12px; |