From d8c936e4381a75d8d1a4dd0f642b99827457a0fe Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 02 四月 2026 13:48:08 +0800
Subject: [PATCH] 军泰伟业 1.军泰伟业-库存管理增加库位 2.军泰伟业-销售产品增加物料号字段 3.军泰伟业-产品维护增加录入时间和修改时间的展示 4.军泰伟业-发货不需要审核流程了

---
 src/views/basicData/product/index.vue                     |   15 +++
 src/views/inventoryManagement/receiptManagement/index.vue |    2 
 src/views/inventoryManagement/stockManagement/index.vue   |    2 
 src/views/salesManagement/salesLedger/index.vue           |   89 ++++-------------
 src/views/salesManagement/salesQuotation/index.vue        |  173 ++++++++++++----------------------
 src/views/inventoryManagement/dispatchLog/index.vue       |    2 
 6 files changed, 103 insertions(+), 180 deletions(-)

diff --git a/src/views/basicData/product/index.vue b/src/views/basicData/product/index.vue
index 6f1fed3..19acdbd 100644
--- a/src/views/basicData/product/index.vue
+++ b/src/views/basicData/product/index.vue
@@ -266,6 +266,11 @@
     minWidth: 100,
   },
   {
+    label: "瀛愰」鏁伴噺",
+    prop: "subItemCount",
+    minWidth: 100,
+  },
+  {
     label: "浜у搧灞炴��",
     prop: "productType",
     width: 100,
@@ -276,6 +281,16 @@
       return typeMap[String(v)] || "info";
     },
   },
+	{
+		label: "鍒涘缓",
+		prop: "createTime",
+		minWidth: 120,
+	},
+	{
+		label: "淇敼鏃堕棿",
+		prop: " updateTime",
+		minWidth: 120,
+	},
   {
     dataType: "action",
     label: "鎿嶄綔",
diff --git a/src/views/inventoryManagement/dispatchLog/index.vue b/src/views/inventoryManagement/dispatchLog/index.vue
index 2f70131..ef11844 100644
--- a/src/views/inventoryManagement/dispatchLog/index.vue
+++ b/src/views/inventoryManagement/dispatchLog/index.vue
@@ -26,7 +26,7 @@
       type: 1
     },
     {
-      label: '澶栬喘',
+      label: '鏍囧噯浠�',
       name: 'purchase',
       type: 2
     },
diff --git a/src/views/inventoryManagement/receiptManagement/index.vue b/src/views/inventoryManagement/receiptManagement/index.vue
index 879e3c3..af17962 100644
--- a/src/views/inventoryManagement/receiptManagement/index.vue
+++ b/src/views/inventoryManagement/receiptManagement/index.vue
@@ -23,7 +23,7 @@
     type: 1
   },
   {
-    label: '澶栬喘',
+    label: '鏍囧噯浠�',
     name: 'purchase',
     type: 2
   },
diff --git a/src/views/inventoryManagement/stockManagement/index.vue b/src/views/inventoryManagement/stockManagement/index.vue
index 417f6c2..fd1a777 100644
--- a/src/views/inventoryManagement/stockManagement/index.vue
+++ b/src/views/inventoryManagement/stockManagement/index.vue
@@ -24,7 +24,7 @@
     component: markRaw(StockRecord)
   },
   {
-    label: '澶栬喘',
+    label: '鏍囧噯浠�',
     name: 'purchase',
     type: 2,
     component: markRaw(StockRecord)
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index bdd2d94..f6241a2 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -46,6 +46,7 @@
               <el-table-column align="center" label="搴忓彿" type="index"/>
               <el-table-column label="浜у搧澶х被" prop="productCategory" />
               <el-table-column label="鍥剧焊缂栧彿" prop="specificationModel" />
+							<el-table-column label="鐗╂枡鍙�" prop="material" />
               <el-table-column label="鍗曚綅" prop="unit" />
 							<el-table-column label="浜у搧鐘舵��"
 															 width="100px"
@@ -111,9 +112,7 @@
         <el-table-column fixed="right" label="鎿嶄綔" width="100" 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('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>
@@ -216,6 +215,7 @@
 					<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="material" />
 					<el-table-column label="鍗曚綅" prop="unit" />
 					<el-table-column label="鏁伴噺" prop="quantity" />
 					<el-table-column label="绋庣巼(%)" prop="taxRate" />
@@ -340,6 +340,13 @@
 					<el-col :span="24">
 						<el-form-item label="鍥剧焊缂栧彿锛�" prop="specificationModel">
 							<el-input v-model="productForm.specificationModel" placeholder="璇疯緭鍏ュ浘绾哥紪鍙�" disabled />
+						</el-form-item>
+					</el-col>
+				</el-row>
+				<el-row :gutter="30">
+					<el-col :span="24">
+						<el-form-item label="鐗╂枡鍙凤細" prop="material">
+							<el-input v-model="productForm.material" placeholder="璇疯緭鍏ョ墿鏂欏彿" clearable />
 						</el-form-item>
 					</el-col>
 				</el-row>
@@ -565,50 +572,16 @@
 			@close="closeDeliveryDia"
 		>
 			<el-form :model="deliveryForm" label-width="120px" label-position="top" :rules="deliveryRules" ref="deliveryFormRef">
-        <!-- 瀹℃壒浜洪�夋嫨锛堜豢鍗忓悓瀹℃壒閲岀殑瀹℃壒浜鸿妭鐐归�夋嫨锛� -->
-        <el-row>
-          <el-col :span="24">
-            <el-form-item>
-              <template #label>
-                <span>瀹℃壒浜洪�夋嫨锛�</span>
-                <el-button type="primary" @click="addApproverNode" style="margin-left: 8px;">鏂板鑺傜偣</el-button>
-              </template>
-              <div style="display: flex; align-items: flex-end; flex-wrap: wrap;">
-                <div
-                  v-for="(node, index) in approverNodes"
-                  :key="node.id"
-                  style="margin-right: 20px; text-align: center; margin-bottom: 10px;"
-                >
-                  <div>
-                    <span>瀹℃壒浜�</span>
-                    鈫�
-                  </div>
-                  <el-select
-                    v-model="node.userId"
-                    placeholder="閫夋嫨浜哄憳"
-                    filterable
-                    style="width: 140px; margin-bottom: 8px;"
-                  >
-                    <el-option
-                      v-for="user in userList"
-                      :key="user.userId"
-                      :label="user.nickName"
-                      :value="user.userId"
-                    />
-                  </el-select>
-                  <div>
-                    <el-button
-                      type="danger"
-                      size="small"
-                      @click="removeApproverNode(index)"
-                      v-if="approverNodes.length > 1"
-                    >鍒犻櫎</el-button>
-                  </div>
-                </div>
-              </div>
-            </el-form-item>
-          </el-col>
-        </el-row>
+				<el-row>
+					<el-col :span="24">
+						<el-alert
+							title="纭鍚庡皢鐩存帴鍙戣揣锛�"
+							type="warning"
+							:closable="false"
+							show-icon
+						/>
+					</el-col>
+				</el-row>
 			</el-form>
 			<template #footer>
 				<div class="dialog-footer">
@@ -715,6 +688,7 @@
 const productFormData = reactive({
 	productForm: {
 		productCategory: "",
+		material: "",
 		specificationModel: "",
 		unit: "",
 		quantity: "",
@@ -776,16 +750,6 @@
   deliveryRules: {},
 });
 const { deliveryForm, deliveryRules } = toRefs(deliveryFormData);
-
-// 鍙戣揣瀹℃壒浜鸿妭鐐癸紙浠垮崗鍚屽鎵� infoFormDia.vue锛�
-const approverNodes = ref([{ id: 1, userId: null }]);
-let nextApproverId = 2;
-const addApproverNode = () => {
-  approverNodes.value.push({ id: nextApproverId++, userId: null });
-};
-const removeApproverNode = (index) => {
-  approverNodes.value.splice(index, 1);
-};
 
 // 瀵煎叆鐩稿叧
 const importUploadRef = ref(null);
@@ -1122,6 +1086,7 @@
 		return {
 			// 鍙拌处瀛楁
 			productCategory: p.product || p.productName || "",
+			material: p.material || "",
 			specificationModel: p.specification || "",
 			unit: p.unit || "",
 			quantity: quantity,
@@ -1339,6 +1304,7 @@
 	if (selectedProducts && selectedProducts.length > 0) {
 		const product = selectedProducts[0];
 		productForm.value.productCategory = product.productName;
+		productForm.value.material = product.material || "";
 		productForm.value.specificationModel = product.model;
 		productForm.value.unit = product.unit;
 	}
@@ -2138,9 +2104,6 @@
   deliveryForm.value = {
     type: "璐ц溅",
   };
-  // 閲嶇疆瀹℃壒浜鸿妭鐐癸紙榛樿涓�涓┖鑺傜偣锛�
-  approverNodes.value = [{ id: 1, userId: null }];
-  nextApproverId = 2;
 	deliveryFormVisible.value = true;
 };
 
@@ -2148,20 +2111,12 @@
 const submitDelivery = () => {
   proxy.$refs["deliveryFormRef"].validate((valid) => {
     if (valid) {
-      // 瀹℃壒浜哄繀濉牎楠岋紙鎵�鏈夎妭鐐归兘瑕侀�変汉锛�
-      const hasEmptyApprover = approverNodes.value.some(node => !node.userId);
-      if (hasEmptyApprover) {
-        proxy.$modal.msgError("璇蜂负鎵�鏈夊鎵硅妭鐐归�夋嫨瀹℃壒浜猴紒");
-        return;
-      }
-      const approveUserIds = approverNodes.value.map(node => node.userId).join(",");
       const currentExpandedKeys = [...expandedRowKeys.value];
       const salesLedgerId = currentDeliveryRow.value.salesLedgerId;
       addShippingInfo({
         salesLedgerId: salesLedgerId,
         salesLedgerProductId: currentDeliveryRow.value.id,
         shippingTotal: currentDeliveryRow.value.quantity,
-        approveUserIds,
       })
         .then(() => {
           proxy.$modal.msgSuccess("鍙戣揣鎴愬姛");
diff --git a/src/views/salesManagement/salesQuotation/index.vue b/src/views/salesManagement/salesQuotation/index.vue
index 87439ea..24147ae 100644
--- a/src/views/salesManagement/salesQuotation/index.vue
+++ b/src/views/salesManagement/salesQuotation/index.vue
@@ -229,40 +229,14 @@
           </template>
           <div class="form-content">
             <el-table :data="form.products" border style="width: 100%" class="product-table" v-if="form.products.length > 0">
-            <el-table-column prop="product" label="浜у搧鍚嶇О" width="200">
+            <el-table-column prop="product" label="浜у搧鍚嶇О" width="220">
               <template #default="scope">
-                <el-form-item :prop="`products.${scope.$index}.productId`" class="product-table-form-item">
-                  <el-tree-select
-                    v-model="scope.row.productId"
-                    placeholder="璇烽�夋嫨"
-                    clearable
-                    check-strictly
-                    @change="getModels($event, scope.row)"
-                    :data="productOptions"
-                    :render-after-expand="false"
-                    style="width: 100%"
-                  />
-                </el-form-item>
+                <span>{{ scope.row.product || scope.row.productName || '--' }}</span>
               </template>
             </el-table-column>
-            <el-table-column prop="specification" label="鍥剧焊缂栧彿" width="200">
+            <el-table-column prop="specification" label="鍥剧焊缂栧彿" width="220">
               <template #default="scope">
-                <el-form-item :prop="`products.${scope.$index}.specificationId`" class="product-table-form-item">
-                  <el-select
-                    v-model="scope.row.specificationId"
-                    placeholder="璇烽�夋嫨"
-                    clearable
-                    @change="getProductModel($event, scope.row)"
-                    style="width: 100%"
-                  >
-                    <el-option
-                      v-for="item in scope.row.modelOptions || []"
-                      :key="item.id"
-                      :label="item.model"
-                      :value="item.id"
-                    />
-                  </el-select>
-                </el-form-item>
+                <span>{{ scope.row.specification || '--' }}</span>
               </template>
             </el-table-column>
             <el-table-column prop="unit" label="鍗曚綅">
@@ -275,7 +249,7 @@
             <el-table-column prop="unitPrice" label="鍗曚环">
               <template #default="scope">
                 <el-form-item :prop="`products.${scope.$index}.unitPrice`" class="product-table-form-item">
-                  <el-input-number v-model="scope.row.unitPrice" :min="0" :precision="2" style="width: 100%" />
+                  <el-input-number v-model="scope.row.unitPrice" :min="0.01" :precision="2" :step="0.01" style="width: 100%" />
                 </el-form-item>
               </template>
             </el-table-column>
@@ -313,6 +287,12 @@
       </el-form>
       </div>
     </FormDialog>
+
+    <ProductSelectDialog
+      v-model="productSelectVisible"
+      :single="true"
+      @confirm="handleProductSelectConfirm"
+    />
 
     <!-- 鏌ョ湅璇︽儏瀵硅瘽妗� -->
     <el-dialog v-model="viewDialogVisible" title="鎶ヤ环璇︽儏" width="800px">
@@ -359,6 +339,7 @@
 import { Search, Document, UserFilled, Box, EditPen, Plus, ArrowRight, Delete } from '@element-plus/icons-vue'
 import Pagination from '@/components/PIMTable/Pagination.vue'
 import FormDialog from '@/components/Dialog/FormDialog.vue'
+import ProductSelectDialog from '@/views/basicData/product/ProductSelectDialog.vue'
 import {getQuotationList,addQuotation,updateQuotation,deleteQuotation} from '@/api/salesManagement/salesQuotation.js'
 import {userListNoPage} from "@/api/system/user.js";
 import {customerList} from "@/api/salesManagement/salesLedger.js";
@@ -374,7 +355,6 @@
 
 const quotationList = ref([])
 const productOptions = ref([]);
-const modelOptions = ref([]);
 const pagination = reactive({
   total: 3,
   currentPage: 1,
@@ -383,6 +363,8 @@
 
 const dialogVisible = ref(false)
 const viewDialogVisible = ref(false)
+const productSelectVisible = ref(false)
+const activeProductIndex = ref(-1)
 const dialogTitle = ref('鏂板鎶ヤ环')
 const form = reactive({
   quotationNo: '',
@@ -541,65 +523,6 @@
 	}
 	return null;
 }
-const getModels = (value, row) => {
-	if (!row) return;
-	// 濡傛灉娓呯┖閫夋嫨锛屽垯娓呯┖鐩稿叧瀛楁
-	if (!value) {
-		row.productId = '';
-		row.product = '';
-		row.modelOptions = [];
-		row.specificationId = '';
-		row.specification = '';
-		row.unit = '';
-		return;
-	}
-	// 鏇存柊 productId锛坴-model 宸茬粡鑷姩鏇存柊锛岃繖閲岀‘淇濅竴鑷存�э級
-	row.productId = value;
-	// 鎵惧埌瀵瑰簲鐨� label 骞惰祴鍊肩粰 row.product
-	const label = findNodeById(productOptions.value, value);
-	if (label) {
-		row.product = label;
-	}
-	// 鑾峰彇瑙勬牸鍨嬪彿鍒楄〃锛岃缃埌褰撳墠琛岀殑 modelOptions
-	modelList({ id: value }).then((res) => {
-		row.modelOptions = res || [];
-	});
-};
-const getProductModel = (value, row) => {
-	if (!row) return;
-	// 濡傛灉娓呯┖閫夋嫨锛屽垯娓呯┖鐩稿叧瀛楁
-	if (!value) {
-		row.specificationId = '';
-		row.specification = '';
-		row.unit = '';
-		return;
-	}
-	// 鏇存柊 specificationId锛坴-model 宸茬粡鑷姩鏇存柊锛岃繖閲岀‘淇濅竴鑷存�э級
-	row.specificationId = value;
-	const modelOptions = row.modelOptions || [];
-	const index = modelOptions.findIndex((item) => item.id === value);
-	if (index !== -1) {
-		row.specification = modelOptions[index].model;
-		row.unit = modelOptions[index].unit;
-	} else {
-		row.specification = '';
-		row.unit = '';
-	}
-};
-const findNodeById = (nodes, productId) => {
-	for (let i = 0; i < nodes.length; i++) {
-		if (nodes[i].value === productId) {
-			return nodes[i].label; // 鎵惧埌鑺傜偣锛岃繑鍥� label
-		}
-		if (nodes[i].children && nodes[i].children.length > 0) {
-			const foundLabel = findNodeById(nodes[i].children, productId);
-			if (foundLabel) {
-				return foundLabel; // 鍦ㄥ瓙鑺傜偣涓壘鍒帮紝杩斿洖 label
-			}
-		}
-	}
-	return null; // 娌℃湁鎵惧埌鑺傜偣锛岃繑鍥瀗ull
-};
 const handleView = (row) => {
   // 鍙鍒堕渶瑕佺殑瀛楁锛岄伩鍏嶅皢缁勪欢寮曠敤鏀惧叆鍝嶅簲寮忓璞�
   currentQuotation.value = {
@@ -755,23 +678,51 @@
 }
 
 const addProduct = () => {
-  form.products.push({
-    productId: '',
-    product: '',
-    productName: '',
-    specificationId: '',
-    specification: '',
-    quantity: 1,
-    unit: '',
-    unitPrice: 0,
-    amount: 0,
-    modelOptions: [] // 涓烘瘡琛屾坊鍔犵嫭绔嬬殑瑙勬牸鍨嬪彿鍒楄〃
-  })
+  activeProductIndex.value = -1
+  productSelectVisible.value = true
 }
 
 const removeProduct = (index) => {
   form.products.splice(index, 1)
   calculateSubtotal()
+}
+
+const handleProductSelectConfirm = (rows) => {
+  if (!rows || rows.length === 0 || activeProductIndex.value < 0) {
+    if (!rows || rows.length === 0) {
+      return
+    }
+    const selected = rows[0]
+    form.products.push({
+      productId: selected.id,
+      product: selected.productName || '',
+      productName: selected.productName || '',
+      specificationId: selected.id,
+      specification: selected.model || '',
+      quantity: 1,
+      unit: selected.unit || '',
+    unitPrice: 0.01,
+      amount: 0,
+      modelOptions: [],
+    })
+    calculateSubtotal()
+    activeProductIndex.value = -1
+    return
+  }
+
+  const row = form.products[activeProductIndex.value]
+  if (!row) {
+    return
+  }
+
+  const selected = rows[0]
+  row.productId = selected.id
+  row.product = selected.productName || ''
+  row.productName = selected.productName || ''
+  row.specificationId = selected.id
+  row.specification = selected.model || ''
+  row.unit = selected.unit || row.unit || ''
+  calculateAmount(row)
 }
 
 const calculateAmount = (product) => {
@@ -801,15 +752,17 @@
         return
       }
 
-      // 瀹℃壒浜哄繀濉牎楠�
-      const hasEmptyApprover = approverNodes.value.some(node => !node.userId)
-      if (hasEmptyApprover) {
-        ElMessage.error('璇蜂负鎵�鏈夊鎵硅妭鐐归�夋嫨瀹℃壒浜猴紒')
+      const hasInvalidPrice = form.products.some(product => Number(product.unitPrice) <= 0)
+      if (hasInvalidPrice) {
+        ElMessage.error('鍗曚环蹇呴』澶т簬0')
         return
       }
-      
-      // 鏀堕泦鎵�鏈夎妭鐐圭殑瀹℃壒浜篿d
-      form.approveUserIds = approverNodes.value.map(node => node.userId).join(',')
+
+      // 鏀堕泦鎵�鏈夎妭鐐圭殑瀹℃壒浜篿d锛屽厑璁镐负绌�
+      form.approveUserIds = approverNodes.value
+        .map(node => node.userId)
+        .filter(userId => userId !== null && userId !== undefined && userId !== '')
+        .join(',')
       
       // 璁$畻鎵�鏈変骇鍝佺殑鍗曚环鎬诲拰
       form.totalAmount = form.products.reduce((sum, product) => {

--
Gitblit v1.9.3