From 2591e298a3fd1332ad0ca33059f6ba0b7d426f51 Mon Sep 17 00:00:00 2001
From: pengwei <2071057782@qq.com>
Date: 星期四, 20 三月 2025 10:08:00 +0800
Subject: [PATCH] 最新代码提交

---
 项目代码/client/src/views/tts/TaskManagement/Tasktemplates.vue |  138 +++++++++++++++++++++++++++++-----------------
 1 files changed, 87 insertions(+), 51 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/tts/TaskManagement/Tasktemplates.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/tts/TaskManagement/Tasktemplates.vue"
index ddcc095..83a638a 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/tts/TaskManagement/Tasktemplates.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/tts/TaskManagement/Tasktemplates.vue"
@@ -63,7 +63,7 @@
           <el-button
             type="primary"
             size="small"
-            @click="add('鏂板缓')"
+            @click="addData()"
             style="
               width: 5.5rem;
               height: 2rem;
@@ -170,7 +170,7 @@
       v-model="dialogVisible"
       title=""
       width="60%"
-      @close="handleClose(formRef)"
+      @close="resetForm(formRef)"
       top="2%"
     >
       <template #title>
@@ -550,7 +550,7 @@
   </div>
 </template>
 <script setup>
-import { ref, reactive, onMounted } from "vue";
+import { ref, reactive, onMounted, toRef } from "vue";
 import {
   GetTemplateList,
   AddData,
@@ -561,16 +561,19 @@
 import { GetUerType } from "@/api/user";
 import { ElMessage } from "element-plus";
 import { formatTime } from "@/utils/index.js";
-const queryForm = reactive({
+
+const obj = {
   selectName: "",
   selectTime: [], // 鏃堕棿鑼冨洿
   selectType: "",
   selectInput: "",
-});
+};
+const queryForm = toRef({ ...obj });
 
+//琛ㄥ崟鏁版嵁
 const tableData = ref([]);
 const props = { multiple: true };
-const table = ref(false);
+// const table = ref(false);
 //鏂板缓/缂栬緫  鎻愪氦鏁版嵁
 const form = ref({
   templateName: "",
@@ -587,22 +590,25 @@
   fuZhu_Lc: "",
   liJu_Dg: "",
   fuZhu_Dg: "",
+  createDate: formatTime(new Date()), //鍒涘缓鏃堕棿
+  creater: JSON.parse(localStorage.getItem("user")).userName, //鍒涘缓浜�
 });
 
 const selectoptions = ref([
   {
-    value: "鐢垫皵",
-    label: "鐢垫皵",
+    value: "templateName",
+    label: "妯℃澘鍚嶇О",
   },
   {
-    value: "鏈烘",
-    label: "鏈烘",
+    value: "takeName",
+    label: "浠诲姟鍚嶇О",
   },
   {
-    value: "鍦版矡",
-    label: "鍦版矡",
+    value: "jiShuYuan",
+    label: "鎶�鏈憳",
   },
 ]);
+//琛ㄥ崟瑙勫垯
 const rules = reactive({
   templateName: [
     { required: true, message: "璇疯緭鍏ユā鏉垮悕绉�", trigger: "blur" },
@@ -632,13 +638,6 @@
   ],
   fuZhu_Dg: [{ required: true, message: "璇疯緭鍏ュ湴娌熻緟鍔╁憳", trigger: "blur" }],
 });
-
-function cancelClick() {
-  table.value = false;
-}
-function confirmClick() {
-  table.value = false;
-}
 //寮瑰嚭妗�
 const dialogVisible = ref(false);
 const UerTypeoptions = ref({
@@ -648,21 +647,34 @@
   trench: [], //鍦版矡
 });
 const type = ref("鏂板缓");
+//鏂板缓缂栬緫ref
+const formRef = ref();
+//椤甸潰鏁伴噺
+const pageTotal = ref(0);
 //娣诲姞鏂规硶
-const add = (val) => {
-  type.value = val;
+const addData = () => {
+  type.value = "鏂板缓";
   GetUerType().then((res) => {
-    UerTypeoptions.value.quality = res.data.filter(
-      (item) => item.roleId != 1 && item.roleId == 2
-    );
+    UerTypeoptions.value.quality = res.data.filter((item) => {
+      return item.user_Id != 1 && item.roleName.substring(2, 4) == "璐ㄦ";
+    });
     UerTypeoptions.value.electric = res.data.filter(
-      (item) => item.roleId != 1 && item.roleId == 3
+      (item) =>
+        item.user_Id != 1 &&
+        item.roleName.substring(2, 4) != "璐ㄦ" &&
+        item.roleName.substring(0, 2) == "鐢垫皵"
     );
     UerTypeoptions.value.mechanical = res.data.filter(
-      (item) => item.roleId != 1 && item.roleId == 4
+      (item) =>
+        item.user_Id != 1 &&
+        item.roleName.substring(2, 4) != "璐ㄦ" &&
+        item.roleName.substring(0, 2) == "鏈烘"
     );
     UerTypeoptions.value.trench = res.data.filter(
-      (item) => item.roleId != 1 && item.roleId == 5
+      (item) =>
+        item.user_Id != 1 &&
+        item.roleName.substring(2, 4) != "璐ㄦ" &&
+        item.roleName.substring(0, 2) == "鍦版矡"
     );
     dialogVisible.value = true;
   });
@@ -675,23 +687,30 @@
   form.value = Object.assign({}, obj);
   dialogVisible.value = true;
   GetUerType().then((res) => {
-    UerTypeoptions.value.quality = res.data.filter(
-      (item) => item.roleId != 1 && item.roleId == 2
-    );
+    UerTypeoptions.value.quality = res.data.filter((item) => {
+      return item.user_Id != 1 && item.roleName.substring(2, 4) == "璐ㄦ";
+    });
     UerTypeoptions.value.electric = res.data.filter(
-      (item) => item.roleId != 1 && item.roleId == 3
+      (item) =>
+        item.user_Id != 1 &&
+        item.roleName.substring(2, 4) != "璐ㄦ" &&
+        item.roleName.substring(0, 2) == "鐢垫皵"
     );
     UerTypeoptions.value.mechanical = res.data.filter(
-      (item) => item.roleId != 1 && item.roleId == 4
+      (item) =>
+        item.user_Id != 1 &&
+        item.roleName.substring(2, 4) != "璐ㄦ" &&
+        item.roleName.substring(0, 2) == "鏈烘"
     );
     UerTypeoptions.value.trench = res.data.filter(
-      (item) => item.roleId != 1 && item.roleId == 5
+      (item) =>
+        item.user_Id != 1 &&
+        item.roleName.substring(2, 4) != "璐ㄦ" &&
+        item.roleName.substring(0, 2) == "鍦版矡"
     );
     dialogVisible.value = true;
   });
 };
-// 鑾峰彇鏁版嵁
-const getpagedata = () => {};
 
 //鑾峰彇闇�瑕佸垹闄ょ殑鏁版嵁
 const deletid = ref([]);
@@ -718,19 +737,20 @@
     }
   });
 };
+//瀵煎嚭鏁版嵁
 const printExcel = () => {
   // 鏌ヨ鏉′欢
-  const startTime = formatTime(queryForm.selectTime[0]);
-  const endTime = formatTime(queryForm.selectTime[1]);
+  const startTime = formatTime(queryForm.value.selectTime[0]);
+  const endTime = formatTime(queryForm.value.selectTime[1]);
   const filter = [
     {
-      name: queryForm.selectType,
-      value: queryForm.selectInput,
-      displayType: "String",
+      name: queryForm.value.selectType,
+      value: queryForm.value.selectInput,
+      displayType: "like",
     },
     {
       name: "pustatus",
-      value: queryForm.selectName,
+      value: queryForm.value.selectName,
       displayType: "String",
     },
     { name: "createDate", value: startTime, displayType: "ThanOrEqual" },
@@ -799,16 +819,16 @@
   pageQuery.value.page = val;
   initData();
 };
-const pageTotal = ref(0);
+//椤甸潰鍒濆鍖栨暟鎹�
 const initData = () => {
   // 鏌ヨ鏉′欢
-  const startTime = formatTime(queryForm.selectTime[0]);
-  const endTime = formatTime(queryForm.selectTime[1]);
+  const startTime = formatTime(queryForm.value.selectTime[0]);
+  const endTime = formatTime(queryForm.value.selectTime[1]);
   const filter = [
     {
-      name: "",
-      value: queryForm.selectName,
-      displayType: "Contains",
+      name: queryForm.value.selectType,
+      value: queryForm.value.selectInput,
+      displayType: "like",
     },
     { name: "createDate", value: startTime, displayType: "ThanOrEqual" },
     { name: "createDate", value: endTime, displayType: "LessOrEqual" },
@@ -827,16 +847,33 @@
   pageQuery.value.page = 1;
   initData();
 };
+//閲嶇疆椤甸潰
 const resetQuery = () => {
-  queryForm.value = { selectName: "", selectTime: [] };
+  queryForm.value = Object.assign({}, obj);
   pageQuery.value.page = 1;
   initData();
 };
-const formRef = ref();
+
 //閲嶇疆琛ㄥ崟
-const handleClose = (formEl) => {
+const resetForm = (formEl) => {
   if (!formEl) return;
   formEl.resetFields();
+  form.value = {
+    templateName: "",
+    templateGroup: "",
+    takeName: "",
+    jiShuYuan: "",
+    gongZhang: "",
+    zhiJianYuan_Dq: "",
+    zhiJianYuan_Lc: "",
+    zhiJianYuan_Dg: "",
+    liJu_Dq: "",
+    fuZhu_Dq: "",
+    liJu_Lc: "",
+    fuZhu_Lc: "",
+    liJu_Dg: "",
+    fuZhu_Dg: "",
+  };
 };
 onMounted(() => {
   initData();
@@ -883,7 +920,6 @@
           width: 6.88rem;
           height: 2rem;
           text-align: center;
-          border: 0.06rem solid rgba(222, 222, 222, 1);
           border-radius: 0.25rem 0 0 0.25rem;
           font-size: 0.75rem;
           display: flex;

--
Gitblit v1.9.3