From 2aaa8c190128efa6399124a00798c3c6efa2f86e Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期五, 16 一月 2026 13:04:07 +0800
Subject: [PATCH] fix: 采购台账中涉及到价格、数量等输入框时,限制数值输入不能为负数

---
 src/views/procurementManagement/procurementLedger/index.vue |   51 ++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 38 insertions(+), 13 deletions(-)

diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index fff44de..321038a 100644
--- a/src/views/procurementManagement/procurementLedger/index.vue
+++ b/src/views/procurementManagement/procurementLedger/index.vue
@@ -53,7 +53,7 @@
         show-summary
         :summary-method="summarizeMainTable"
         @expand-change="expandChange"
-        height="calc(100vh - 18.5em)"
+        height="calc(100vh - 19em)"
       >
         <el-table-column align="center" type="selection" width="55" />
         <el-table-column type="expand">
@@ -103,12 +103,10 @@
         <el-table-column
           label="閿�鍞悎鍚屽彿"
           prop="salesContractNo"
-          width="200"
           show-overflow-tooltip
         />
         <el-table-column
           label="渚涘簲鍟嗗悕绉�"
-          width="240"
           prop="supplierName"
           show-overflow-tooltip
         />
@@ -155,16 +153,15 @@
               type="primary"
               size="small"
               @click="openForm('edit', scope.row)"
-							:disabled="scope.row.receiptPaymentAmount>0 || scope.row.recorderName !== userStore.nickName"
               >缂栬緫</el-button
             >
-<!--            <el-button-->
-<!--              link-->
-<!--              type="success"-->
-<!--              size="small"-->
-<!--              @click="showQRCode(scope.row)"-->
-<!--              >鐢熸垚浜岀淮鐮�</el-button-->
-<!--            >-->
+            <el-button
+              link
+              type="primary"
+              size="small"
+              @click="downLoadFile(scope.row)"
+              >闄勪欢</el-button
+            >
 
           </template>
         </el-table-column>
@@ -206,6 +203,7 @@
               <el-select
                 v-model="form.salesLedgerId"
                 placeholder="璇烽�夋嫨"
+								filterable
                 clearable
                 @change="salesLedgerChange"
               >
@@ -225,6 +223,7 @@
               <el-select
                 v-model="form.supplierId"
                 placeholder="璇烽�夋嫨"
+								filterable
                 clearable
               >
                 <el-option
@@ -278,6 +277,7 @@
                 placeholder="璇烽�夋嫨"
                 clearable
                 disabled
+								filterable
               >
                 <el-option
                   v-for="item in userList"
@@ -494,6 +494,7 @@
                 v-model="productForm.taxInclusiveUnitPrice"
                 :precision="2"
                 :step="0.1"
+                :min="0"
                 clearable
                 style="width: 100%"
                 @change="mathNum"
@@ -504,6 +505,7 @@
 						<el-form-item label="鏁伴噺锛�" prop="quantity">
 							<el-input-number
 								:step="0.1"
+								:min="0"
 								clearable
 								:precision="2"
 								style="width: 100%"
@@ -521,6 +523,7 @@
                 v-model="productForm.taxInclusiveTotalPrice"
                 :precision="2"
                 :step="0.1"
+                :min="0"
                 clearable
                 style="width: 100%"
                 @change="reverseMathNum('taxInclusiveTotalPrice')"
@@ -532,12 +535,16 @@
               label="涓嶅惈绋庢�讳环(鍏�)锛�"
               prop="taxExclusiveTotalPrice"
             >
-              <el-input 
+              <el-input-number
                 v-model="productForm.taxExclusiveTotalPrice"
+                :precision="2"
+                :min="0"
+                style="width: 100%"
                 @change="reverseMathNum('taxExclusiveTotalPrice')"
               />
             </el-form-item>
           </el-col>
+
         </el-row>
         <el-row :gutter="30">
           <el-col :span="12">
@@ -558,10 +565,12 @@
 								v-model="productForm.warnNum"
 								:precision="2"
 								:step="0.1"
+								:min="0"
 								clearable
 								style="width: 100%"
 							/>
 						</el-form-item>
+
 					</el-col>
         </el-row>
       </el-form>
@@ -651,11 +660,13 @@
                 v-model="scanAddForm.contractAmount"
                 :precision="2"
                 :step="0.1"
+                :min="0"
                 clearable
                 style="width: 100%"
                 placeholder="璇疯緭鍏�"
               />
             </el-form-item>
+
           </el-col>
         </el-row>
         <el-row :gutter="20">
@@ -787,6 +798,7 @@
         </div>
       </template>
     </el-dialog>
+		<FileList ref="fileListRef" />
   </div>
 </template>
 
@@ -797,6 +809,7 @@
 import { Search } from "@element-plus/icons-vue";
 import { ElMessageBox } from "element-plus";
 import { userListNoPage } from "@/api/system/user.js";
+import FileList from "./fileList.vue";
 import {
   getSalesLedgerWithProducts,
   addOrUpdateSalesLedgerProduct,
@@ -1238,6 +1251,13 @@
     proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
     return;
   }
+  // 淇濊瘉鑷冲皯淇濈暀涓�鏉′骇鍝佷俊鎭�
+  const remainingCount =
+    productData.value.length - productSelectedRows.value.length;
+  if (remainingCount < 1) {
+    proxy.$modal.msgWarning("鑷冲皯淇濈暀涓�鏉′骇鍝佷俊鎭紝鏃犳硶鍏ㄩ儴鍒犻櫎");
+    return;
+  }
   if (operationType.value === "add") {
     productSelectedRows.value.forEach((selectedRow) => {
       const index = productData.value.findIndex(
@@ -1261,7 +1281,7 @@
         delProduct(ids).then((res) => {
           proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
           closeProductDia();
-          getSalesLedgerWithProducts({ id: currentId.value, type: 2 }).then(
+					getPurchaseById({ id: currentId.value, type: 2 }).then(
             (res) => {
               productData.value = res.productData;
             }
@@ -1413,6 +1433,11 @@
   }
 };
 
+const fileListRef = ref(null)
+const downLoadFile = (row) => {
+	fileListRef.value.open(row.salesLedgerFiles)
+}
+
 // 鏄剧ず浜岀淮鐮�
 const showQRCode = async (row) => {
   try {

--
Gitblit v1.9.3