From c69af876655527743762614dfdbb3af5e21f0fb8 Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期二, 12 八月 2025 15:16:02 +0800
Subject: [PATCH] 排产工单页面状态、操作按钮调整

---
 src/views/mes/MesProductionWorkOrderListView.vue            |   37 ++++++++++-
 src/views/mes/modules/MesProductionWorkOrderReportModal.vue |  143 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 175 insertions(+), 5 deletions(-)

diff --git a/src/views/mes/MesProductionWorkOrderListView.vue b/src/views/mes/MesProductionWorkOrderListView.vue
index 17bf9dc..e7fd391 100644
--- a/src/views/mes/MesProductionWorkOrderListView.vue
+++ b/src/views/mes/MesProductionWorkOrderListView.vue
@@ -83,9 +83,19 @@
 
           <span slot="action" slot-scope="text, record">
             <a @click="handleDetail(record)">璇︽儏</a>
-          <span v-if="record.workOrderStatus === 'PUBLISHED'">
+          <span v-if="record.workOrderStatus === 'PUBLISHED' || record.workOrderStatus === 'EXECUTING'">
             <a-divider type="vertical" />
             <a @click="handleRePublish(record)">閲嶅彂甯�</a>
+          </span>
+            <span v-if="record.workOrderStatus === 'PUBLISHED'">
+            <a-divider type="vertical" />
+            <a-popconfirm title="纭畾寮�濮嬫墽琛屽悧?" @confirm="() => handleExecute(record.id)">
+                <a>鎵ц</a>
+            </a-popconfirm>
+          </span>
+          <span v-if="record.workOrderStatus === 'EXECUTING'">
+            <a-divider type="vertical" />
+            <a @click="handleWorkReport(record)">鎶ュ伐</a>
           </span>
           <span v-if="record.workOrderStatus === 'NEW'">
             <a-divider type="vertical" />
@@ -195,6 +205,7 @@
     <MesMaterialTransferDetailList ref="MesMaterialTransferDetailList"></MesMaterialTransferDetailList>
     <MesProductionWorkOrderScheduleModal ref="MesProductionWorkOrderScheduleModal"></MesProductionWorkOrderScheduleModal>
     <MesProductionWorkOrderRepublishModal ref="MesProductionWorkOrderRepublishModal" @ok="modalFormOk"></MesProductionWorkOrderRepublishModal>
+    <MesProductionWorkOrderReportModal ref="MesProductionWorkOrderReportModal" @ok="modalFormOk"></MesProductionWorkOrderReportModal>
   </a-card>
 </template>
 
@@ -213,6 +224,7 @@
 import MesMaterialTransferDetailList from '@views/mes/MesMaterialTransferDetailList.vue'
 import MesProductionWorkOrderScheduleModal from '@views/mes/modules/MesProductionWorkOrderScheduleModal.vue'
 import MesProductionWorkOrderRepublishModal from '@views/mes/modules/MesProductionWorkOrderRepublishModal.vue'
+import MesProductionWorkOrderReportModal from '@views/mes/modules/MesProductionWorkOrderReportModal.vue'
 
 export default {
   name: 'MesProductionWorkOrderList',
@@ -223,7 +235,8 @@
     MesMaterialUnloadingList,
     MesMaterialTransferDetailList,
     MesProductionWorkOrderScheduleModal,
-    MesProductionWorkOrderRepublishModal
+    MesProductionWorkOrderRepublishModal,
+    MesProductionWorkOrderReportModal,
   },
   data() {
     return {
@@ -274,7 +287,7 @@
           dataIndex: 'planQuantity'
         },
         {
-          title: '浜х嚎(鍐椾綑)',
+          title: '浜х嚎',
           align: 'center',
           dataIndex: 'factoryId_dictText'
         },
@@ -284,7 +297,7 @@
           dataIndex: 'groupId_dictText'
         },
         {
-          title: '鐝(鍐椾綑)',
+          title: '鐝',
           align: 'center',
           dataIndex: 'shiftId_dictText'
         },
@@ -674,7 +687,8 @@
         queryOrderById:'/mesproductionwork/mesProductionOrder/queryById',
         queryUnloadingByLoadingId:'/mes/mesMaterialUnloading/queryUnloadingByLoadingId',
         queryTransferDetailBy:'/mes/mesMaterialTransferDetail/queryTransferDetailBy',
-        publish: '/mesproductionworkorder/mesProductionWorkOrder/publish'
+        publish: '/mesproductionworkorder/mesProductionWorkOrder/publish',
+        execute: '/mesproductionworkorder/mesProductionWorkOrder/execute',
       },
       dictOptions: {},
       superFieldList: []
@@ -702,9 +716,22 @@
         }
       })
     },
+    handleExecute(id) {
+      getAction(this.url.execute, { id: id }).then((res) => {
+        if (res.success) {
+          this.$message.success(res.message)
+          this.loadData()
+        } else {
+          this.$message.warning(res.message)
+        }
+      })
+    },
     handleRePublish(record) {
       this.$refs.MesProductionWorkOrderRepublishModal.add(record)
     },
+    handleWorkReport(record) {
+      this.$refs.MesProductionWorkOrderReportModal.add(record)
+    },
     async handleTransferDetail(row){
       console.log('row---->',row)
       const transferDetailResult = await getAction(this.url.queryTransferDetailBy,{'requestId':row.id})
diff --git a/src/views/mes/modules/MesProductionWorkOrderReportModal.vue b/src/views/mes/modules/MesProductionWorkOrderReportModal.vue
new file mode 100644
index 0000000..ccd82fc
--- /dev/null
+++ b/src/views/mes/modules/MesProductionWorkOrderReportModal.vue
@@ -0,0 +1,143 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="鍏抽棴">
+
+    <a-spin :spinning="confirmLoading">
+      <j-form-container :disabled="formDisabled">
+        <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+          <a-row :gutter="24">
+            <a-col :span="12">
+              <a-form-model-item label="鎶ュ伐璁㈠崟" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderId">
+                <a-select
+                  v-model="model.orderId"
+                  :options="workOrderOptions"
+                  placeholder="璇烽�夋嫨鎶ュ伐璁㈠崟">
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item label="鎶ュ伐宸ュ崟" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workOrderCode">
+                <a-input
+                  v-model="model.workOrderCode"
+                  :disabled="true"
+                  placeholder="璇烽�夋嫨鎶ュ伐宸ュ崟">
+                </a-input>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item label="浜х嚎" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId_dictText">
+                <a-input
+                  v-model="model.factoryId_dictText"
+                  :disabled="true"
+                  placeholder="璇烽�夋嫨浜х嚎">
+                </a-input>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item label="鎶ュ伐鏁伴噺" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="quantity">
+                <a-input-number
+                  v-model="model.quantity"
+                  placeholder="璇峰~鍐欐姤宸ユ暟閲�"
+                  style="width: 100%"
+                  :min="0">
+                </a-input-number>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </j-form-container>
+    </a-spin>
+  </j-modal>
+</template>
+
+<script>
+import { postAction, getAction } from '@api/manage'
+
+export default {
+  name: 'MesProductionWorkOrderRepublishModal',
+  data () {
+    return {
+      title: '鎶ュ伐',
+      width: 800,
+      visible: false,
+      disableSubmit: false,
+      confirmLoading: false,
+      model: {},
+      validatorRules: {
+      },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 6 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 18 },
+      },
+      url: {
+        republish: '/mesproductionworkorder/mesProductionWorkOrder/republish',
+        selectReportWorkOrderList: '/mes/productionOrder/selectReportWorkOrderList'
+      },
+      workOrderOptions: []
+    }
+  },
+  computed: {
+    formDisabled(){
+      return this.disabled
+    },
+  },
+  methods: {
+    add (record) {
+      // 閲嶇疆琛ㄥ崟
+      this.$refs.form && this.$refs.form.resetFields()
+      // 璁剧疆鍒濆鍊�
+      this.model = Object.assign({}, record);
+      getAction(this.url.selectReportWorkOrderList, {materialNumber: record.materialNumber}).then(res => {
+        if (res.success) {
+          this.workOrderOptions = res.result
+        }
+      })
+      this.visible = true
+    },
+    close () {
+      this.$emit('close');
+      this.visible = false;
+    },
+    handleOk () {
+      this.$refs.form.validate(valid => {
+        if (valid) {
+          this.confirmLoading = true
+          let formData = {
+            id: this.model.id,
+            planQuantity: this.model.planQuantity,
+            republishReason: this.model.republishReason
+          }
+          postAction(this.url.republish, formData).then(res => {
+            if (res.success) {
+              this.$message.success(res.message)
+              this.submitCallback()
+            } else {
+              this.$message.warning(res.message)
+            }
+          }).finally(() => {
+            this.confirmLoading = false
+          })
+        }
+      })
+    },
+    submitCallback(){
+      this.$emit('ok');
+      this.visible = false;
+    },
+    handleCancel () {
+      this.close()
+    }
+  }
+}
+</script>

--
Gitblit v1.9.3