From 80f27f1672467e91ff3d4fd7f30a817f6f11d5c0 Mon Sep 17 00:00:00 2001
From: CD配唱片 <CD配唱片>
Date: 星期五, 25 四月 2025 22:55:48 +0800
Subject: [PATCH] Merge branch 'dev' of http://192.168.50.149:8085/r/aps-kj-web into dev

---
 src/views/basicData/calendar/index.vue |  763 +++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 640 insertions(+), 123 deletions(-)

diff --git a/src/views/basicData/calendar/index.vue b/src/views/basicData/calendar/index.vue
index bb3b016..073b58d 100644
--- a/src/views/basicData/calendar/index.vue
+++ b/src/views/basicData/calendar/index.vue
@@ -1,34 +1,34 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="鎻忚堪" prop="description">
-        <el-input
-          v-model="queryParams.description"
-          placeholder="璇疯緭鍏ユ弿杩�"
-          clearable
-          @keyup.enter="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="鏃ュ巻鐢熸晥鏃ユ湡" prop="effectiveDate">
-        <el-date-picker clearable
-          v-model="queryParams.effectiveDate"
-          type="date"
-          value-format="YYYY-MM-DD"
-          placeholder="璇烽�夋嫨鏃ュ巻鐢熸晥鏃ユ湡">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="澶辨晥鏃ユ湡" prop="expiringDate">
-        <el-date-picker clearable
-          v-model="queryParams.expiringDate"
-          type="date"
-          value-format="YYYY-MM-DD"
-          placeholder="璇烽�夋嫨澶辨晥鏃ユ湡">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleQuery">鎼滅储</el-button>
-        <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button>
-      </el-form-item>
+    <el-form
+      class="responsive-form"
+      :model="queryParams"
+      ref="queryRef"
+      :inline="true"
+      v-show="showSearch"
+      label-width="68px"
+    >
+      <el-row type="flex" justify="left">
+        <el-col :span="6">
+          <el-form-item label="鏃ュ巻鎻忚堪" prop="description">
+            <el-input
+              style="width: 140px"
+              v-model="queryParams.description"
+              placeholder="璇疯緭鍏ユ弿杩板叧閿瘝"
+              clearable
+              @keyup.enter="handleQuery"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="18" style="text-align: right">
+          <el-form-item class="column-with-margin">
+            <el-button type="primary" icon="Search" @click="handleQuery"
+              >鏌ヨ</el-button
+            >
+            <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button>
+          </el-form-item>
+        </el-col>
+      </el-row>
     </el-form>
 
     <el-row :gutter="10" class="mb8">
@@ -38,8 +38,9 @@
           plain
           icon="Plus"
           @click="handleAdd"
-          v-hasPermi="['core:calendar:add']"
-        >鏂板</el-button>
+          v-hasPermi="['aps:calendar:update']"
+          >鏂板</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -48,8 +49,9 @@
           icon="Edit"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['core:calendar:edit']"
-        >淇敼</el-button>
+          v-hasPermi="['aps:calendar:update']"
+          >淇敼</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -58,86 +60,219 @@
           icon="Delete"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['core:calendar:remove']"
-        >鍒犻櫎</el-button>
+          v-hasPermi="['aps:calendar:remove']"
+          >鍒犻櫎</el-button
+        >
       </el-col>
-      <el-col :span="1.5">
+      <!-- <el-col :span="1.5">
         <el-button
           type="warning"
           plain
           icon="Download"
           @click="handleExport"
           v-hasPermi="['core:calendar:export']"
-        >瀵煎嚭</el-button>
-      </el-col>
-      <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
+          >瀵煎嚭</el-button
+        >
+      </el-col> -->
+      <right-toolbar
+        v-model:showSearch="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
     </el-row>
-
-    <el-table v-loading="loading" :data="calendarList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="${comment}" align="center" prop="id" />
-      <el-table-column label="鎻忚堪" align="center" prop="description" />
-      <el-table-column label="绫诲瀷锛屽懆宸ヤ綔/鑺傚亣鏃�" align="center" prop="type" />
-      <el-table-column label="鏃ュ巻鐢熸晥鏃ユ湡" align="center" prop="effectiveDate" width="180">
-        <template #default="scope">
-          <span>{{ parseTime(scope.row.effectiveDate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="澶辨晥鏃ユ湡" align="center" prop="expiringDate" width="180">
-        <template #default="scope">
-          <span>{{ parseTime(scope.row.expiringDate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="鏃ュ巻鍐呭" align="center" prop="content" />
-      <el-table-column label="閫傜敤宸ュ巶" align="center" prop="applicableFactory" />
-      <el-table-column label="閫傜敤杞﹂棿" align="center" prop="applicableWorkshop" />
-      <el-table-column label="閫傜敤宸ュ簭" align="center" prop="applicableProcess" />
-      <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
-        <template #default="scope">
-          <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['core:calendar:edit']">淇敼</el-button>
-          <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['core:calendar:remove']">鍒犻櫎</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-    
-    <pagination
-      v-show="total>0"
-      :total="total"
-      v-model:page="queryParams.pageNum"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <HxlhTable
+      style="width: 100%"
+      :columns="columns"
+      :data="calendarList"
+      :loading="loading"
+      :height="height"
+      ref="tableRef"
+      :page="page"
+      @changePageNo="changePageNo"
+      @changePageSize="changePageSize"
+      @on-checkbox="handleCheckboxChange"
+      class="auto-height-grid"
+    >
+      <template #status="{ row }">
+        <vxe-tag v-if="row.type === '1'" status="primary">鍛ㄥ伐浣滄棩</vxe-tag>
+        <vxe-tag v-if="row.type === '2'" status="success">鑺傚亣鏃�</vxe-tag>
+      </template>
+      <template #mark="{ row }">
+        <div v-if="row.type === '1'">
+            <span v-for="(item, index) in JSON.parse(row.content.value).weekdays" :key="index">
+              <span v-if="item.work==='y'" status="success" class="mart5">{{item.chineseName}}: 宸ヤ綔鏃�;&nbsp;</span>
+              <span v-if="item.work==='n'" status="info" class="mart5">{{item.chineseName}}: 闈炲伐浣滄棩;&nbsp;</span>
+            </span>
+            <!-- <div v-for="(item, index) in JSON.parse(row.content.value).weekdays" :key="index">
+              <vxe-tag v-if="item.work==='y'" status="success" class="mart5">{{item.chineseName}}: 宸ヤ綔鏃�;&nbsp;</vxe-tag>
+              <vxe-tag v-if="item.work==='n'" status="info" class="mart5">{{item.chineseName}}: 闈炲伐浣滄棩;&nbsp;</vxe-tag>
+            </div> -->
+        </div>
+        <div v-if="row.type === '2'">
+            <div>{{JSON.parse(row.content.value).holidays.startdate}}鑷硔{JSON.parse(row.content.value).holidays.enddate}}</div>
+        </div>
+      </template>
+      <template #buttons="{row}">
+        <vxe-button mode="text" @click="handleUpdate(row)" v-hasPermi="['aps:calendar:update']" >淇敼</vxe-button>
+        <vxe-button mode="text" @click="handleDelete(row)" v-hasPermi="['aps:calendar:remove']" >鍒犻櫎</vxe-button>
+      </template>
+    </HxlhTable>
 
     <!-- 娣诲姞鎴栦慨鏀规棩鍘嗙鐞嗗璇濇 -->
     <el-dialog :title="title" v-model="open" width="500px" append-to-body>
-      <el-form ref="calendarRef" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="鎻忚堪" prop="description">
+      <el-form
+        ref="calendarRef"
+        :model="form"
+        :rules="rules"
+        label-width="105px"
+      >
+        <el-form-item label="鏃ュ巻鎻忚堪" prop="description">
           <el-input v-model="form.description" placeholder="璇疯緭鍏ユ弿杩�" />
         </el-form-item>
-        <el-form-item label="鏃ュ巻鐢熸晥鏃ユ湡" prop="effectiveDate">
-          <el-date-picker clearable
+        <el-form-item label="鏃ュ巻绫诲瀷" prop="type">
+          <el-radio-group v-model="form.type" @change="handleSwitchType">
+            <el-radio :label="'1'">鍛ㄥ伐浣�</el-radio>
+            <el-radio :label="'2'">鑺傚亣鏃�</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="鐢熸晥鏃堕棿" prop="effectiveDate">
+          <el-date-picker
+            clearable
             v-model="form.effectiveDate"
             type="date"
             value-format="YYYY-MM-DD"
-            placeholder="璇烽�夋嫨鏃ュ巻鐢熸晥鏃ユ湡">
+            placeholder="閫夋嫨鏃ユ湡"
+          >
           </el-date-picker>
         </el-form-item>
-        <el-form-item label="澶辨晥鏃ユ湡" prop="expiringDate">
-          <el-date-picker clearable
+        <el-form-item label="澶辨晥鏃堕棿" prop="expiringDate">
+          <el-date-picker
+            clearable
             v-model="form.expiringDate"
             type="date"
             value-format="YYYY-MM-DD"
-            placeholder="璇烽�夋嫨澶辨晥鏃ユ湡">
+            placeholder="閫夋嫨鏃ユ湡"
+          >
           </el-date-picker>
         </el-form-item>
-        <el-form-item label="鏃ュ巻鍐呭" prop="content">
-          <el-input v-model="form.content" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" />
+        <div v-if="form.type === '1'">
+          <div class="title_bar_line">
+            <div class="line_short"></div>
+            <div>鍛ㄥ伐浣滆缃�</div>
+            <div class="line_long"></div>
+          </div>
+          <div
+            class="week_flex"
+            v-for="(item, index) in weekDaysSettingList"
+            :key="index"
+          >
+            <div class="week_flex_item">{{ item.chineseName }}</div>
+            <div class="week_flex_item">
+              <el-radio-group v-model="item.work" @change="handleSetWorkDays">
+                <el-radio :label="'y'">宸ヤ綔鏃�</el-radio>
+                <el-radio :label="'n'">闈炲伐浣滄棩</el-radio>
+              </el-radio-group>
+            </div>
+          </div>
+        </div>
+        <div v-if="form.type === '2'">
+          <div class="title_bar_line">
+            <div class="line_short"></div>
+            <div>鑺傚亣鏃ヨ缃�</div>
+            <div class="line_long"></div>
+          </div>
+          <div class="week_flex mt20">
+            <div class="week_flex_item">鑺傛棩寮�濮嬫椂闂�</div>
+            <div class="week_flex_item">
+              <el-date-picker
+                clearable
+                v-model="holidays.startdate"
+                type="date"
+                value-format="YYYY-MM-DD"
+                placeholder="閫夋嫨鏃ユ湡"
+              >
+              </el-date-picker>
+            </div>
+          </div>
+          <div class="week_flex mt20">
+            <div class="week_flex_item">鑺傛棩缁撴潫鏃堕棿</div>
+            <div class="week_flex_item">
+              <el-date-picker
+                clearable
+                v-model="holidays.enddate"
+                type="date"
+                value-format="YYYY-MM-DD"
+                placeholder="閫夋嫨鏃ユ湡"
+              >
+              </el-date-picker>
+            </div>
+          </div>
+        </div>
+        <el-form-item
+          label="閫傜敤宸ュ巶"
+          prop="applicableFactory"
+          class="factory_use_item"
+        >
+          <el-select
+            clearable
+            v-model="form.applicableFactory"
+            style="width: 160px"
+            placeholder="璇疯緭鍏ラ�傜敤宸ュ巶"
+            @change="changePlant($event)"
+          >
+            <el-option
+              v-for="plant in plantList"
+              :key="plant.id"
+              :label="plant.plantName"
+              :value="plant.plantCode"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item
+          label="閫傜敤杞﹂棿"
+          prop="applicableWorkshop"
+          class="factory_use_item"
+        >
+          <el-select
+            clearable
+            v-model="form.applicableWorkshop"
+            style="width: 160px"
+            placeholder="璇疯緭鍏ラ�傜敤杞﹂棿"
+          >
+            <el-option
+              v-for="shop in shopList"
+              :key="shop.id"
+              :label="shop.shopName"
+              :value="shop.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item
+          label="閫傜敤宸ュ簭"
+          prop="applicableProcess"
+          class="factory_use_item"
+        >
+          <el-select
+            clearable
+            v-model="form.applicableProcess"
+            style="width: 160px"
+            placeholder="璇疯緭鍏ラ�傜敤宸ュ簭"
+          >
+            <el-option
+              v-for="process in processList"
+              :key="process.id"
+              :label="process.processName"
+              :value="process.processName"
+            >
+            </el-option>
+          </el-select>
         </el-form-item>
       </el-form>
       <template #footer>
         <div class="dialog-footer">
-          <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
           <el-button @click="cancel">鍙� 娑�</el-button>
+          <el-button type="primary" @click="submitForm">淇濆瓨</el-button>
         </div>
       </template>
     </el-dialog>
@@ -145,10 +280,20 @@
 </template>
 
 <script setup name="Calendar">
-import { listCalendar, getCalendar, delCalendar, addCalendar, updateCalendar } from "@/api/core/calendar";
-
+import HxlhTable from "@/components/HxlhTable";
+import {
+  listCalendar,
+  getCalendar,
+  delCalendar,
+  addCalendar,
+  updateCalendar,
+} from "@/api/basicData/calendar";
+import axios from "axios";
+import { listAll_plant } from "@/api/basicData/plant";
+import { listAll_shop, listAps_shop } from "@/api/basicData/shop";
+import { selectProcessNameList } from "@/api/basicData/processRoute.js";
 const { proxy } = getCurrentInstance();
-
+const tableRef = ref()
 const calendarList = ref([]);
 const open = ref(false);
 const loading = ref(true);
@@ -158,9 +303,10 @@
 const multiple = ref(true);
 const total = ref(0);
 const title = ref("");
-
 const data = reactive({
-  form: {},
+  form: {
+    type: "1",
+  },
   queryParams: {
     pageNum: 1,
     pageSize: 10,
@@ -174,19 +320,225 @@
     applicableProcess: null,
   },
   rules: {
-  }
+    description: [
+      {
+        required: true,
+        message: "璇疯緭鍏ユ棩鍘嗘弿杩�",
+        trigger: "blur",
+      },
+    ],
+    type: [
+      {
+        required: true,
+        message: "璇烽�夋嫨鏃ュ巻绫诲瀷",
+        trigger: "blur",
+      },
+    ],
+    effectiveDate: [
+      {
+        required: true,
+        message: "璇烽�夋嫨鏃ュ巻鐢熸晥鏃堕棿",
+        trigger: "blur",
+      },
+    ],
+    expiringDate: [
+      {
+        required: true,
+        message: "璇烽�夋嫨鏃ュ巻澶辨晥鏃堕棿",
+        trigger: "blur",
+      },
+    ],
+    applicableFactory: [
+      {
+        required: true,
+        message: "璇烽�夋嫨閫傜敤宸ュ巶",
+        trigger: "blur",
+      },
+    ],
+  },
 });
-
 const { queryParams, form, rules } = toRefs(data);
+const dateType = ref("鍛ㄥ伐浣�");
+const dateTypeList = ref([
+  {
+    name: "鍛ㄥ伐浣�",
+    label: "1",
+  },
+  {
+    name: "鑺傚亣鏃�",
+    label: "2",
+  },
+]);
+const typeRadioNumber = ref(1);
+const weekDaysSettingList = ref([
+  {
+    day: "Monday",
+    chineseName: "鏄熸湡涓�",
+    work: "y",
+  },
+  {
+    day: "TuesDay",
+    chineseName: "鏄熸湡浜�",
+    work: "y",
+  },
+  {
+    day: "Wednesday",
+    chineseName: "鏄熸湡涓�",
+    work: "y",
+  },
+  {
+    day: "Thursday",
+    chineseName: "鏄熸湡鍥�",
+    work: "y",
+  },
+  {
+    day: "Friday",
+    chineseName: "鏄熸湡浜�",
+    work: "y",
+  },
+  {
+    day: "Saturday",
+    chineseName: "鏄熸湡鍏�",
+    work: "y",
+  },
+  {
+    day: "Sunday",
+    chineseName: "鏄熸湡鏃�",
+    work: "y",
+  },
+]);
+const holidays = ref({
+  startdate: "",
+  enddate: "",
+});
+const plantList = ref([]);
+const shopList = ref([]);
+const allShopList = ref([]);
+const processList = ref([]);
+const height = ref(document.documentElement.clientHeight - 220 + "px;");
+// 琛ㄦ牸閰嶇疆-鍒楄〃
+const columns = ref([
+  { type: "checkbox", width: 60, align: "center" },
+  {
+    title: "鏃ュ巻鎻忚堪",
+    field: "description",
+    width: 150,
+    align: "center",
+  },
+  {
+    title: "鏃ュ巻绫诲瀷",
+    field: "type",
+    width: 200,
+    align: "center",
+    slots: { default: "status" },
+  },
+  {
+    title: "鏃ュ巻鐢熸晥鏃堕棿",
+    field: "effectiveDate",
+    width: 200,
+    align: "center",
+  },
+  {
+    title: "鏃ュ巻澶辨晥鏃堕棿",
+    field: "expiringDate",
+    width: 200,
+    align: "center",
+  },
+  {
+    title: "鏃ュ巻鍐呭",
+    field: "content",
+    width: 230,
+    align: "center",
+    slots: { default: "mark" },
+  },
+  {
+    title: "閫傜敤宸ュ巶",
+    field: "applicableFactory",
+    width: 200,
+    align: "center",
+    formatter: ({ cellValue, row, column }) => {
+      console.log(cellValue, "000hsudhwhuwhuhwu");
+      for (let i = 0; i < plantList.value.length; i++) {
+        console.log(
+          cellValue,
+          plantList.value[i].plantCode,
+          plantList.value[i].plantName,
+          "111hsudhwhuwhuhwu"
+        );
+        if (cellValue === plantList.value[i].plantCode) {
+          return plantList.value[i].plantName;
+        }
+      }
+    },
+  },
+  {
+    title: '閫傜敤杞﹂棿',
+    field: 'applicableWorkshop',
+    width: 200,
+    align: 'center',
+    formatter: (({ cellValue, row, column }) => {
+     
+      if (cellValue) {
+        for(let i=0;i<shopList.value.length;i++){
+          if(cellValue===shopList.value[i].id){
+             console.log(cellValue,'cellValue')
+            return shopList.value[i].shopName
+          }
+        }
+      }
+      return '';
+    })
+  },
+  {
+    title: "閫傜敤宸ュ簭",
+    field: "applicableProcess",
+    width: 200,
+    align: "center",
+  },
+  {
+    title: "鍒涘缓鑰�",
+    field: "createBy",
+    width: 200,
+    align: "center",
+  },
+  {
+    title: "鍒涘缓鏃堕棿",
+    field: "createTime",
+    width: 200,
+    align: "center",
+  },
+  { title: '鎿嶄綔', width: 100, fixed:"right", slots: { default: 'buttons' }, align: 'center' }
+]);
+// 鍒嗛〉灞炴��
+const page = ref({
+  total: 0,
+  current: 1,
+  size: 10,
+});
 
 /** 鏌ヨ鏃ュ巻绠$悊鍒楄〃 */
 function getList() {
   loading.value = true;
-  listCalendar(queryParams.value).then(response => {
+  listCalendar(queryParams.value).then((response) => {
     calendarList.value = response.rows;
-    total.value = response.total;
+    page.value.total = response.total;
     loading.value = false;
   });
+  axios.all([
+    /** 鏌ヨ宸ュ巶鍒楄〃 */
+    listAll_plant({}),
+    /** 鏌ヨ杞﹂棿鍒楄〃 */
+    listAll_shop({}),
+  ])
+  .then(axios.spread((response1, response2) => {
+    plantList.value = response1.data;
+    shopList.value = response2.data;
+    loading.value = false;
+  }))
+  .catch(error => {
+    console.error('璇锋眰鍑洪敊:', error);
+  });
+
 }
 
 // 鍙栨秷鎸夐挳
@@ -200,7 +552,7 @@
   form.value = {
     id: null,
     description: null,
-    type: null,
+    type: "1",
     effectiveDate: null,
     expiringDate: null,
     content: null,
@@ -210,7 +562,7 @@
     createBy: null,
     createTime: null,
     updateBy: null,
-    updateTime: null
+    updateTime: null,
   };
   proxy.resetForm("calendarRef");
 }
@@ -229,24 +581,51 @@
 
 // 澶氶�夋閫変腑鏁版嵁
 function handleSelectionChange(selection) {
-  ids.value = selection.map(item => item.id);
+  ids.value = selection.map((item) => item.id);
   single.value = selection.length != 1;
   multiple.value = !selection.length;
 }
 
 /** 鏂板鎸夐挳鎿嶄綔 */
-function handleAdd() {
+async function handleAdd() {
   reset();
   open.value = true;
   title.value = "娣诲姞鏃ュ巻绠$悊";
-}
+  // const res = await listAll_plant({});
+  // plantList.value = res.data;
 
+  console.log(res, "sjchhscwhciwhcwi");
+}
+/** 閫夋嫨宸ュ巶鍚庝簨浠� 鍔犺浇杞﹂棿 鍜� 宸ュ簭 **/
+function changePlant(plant) {
+  listAps_shop({ plantCode: plant }).then((response) => {
+    console.log(response, "sbcsuhcuhscschsc");
+    shopList.value = response.rows;
+  });
+  selectProcessNameList({ orgCode: plant }).then((response) => {
+    processList.value = response.rows;
+  });
+}
 /** 淇敼鎸夐挳鎿嶄綔 */
 function handleUpdate(row) {
   reset();
-  const _id = row.id || ids.value
-  getCalendar(_id).then(response => {
+  const _id = row.id || ids.value;
+  getCalendar(_id).then((response) => {
     form.value = response.data;
+    console.log(
+      form.value,
+      JSON.parse(response.data.content.value),
+      "hushchsuch"
+    );
+    // form.value.content = JSON.parse(response.data.content.value);
+    if (form.value.type === "1") {
+      weekDaysSettingList.value = JSON.parse(
+        response.data.content.value
+      ).weekdays;
+    } else if (form.value.type === "2") {
+      holidays.value = JSON.parse(response.data.content.value).holidays;
+    }
+
     open.value = true;
     title.value = "淇敼鏃ュ巻绠$悊";
   });
@@ -254,20 +633,61 @@
 
 /** 鎻愪氦鎸夐挳 */
 function submitForm() {
-  proxy.$refs["calendarRef"].validate(valid => {
+  proxy.$refs["calendarRef"].validate((valid) => {
     if (valid) {
       if (form.value.id != null) {
-        updateCalendar(form.value).then(response => {
-          proxy.$modal.msgSuccess("淇敼鎴愬姛");
-          open.value = false;
-          getList();
-        });
+        console.log(form.value, "淇敼鏃ュ巻===");
+        if (form.value.type === "1") {
+          updateCalendar({
+            ...form.value,
+            content: {
+              weekdays: weekDaysSettingList.value,
+            },
+            applicableWorkshop: form.value.applicableWorkshop,
+            applicableProcess: form.value.applicableProcess,
+          }).then((response) => {
+            proxy.$modal.msgSuccess("淇敼鎴愬姛");
+            open.value = false;
+            getList();
+          });
+        } else if (form.value.type === "2") {
+          updateCalendar({
+            ...form.value,
+            content: {
+              holidays: holidays.value,
+            },
+            applicableWorkshop: form.value.applicableWorkshop,
+            applicableProcess: form.value.applicableProcess,
+          }).then((response) => {
+            proxy.$modal.msgSuccess("淇敼鎴愬姛");
+            open.value = false;
+            getList();
+          });
+        }
       } else {
-        addCalendar(form.value).then(response => {
-          proxy.$modal.msgSuccess("鏂板鎴愬姛");
-          open.value = false;
-          getList();
-        });
+        if (form.value.type === "1") {
+          addCalendar({
+            ...form.value,
+            content: {
+              weekdays: weekDaysSettingList.value,
+            },
+          }).then((response) => {
+            proxy.$modal.msgSuccess("鏂板鎴愬姛");
+            open.value = false;
+            getList();
+          });
+        } else if (form.value.type === "2") {
+          addCalendar({
+            ...form.value,
+            content: {
+              holidays: holidays.value,
+            },
+          }).then((response) => {
+            proxy.$modal.msgSuccess("鏂板鎴愬姛");
+            open.value = false;
+            getList();
+          });
+        }
       }
     }
   });
@@ -276,20 +696,117 @@
 /** 鍒犻櫎鎸夐挳鎿嶄綔 */
 function handleDelete(row) {
   const _ids = row.id || ids.value;
-  proxy.$modal.confirm('鏄惁纭鍒犻櫎鏃ュ巻绠$悊缂栧彿涓�"' + _ids + '"鐨勬暟鎹」锛�').then(function() {
-    return delCalendar(_ids);
-  }).then(() => {
-    getList();
-    proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-  }).catch(() => {});
+  proxy.$modal
+    .confirm('鏄惁纭鍒犻櫎鏃ュ巻绠$悊缂栧彿涓�"' + _ids + '"鐨勬暟鎹」锛�')
+    .then(function () {
+      return delCalendar(_ids);
+    })
+    .then(() => {
+      getList();
+      proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+    })
+    .catch(() => {});
 }
 
 /** 瀵煎嚭鎸夐挳鎿嶄綔 */
 function handleExport() {
-  proxy.download('core/calendar/export', {
-    ...queryParams.value
-  }, `calendar_${new Date().getTime()}.xlsx`)
+  proxy.download(
+    "core/calendar/export",
+    {
+      ...queryParams.value,
+    },
+    `calendar_${new Date().getTime()}.xlsx`
+  );
 }
-
-getList();
+function handleSwitchType(e) {
+  console.log(e, "鏃ユ湡绫诲瀷鍒囨崲");
+  typeRadioNumber.value = e;
+  form.value.type = e;
+  form.value.effectiveDate = null;
+  form.value.expiringDate = null;
+  form.value.content = null;
+  form.value.applicableFactory = null;
+  form.value.applicableWorkshop = null;
+  form.value.applicableProcess = null;
+}
+// 璁剧疆鍛ㄥ伐浣滄棩
+function handleSetWorkDays(e) {
+  console.log(weekDaysSettingList.value, "璁剧疆鍛ㄥ伐浣滄棩");
+}
+function changePageNo(currentPage) {
+  queryParams.value.pageNum = currentPage;
+  page.value.current = currentPage;
+  getList();
+}
+function changePageSize(pageSize) {
+  page.value.current = 1;
+  queryParams.value.pageNum = 1;
+  queryParams.value.pageSize = pageSize;
+  getList();
+}
+// 澶氶�夋閫変腑鏁版嵁
+const handleCheckboxChange = (data) => {
+  ids.value = data.records.map((item) => item.id);
+  single.value = data.records.length !== 1;
+  multiple.value = !data.records.length;
+};
+onMounted(() => {
+  getList();
+});
 </script>
+<style lang="scss" scoped>
+.column-with-margin {
+  margin-right: 0px;
+}
+.title_bar_line {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  color: #333;
+  margin-bottom: 10px;
+  .line_short {
+    width: 5%;
+    height: 1px;
+    margin-right: 20px;
+    border-top: 1px solid #ddd;
+  }
+  .line_long {
+    width: 60%;
+    height: 1px;
+    margin-left: 20px;
+    border-top: 1px solid #ddd;
+  }
+}
+.week_flex {
+  display: flex;
+  justify-content: flex-start;
+  align-content: center;
+  color: #606266;
+  font-weight: 700;
+  margin-left: 20px;
+  &.mt20 {
+    margin-top: 20px;
+    margin-left: 0 !important;
+  }
+  .week_flex_item {
+    &:nth-child(1) {
+      margin-top: 5px;
+    }
+    &:nth-child(2) {
+      margin-left: 20px;
+    }
+  }
+}
+.factory_use_item {
+  margin-top: 10px;
+}
+.mart5{
+  margin-top:5px;
+}
+.custom-height {
+  height: 200px; /* 鎴栬�呬娇鐢� min-height */
+}
+.auto-height-grid .xe-body .xe-body--row {
+  height: auto; /* 鎴栬�呬娇鐢� min-height */
+}
+</style>

--
Gitblit v1.9.3