From a3d0412c3cfcec269e0bec57b844b1fc0b44c767 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 19 十一月 2025 09:59:42 +0800
Subject: [PATCH] 1.弘也水泥-销售台账发货放到每一条产品上

---
 src/views/salesManagement/salesLedger/index.vue |   54 ++++++++++++++++++++++++++++--------------------------
 1 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index f1fb9a2..2afec1f 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -45,16 +45,22 @@
         <el-table-column align="center" type="selection" width="55" />
         <el-table-column type="expand">
           <template #default="props">
-            <el-table :data="props.row.children" border show-summary :summary-method="summarizeChildrenTable">
-              <el-table-column align="center" label="搴忓彿" type="index" width="60" />
-              <el-table-column label="浜у搧澶х被" prop="productCategory" />
-              <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" />
-              <el-table-column label="鍗曚綅" prop="unit" />
-              <el-table-column label="鏁伴噺" prop="quantity" />
-              <el-table-column label="绋庣巼(%)" prop="taxRate" />
-              <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" />
-              <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" />
-              <el-table-column label="涓嶅惈绋庢�讳环(鍏�)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
+            <el-table :data="props.row.children" border show-summary :summary-method="summarizeChildrenTable" style="min-width: 1200px;"
+                      scrollbar-always-on>
+              <el-table-column align="center" label="搴忓彿" type="index" width="70" />
+              <el-table-column label="浜у搧澶х被" prop="productCategory" width="160" />
+              <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" width="220" />
+              <el-table-column label="鍗曚綅" prop="unit" width="100" />
+              <el-table-column label="鏁伴噺" prop="quantity" width="120" />
+              <el-table-column label="绋庣巼(%)" prop="taxRate" width="120" />
+              <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" width="160" />
+              <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" width="180" />
+              <el-table-column label="涓嶅惈绋庢�讳环(鍏�)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" width="180" />
+              <el-table-column fixed="right" label="鎿嶄綔" width="150" align="center">
+                <template #default="scope">
+                  <el-button link type="primary" size="small" @click="openDeliveryForm(props.row, scope.row)">鍙戣揣</el-button>
+                </template>
+              </el-table-column>
             </el-table>
           </template>
         </el-table-column>
@@ -70,12 +76,11 @@
         <el-table-column label="褰曞叆浜�" prop="entryPersonName" width="100" show-overflow-tooltip />
         <el-table-column label="褰曞叆鏃ユ湡" prop="entryDate" width="120" show-overflow-tooltip />
         <el-table-column label="绛捐鏃ユ湡" prop="executionDate" width="120" show-overflow-tooltip />
-        <el-table-column fixed="right" label="鎿嶄綔" min-width="200" align="center">
+        <el-table-column fixed="right" label="鎿嶄綔" min-width="150" align="center">
           <template #default="scope">
-            <el-button link type="primary" size="small" :disabled="scope.row.invoiceTotal>0 || scope.row.entryPersonName !== userStore.nickName" @click="openForm('edit', scope.row)">缂栬緫</el-button>
+            <el-button link type="primary" size="small" @click="openForm('edit', scope.row)">缂栬緫</el-button>
 <!--            <el-button link type="primary" size="small" @click="openForm('view', scope.row)">璇︽儏</el-button>-->
             <el-button link type="primary" size="small" @click="downLoadFile(scope.row)">闄勪欢</el-button>
-            <el-button link type="primary" size="small" @click="openDeliveryForm(scope.row)">鍙戣揣</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -142,7 +147,7 @@
           <el-col :span="12">
             <el-form-item label="褰曞叆鏃ユ湡锛�" prop="entryDate">
               <el-date-picker style="width: 100%" v-model="form.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
-                type="date" placeholder="璇烽�夋嫨" clearable disabled />
+                type="date" placeholder="璇烽�夋嫨" clearable />
             </el-form-item>
           </el-col>
         </el-row>
@@ -505,12 +510,9 @@
     customerContractNo: "", // 瀹㈡埛鍚堝悓缂栧彿
     salesContractNo: "", // 閿�鍞悎鍚岀紪鍙�
     projectName: "", // 椤圭洰鍚嶇О
-    entryDate: [
-      dayjs().format("YYYY-MM-DD"),
-      dayjs().add(1, "day").format("YYYY-MM-DD"),
-    ], // 褰曞叆鏃ユ湡
-    entryDateStart: dayjs().format("YYYY-MM-DD"),
-    entryDateEnd: dayjs().add(1, "day").format("YYYY-MM-DD"),
+    entryDate: null, // 褰曞叆鏃ユ湡
+    entryDateStart: undefined,
+    entryDateEnd: undefined,
   },
   form: {
     salesContractNo: "",
@@ -591,7 +593,7 @@
 
 // 鍙戣揣鐩稿叧
 const deliveryFormVisible = ref(false);
-const currentDeliveryRow = ref(null);
+const currentDeliveryContext = ref(null);
 const deliveryFormData = reactive({
   deliveryForm: {
     shippingDate: "",
@@ -1526,8 +1528,8 @@
 }
 
 // 鎵撳紑鍙戣揣寮规
-const openDeliveryForm = (row) => {
-  currentDeliveryRow.value = row;
+const openDeliveryForm = (parentRow, productRow) => {
+  currentDeliveryContext.value = { parentRow, productRow };
   deliveryForm.value = {
     shippingDate: getCurrentDate(),
     shippingCarNumber: "",
@@ -1540,14 +1542,14 @@
   proxy.$refs["deliveryFormRef"].validate((valid) => {
     if (valid) {
       addShippingInfo({
-        salesLedgerId: currentDeliveryRow.value.id,
+        salesLedgerId: currentDeliveryContext.value.parentRow.id,
+        salesLedgerProductId: currentDeliveryContext.value.productRow.id,
         shippingDate: deliveryForm.value.shippingDate,
         shippingCarNumber: deliveryForm.value.shippingCarNumber,
       })
         .then(() => {
           proxy.$modal.msgSuccess("鍙戣揣鎴愬姛");
           closeDeliveryDia();
-          getList();
         })
         .catch(() => {
           proxy.$modal.msgError("鍙戣揣澶辫触锛岃閲嶈瘯");
@@ -1560,7 +1562,7 @@
 const closeDeliveryDia = () => {
   proxy.resetForm("deliveryFormRef");
   deliveryFormVisible.value = false;
-  currentDeliveryRow.value = null;
+  currentDeliveryContext.value = null;
 };
 
 onMounted(() => {

--
Gitblit v1.9.3