Browse Source

修改bug

chenrui 7 months ago
parent
commit
7422ffae4b

+ 3 - 3
src/views/salesManagement/salesQueryNew/comps/activeQueryPart.vue

@@ -182,10 +182,10 @@ export default {
   computed: {
   computed: {
     columns () {
     columns () {
       const arr = [
       const arr = [
-        { title: '产品编码', dataIndex: 'productCode', width: '150px', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '140px', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', scopedSlots: { customRender: 'productName' }, align: 'left' },
         { title: '产品名称', dataIndex: 'productName', scopedSlots: { customRender: 'productName' }, align: 'left' },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '品牌', dataIndex: 'productBrandName', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '品牌', dataIndex: 'productBrandName', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '出库仓库', dataIndex: 'warehouseName', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '出库仓库', dataIndex: 'warehouseName', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '库存数量', dataIndex: 'currentStockQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '库存数量', dataIndex: 'currentStockQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'productUnit', width: '60px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'productUnit', width: '60px', align: 'center', customRender: function (text) { return text || '--' } },
@@ -197,7 +197,7 @@ export default {
       ]
       ]
       let idx = 7
       let idx = 7
       if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
       if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
-        arr.splice(idx, 0, { title: '售价', dataIndex: 'productPrice', width: '100px', align: 'right', scopedSlots: { customRender: 'productPrice' } })
+        arr.splice(idx, 0, { title: '售价', dataIndex: 'productPrice', width: '70px', align: 'right', scopedSlots: { customRender: 'productPrice' } })
         arr.splice(idx + 1, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
         arr.splice(idx + 1, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
         idx = idx + 2
         idx = idx + 2
       }
       }

+ 22 - 9
src/views/salesManagement/salesQueryNew/comps/cumulativeProduct.vue

@@ -58,7 +58,7 @@
     </a-tabs>
     </a-tabs>
     <div class="table-operator">
     <div class="table-operator">
       <a-button type="primary" @click="handleAdd">批量添加</a-button>
       <a-button type="primary" @click="handleAdd">批量添加</a-button>
-      <span v-if="selectTotal" style="margin-left:10px;">已选{{ selectTotal }}项</span>
+      <span v-if="selectTotal" style="margin-left:10px;">已选{{ selectTotal }}项,数量合计{{ selectCount.totalNum }}个,售价小计合计{{ toThousands(selectCount.totalPrice) }}元</span>
     </div>
     </div>
     <!-- 列表 -->
     <!-- 列表 -->
     <s-table
     <s-table
@@ -145,24 +145,37 @@ export default {
     selectTotal () {
     selectTotal () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
     },
     },
+    // 数量合计、售价小计
+    selectCount () {
+      let totalNum = 0
+      let totalPrice = 0
+      if (this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.length) {
+        this.rowSelectionInfo.selectedRows.forEach(item => {
+          totalNum += item.qty
+          totalPrice += item.totalAmount
+        })
+      }
+      return { totalNum, totalPrice }
+    },
     columns () {
     columns () {
+      const _this = this
       const arr = [
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '销售单号', dataIndex: 'borrowBillNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '销售单号', dataIndex: 'borrowBillNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'buyerName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'buyerName', width: '11%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品编码', dataIndex: 'productCode', width: '150px', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'productCode', width: '150px', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productEntity.name', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品名称', dataIndex: 'productEntity.name', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '品牌', dataIndex: 'productEntity.productBrandName', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '60px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '包装数', dataIndex: 'packQtyV', width: '60px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '销售数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '品牌', dataIndex: 'productEntity.productBrandName', width: '70px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '50px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '包装数', dataIndex: 'packQtyV', width: '50px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '销售数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
       ]
       const idx = 7
       const idx = 7
       if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
       if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
-        arr.splice(idx, 0, { title: '售价', dataIndex: 'price', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(idx + 1, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
-        arr.push({ title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(idx, 0, { title: '售价', dataIndex: 'price', width: '70px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(idx + 1, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.push({ title: '售价小计', dataIndex: 'totalAmount', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       }
       return arr
       return arr
     }
     }

+ 2 - 2
src/views/salesManagement/salesQueryNew/comps/queryPart.vue

@@ -171,11 +171,11 @@ export default {
         { title: '单位', dataIndex: 'productUnit', width: '60px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'productUnit', width: '60px', align: 'center', customRender: function (text) { return text || '--' } },
         // { title: '售价', dataIndex: 'productPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '售价', dataIndex: 'productPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '包装数', dataIndex: 'packQtyV', width: '60px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '包装数', dataIndex: 'packQtyV', width: '60px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: '80px', align: 'center', fixed: 'right' },
+        { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: '70px', align: 'center', fixed: 'right' },
         { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: '60px', align: 'center', fixed: 'right' }
         { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: '60px', align: 'center', fixed: 'right' }
       ]
       ]
       if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
       if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
-        arr.splice(6, 0, { title: '售价', dataIndex: 'productPrice', width: '80px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(6, 0, { title: '售价', dataIndex: 'productPrice', width: '70px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
         arr.splice(7, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '80px', align: 'center', customRender: function (text) { return text || '--' } })
         arr.splice(7, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '80px', align: 'center', customRender: function (text) { return text || '--' } })
       }
       }
       return arr
       return arr