瀏覽代碼

销售详情 新增“当前库存”列

chenrui 3 年之前
父節點
當前提交
290218abb6
共有 1 個文件被更改,包括 17 次插入5 次删除
  1. 17 5
      src/views/salesManagement/salesQuery/detail.vue

+ 17 - 5
src/views/salesManagement/salesQuery/detail.vue

@@ -112,6 +112,11 @@
             </a-badge>
             <span v-if="!(record.promotionFlag == 1 || ((Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit'))))">{{ text }}</span>
           </template>
+          <!-- 当前库存 -->
+          <template slot="stockQty" slot-scope="text, record">
+            <p style="margin: 0;" v-if="Number(record.stockQty) < Number(record.unpushedQty)">{{ record.stockQty }}(<span class="redStyle">缺{{ Number(record.unpushedQty) - Number(record.stockQty) }}</span>)</p>
+            <p style="margin: 0;" v-else>{{ record.stockQty }}</p>
+          </template>
         </s-table>
       </a-card>
       <a-card size="small" :bordered="false" class="footer-cont">
@@ -238,16 +243,16 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '15%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
-        { title: '产品名称', dataIndex: 'productName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '13%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
+        { title: '产品名称', dataIndex: 'productName', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '省级价', dataIndex: 'productEntity.provincePrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '销售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '销售数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已取消数', dataIndex: 'cancelQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '待下推数', dataIndex: 'unpushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '已下推数', dataIndex: 'pushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '待下推数', dataIndex: 'unpushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '已取消数', dataIndex: 'cancelQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
       if (this.$hasPermissions('B_isShowCost')) {
         arr.splice(4, 0, { title: '成本价', dataIndex: 'showCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
@@ -256,6 +261,9 @@ export default {
         const ind = this.$hasPermissions('B_isShowCost') ? 6 : 5
         arr.splice(ind, 0, { title: '市级价', dataIndex: 'productEntity.cityPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
+      if (this.detailData && this.detailData.billStatus == 'WAIT_AUDIT' && this.$hasPermissions('B_salesAudit')) { //  审核,需用到库存
+        arr.splice(arr.length - 3, 0, { title: '当前库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' })
+      }
       return arr
     }
   },
@@ -421,5 +429,9 @@ export default {
       margin-top: 5px;
       text-align: center;
     }
+    .redStyle{
+      font-weight: bold;
+      color: red;
+    }
   }
 </style>