From c49a9d727dd7620c3a9cb67c512b29bab842b1eb Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 04 十一月 2025 10:41:17 +0800
Subject: [PATCH] 仓储物流-查询条件加一个日期

---
 src/views/inventoryManagement/receiptManagement/index.vue |   37 ++++++++++++++++++++++++++++---------
 1 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/src/views/inventoryManagement/receiptManagement/index.vue b/src/views/inventoryManagement/receiptManagement/index.vue
index c843b5a..1de9809 100644
--- a/src/views/inventoryManagement/receiptManagement/index.vue
+++ b/src/views/inventoryManagement/receiptManagement/index.vue
@@ -5,6 +5,16 @@
         <span class="search_title">渚涘簲鍟嗗悕绉帮細</span>
         <el-input v-model="searchForm.supplierName" style="width: 240px" placeholder="璇疯緭鍏�" @change="handleQuery"
           clearable prefix-icon="Search" />
+        <span class="search_title ml10">鍏ュ簱鏃ユ湡锛�</span>
+				<el-date-picker
+					v-model="searchForm.timeStr"
+					type="date"
+					placeholder="璇烽�夋嫨鏃ユ湡"
+					value-format="YYYY-MM-DD"
+					format="YYYY-MM-DD"
+					clearable
+					@change="handleQuery"
+				/>
         <el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
       </div>
       <div>
@@ -19,11 +29,11 @@
         :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)">
         <el-table-column align="center" type="selection" width="55" />
         <el-table-column align="center" label="搴忓彿" type="index" width="60" />
-        <el-table-column label="鍏ュ簱鏃堕棿" prop="createDate" width="100" show-overflow-tooltip />
+        <el-table-column label="鍏ュ簱鏃堕棿" prop="createTime" width="100" show-overflow-tooltip />
         <el-table-column label="鍏ュ簱鎵规" prop="inboundBatches" width="160" show-overflow-tooltip />
-        <el-table-column label="渚涘簲鍟嗗悕绉�" prop="supplierName" width="160" show-overflow-tooltip />
+        <el-table-column label="渚涘簲鍟嗗悕绉�" prop="supplierName" width="240" show-overflow-tooltip />
         <el-table-column label="浜у搧澶х被" prop="productCategory" width="100" show-overflow-tooltip />
-        <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" width="160" show-overflow-tooltip />
+        <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" width="200" show-overflow-tooltip />
         <el-table-column label="鍗曚綅" prop="unit" width="70" show-overflow-tooltip />
         <el-table-column label="鍏ュ簱鏁伴噺" prop="inboundNum" width="90" show-overflow-tooltip />
         <el-table-column label="鍚◣鍗曚环" prop="taxInclusiveUnitPrice" width="100" show-overflow-tooltip />
@@ -33,7 +43,7 @@
         <el-table-column label="鍏ュ簱浜�" prop="createBy" width="80" show-overflow-tooltip />
         <el-table-column fixed="right" label="鎿嶄綔" min-width="60" align="center">
           <template #default="scope">
-            <el-button link type="primary" size="small" @click="openForm('edit', scope.row);">缂栬緫</el-button>
+            <el-button link type="primary" size="small" @click="openForm('edit', scope.row);" :disabled="scope.row.createUser !== userStore.id">缂栬緫</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -80,9 +90,9 @@
           <el-table-column label="渚涘簲鍟�" prop="supplierName" width="100" />
           <el-table-column label="閲囪喘鏁伴噺" prop="quantity" width="100" />
           <el-table-column label="寰呭叆搴撴暟閲�" prop="quantity0" width="100" />
-          <el-table-column label="鏈鍏ュ簱鏁伴噺" prop="quantityStock" width="120">
+          <el-table-column label="鏈鍏ュ簱鏁伴噺" prop="quantityStock" width="150">
             <template #default="scope">
-              <el-input v-model="scope.row.quantityStock" type="number" :min="0" :max="scope.row.quantity0" />
+              <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.quantityStock" :max="scope.row.quantity0" />
             </template>
           </el-table-column>
           <el-table-column label="绋庣巼(%)" prop="taxRate" width="120" />
@@ -155,6 +165,7 @@
 const data = reactive({
   searchForm: {
     supplierName: '',
+		timeStr: '',
   },
   form: {
     id: null,
@@ -240,6 +251,7 @@
   const openForm = async (type, row) => {
     operationType.value = type
     dialogFormVisible.value = true
+    selectedRows.value = []
 
     if (type === 'add') {
       // 鏂板鏃跺垵濮嬪寲琛ㄥ崟
@@ -257,7 +269,6 @@
       }
       productList.value = [] // 娓呯┖浜у搧鍒楄〃
     } else {
-
       form.value = JSON.parse(JSON.stringify(row))
       try {
         loadingProducts.value = true
@@ -268,8 +279,9 @@
         });
         productList.value = res.data.map(item => ({
           ...item,
-          quantityStock: item.quantityStock || 0 // 濡傛灉宸叉湁鍏ュ簱鏁伴噺鍒欎繚鐣�
+          quantityStock: row.inboundNum // 濡傛灉宸叉湁鍏ュ簱鏁伴噺鍒欎繚鐣�
         }))
+        selectedRows.value = productList.value
       } catch (error) {
         console.error('鍔犺浇浜у搧澶辫触:', error)
         proxy.$modal.msgError('鍔犺浇浜у搧澶辫触')
@@ -325,6 +337,7 @@
         nickName: userStore.nickName,// 浣跨敤鏂版牸寮忓寲鍑芥暟
         details: selectedRows.value.map(product => ({
           id: product.id,
+          // id: product.salesLedgerProductId,
           inboundQuantity: Number(product.quantityStock)
         })),
       };
@@ -386,6 +399,12 @@
   const handleDelete = () => {
     let ids = []
     if (selectedRows.value.length > 0) {
+			// 妫�鏌ユ槸鍚︽湁浠栦汉缁存姢鐨勬暟鎹�
+			const unauthorizedData = selectedRows.value.filter(item => item.createUser !== userStore.id);
+			if (unauthorizedData.length > 0) {
+				proxy.$modal.msgWarning("涓嶅彲鍒犻櫎浠栦汉缁存姢鐨勬暟鎹�");
+				return;
+			}
       ids = selectedRows.value.map(item => item.id);
     } else {
       proxy.$modal.msgWarning('璇烽�夋嫨鏁版嵁')
@@ -399,7 +418,7 @@
           type: 'warning',
         }
     ).then(() => {
-      delStockIn(ids).then(res => {
+      delStockIn({ids:ids}).then(res => {
         proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛")
         getList()
       })

--
Gitblit v1.9.3