From eb50cc99c74372f449c20f92a79721dc6843c02f Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期一, 15 九月 2025 19:33:18 +0800
Subject: [PATCH] art: 生产订单SAP同步

---
 src/views/mes/modules/MesProductionOrderModal.vue |    5 ++
 src/views/mes/MesProductionOrderList.vue          |   65 +++++++++++++++++++++++---------
 2 files changed, 51 insertions(+), 19 deletions(-)

diff --git a/src/views/mes/MesProductionOrderList.vue b/src/views/mes/MesProductionOrderList.vue
index e48a9b7..a7ae2c7 100644
--- a/src/views/mes/MesProductionOrderList.vue
+++ b/src/views/mes/MesProductionOrderList.vue
@@ -20,21 +20,27 @@
               <j-input placeholder="璇疯緭鍏ョ墿鏂欑紪鍙�" v-model="queryParam.materialNumber"></j-input>
             </a-form-item>
           </a-col>
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="鐗╂枡鍚嶇О">
-              <j-input placeholder="璇疯緭鍏ョ墿鏂欏悕绉�" v-model="queryParam.materialName"></j-input>
-            </a-form-item>
-          </a-col>
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="璁㈠崟鐘舵��">
-              <j-dict-select-tag dictCode="production_order_status" placeholder="璇烽�夋嫨璁㈠崟鐘舵��"
-                                 v-model="queryParam.orderStatus"></j-dict-select-tag>
-            </a-form-item>
-          </a-col>
+          <template v-if="toggleSearchStatus">
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="鐗╂枡鍚嶇О">
+                <j-input placeholder="璇疯緭鍏ョ墿鏂欏悕绉�" v-model="queryParam.materialName"></j-input>
+              </a-form-item>
+            </a-col>
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="璁㈠崟鐘舵��">
+                <j-dict-select-tag dictCode="production_order_status" placeholder="璇烽�夋嫨璁㈠崟鐘舵��"
+                                   v-model="queryParam.orderStatus"></j-dict-select-tag>
+              </a-form-item>
+            </a-col>
+          </template>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
               <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
               <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>
+               <a @click="handleToggleSearch" style="margin-left: 8px">
+                {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }}
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
+              </a>
             </span>
           </a-col>
         </a-row>
@@ -64,6 +70,10 @@
         class="j-table-force-nowrap"
         @change="handleTableChange">
         <span slot="action" slot-scope="text, record">
+          <a-popconfirm title="纭畾鍚屾鏈�鏂版暟鎹悧?" @confirm="() => handleSync(record.id)">
+          <a>鍒犻櫎</a>
+        </a-popconfirm>
+          <a-divider type="vertical" />
           <a @click="handleEdit(record)">缂栬緫</a>
           <a-divider type="vertical" />
           <a @click="handleDetail(record)">璇︽儏</a>
@@ -81,6 +91,7 @@
 import { mixinDevice } from '@/utils/mixin'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import MesProductionOrderModal from './modules/MesProductionOrderModal'
+import { getAction } from '@api/manage'
 
 export default {
   name: 'MesProductionOrderList',
@@ -102,25 +113,25 @@
           customRender: function(t, r, index) {
             return parseInt(index) + 1
           },
-          fixed: 'left',
+          fixed: 'left'
         },
         {
           title: '鐢熶骇璁㈠崟鍙�',
           align: 'center',
           dataIndex: 'orderCode',
-          fixed: 'left',
+          fixed: 'left'
         },
         {
           title: '璁㈠崟绫诲瀷',
           align: 'center',
           dataIndex: 'orderCategory_dictText',
-          fixed: 'left',
+          fixed: 'left'
         },
         {
           title: '鐗╂枡缂栧彿',
           align: 'center',
           dataIndex: 'materialNumber',
-          fixed: 'left',
+          fixed: 'left'
         },
         {
           title: '鐗╂枡鍚嶇О',
@@ -248,15 +259,31 @@
       ],
       url: {
         list: '/mes/productionOrder/list',
-      },
-      dictOptions: {},
+        syncSapProductionOrder: '/mes/productionOrder/syncSapProductionOrder'
+      }
     }
   },
   created() {
   },
-  computed: {
-  },
+  computed: {},
   methods: {
+    handleSync(id) {
+      let that = this
+      getAction(that.url.syncSapProductionOrder, { id: id }).then((res) => {
+        if (res.success) {
+          that.$notification.success({
+            message: '娑堟伅',
+            description: res.message
+          })
+          that.loadData()
+        } else {
+          that.$notification.warning({
+            message: '娑堟伅',
+            description: res.message
+          })
+        }
+      })
+    }
   }
 }
 </script>
diff --git a/src/views/mes/modules/MesProductionOrderModal.vue b/src/views/mes/modules/MesProductionOrderModal.vue
index 4623da5..d968998 100644
--- a/src/views/mes/modules/MesProductionOrderModal.vue
+++ b/src/views/mes/modules/MesProductionOrderModal.vue
@@ -56,6 +56,11 @@
     },
     handleCancel() {
       this.close()
+    },
+    // 鎵撳紑璇︽儏寮圭獥鏃舵竻闄よ〃鍗曟牎楠�
+    removeValidate() {
+      if (this.$refs.realForm)
+        this.$refs.realForm.clearValidate()
     }
   }
 }

--
Gitblit v1.9.3