From 04b1a9cfde4049be9a38b9832d5289d4a192c883 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期五, 15 五月 2026 16:29:33 +0800
Subject: [PATCH] 加班申请模块和审批流程公共组件

---
 src/views/productionManagement/processRoute/processRouteItem/index.vue |   48 +++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 39 insertions(+), 9 deletions(-)

diff --git a/src/views/productionManagement/processRoute/processRouteItem/index.vue b/src/views/productionManagement/processRoute/processRouteItem/index.vue
index fd1a6a8..99d4ab1 100644
--- a/src/views/productionManagement/processRoute/processRouteItem/index.vue
+++ b/src/views/productionManagement/processRoute/processRouteItem/index.vue
@@ -68,7 +68,8 @@
                    style="margin-right: 10px;">
           鍗$墖瑙嗗浘
         </el-button>
-        <el-button type="primary"
+        <el-button v-if="editable"
+                   type="primary"
                    @click="handleAdd">鏂板</el-button>
       </div>
     </div>
@@ -110,6 +111,13 @@
       <el-table-column label="鍗曚綅"
                        prop="unit"
                        width="100" />
+      <el-table-column label="璁¤垂绫诲瀷"
+                       prop="type"
+                       width="100">
+        <template #default="scope">
+          {{scope.row.type==0 ? "璁℃椂" : "璁′欢"}}
+        </template>
+      </el-table-column>
       <el-table-column label="鏄惁璐ㄦ"
                        prop="isQuality"
                        width="100">
@@ -133,12 +141,12 @@
                      link
                      size="small"
                      @click="handleEdit(scope.row)"
-                     :disabled="scope.row.isComplete">缂栬緫</el-button>
+                     :disabled="scope.row.isComplete || !editable">缂栬緫</el-button>
           <el-button type="danger"
                      link
                      size="small"
                      @click="handleDelete(scope.row)"
-                     :disabled="scope.row.isComplete">鍒犻櫎</el-button>
+                     :disabled="scope.row.isComplete || !editable">鍒犻櫎</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -152,7 +160,8 @@
                      style="margin-right: 10px;">
             琛ㄦ牸瑙嗗浘
           </el-button>
-          <el-button type="primary"
+          <el-button v-if="editable"
+                     type="primary"
                      @click="handleAdd">鏂板</el-button>
         </div>
       </div>
@@ -179,12 +188,16 @@
                   {{ item.model }}
                   <!-- <span v-if="item.unit" class="product-unit">{{ item.unit }}</span> -->
                 </div>
+                <el-tag class="product-tag"
+                        :type="item.type == 1 ? 'primary' : 'success'"
+                        style="margin-left: 8px;">{{ item.type==0?'璁℃椂':'璁′欢' }}</el-tag>
                 <el-tag type="primary"
                         class="product-tag"
+                        style="margin-left: 8px;"
                         v-if="item.isQuality">璐ㄦ</el-tag>
                 <el-tag type="primary"
                         class="product-tag"
-                        :style="item.isQuality?'margin-left:8px':''"
+                        style="margin-left: 8px;"
                         v-if="item.isProduction">鐢熶骇</el-tag>
               </div>
               <div v-else
@@ -196,7 +209,7 @@
                          link
                          size="small"
                          @click="handleEdit(item)"
-                         :disabled="item.isComplete">缂栬緫</el-button>
+                         :disabled="item.isComplete || !editable">缂栬緫</el-button>
               <el-button type="info"
                          link
                          size="small"
@@ -205,7 +218,7 @@
                          link
                          size="small"
                          @click="handleDelete(item)"
-                         :disabled="item.isComplete">鍒犻櫎</el-button>
+                         :disabled="item.isComplete || !editable">鍒犻櫎</el-button>
             </div>
           </div>
         </div>
@@ -216,7 +229,7 @@
          style="margin-top: 20px;">
       <div class="section-title">BOM 缁撴瀯</div>
       <div class="section-actions"
-           v-if="pageType === 'order'">
+           v-if="pageType === 'order' && editable">
         <el-button v-if="!bomDataValue.isEdit"
                    type="primary"
                    @click="bomDataValue.isEdit = true">
@@ -422,6 +435,13 @@
                       v-else>
           <span>{{ form.unit }}</span>
         </el-form-item>
+        <el-form-item label="璁¤垂绫诲瀷"
+                      prop="type">
+          <el-radio-group v-model="form.type">
+            <el-radio :label="0">璁℃椂</el-radio>
+            <el-radio :label="1">璁′欢</el-radio>
+          </el-radio-group>
+        </el-form-item>
         <el-form-item label="鏄惁璐ㄦ"
                       prop="isQuality">
           <el-switch v-model="form.isQuality"
@@ -447,7 +467,6 @@
                          @confirm="handleProductSelect"
                          single />
     <!-- 鍙傛暟鍒楄〃瀵硅瘽妗� -->
-    <!-- :editable="!routeInfo.status" -->
     <ProcessParamListDialog v-model="showParamListDialog"
                             :title="`${currentProcess ? (currentProcess.processName || currentProcess.technologyOperationName || currentProcess.operationName) : ''} - 鍙傛暟鍒楄〃`"
                             :route-id="routeId"
@@ -455,6 +474,7 @@
                             :process="currentProcess"
                             :page-type="pageType"
                             :param-list="paramList"
+                            :editable="editable"
                             @getsyncProcessParamItem="getsyncProcessParamItem"
                             @refresh="refreshParamList" />
   </div>
@@ -509,6 +529,7 @@
   const routeId = computed(() => route.query.id);
   const orderId = computed(() => route.query.orderId);
   const pageType = computed(() => route.query.type);
+  const editable = computed(() => route.query.editable !== "false");
 
   const tableLoading = ref(false);
   const tableData = ref([]);
@@ -555,6 +576,7 @@
     model: "",
     unit: "",
     isQuality: false,
+    type: 0,
     isProduction: false,
   });
 
@@ -684,6 +706,7 @@
       model: row.model || "",
       unit: row.unit || "",
       isQuality: row.isQuality,
+      type: row.type || 0,
       isProduction: row.isProduction,
     };
     dialogVisible.value = true;
@@ -755,6 +778,7 @@
                 operationName: getProcessName(form.value.technologyOperationId),
                 productModelId: form.value.productModelId,
                 isQuality: form.value.isQuality,
+                type: form.value.type,
                 isProduction: form.value.isProduction,
                 dragSort,
               })
@@ -763,6 +787,7 @@
                 technologyOperationId: form.value.technologyOperationId,
                 productModelId: form.value.productModelId,
                 isQuality: form.value.isQuality,
+                type: form.value.type,
                 isProduction: form.value.isProduction,
                 dragSort,
               });
@@ -790,6 +815,7 @@
                 operationName: getProcessName(form.value.technologyOperationId),
                 productModelId: form.value.productModelId,
                 isQuality: form.value.isQuality,
+                type: form.value.type,
                 isProduction: form.value.isProduction,
               })
             : addOrUpdateProcessRouteItem1({
@@ -798,6 +824,7 @@
                 productModelId: form.value.productModelId,
                 id: form.value.id,
                 isQuality: form.value.isQuality,
+                type: form.value.type,
                 isProduction: form.value.isProduction,
               });
 
@@ -829,6 +856,7 @@
       model: "",
       unit: "",
       isQuality: false,
+      type: 0,
       isProduction: false,
     };
     formRef.value?.resetFields();
@@ -878,6 +906,7 @@
   // 鍒濆鍖栨嫋鎷芥帓搴�
   const initSortable = () => {
     destroySortable();
+    if (!editable.value) return;
 
     if (viewMode.value === "table") {
       // 琛ㄦ牸瑙嗗浘鐨勬嫋鎷芥帓搴�
@@ -1064,6 +1093,7 @@
     processOptions.value.forEach(item => {
       if (item.id == value) {
         form.value.isQuality = item.isQuality;
+        form.value.type = item.type || 0;
         form.value.isProduction = item.isProduction;
       }
     });

--
Gitblit v1.9.3