Преглед изворни кода

现有库存改为可用库存

chenrui пре 3 година
родитељ
комит
06807dfc22

+ 3 - 8
src/views/inventoryManagement/inventoryQuery/detailModal.vue

@@ -11,8 +11,8 @@
     <!-- 合计 -->
     <!-- 合计 -->
     <a-alert type="info" style="margin-bottom:10px">
     <a-alert type="info" style="margin-bottom:10px">
       <div class="ftext" slot="message">
       <div class="ftext" slot="message">
-        现有库存总数量(个):<strong>{{ currentStock&&(currentStock.currentQty || currentStock.currentQty==0) ? currentStock.currentQty : '--' }}</strong>;
-        现有库存总成本(¥):<strong>{{ currentStock&&(currentStock.putCost || currentStock.putCost==0) ? currentStock.putCost : '--' }}</strong>。
+        可用库存总数量(个):<strong>{{ currentStock&&(currentStock.currentQty || currentStock.currentQty==0) ? currentStock.currentQty : '--' }}</strong>;
+        可用库存总成本(¥):<strong>{{ currentStock&&(currentStock.putCost || currentStock.putCost==0) ? currentStock.putCost : '--' }}</strong>。
       </div>
       </div>
     </a-alert>
     </a-alert>
     <!-- 库存详情 -->
     <!-- 库存详情 -->
@@ -26,11 +26,6 @@
       :data="loadData"
       :data="loadData"
       :scroll="{ x: 1210, y: 500 }"
       :scroll="{ x: 1210, y: 500 }"
       bordered>
       bordered>
-      <!-- 库存数量 -->
-      <template slot="currentQty" slot-scope="text, record">
-        {{ (record.currentQty + record.freezeQty) || 0 }}
-        <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
-      </template>
     </s-table>
     </s-table>
     <div class="btn-cont">
     <div class="btn-cont">
       <a-button id="inventoryQueryDetail-detail-modal-back" @click="isShow = false">返回列表</a-button>
       <a-button id="inventoryQueryDetail-detail-modal-back" @click="isShow = false">返回列表</a-button>
@@ -72,7 +67,7 @@ export default {
         { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { 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: '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: '入库类型', 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 : '--') } },
         { title: '成本单价', dataIndex: 'putCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
         { title: '成本单价', dataIndex: 'putCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       ],
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象

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

@@ -77,8 +77,8 @@
       <!-- 合计 -->
       <!-- 合计 -->
       <a-alert type="info" style="margin-bottom:10px">
       <a-alert type="info" style="margin-bottom:10px">
         <div class="ftext" slot="message">
         <div class="ftext" slot="message">
-          现有库存总数量(个):<strong>{{ currentStock&&(currentStock.totalCurrentStockQty || currentStock.totalCurrentStockQty==0) ? currentStock.totalCurrentStockQty : '--' }}</strong>;
-          现有库存总成本(¥):<strong>{{ currentStock&&(currentStock.totalCurrentStockCost || currentStock.totalCurrentStockCost==0) ? currentStock.totalCurrentStockCost : '--' }}</strong>。
+          可用库存总数量(个):<strong>{{ currentStock&&(currentStock.totalCurrentStockQty || currentStock.totalCurrentStockQty==0) ? currentStock.totalCurrentStockQty : '--' }}</strong>;
+          可用库存总成本(¥):<strong>{{ currentStock&&(currentStock.totalCurrentStockCost || currentStock.totalCurrentStockCost==0) ? currentStock.totalCurrentStockCost : '--' }}</strong>。
         </div>
         </div>
       </a-alert>
       </a-alert>
       <!-- 列表 -->
       <!-- 列表 -->
@@ -97,14 +97,6 @@
           <span v-if="record.productTypeName2">{{ record.productTypeName2 || '' }} ></span>
           <span v-if="record.productTypeName2">{{ record.productTypeName2 || '' }} ></span>
           <span v-if="record.productTypeName3">{{ record.productTypeName3 || '' }}</span>
           <span v-if="record.productTypeName3">{{ record.productTypeName3 || '' }}</span>
         </template>
         </template>
-        <!-- 现有库存数量 -->
-        <template slot="currentStockQty" slot-scope="text, record">
-          {{ (record.currentStockQty + record.freezeQty) || 0 }}
-          <span v-if="Number(record.freezeQty)">(冻结{{ record.freezeQty }})</span>
-        </template>
-        <template slot="currentStockCost" slot-scope="text, record">
-          {{ (Number(record.currentStockCost)*1000 + Number(record.freezeCost)*1000)/1000 || 0 }}
-        </template>
         <!-- 操作 -->
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
         <template slot="action" slot-scope="text, record">
           <a-button
           <a-button
@@ -170,8 +162,8 @@ export default {
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品品牌', dataIndex: 'brandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品品牌', dataIndex: 'brandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品分类', scopedSlots: { customRender: 'productTypeName' }, width: 140, align: 'center' },
         { title: '产品分类', scopedSlots: { customRender: 'productTypeName' }, width: 140, align: 'center' },
-        { title: '现有库存数量(个)', dataIndex: 'currentStockQty', scopedSlots: { customRender: 'currentStockQty' }, width: 140, align: 'center', sorter: true },
-        { title: '现有库存成本(¥)', dataIndex: 'currentStockCost', scopedSlots: { customRender: 'currentStockCost' }, width: 140, align: 'center', sorter: true },
+        { title: '可用库存数量(个)', dataIndex: 'currentStockQty', width: 140, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '可用库存成本(¥)', dataIndex: 'currentStockCost', width: 140, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 170, align: 'center', fixed: 'right' }
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 170, align: 'center', fixed: 'right' }
       ],
       ],
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象

+ 5 - 4
src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue

@@ -66,8 +66,8 @@
       <!-- 合计 -->
       <!-- 合计 -->
       <a-alert type="info" style="margin-bottom:10px">
       <a-alert type="info" style="margin-bottom:10px">
         <div class="ftext" slot="message">
         <div class="ftext" slot="message">
-          当前库存总数量(个):<strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong>;
-          当前库存总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong>。
+          当前库存总数量(个):<strong>{{ (productTotal&&(productTotal.currentStockQty || productTotal.currentStockQty==0)) ? productTotal.currentStockQty : '--' }}</strong>;
+          当前库存总成本(¥):<strong>{{ (productTotal&&(productTotal.currentStockCost || productTotal.currentStockCost==0)) ? productTotal.currentStockCost : '--' }}</strong>。
         </div>
         </div>
       </a-alert>
       </a-alert>
       <!-- 列表 -->
       <!-- 列表 -->
@@ -96,7 +96,8 @@
 <script>
 <script>
 import { STable, VSelect } from '@/components'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { stockFlowList, stockFlowCount } from '@/api/stockFlow'
+import { stockFlowList } from '@/api/stockFlow'
+import { stockByProductSn } from '@/api/stock'
 import { warehouseAllList } from '@/api/warehouse'
 import { warehouseAllList } from '@/api/warehouse'
 export default {
 export default {
   components: { STable, VSelect, rangeDate },
   components: { STable, VSelect, rangeDate },
@@ -160,7 +161,7 @@ export default {
     },
     },
     // 合计
     // 合计
     getTotal (param) {
     getTotal (param) {
-      stockFlowCount(param).then(res => {
+      stockByProductSn({ productSn: this.$route.params.sn }).then(res => {
         if (res.status == 200 && res.data) {
         if (res.status == 200 && res.data) {
           this.productTotal = res.data
           this.productTotal = res.data
         } else {
         } else {