From 93d2a0bd19ffb1d86c6807a4d93d0eff580c14f1 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期六, 25 四月 2026 16:39:26 +0800
Subject: [PATCH] 生产计划和生产订单一些修改

---
 src/views/productionManagement/processRoute/processRouteItem/index.vue |   41 +++++-
 src/views/productionManagement/productionOrder/index.vue               |  265 ++++++++++++++++++++++++++++++++++++++++++--
 src/components/ProcessParamListDialog.vue                              |    3 
 src/api/productionManagement/productionOrder.js                        |   11 +
 4 files changed, 299 insertions(+), 21 deletions(-)

diff --git a/src/api/productionManagement/productionOrder.js b/src/api/productionManagement/productionOrder.js
index e92dc83..9f7ce58 100644
--- a/src/api/productionManagement/productionOrder.js
+++ b/src/api/productionManagement/productionOrder.js
@@ -47,8 +47,9 @@
 
 export function delProductOrder(ids) {
   return request({
-    url: `/productionOrder/delete/${ids}`,
+    url: `/productionOrder/delete`,
     method: "delete",
+    data: ids,
   });
 }
 
@@ -97,6 +98,14 @@
   });
 }
 
+// 鐢熶骇璁㈠崟-鑾峰彇鏉ユ簮鏁版嵁
+export function getProductOrderSource(id) {
+  return request({
+    url: `/productionOrder/source/${id}`,
+    method: "get",
+  });
+}
+
 // 鐢熶骇璁㈠崟-閫�鏂欑‘璁�
 export function confirmMaterialReturn(data) {
   return request({
diff --git a/src/components/ProcessParamListDialog.vue b/src/components/ProcessParamListDialog.vue
index 883a94f..77e717f 100644
--- a/src/components/ProcessParamListDialog.vue
+++ b/src/components/ProcessParamListDialog.vue
@@ -380,6 +380,9 @@
         paramId: selectedParam.value.id,
         standardValue: selectedParam.value.standardValue || "",
         isRequired: selectedParam.value.isRequired || 0,
+        technologyOperationId: props.process.id,
+        technologyOperationParamId: selectedParam.value.id,
+        technologyRoutingOperationId: Number(props.routeId),
       })
         .then(res => {
           if (res.code === 200) {
diff --git a/src/views/productionManagement/processRoute/processRouteItem/index.vue b/src/views/productionManagement/processRoute/processRouteItem/index.vue
index 734d34c..44fef19 100644
--- a/src/views/productionManagement/processRoute/processRouteItem/index.vue
+++ b/src/views/productionManagement/processRoute/processRouteItem/index.vue
@@ -206,7 +206,7 @@
     <div class="section-header"
          style="margin-top: 20px;">
       <div class="section-title">BOM 缁撴瀯</div>
-      <div class="section-actions"
+      <!-- <div class="section-actions"
            v-if="pageType === 'order'">
         <el-button v-if="!bomDataValue.isEdit"
                    type="primary"
@@ -223,7 +223,7 @@
                    :loading="bomDataValue.loading">
           淇濆瓨BOM
         </el-button>
-      </div>
+      </div> -->
     </div>
     <el-table :data="bomTableData"
               border
@@ -369,6 +369,7 @@
                :rules="rules"
                label-width="120px">
         <el-form-item label="宸ュ簭"
+                      v-if="operationType === 'add' || pageType === 'route'"
                       prop="technologyOperationId">
           <el-select v-model="form.technologyOperationId"
                      placeholder="璇烽�夋嫨宸ュ簭"
@@ -381,7 +382,12 @@
                        :value="process.id" />
           </el-select>
         </el-form-item>
+        <el-form-item label="宸ュ簭"
+                      v-else>
+          <span>{{ getProcessName(form.technologyOperationId) }}</span>
+        </el-form-item>
         <el-form-item label="浜у搧鍚嶇О"
+                      v-if="operationType === 'add' || pageType === 'route'"
                       prop="productModelId">
           <el-button type="primary"
                      @click="showProductSelectDialog = true">
@@ -390,12 +396,21 @@
               : '閫夋嫨浜у搧' }}
           </el-button>
         </el-form-item>
+        <el-form-item label="浜у搧鍚嶇О"
+                      v-else>
+          <span>{{ form.productName }}{{ form.model ? ' - ' + form.model : '' }}</span>
+        </el-form-item>
         <el-form-item label="鍗曚綅"
+                      v-if="operationType === 'add' || pageType === 'route'"
                       prop="unit">
           <el-input v-model="form.unit"
                     :placeholder="form.productModelId ? '鏍规嵁閫夋嫨鐨勪骇鍝佽嚜鍔ㄥ甫鍑�' : '璇峰厛閫夋嫨浜у搧'"
                     clearable
                     :disabled="true" />
+        </el-form-item>
+        <el-form-item label="鍗曚綅"
+                      v-else>
+          <span>{{ form.unit }}</span>
         </el-form-item>
         <el-form-item label="鏄惁璐ㄦ"
                       prop="isQuality">
@@ -721,9 +736,11 @@
 
           const addPromise = isOrderPage
             ? addRouteItem({
-                productOrderId: Number(orderId.value),
-                productRouteId: Number(routeId.value),
+                productionOrderId: Number(orderId.value),
+                orderRoutingId: Number(routeId.value),
                 technologyOperationId: form.value.technologyOperationId,
+                technologyRoutingId: Number(routeId.value),
+                operationName: getProcessName(form.value.technologyOperationId),
                 productModelId: form.value.productModelId,
                 isQuality: form.value.isQuality,
                 isProduction: form.value.isProduction,
@@ -758,6 +775,7 @@
             ? addOrUpdateProductProcessRouteItem({
                 id: form.value.id,
                 technologyOperationId: form.value.technologyOperationId,
+                operationName: getProcessName(form.value.technologyOperationId),
                 productModelId: form.value.productModelId,
                 isQuality: form.value.isQuality,
                 isProduction: form.value.isProduction,
@@ -995,7 +1013,8 @@
   });
 
   const syncProcessOperationFields = item => {
-    const processId = item.processId ?? item.operationId ?? "";
+    const processId =
+      item.processId ?? item.operationId ?? item.technologyOperationId ?? "";
     if (!processId) {
       item.processId = "";
       return;
@@ -1007,7 +1026,11 @@
       option?.name || item.processName || item.operationName || "";
 
     item.processId = processId;
-    item.operationId = processId;
+    if (pageType.value === "order") {
+      item.technologyOperationId = processId;
+    } else {
+      item.operationId = processId;
+    }
     item.processName = processName;
     item.operationName = processName;
   };
@@ -1157,7 +1180,8 @@
         productModelId: undefined,
         processId: "",
         processName: "",
-        operationId: "",
+        [pageType.value === "order" ? "technologyOperationId" : "operationId"]:
+          "",
         operationName: "",
         unitQuantity: 1,
         demandedQuantity: 0,
@@ -1192,7 +1216,8 @@
           productModelId: undefined,
           processId: "",
           processName: "",
-          operationId: "",
+          [pageType.value === "order" ? "technologyOperationId" : "operationId"]:
+            "",
           operationName: "",
           unitQuantity: 1,
           demandedQuantity: 0,
diff --git a/src/views/productionManagement/productionOrder/index.vue b/src/views/productionManagement/productionOrder/index.vue
index 02e75eb..d876f3d 100644
--- a/src/views/productionManagement/productionOrder/index.vue
+++ b/src/views/productionManagement/productionOrder/index.vue
@@ -43,16 +43,33 @@
                     style="width: 160px;"
                     @change="handleQuery" />
         </el-form-item>
+        <el-form-item label="鐘舵��:">
+          <el-select v-model="searchForm.status"
+                     placeholder="璇烽�夋嫨"
+                     style="width: 160px;"
+                     @change="handleQuery">
+            <el-option label="寰呭紑濮�"
+                       value="1" />
+            <el-option label="杩涜涓�"
+                       value="2" />
+            <el-option label="宸插畬鎴�"
+                       value="3" />
+            <el-option label="宸插彇娑�"
+                       value="4" />
+          </el-select>
+        </el-form-item>
         <el-form-item>
           <el-button type="primary"
                      @click="handleQuery">鎼滅储</el-button>
+          <el-button type="info"
+                     @click="handleReset">閲嶇疆</el-button>
         </el-form-item>
       </el-form>
       <div class="action-buttons">
-        <el-button type="primary"
-                   @click="isShowNewModal = true">鏂板</el-button>
+        <!-- <el-button type="primary"
+                   @click="isShowNewModal = true">鏂板</el-button> -->
         <el-button type="danger"
-                   @click="handleDelete">鍒犻櫎</el-button>
+                   @click="handleDelete">閫�鍥�</el-button>
         <el-button @click="handleOut">瀵煎嚭</el-button>
       </div>
     </div>
@@ -98,6 +115,76 @@
         </span>
       </template>
     </el-dialog>
+    <!-- 鏉ユ簮鏁版嵁寮圭獥 -->
+    <el-dialog v-model="sourceDataDialogVisible"
+               title="鏉ユ簮鏁版嵁"
+               width="1200px">
+      <div v-if="sourceRowData"
+           class="applyno-summary1">
+        <div class="summary-item">
+          <span class="summary-label">浜у搧鍚嶇О锛�</span>
+          <span class="summary-value">
+            <el-tag type="primary">{{ sourceRowData.productName || '-' }}</el-tag>
+          </span>
+        </div>
+        <div class="summary-item">
+          <span class="summary-label">瑙勬牸锛�</span>
+          <span class="summary-value">{{ sourceRowData.model || '-' }}</span>
+        </div>
+        <div class="summary-item">
+          <span class="summary-label">璁㈠崟闇�姹傛暟閲忥細</span>
+          <span class="summary-value">{{ sourceRowData.quantity || 0 }}</span>
+        </div>
+      </div>
+      <div class="source-table-container">
+        <div class="source-data-cards-container">
+          <div v-for="(item, index) in sourceTableData"
+               :key="index"
+               class="source-data-card">
+            <div class="card-body">
+              <div class="info-grid">
+                <div class="info-item">
+                  <div class="info-label">璁″垝鍙�</div>
+                  <div class="info-value">{{ item.mpsNo || '-' }}</div>
+                </div>
+                <div class="info-item">
+                  <div class="info-label">鏁版嵁鏉ユ簮</div>
+                  <div class="info-value">
+                    <el-tag :type="item.source === '閿�鍞�' ? 'primary' : 'warning'">
+                      {{ item.source || '鏈煡' }}
+                    </el-tag>
+                  </div>
+                </div>
+                <div class="info-item">
+                  <div class="info-label">鍚堝悓鍙�</div>
+                  <div class="info-value">{{ item.salesContractNo || '-' }}</div>
+                </div>
+                <div class="info-item">
+                  <div class="info-label">瀹㈡埛鍚嶇О</div>
+                  <div class="info-value">{{ item.customerName || '-' }}</div>
+                </div>
+                <div class="info-item">
+                  <div class="info-label">椤圭洰鍚嶇О</div>
+                  <div class="info-value">{{ item.projectName || '-' }}</div>
+                </div>
+                <div class="info-item">
+                  <div class="info-label">璁″垝闇�姹傛暟閲�</div>
+                  <div class="info-value">{{ item.qtyRequired || 0 }} {{ item.unit || '' }}</div>
+                </div>
+                <div class="info-item">
+                  <div class="info-label">鍗曚綅</div>
+                  <div class="info-value">{{ item.unit || '-' }}</div>
+                </div>
+                <div class="info-item">
+                  <div class="info-label">闇�姹傛棩鏈�</div>
+                  <div class="info-value">{{ item.requiredDate ? dayjs(item.requiredDate).format('YYYY-MM-DD') : '-' }}</div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </el-dialog>
     <MaterialLedgerDialog v-model="materialDialogVisible"
                           :order-row="currentMaterialOrder"
                           @saved="getList" />
@@ -129,6 +216,7 @@
     bindingRoute,
     listProcessBom,
     delProductOrder,
+    getProductOrderSource,
   } from "@/api/productionManagement/productionOrder.js";
   import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js";
   import MaterialLedgerDialog from "@/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue";
@@ -143,6 +231,12 @@
 
   const router = useRouter();
   const isShowNewModal = ref(false);
+  const sourceDataDialogVisible = ref(false);
+  const sourceTableData = ref([]);
+  const sourceRowData = ref(null);
+  const sourcePage = reactive({
+    total: 0,
+  });
 
   const tableColumn = ref([
     {
@@ -150,15 +244,28 @@
       prop: "npsNo",
       width: "150px",
     },
+    // 1.寰呭紑濮嬨��2.杩涜涓��3.宸插畬鎴愩��4.宸插彇娑�
     {
-      label: "閿�鍞悎鍚屽彿",
-      prop: "salesContractNo",
+      label: "鐘舵��",
+      prop: "status",
       width: "150px",
-    },
-    {
-      label: "瀹㈡埛鍚嶇О",
-      prop: "customerName",
-      width: "200px",
+      dataType: "tag",
+      formatData: val =>
+        val === 1
+          ? "寰呭紑濮�"
+          : val === 2
+          ? "杩涜涓�"
+          : val === 3
+          ? "宸插畬鎴�"
+          : "宸插彇娑�",
+      formatType: val =>
+        val === 1
+          ? "primary"
+          : val === 2
+          ? "warning"
+          : val === 3
+          ? "success"
+          : "danger",
     },
     {
       label: "浜у搧鍚嶇О",
@@ -218,6 +325,7 @@
         {
           name: "宸ヨ壓璺嚎",
           type: "text",
+          showHide: row => row.processRouteCode,
           clickFun: row => {
             showRouteItemModal(row);
           },
@@ -236,6 +344,13 @@
           showHide: row => row.processRouteCode,
           clickFun: row => {
             openBindRouteDialog(row, "change");
+          },
+        },
+        {
+          name: "鏉ユ簮",
+          type: "text",
+          clickFun: row => {
+            showSourceData(row);
           },
         },
         // {
@@ -279,6 +394,7 @@
       projectName: "",
       productName: "",
       model: "",
+      status: "",
     },
   });
   const { searchForm } = toRefs(data);
@@ -385,6 +501,20 @@
     materialDetailDialogVisible.value = true;
   };
 
+  const handleReset = () => {
+    searchForm.value = {
+      ...searchForm.value,
+      npsNo: "",
+      customerName: "",
+      salesContractNo: "",
+      projectName: "",
+      productName: "",
+      model: "",
+      status: "",
+    };
+    handleQuery();
+  };
+
   // 鏌ヨ鍒楄〃
   /** 鎼滅储鎸夐挳鎿嶄綔 */
   const handleQuery = () => {
@@ -465,6 +595,29 @@
     });
   };
 
+  // 鏌ョ湅鏉ユ簮鐢熶骇璁″垝鏁版嵁
+  const showSourceData = row => {
+    // 瀛樺偍鐐瑰嚮鏉ユ簮鎸夐挳鏃朵紶閫掔殑row鍙傛暟
+    sourceRowData.value = row;
+    // 璋冪敤API鑾峰彇鏉ユ簮鏁版嵁
+    getProductOrderSource(row.id)
+      .then(res => {
+        if (res.code === 200) {
+          // 鐩存帴瀛樺偍杩斿洖鐨勬墎骞冲寲鏁版嵁
+          sourceTableData.value = res.data || [];
+          sourcePage.total = sourceTableData.value.length;
+          // 鎵撳紑寮圭獥
+          sourceDataDialogVisible.value = true;
+        } else {
+          proxy.$modal.msgError(res.msg || "鑾峰彇鏉ユ簮鏁版嵁澶辫触");
+        }
+      })
+      .catch(err => {
+        proxy.$modal.msgError("鑾峰彇鏉ユ簮鏁版嵁澶辫触");
+        console.error(err);
+      });
+  };
+
   // 琛ㄦ牸閫夋嫨鏁版嵁
   const handleSelectionChange = selection => {
     selectedRows.value = selection;
@@ -478,14 +631,15 @@
       proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
       return;
     }
-    ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+    ElMessageBox.confirm("鏄惁閫�鍥炶鐢熶骇璁㈠崟锛�", "閫�鍥�", {
       confirmButtonText: "纭",
       cancelButtonText: "鍙栨秷",
       type: "warning",
     })
       .then(() => {
+        console.log(ids, "ids");
         delProductOrder(ids).then(res => {
-          proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+          proxy.$modal.msgSuccess("閫�鍥炴垚鍔�");
           getList();
         });
       })
@@ -550,3 +704,90 @@
     margin-top: unset;
   }
 </style>
+<style lang="scss">
+  .status-cell {
+    font-weight: 600;
+    color: #409eff;
+    font-family: "Courier New", monospace;
+    text-shadow: 0 1px 2px rgba(64, 158, 255, 0.2);
+  }
+
+  .source-table-container {
+    margin-top: 20px;
+  }
+
+  .source-data-cards-container {
+    display: flex;
+    flex-direction: column;
+    gap: 16px;
+    max-height: 500px;
+    overflow-y: auto;
+    padding: 10px;
+    background-color: #f5f7fa;
+    border-radius: 4px;
+    padding-bottom: 20px;
+
+    .source-data-card {
+      background: #fff;
+      border-radius: 8px;
+      box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+      overflow: hidden;
+
+      .card-body {
+        padding: 20px;
+
+        .info-grid {
+          display: grid;
+          grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
+          gap: 16px;
+
+          .info-item {
+            display: flex;
+            flex-direction: column;
+
+            .info-label {
+              font-size: 12px;
+              color: #909399;
+              margin-bottom: 4px;
+              font-weight: 500;
+            }
+
+            .info-value {
+              font-size: 14px;
+              color: #303133;
+              font-weight: 500;
+            }
+          }
+        }
+      }
+    }
+  }
+
+  .applyno-summary1 {
+    padding: 16px 20px;
+    background: #f5f7fa;
+    border-bottom: 1px solid #e4e7ed;
+    display: flex;
+    flex-wrap: wrap;
+    gap: 16px;
+
+    .summary-item {
+      display: flex;
+      align-items: center;
+      margin-right: 20px;
+
+      .summary-label {
+        font-size: 13px;
+        color: #909399;
+        margin-right: 8px;
+        font-weight: 500;
+      }
+
+      .summary-value {
+        font-size: 14px;
+        color: #303133;
+        font-weight: 500;
+      }
+    }
+  }
+</style>

--
Gitblit v1.9.3