From 1932a62477dfc3a7e604918c29d0d0d3bfa9c9d8 Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期六, 25 四月 2026 15:07:19 +0800
Subject: [PATCH] 阳光印刷web 销售订单查询 客户往来调整间距

---
 src/views/productionManagement/productionOrder/index.vue |  222 +++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 158 insertions(+), 64 deletions(-)

diff --git a/src/views/productionManagement/productionOrder/index.vue b/src/views/productionManagement/productionOrder/index.vue
index b1d5ab1..ecf90d3 100644
--- a/src/views/productionManagement/productionOrder/index.vue
+++ b/src/views/productionManagement/productionOrder/index.vue
@@ -11,7 +11,7 @@
                     style="width: 160px;"
                     @change="handleQuery" />
         </el-form-item>
-        <el-form-item label="鍚堝悓鍙�:">
+        <el-form-item label="璁㈠崟缂栧彿:">
           <el-input v-model="searchForm.salesContractNo"
                     placeholder="璇疯緭鍏�"
                     clearable
@@ -41,6 +41,8 @@
         </el-form-item>
       </el-form>
       <div>
+<!--        <el-button type="primary" @click="isShowNewModal = true">鏂板</el-button>-->
+        <el-button type="danger" @click="handleDelete">鍒犻櫎</el-button>
         <el-button @click="handleOut">瀵煎嚭</el-button>
       </div>
     </div>
@@ -51,6 +53,8 @@
                 :page="page"
                 :tableLoading="tableLoading"
                 :row-class-name="tableRowClassName"
+                :isSelection="true"
+                @selection-change="handleSelectionChange"
                 @pagination="pagination">
         <template #completionStatus="{ row }">
           <el-progress
@@ -61,49 +65,59 @@
         </template>
       </PIMTable>
     </div>
-    <el-dialog v-model="bindRouteDialogVisible"
-               title="缁戝畾宸ヨ壓璺嚎"
-               width="500px">
-      <el-form label-width="90px">
-        <el-form-item label="宸ヨ壓璺嚎">
-          <el-select v-model="bindForm.routeId"
-                     placeholder="璇烽�夋嫨宸ヨ壓璺嚎"
-                     style="width: 100%;"
-                     :loading="bindRouteLoading">
-            <el-option v-for="item in routeOptions"
-                       :key="item.id"
-                       :label="`${item.processRouteCode || ''}`"
-                       :value="item.id" />
-          </el-select>
-        </el-form-item>
-      </el-form>
-      <template #footer>
-        <span class="dialog-footer">
-          <el-button @click="bindRouteDialogVisible = false">鍙� 娑�</el-button>
-          <el-button type="primary"
-                     :loading="bindRouteSaving"
-                     @click="handleBindRouteConfirm">纭� 璁�</el-button>
-        </span>
-      </template>
-    </el-dialog>
+
+    <BindRouteDialog
+        ref="BindRouteDialogRef"
+        v-model="bindRouteDialogVisible"
+        :type="bindDialogType"
+        :rowData="rowData"
+        @confirm="handleBindRouteSubmit"
+    />
+    <new-product-order v-if="isShowNewModal"
+                         v-model:visible="isShowNewModal"
+                         @completed="handleQuery" />
   </div>
 </template>
 
 <script setup>
-  import { onMounted, ref } from "vue";
+  import { defineAsyncComponent, getCurrentInstance, onMounted, reactive, ref, toRefs } from "vue";
   import { ElMessageBox } from "element-plus";
   import dayjs from "dayjs";
   import { useRouter } from "vue-router";
   import {
     productOrderListPage,
-    listProcessRoute,
     bindingRoute,
-    listProcessBom,
+    delProductOrder,
+    saveProductionProductInput,
+    viewGetByProductWordId
   } from "@/api/productionManagement/productionOrder.js";
   import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js";
+  import PIMTable from "@/components/PIMTable/PIMTable.vue";
+  import BindRouteDialog from "./BindRouteDialog.vue";
+  const NewProductOrder = defineAsyncComponent(() => import("@/views/productionManagement/productionOrder/New.vue"));
+
   const { proxy } = getCurrentInstance();
 
   const router = useRouter();
+  const isShowNewModal = ref(false);
+  const MOCK_MODE = true;
+
+  const loading = ref(false)
+  const dialogVisible = ref(false)
+  const bindDialogType = ref('add')
+  const BindRouteDialogRef = ref(null)
+
+  const handleBindRouteSubmit =async (data)=>{
+    const res = await saveProductionProductInput(data)
+    if(res.code === 200){
+      proxy.$modal.msgSuccess("缁戝畾鎴愬姛");
+      bindRouteDialogVisible.value = false
+      handleQuery()
+    }else{
+      proxy.$modal.msgError(res.msg || "缁戝畾澶辫触")
+    }
+
+  }
 
   const tableColumn = ref([
     {
@@ -112,12 +126,12 @@
       width: '120px',
     },
     {
-      label: "閿�鍞悎鍚屽彿",
+      label: "璁㈠崟缂栧彿",
       prop: "salesContractNo",
       width: '150px',
     },
     {
-      label: "瀹㈡埛鍚嶇О",
+      label: "鍘傚",
       prop: "customerName",
       width: '200px',
     },
@@ -127,7 +141,7 @@
       width: '120px',
     },
     {
-      label: "瑙勬牸",
+      label: "绾稿紶瑙勬牸",
       prop: "specificationModel",
       width: '120px',
     },
@@ -137,8 +151,28 @@
       width: '200px',
     },
     {
-      label: "闇�姹傛暟閲�",
+      label: "鍗板埛鏁伴噺",
       prop: "quantity",
+    },
+    {
+      label: "灏哄",
+      prop: "cutSize",
+      width: '120px',
+    },
+    {
+      label: "灏忕洅鏁伴噺",
+      prop: "smallBoxQty",
+      width: '120px',
+    },
+    {
+      label: "涓洅鏁伴噺",
+      prop: "mediumBoxQty",
+      width: '120px',
+    },
+    {
+      label: "鑹叉暟",
+      prop: "printColorCount",
+      width: '120px',
     },
     {
       label: "瀹屾垚鏁伴噺",
@@ -164,9 +198,14 @@
       width: 120,
     },
     {
-      label: "浜や粯鏃ユ湡",
+      label: "璁″垝浜よ揣鏃ユ湡",
       prop: "deliveryDate",
       formatData: val => (val ? dayjs(val).format("YYYY-MM-DD") : ""),
+      width: 120,
+    },
+    {
+      label: "澶囨敞",
+      prop: "remark",
       width: 120,
     },
     {
@@ -174,21 +213,22 @@
       label: "鎿嶄綔",
       align: "center",
       fixed: "right",
-      width: 200,
+      width: 300,
       operation: [
-        {
-          name: "宸ヨ壓璺嚎",
-          type: "text",
-          clickFun: row => {
-            showRouteItemModal(row);
-          },
-        },
         {
           name: "缁戝畾宸ヨ壓璺嚎",
           type: "text",
-          showHide: row => !row.processRouteCode,
+          showHide: row => !row.printId,
           clickFun: row => {
             openBindRouteDialog(row);
+          },
+        },
+        {
+          name: "鏌ョ湅宸ヨ壓璺嚎",
+          type: "text",
+          showHide: row => row.printId,
+          clickFun: row => {
+            openBindRouteDialog(row,"view");
           },
         },
         {
@@ -208,6 +248,7 @@
     size: 100,
     total: 0,
   });
+  const selectedRows = ref([]);
 
   const data = reactive({
     searchForm: {
@@ -239,13 +280,18 @@
 
   // 娣诲姞琛ㄨ绫诲悕鏂规硶
   const tableRowClassName = ({ row }) => {
-    switch (row.deliveryDaysDiff) {
-      case 15:
-        return 'yellow'
-      case 10:
-        return 'red'
-      case 2:
-        return 'purple'
+    if (!row.deliveryDate) return '';
+    if (row.isFh) return '';
+
+    const diff = row.deliveryDaysDiff;
+    if (diff === 15) {
+      return 'yellow';
+    } else if (diff === 10) {
+      return 'pink';
+    } else if (diff === 2) {
+      return 'purple';
+    } else if (diff < 2) {
+      return 'red';
     }
   };
 
@@ -254,25 +300,34 @@
   const bindRouteLoading = ref(false);
   const bindRouteSaving = ref(false);
   const routeOptions = ref([]);
+  const rowData = ref(null)
   const bindForm = reactive({
     orderId: null,
     routeId: null,
   });
 
-  const openBindRouteDialog = async row => {
+  const openBindRouteDialog = async (row,type) => {
     bindForm.orderId = row.id;
     bindForm.routeId = null;
-    bindRouteDialogVisible.value = true;
     routeOptions.value = [];
-    if (!row.productModelId) {
-      proxy.$modal.msgWarning("褰撳墠璁㈠崟缂哄皯浜у搧鍨嬪彿锛屾棤娉曟煡璇㈠伐鑹鸿矾绾�");
-      bindRouteDialogVisible.value = false;
-      return;
-    }
     bindRouteLoading.value = true;
     try {
-      const res = await listProcessRoute({ productModelId: row.productModelId });
-      routeOptions.value = res.data || [];
+      BindRouteDialogRef.value?.resetForm?.()
+      if (type === "view") {
+        bindDialogType.value = "detail"
+        const res = await viewGetByProductWordId(row.id)
+        if(res?.cuttingFileVo?.id ==null){
+          res.cuttingFileVo = []
+        }else{
+          res.cuttingFileVo = [res.cuttingFileVo]
+        }
+        rowData.value = res?.data || res
+      } else {
+        bindDialogType.value = "add"
+        rowData.value = row
+        rowData.value.finishedSize = row.specificationModel
+      }
+      bindRouteDialogVisible.value = true;
     } catch (e) {
       console.error("鑾峰彇宸ヨ壓璺嚎鍒楄〃澶辫触锛�", e);
       proxy.$modal.msgError("鑾峰彇宸ヨ壓璺嚎鍒楄〃澶辫触");
@@ -382,6 +437,33 @@
     });
   };
 
+  // 琛ㄦ牸閫夋嫨鏁版嵁
+  const handleSelectionChange = (selection) => {
+    selectedRows.value = selection;
+  };
+
+  const handleDelete = () => {
+    let ids = [];
+    if (selectedRows.value.length > 0) {
+      ids = selectedRows.value.map((item) => item.id);
+    } else {
+      proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+      return;
+    }
+    ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    }).then(() => {
+      delProductOrder(ids).then((res) => {
+        proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+        getList();
+      });
+    }).catch(() => {
+      proxy.$modal.msg("宸插彇娑�");
+    });
+  };
+
   // 瀵煎嚭
   const handleOut = () => {
     ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
@@ -397,8 +479,6 @@
       });
   };
 
-  const handleConfirmRoute = () => {};
-
   onMounted(() => {
     getList();
   });
@@ -410,14 +490,28 @@
 }
 
 ::v-deep .yellow {
-  background-color: #e8b183;
+  background-color: #FAF0DE;
+}
+
+::v-deep .pink {
+  background-color: #FAE1DE;
 }
 
 ::v-deep .red {
-  background-color: #e35050;
+  background-color: #ffe5e5;
 }
 
 ::v-deep .purple{
-  background-color: #c484dd;
+  background-color: #F4DEFA;
+}
+
+:deep(.fixed-desc .el-descriptions__table) {
+  table-layout: fixed;
+  width: 100%;
+}
+
+:deep(.fixed-desc .el-descriptions__cell) {
+  width: 25%;
+  word-break: break-word;
 }
 </style>

--
Gitblit v1.9.3