From ec0d91353b767f089fa72f3cd1eb62568852710b Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期四, 22 八月 2024 10:39:30 +0800
Subject: [PATCH] 工单管理增加取消下发功能

---
 src/assets/icons/Cancel.svg                                         |    1 +
 src/assets/icons/unrelease.svg                                      |    2 +-
 src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO_BATCH.ts |   33 ++++++++++++++++++++++++++++++++-
 src/assets/icons/unrelease-blue.svg                                 |    1 +
 4 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/src/assets/icons/Cancel.svg b/src/assets/icons/Cancel.svg
new file mode 100644
index 0000000..d3fb035
--- /dev/null
+++ b/src/assets/icons/Cancel.svg
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1724293769623" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4238" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M361.386667 361.386667a32 32 0 0 1 45.226666 0L512 466.773333l105.386667-105.386666a32 32 0 1 1 45.226666 45.226666L557.226667 512l105.386666 105.386667a32 32 0 1 1-45.226666 45.226666L512 557.226667l-105.386667 105.386666a32 32 0 0 1-45.226666-45.226666L466.773333 512 361.386667 406.613333a32 32 0 0 1 0-45.226666z" fill="#0a85c6" p-id="4239"></path><path d="M312.192 160.810667a1813.418667 1813.418667 0 0 1 399.616 0c77.952 8.704 140.885333 70.101333 150.016 148.48 15.786667 134.656 15.786667 270.762667 0 405.461333-9.173333 78.378667-72.106667 139.733333-150.016 148.48a1813.802667 1813.802667 0 0 1-399.616 0c-77.952-8.746667-140.885333-70.101333-150.016-148.48a1745.152 1745.152 0 0 1 0-405.504c9.130667-78.336 72.106667-139.733333 150.016-148.48z m392.533333 63.573333a1749.376 1749.376 0 0 0-385.450666 0A106.069333 106.069333 0 0 0 225.706667 316.714667a1681.194667 1681.194667 0 0 0 0 390.570666 106.069333 106.069333 0 0 0 93.568 92.288c127.018667 14.208 258.432 14.208 385.450666 0a106.069333 106.069333 0 0 0 93.525334-92.288 1681.109333 1681.109333 0 0 0 0-390.570666 106.069333 106.069333 0 0 0-93.525334-92.330667z" fill="#0a85c6" p-id="4240"></path></svg>
\ No newline at end of file
diff --git a/src/assets/icons/unrelease-blue.svg b/src/assets/icons/unrelease-blue.svg
new file mode 100644
index 0000000..ec4ea14
--- /dev/null
+++ b/src/assets/icons/unrelease-blue.svg
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1724294074697" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8407" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M912.657067 0a68.266667 68.266667 0 0 1 68.266666 68.266667l-0.068266 332.8 0.136533 0.955733a40.96 40.96 0 0 1-34.338133 40.413867l-6.621867 0.546133a40.96 40.96 0 0 1-40.96-40.96L898.935467 81.92H116.053333v860.091733l368.64-0.068266A40.96 40.96 0 1 1 484.693333 1024H102.4a68.266667 68.266667 0 0 1-68.266667-68.266667V68.266667a68.266667 68.266667 0 0 1 68.266667-68.266667h810.257067zM716.8 443.733333a273.066667 273.066667 0 1 1 0 546.133334 273.066667 273.066667 0 0 1 0-546.133334z m0 81.92a191.146667 191.146667 0 1 0 0 382.293334 191.146667 191.146667 0 0 0 0-382.293334z m-38.638933 94.890667l38.638933 38.5024 38.638933-38.570667a40.96 40.96 0 0 1 57.890134 57.9584l-38.570667 38.570667 38.570667 38.638933a40.96 40.96 0 0 1-57.890134 57.9584L716.8 774.9632l-38.638933 38.638933a40.96 40.96 0 0 1-57.890134-57.9584l38.570667-38.638933-38.570667-38.570667a40.96 40.96 0 0 1 57.890134-57.9584zM390.485333 136.533333a40.96 40.96 0 0 1 40.96 40.96v200.704l65.1264-65.1264a40.96 40.96 0 1 1 57.890134 57.890134l-135.168 135.168a40.823467 40.823467 0 0 1-25.463467 11.8784h-6.9632a40.823467 40.823467 0 0 1-25.463467-11.8784l-135.168-135.168a40.96 40.96 0 0 1 57.890134-57.890134l65.3312 65.3312V177.493333a40.96 40.96 0 0 1 40.96-40.96z" fill="#106fa0" p-id="8408"></path></svg>
\ No newline at end of file
diff --git a/src/assets/icons/unrelease.svg b/src/assets/icons/unrelease.svg
index e7cc357..265d1c9 100644
--- a/src/assets/icons/unrelease.svg
+++ b/src/assets/icons/unrelease.svg
@@ -1 +1 @@
-<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1716651312719" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="45590" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M925.5 340.15v530.94c0 49.5-40.5 90-90 90H186.59c-49.5 0-90-40.5-90-90v-716c0-49.5 40.5-90 90-90h463.85v40H196.59c-33 0-60 27-60 60v696c0 33 27 60 60 60H825.5c33 0 60-27 60-60V340.15h40z" fill="#d81e06" p-id="45591"></path><path d="M919.64 351.31c-7.81 7.81-20.47 7.81-28.28 0L639.28 99.23c-7.81-7.81-7.81-20.47 0-28.28 7.81-7.81 20.47-7.81 28.28 0l252.08 252.08c7.81 7.81 7.81 20.47 0 28.28zM603.67 308.07H233.11c-11.05 0-20-8.95-20-20s8.95-20 20-20h370.55c11.05 0 20 8.95 20 20 0.01 11.05-8.95 20-19.99 20zM603.67 478.41H233.11c-11.05 0-20-8.95-20-20s8.95-20 20-20h370.55c11.05 0 20 8.95 20 20 0.01 11.04-8.95 20-19.99 20zM423.92 648.75H233.11c-11.05 0-20-8.95-20-20s8.95-20 20-20h190.81c11.05 0 20 8.95 20 20 0 11.04-8.95 20-20 20zM745.32 850.24L561.93 666.85c-7.81-7.81-7.81-20.47 0-28.28 7.81-7.81 20.47-7.81 28.28 0L773.6 821.96c7.81 7.81 7.81 20.47 0 28.28-7.8 7.81-20.47 7.81-28.28 0z" fill="#d81e06" p-id="45592"></path><path d="M561.93 821.96l183.39-183.39c7.81-7.81 20.47-7.81 28.28 0 7.81 7.81 7.81 20.47 0 28.28L590.22 850.24c-7.81 7.81-20.47 7.81-28.28 0-7.82-7.81-7.82-20.47-0.01-28.28z" fill="#d81e06" p-id="45593"></path></svg>
\ No newline at end of file
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1724294074697" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8407" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M912.657067 0a68.266667 68.266667 0 0 1 68.266666 68.266667l-0.068266 332.8 0.136533 0.955733a40.96 40.96 0 0 1-34.338133 40.413867l-6.621867 0.546133a40.96 40.96 0 0 1-40.96-40.96L898.935467 81.92H116.053333v860.091733l368.64-0.068266A40.96 40.96 0 1 1 484.693333 1024H102.4a68.266667 68.266667 0 0 1-68.266667-68.266667V68.266667a68.266667 68.266667 0 0 1 68.266667-68.266667h810.257067zM716.8 443.733333a273.066667 273.066667 0 1 1 0 546.133334 273.066667 273.066667 0 0 1 0-546.133334z m0 81.92a191.146667 191.146667 0 1 0 0 382.293334 191.146667 191.146667 0 0 0 0-382.293334z m-38.638933 94.890667l38.638933 38.5024 38.638933-38.570667a40.96 40.96 0 0 1 57.890134 57.9584l-38.570667 38.570667 38.570667 38.638933a40.96 40.96 0 0 1-57.890134 57.9584L716.8 774.9632l-38.638933 38.638933a40.96 40.96 0 0 1-57.890134-57.9584l38.570667-38.638933-38.570667-38.570667a40.96 40.96 0 0 1 57.890134-57.9584zM390.485333 136.533333a40.96 40.96 0 0 1 40.96 40.96v200.704l65.1264-65.1264a40.96 40.96 0 1 1 57.890134 57.890134l-135.168 135.168a40.823467 40.823467 0 0 1-25.463467 11.8784h-6.9632a40.823467 40.823467 0 0 1-25.463467-11.8784l-135.168-135.168a40.96 40.96 0 0 1 57.890134-57.890134l65.3312 65.3312V177.493333a40.96 40.96 0 0 1 40.96-40.96z" fill="#d81e06" p-id="8408"></path></svg>
\ No newline at end of file
diff --git a/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO_BATCH.ts b/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO_BATCH.ts
index 8801d77..213042c 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO_BATCH.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO_BATCH.ts
@@ -4,7 +4,7 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-07-25 21:44:58
+ * @LastEditTime: 2024-08-22 10:26:40
  */
 
 import { Tag, Tooltip } from 'ant-design-vue';
@@ -58,6 +58,10 @@
         if (x.name == 'handleRelease') {
           x.onClick = handleRelease.bind(null, args, params);
           x.tooltip = '涓嬪彂';
+        }
+        if (x.name == 'handleUnRelease') {
+          x.onClick = handleUnRelease.bind(null, args, params);
+          x.tooltip = '鍙栨秷涓嬪彂';
         }
       });
       return data;
@@ -408,6 +412,33 @@
     });
   }
 
+  /**
+   * @description: 宸ュ崟鍙栨秷涓嬪彂鏂规硶
+   * @param {*} args
+   * @param {Recordable} params
+   * @return {*}
+   */
+  function handleUnRelease(args, params: Recordable) {
+    const reload = args[1];
+    if (params['record'].STATUS != 2) {
+      createErrorModal({
+        title: t('璀﹀憡'),
+        content: t('宸ュ崟涓嶆槸涓嬪彂鐘舵�侊紝涓嶈兘鍙栨秷涓嬪彂锛�'),
+        getContainer: () => document.body,
+      });
+      return;
+    } 
+    params['record'].STATUS = 0;
+    SaveEntity(params['record'], true, 'BIZ_MES_WO_BATCH').then((action) => {
+      if (action.IsSuccessed) {
+        createMessage.success(t('宸插彇娑�'));
+        reload();
+      } else {
+        createMessage.success(t('鍙栨秷鎿嶄綔澶辫触'));
+      }
+    });
+  }
+
   const woformSchema: FormSchema[] = [
     {
       field: 'PLAN_QTY',

--
Gitblit v1.9.3