lilei 6 月之前
父節點
當前提交
3772677d73

+ 23 - 3
src/components/VTable/index.vue

@@ -19,12 +19,13 @@
         :virtual-scroll-option="{enable: !showPagination}"
         :sort-option="sortOption"
         :checkbox-option="checkboxOption"
+        :event-custom-option="eventCustomOption"
       />
       <div v-show="localDataSource.length==0" :style="{height:(showPagination?scroll.y-35:scroll.y)+'px',position:!showPagination?'absolute':'relative',top:!showPagination?0:''}" class="empty-data"><a-empty description="暂无数据" :image="simpleImage"/></div>
       <div class="ve-pagination" :class="'ve-pagination-align-'+pageAlign">
         <div class="ve-page-left" v-if="pageAlign=='right'"><slot name="page"></slot></div>
         <a-pagination
-          v-show="showPagination"
+          v-show="showPagination&&localPagination.total"
           size="small"
           :total="localPagination.total"
           v-model="localPagination.current"
@@ -158,7 +159,26 @@ export default {
       }, this.pagination),
       // 选中的项
       selectedRowKeys: [],
-      selectedRows: []
+      selectedRows: [],
+      eventCustomOption: {
+        bodyRowEvents: ({ row, column, rowIndx }) => {
+          return {
+            click: (event) => {
+              this.$emit('rowClick', event, row, rowIndx)
+            },
+            dblclick: (event) => {
+              this.$emit('dblRowClick', event, row, rowIndx)
+            },
+            contextmenu: (event) => {},
+            mouseenter: (event) => {},
+            mouseleave: (event) => {},
+            mousemove: (event) => {},
+            mouseover: (event) => {},
+            mousedown: (event) => {},
+            mouseup: (event) => {}
+          }
+        }
+      }
     }
   },
   created () {
@@ -238,7 +258,7 @@ export default {
       const _this = this
       for (let i = 0; i < columns.length; i++) {
         const item = columns[i]
-        const windowWidth = window.innerWidth
+        const windowWidth = window.innerWidth - 200
         ret.push({
           field: item.field || item.dataIndex,
           key: item.key || 'col-' + i,

+ 5 - 5
src/views/salesManagement/salesQueryNew/comps/chooseProduct.vue

@@ -16,11 +16,11 @@
         <div>
           <!-- 查询配件列表 -->
           <!-- 正常产品 -->
-          <queryPart v-if="cptype==0" ref="partQuery" :newLoading="isInster" @add="insterProduct"></queryPart>
+          <normalQueryPart v-if="cptype==0" ref="partQuery" :newLoading="isInster" @add="insterProduct"></normalQueryPart>
           <!-- 活动产品 -->
           <activeQueryPart v-if="cptype==1" ref="partQuery" :newLoading="isInster" @add="insterProduct"></activeQueryPart>
           <!-- 累计产品 -->
-          <cumulativeProduct v-if="cptype==2" ref="partQuery" :newLoading="isInster" @add="insterProduct"></cumulativeProduct>
+          <cumulativeQueryPart v-if="cptype==2" ref="partQuery" :newLoading="isInster" @add="insterProduct"></cumulativeQueryPart>
         </div>
       </div>
     </a-spin>
@@ -28,12 +28,12 @@
 </template>
 
 <script>
-import queryPart from './queryPart.vue'
+import normalQueryPart from './normalQueryPart.vue'
 import activeQueryPart from './activeQueryPart.vue'
-import cumulativeProduct from './cumulativeProduct.vue'
+import cumulativeQueryPart from './cumulativeQueryPart.vue'
 export default {
   name: 'ChooseProductsModal',
-  components: { queryPart, activeQueryPart, cumulativeProduct },
+  components: { normalQueryPart, activeQueryPart, cumulativeQueryPart },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,

+ 1 - 1
src/views/salesManagement/salesQueryNew/comps/cumulativeProduct.vue → src/views/salesManagement/salesQueryNew/comps/cumulativeQueryPart.vue

@@ -87,7 +87,7 @@ import ProductBrand from '@/views/common/productBrand.js'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import { STable, VSelect } from '@/components'
 export default {
-  name: 'ActiveQueryPart',
+  name: 'CumulativeQueryPart',
   mixins: [commonMixin],
   components: { STable, VSelect, ProductBrand, ProductType, dealerSubareaScopeList },
   props: {

+ 17 - 23
src/views/salesManagement/salesQueryNew/comps/queryPart.vue → src/views/salesManagement/salesQueryNew/comps/normalQueryPart.vue

@@ -48,17 +48,17 @@
       </a-form>
     </div>
     <!-- 列表 -->
-    <s-table
+    <v-table
       class="sTable"
       ref="table"
       size="small"
-      :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :customRow="handleClickRow"
+      @dblRowClick="handleClickRow"
       :scroll="{ y: tableHeight, x: 1050 }"
-      :pageSize="50"
+      :pagination="{pageSize:50}"
       :defaultLoadData="false"
+      pageAlign="right"
       bordered>
       <!-- 销售数量 -->
       <template slot="nums" slot-scope="text, record">
@@ -94,9 +94,10 @@
           :loading="newLoading"
           @click="handleAdd(record)"
           :disabled="!record.productPrice || record.productPrice<=0"
+          :title="!record.productPrice || record.productPrice<=0?'产品价格没有或为0,不可添加!':''"
           id="productInfoList-edit-btn">添加</a-button>
       </template>
-    </s-table>
+    </v-table>
   </div>
 </template>
 
@@ -106,11 +107,11 @@ import { queryStockProductPage } from '@/api/stock'
 import ProductType from '@/views/common/productType.js'
 import ProductBrand from '@/views/common/productBrand.js'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
-import { STable, VSelect } from '@/components'
+import { VTable, VSelect } from '@/components'
 export default {
-  name: 'QueryPart',
+  name: 'NormalQueryPart',
   mixins: [commonMixin],
-  components: { STable, VSelect, ProductBrand, ProductType, chooseWarehouse },
+  components: { VTable, VSelect, ProductBrand, ProductType, chooseWarehouse },
   props: {
     newLoading: Boolean
   },
@@ -164,18 +165,18 @@ export default {
       const arr = [
         { title: '产品编码', dataIndex: 'productCode', width: '150px', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', scopedSlots: { customRender: 'productName' }, align: 'left' },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: '100px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '品牌', dataIndex: 'productBrandName', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '120px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '品牌', dataIndex: 'productBrandName', width: '120px', 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: '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: 'packQtyV', width: '60px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: '70px', align: 'center', fixed: 'right' },
+        { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: '80px', align: 'center', fixed: 'right' },
         { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: '60px', align: 'center', fixed: 'right' }
       ]
       if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
-        arr.splice(6, 0, { title: '售价', dataIndex: 'productPrice', width: '70px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(6, 0, { title: '售价', dataIndex: 'productPrice', width: '80px', 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 || '--' } })
       }
       return arr
@@ -183,7 +184,7 @@ export default {
   },
   watch: {
     advanced (a, b) {
-      this.tableHeight = window.innerHeight - (a ? 325 : 280)
+      this.tableHeight = window.innerHeight - (a ? 295 : 250)
     }
   },
   methods: {
@@ -195,16 +196,9 @@ export default {
       }
     },
     // 双击列表
-    handleClickRow (record) {
-      const _this = this
-      return {
-        on: {
-          dblclick: (event) => {
-            event.stopPropagation()
-            this.$emit('add', record, 0)
-          }
-        }
-      }
+    handleClickRow (event, row, rowIndx) {
+      event.stopPropagation()
+      this.handleAdd(row)
     },
     // 查询
     searchForm () {

+ 20 - 9
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -321,27 +321,38 @@ export default {
     tableHeight () {
       return window.innerHeight - 335
     },
+    w1 () {
+      return window.innerWidth - 200
+    },
     // 表格列定义
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '40px', align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '100px', align: 'left' },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '150px', align: 'left', ellipsis: true },
-        { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '80px', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '150px', align: 'left' },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'left', ellipsis: true },
+        { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '100px', align: 'center' },
         { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '100px', align: 'center' },
-        { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '100px', align: 'center' },
+        { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '150px', align: 'center' },
         { title: '单位', dataIndex: 'productEntity.unit', width: '60px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '100px', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '120px', align: 'center' }
       ]
       if (this.showStockCol) {
-        arr.splice(5, 0, { title: '第三方库存', dataIndex: 'thirdStockQty', width: '80px', align: 'center', customRender: text => ((text || text == 0) ? text : '--') })
+        arr.splice(5, 0, { title: '第三方库存', dataIndex: 'thirdStockQty', width: '100px', align: 'center', customRender: text => ((text || text == 0) ? text : '--') })
       }
       // 售价权限
       if (this.$hasPermissions('B_salesEdit_salesPrice')) {
-        arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '80px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '80px', align: 'center', customRender: function (text) { return text || '--' } })
-        arr.splice(this.showStockCol ? 8 : 7, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '80px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.splice(this.showStockCol ? 8 : 7, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
+      let wt = 0
+      arr.forEach(item => {
+        if (item.width) {
+          wt += parseInt(item.width)
+        }
+      })
+      const w1 = this.w1 - wt
+      arr[2].width = w1 < 120 ? 120 : w1
       return arr
     }
   },

+ 5 - 0
src/views/salesManagement/salesQueryNew/edit.vue

@@ -303,6 +303,11 @@ export default {
     // 确定新增产品到列表,
     // row 产品信息,promo 活动规则信息,promoProductClz 规则类型,cptype 1 添加活动产品,2 累计产品
     insterProduct (row, promo, promoProductClz, cptype) {
+      if (this.spinning) {
+        this.$message.warning('正在添加产品,请稍等...')
+        return
+      }
+      this.spinning = true
       // 正常产品
       if (promoProductClz == 0) {
         this.$refs.productNormalList.saveNewProduct(row, promo)

+ 11 - 4
src/views/salesManagement/salesQueryNew/list.vue

@@ -498,10 +498,17 @@ export default {
   computed: {
     columns () {
       const _this = this
+      const formatDate = function (text) {
+        if (text) {
+          const ret = text.split(' ')
+          return (<div>{ret[0]}<br/>{ret[1]}</div>)
+        }
+        return '--'
+      }
       let arr = [
-        { title: '创建时间', dataIndex: 'createDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '创建时间', dataIndex: 'createDate', width: '6%', align: 'center', customRender: function (text) { return formatDate(text) }, sorter: true },
         { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '8%', align: 'left' },
-        { title: '提交时间', slots: { title: 'customDateTitle' }, dataIndex: 'firstSubmitDate', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') }, sorter: true },
+        { title: '提交时间', slots: { title: 'customDateTitle' }, dataIndex: 'firstSubmitDate', width: '6%', align: 'center', customRender: function (text) { return formatDate(text) }, sorter: true },
         { title: '客户名称', dataIndex: 'buyerName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '5%', align: 'center', ellipsis: true },
         { title: '总数量', dataIndex: 'totalQty', width: '4%', align: 'center' },
@@ -515,10 +522,10 @@ export default {
         { title: '转采购额数量', dataIndex: 'totalConvertPromoGiftsQty', width: '5%', align: 'center', isShow: false, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '转采购额金额', dataIndex: 'totalConvertPromoGiftsAmount', width: '5%', align: 'right', isShow: false, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核时间', dataIndex: 'auditDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '审核时间', dataIndex: 'auditDate', width: '6%', align: 'center', customRender: function (text) { return formatDate(text) }, sorter: true },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '财务状态', dataIndex: 'financialStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '最近备货时间', dataIndex: 'lastStockUpDate', width: '6.5%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '最近备货时间', dataIndex: 'lastStockUpDate', width: '6.5%', align: 'center', customRender: function (text) { return formatDate(text) }, sorter: true },
         { title: '备货打印状态', dataIndex: 'printStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]