lilei %!s(int64=4) %!d(string=hai) anos
pai
achega
c3d62dd408

+ 8 - 6
src/views/purchasingManagement/purchaseOrder/detail.vue

@@ -53,8 +53,9 @@
             :scroll="{ x: 1060 }"
             bordered>
             <!-- 采购数量 -->
-            <template slot="purchaseNum" slot-scope="text, record">
-              <span>{{ record.purchaseNum }}</span>
+            <template slot="origqty" slot-scope="text, record">
+              <div>{{ text }}</div>
+              <div v-if="record.origqty">原采购数量:{{ record.origqty }}</div>
             </template>
             <!-- 缺货数量 -->
             <template slot="outOfStockNum" slot-scope="text, record">
@@ -85,8 +86,9 @@
             :scroll="{ x: 1060 }"
             bordered>
             <!-- 采购数量 -->
-            <template slot="purchaseNum" slot-scope="text, record">
-              <span>{{ record.purchaseNum }}</span>
+            <template slot="origqty" slot-scope="text, record">
+              <div>{{ text }}</div>
+              <div v-if="record.origqty">原采购数量:{{ record.origqty }}</div>
             </template>
             <!-- 缺货数量 -->
             <template slot="outOfStockNum" slot-scope="text, record">
@@ -129,9 +131,9 @@ export default {
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
         { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 140, align: 'center', customRender: function (text) { return text = ' ' ? '--' : text } },
         { title: '采购单价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '采购数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return text || 0 } },
+        { title: '采购数量', dataIndex: 'qty', width: 100, align: 'center', scopedSlots: { customRender: 'origqty' } },
         { title: '缺货数量', dataIndex: 'oosQty', width: 100, align: 'center', customRender: function (text) { return text || 0 } },
         { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '采购金额', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } }

+ 1 - 1
src/views/purchasingManagement/purchaseOrder/warehousing.vue

@@ -29,7 +29,7 @@
         <!-- 采购数量 -->
         <template slot="origqty" slot-scope="text, record, index">
           <div>{{ text }}</div>
-          <div>原采购数量:{{ record.origqty }}</div>
+          <div v-if="record.origqty">原采购数量:{{ record.origqty }}</div>
         </template>
         <!-- 仓库仓位 -->
         <template slot="warehousePosition" slot-scope="text, record, index">

+ 7 - 2
src/views/salesManagement/salesQuery/edit.vue

@@ -323,10 +323,15 @@ export default {
     insterProduct (row) {
       console.log(row)
       // 防止多次添加产品
-      if (this.isInster) {
+      if (this.isInster) { return }
+      const _this = this
+      // 判断是否已添加此产品
+      const hasRow = this.dataSource.find(item => item.productSn == row.productSn && item.warehouseSn == row.warehouseSn && item.warehouseLocationSn == row.warehouseLocationSn)
+      if (hasRow) {
+        this.$message.info('该产品已在当前销售单中存在!')
         return
       }
-      const _this = this
+
       // 库存不足时
       if (row.currentQty < row.salesNums) {
         this.$confirm({