瀏覽代碼

值班表bug修复

xiaochan 4 月之前
父節點
當前提交
9b00f42205
共有 2 個文件被更改,包括 24 次插入12 次删除
  1. 10 7
      src/views/settings/scheduling-class/ExportFalseExcel.vue
  2. 14 5
      src/views/settings/scheduling-class/index.vue

+ 10 - 7
src/views/settings/scheduling-class/ExportFalseExcel.vue

@@ -56,20 +56,23 @@ function employeeHandling(month) {
           classDay.push("休");
         }
       } else {
+        const tmpCode = stringNotBlank(值班人员.falseCode)
+          ? 值班人员.falseCode
+          : 值班人员.code;
+
         if (week === 6) {
           // 如果有换班的话
-          if (
-            stringNotBlank(值班人员.falseCode) &&
-            值班人员.falseCode === item.code
-          ) {
-            classDay.push("白");
-          } else if (值班人员.code === item.code) {
+          if (tmpCode === item.code) {
             classDay.push("白");
           } else {
             classDay.push("白/2");
           }
         } else if (week === 0) {
-          classDay.push("休");
+          if (tmpCode === item.code) {
+            classDay.push("白");
+          } else {
+            classDay.push("休");
+          }
         } else {
           classDay.push("白");
         }

+ 14 - 5
src/views/settings/scheduling-class/index.vue

@@ -178,13 +178,16 @@ function renderTemplate(data) {
   );
 }
 
-function exportExcel() {
+function exportExcel(type: "all" | "true" | "false" = "all") {
   const month = dayjs(store.currentCalendar).format("YYYY-MM");
 
   getByMonth(month).then(res => {
     store.months[month] = res;
-    trueExcelRef.value.exportExcel(`${month}信息中心值班表`, res);
-    falseExcelRef.value.exportExcel(month, res);
+
+    if (type === "all" || type === "true")
+      trueExcelRef.value.exportExcel(`${month}信息中心值班表`, res);
+    if (type === "all" || type === "false")
+      falseExcelRef.value.exportExcel(month, res);
   });
 }
 
@@ -235,8 +238,14 @@ onMounted(async () => {
         >生成 {{ dayjs(store.currentCalendar).format("YYYY-MM") }}排班
       </el-button>
 
-      <el-button @click="exportExcel" type="success" icon="Download"
-        >导出excel
+      <el-button @click="exportExcel('all')" type="success" icon="Download"
+        >导出两个excel
+      </el-button>
+      <el-button @click="exportExcel('true')" type="success" icon="Download"
+        >导出真excel
+      </el-button>
+      <el-button @click="exportExcel('false')" type="success" icon="Download"
+        >导出假excel
       </el-button>
       <div style="margin: 5px" ref="sortRef">
         <el-tag