Explorar o código

现有库存改为可用库存

chenrui %!s(int64=3) %!d(string=hai) anos
pai
achega
f74751f2ec

+ 4 - 9
src/views/inventoryManagement/inventoryQuery/detailModal.vue

@@ -11,8 +11,8 @@
     <!-- 合计 -->
     <a-alert type="info" style="margin-bottom:10px">
       <div class="ftext" slot="message">
-        现有库存总数量(个):<strong>{{ stockQty }}</strong>;
-        <span v-if="$hasPermissions('B_isShowCost')">现有库存总成本(¥):<strong>{{ stockCost }}</strong>。</span>
+        可用库存总数量(个):<strong>{{ (currentStock&&(currentStock.currentStockQty || currentStock.currentStockQty==0)) ? currentStock.currentStockQty : '--' }}</strong>;
+        <span v-if="$hasPermissions('B_isShowCost')">可用库存总成本(¥):<strong>{{ (currentStock&&(currentStock.currentStockCost || currentStock.currentStockCost==0)) ? currentStock.currentStockCost : '--' }}</strong>。</span>
       </div>
     </a-alert>
     <!-- 库存详情 -->
@@ -26,11 +26,6 @@
       :data="loadData"
       :scroll="{ x: 1210, y: 500 }"
       bordered>
-      <!-- 库存数量 -->
-      <template slot="currentQty" slot-scope="text, record">
-        {{ (record.currentQty + record.freezeQty) || 0 }}
-        <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
-      </template>
     </s-table>
     <div class="btn-cont">
       <a-button id="inventoryQueryDetail-detail-modal-back" @click="isShow = false">返回列表</a-button>
@@ -91,7 +86,7 @@ export default {
     },
     columns () {
       const arr = [
-        { title: '序号', dataIndex: 'no', width: 50, align: 'center', fixed: 'left' },
+        { title: '序号', dataIndex: 'no', width: 50, align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
@@ -99,7 +94,7 @@ export default {
         { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', scopedSlots: { customRender: 'currentQty' }, width: 100, align: 'center' }
+        { title: '库存数量', dataIndex: 'currentQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
       if (this.$hasPermissions('B_isShowCost')) {
         arr.splice(9, 0, { title: '成本单价', dataIndex: 'putCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })

+ 4 - 22
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -80,8 +80,8 @@
       <!-- 合计 -->
       <a-alert type="info" style="margin-bottom:10px">
         <div class="ftext" slot="message">
-          现有库存总数量(个):<strong>{{ stockQty }}</strong>;
-          <span v-if="$hasPermissions('B_isShowCost')">现有库存总成本(¥):<strong>{{ stockCost }}</strong>。</span>
+          可用库存总数量(个):<strong>{{ (currentStock&&(currentStock.currentStockQty || currentStock.currentStockQty==0)) ? currentStock.currentStockQty : '--' }}</strong>;
+          <span v-if="$hasPermissions('B_isShowCost')">可用库存总成本(¥):<strong>{{ (currentStock&&(currentStock.currentStockCost || currentStock.currentStockCost==0)) ? currentStock.currentStockCost : '--' }}</strong>。</span>
         </div>
       </a-alert>
       <!-- 列表 -->
@@ -95,14 +95,6 @@
         :data="loadData"
         :scroll="{ x: 1170, y: tableHeight }"
         bordered>
-        <!-- 现有库存数量 -->
-        <template slot="currentStockQty" slot-scope="text, record">
-          {{ (record.currentStockQty + record.freezeQty) || 0 }}
-          <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
-        </template>
-        <template slot="currentStockCost" slot-scope="text, record">
-          {{ ((Number(record.currentStockCost)*1000 + Number(record.freezeCost)*1000)/1000).toFixed(2) || 0 }}
-        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -201,16 +193,6 @@ export default {
     }
   },
   computed: {
-    stockQty () { //  库存总数量 合计
-      const currentStockQty = this.currentStock && this.currentStock.currentStockQty ? Number(this.currentStock.currentStockQty) : 0
-      const freezeQty = this.currentStock && this.currentStock.freezeQty ? Number(this.currentStock.freezeQty) : 0
-      return currentStockQty + freezeQty
-    },
-    stockCost () { //  库存总成本 合计
-      const currentStockCost = this.currentStock && this.currentStock.currentStockCost ? Number(this.currentStock.currentStockCost) : 0
-      const freezeCost = this.currentStock && this.currentStock.freezeCost ? Number(this.currentStock.freezeCost) : 0
-      return ((currentStockCost * 1000 + freezeCost * 1000) / 1000).toFixed(2)
-    },
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
@@ -219,11 +201,11 @@ export default {
         { title: '最后入库时间', dataIndex: 'lastStockTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品品牌', dataIndex: 'productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量(个)', dataIndex: 'currentStockQty', scopedSlots: { customRender: 'currentStockQty' }, width: 120, align: 'center', sorter: true },
+        { title: '可用库存数量', dataIndex: 'currentStockQty', width: 120, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 160, align: 'center', fixed: 'right' }
       ]
       if (this.$hasPermissions('B_isShowCost')) {
-        arr.splice(7, 0, { title: '库存成本(¥)', dataIndex: 'currentStockCost', scopedSlots: { customRender: 'currentStockCost' }, width: 120, align: 'center', sorter: true })
+        arr.splice(7, 0, { title: '可用库存成本', dataIndex: 'currentStockCost', width: 120, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       return arr
     }