Ver código fonte

Merge branch 'develop_yh50' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh50

chenrui 6 meses atrás
pai
commit
b8491add4c
30 arquivos alterados com 1179 adições e 704 exclusões
  1. 1 1
      src/api/salesNew.js
  2. 350 0
      src/components/VTable/index.vue
  3. 2 0
      src/components/index.js
  4. 8 0
      src/components/newThem.less
  5. 3 0
      src/main.js
  6. 1 1
      src/views/common/commonModal.vue
  7. 67 0
      src/views/common/hideCellMenus.js
  8. 4 4
      src/views/financialManagement/financialCollection/selectGlSalesModal.vue
  9. 11 17
      src/views/salesManagement/backorder/detailModal.vue
  10. 9 13
      src/views/salesManagement/backorder/list.vue
  11. 4 4
      src/views/salesManagement/examineVerify/list.vue
  12. 4 4
      src/views/salesManagement/matchSendOutOrder/list.vue
  13. 3 28
      src/views/salesManagement/pushOrderManagement/detail.vue
  14. 3 3
      src/views/salesManagement/pushOrderManagement/list.vue
  15. 3 3
      src/views/salesManagement/salesCollection/list.vue
  16. 5 4
      src/views/salesManagement/salesList/list.vue
  17. 49 30
      src/views/salesManagement/salesQueryNew/comps/activeStatisticsList.vue
  18. 10 2
      src/views/salesManagement/salesQueryNew/comps/chooseProduct.vue
  19. 79 75
      src/views/salesManagement/salesQueryNew/comps/productActiveList.vue
  20. 80 74
      src/views/salesManagement/salesQueryNew/comps/productNormalList.vue
  21. 6 4
      src/views/salesManagement/salesQueryNew/comps/totalProductDetailModal.vue
  22. 1 1
      src/views/salesManagement/salesQueryNew/comps/updateActiveModal.vue
  23. 127 84
      src/views/salesManagement/salesQueryNew/detail.vue
  24. 181 168
      src/views/salesManagement/salesQueryNew/edit.vue
  25. 36 52
      src/views/salesManagement/salesQueryNew/list.vue
  26. 36 27
      src/views/salesManagement/salesQueryNew/vaildPriceModal.vue
  27. 56 46
      src/views/salesManagement/shortageStatisticsC/list.vue
  28. 7 9
      src/views/salesManagement/shortageStatisticsP/list.vue
  29. 32 49
      src/views/salesManagement/stockPrint/list.vue
  30. 1 1
      vue.config.js

+ 1 - 1
src/api/salesNew.js

@@ -207,7 +207,7 @@ export const salesPromoValidaSubmit = (params) => {
 // 审核时活动规则校验
 export const salesPromoValidaAudit = (params) => {
   return axios({
-    url: `/salesPromo/validationAudit/${params.salesBillSn}`,
+    url: `/salesPromo/validationSubmit/${params.salesBillSn}`,
     data: params,
     method: 'post',
     headers: {

+ 350 - 0
src/components/VTable/index.vue

@@ -0,0 +1,350 @@
+<template>
+  <div class="v-table">
+    <a-spin :spinning="localLoading" tip="Loading...">
+      <ve-table
+        ref="tableRef"
+        style="width:100%;word-break:break-all;"
+        :max-height="scroll.y"
+        :scroll-width="scroll.x"
+        :columns="veColumns"
+        :table-data="localDataSource"
+        :row-key-field-name="rowKeyName"
+        :border-x="true"
+        :border-y="bordered"
+        :border-around="bordered"
+        :column-width-resize-option="columnWidthResizeOption"
+        :cell-style-option="cellStyleOption"
+        :row-style-option="{clickHighlight: true}"
+        :cellSelectionOption="{enable: false}"
+        :virtual-scroll-option="{enable: !showPagination}"
+        :sort-option="sortOption"
+      />
+      <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=='left'"><slot name="page"></slot></div>
+        <a-pagination
+          v-show="showPagination"
+          size="small"
+          :total="localPagination.total"
+          v-model="localPagination.current"
+          :pageSize="localPagination.pageSize"
+          :showTotal="total => `共 ${total} 条记录`"
+          :pageSizeOptions="localPagination.pageSizeOptions"
+          :show-quick-jumper="localPagination.showQuickJumper"
+          @change="paginationChange"
+          show-size-changer
+          @showSizeChange="paginationShowSizeChange"
+        />
+        <div class="ve-page-right" v-if="pageAlign=='right'"><slot name="page"></slot></div>
+      </div>
+    </a-spin>
+  </div>
+</template>
+
+<script>
+import { Empty } from 'ant-design-vue'
+export default {
+  name: 'VTable',
+  props: {
+    // 列
+    columns: {
+      type: Array,
+      default: () => []
+    },
+    // load data function
+    data: {
+      type: Function,
+      required: true
+    },
+    // 默认是否加载表格数据
+    defaultLoadData: {
+      type: Boolean,
+      default: true
+    },
+    // 表格宽度和高度
+    scroll: {
+      type: Object,
+      default: () => ({ x: 0, y: 400 })
+    },
+    // 是否显示边框
+    bordered: {
+      type: Boolean,
+      default: true
+    },
+    // 表格默认key name
+    rowKeyName: {
+      type: String,
+      default: 'id'
+    },
+    // 分页配置
+    pagination: {
+      type: Object
+    },
+    // 是否显示分页
+    showPagination: {
+      type: Boolean,
+      default: true
+    },
+    // 分页对齐方式,left ,center,right
+    pageAlign: {
+      type: String,
+      default: 'center'
+    }
+  },
+  computed: {
+    veColumns () {
+      return this.convertColumns(this.columns)
+    }
+  },
+  data () {
+    return {
+      localLoading: false,
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
+      localDataSource: [],
+      sortObj: null,
+      isSucceed: true, //  是否请求成功
+      // 拖到列宽
+      columnWidthResizeOption: {
+        // default false
+        enable: true,
+        // column resize min width
+        minWidth: 30,
+        // column size change
+        sizeChange: ({ column, differWidth, columnWidth }) => {}
+      },
+      // 单元格样式
+      cellStyleOption: {
+        bodyCellClass: ({ row, column, rowIndex }) => {}
+      },
+      // 排序
+      sortOption: {
+        // sort always
+        sortAlways: false,
+        sortChange: (params) => {
+          this.sortChange(params)
+        }
+      },
+      // 分页
+      localPagination: Object.assign({
+        current: 1,
+        pageSize: 10,
+        showSizeChanger: true,
+        showQuickJumper: false
+      }, this.pagination)
+    }
+  },
+  created () {
+    if (this.defaultLoadData) {
+      this.loadData()
+    }
+  },
+  methods: {
+    // 通过key.key...获取属性值
+    getNestedPropertyValue (obj, path) {
+      return path.split('.').reduce(function (o, p) {
+        if (!o) return
+        return o[p]
+      }, obj || {})
+    },
+    // 转换colums数据结构,兼容老页面
+    convertColumns (columns) {
+      const ret = []
+      const _this = this
+      for (let i = 0; i < columns.length; i++) {
+        const item = columns[i]
+        const windowWidth = window.innerWidth
+        ret.push({
+          field: item.field || item.dataIndex,
+          key: item.key || 'col-' + i,
+          title: item.title,
+          // 自定义头部单元格表头
+          renderHeaderCell: ({ column }, h) => {
+            if (item.slots) {
+              return _this.$scopedSlots[item.slots.title]()
+            }
+            if (item.align != 'center') {
+              return (
+                <div style="text-align:center;">{column.title}</div>
+              )
+            }
+            return h('span', column.title)
+          },
+          width: String(item.width).indexOf('%') >= 0 ? Number(String(item.width).replace('%', '') * windowWidth / 100) : item.width, // 百分比转数字
+          align: item.align,
+          fixed: item.fixed,
+          sortBy: item.sortBy || item.sorter ? '' : undefined,
+          children: item.children ? _this.convertColumns(item.children) : undefined,
+          // 自定义单元格
+          scopedSlotsKey: item.scopedSlots && item.scopedSlots.customRender,
+          hasEllipsis: item.ellipsis,
+          renderBodyCell: ({ row, column, rowIndex }, h) => {
+            // 如果filed 是obj.objkey.objkey...形式
+            const text = column.field ? (column.field.indexOf('.') >= 0 ? _this.getNestedPropertyValue(row, column.field) : row[column.field]) : null
+            // 有自定义单元格
+            if (column.scopedSlotsKey) {
+              return _this.$scopedSlots[column.scopedSlotsKey](text, row, rowIndex, column)
+            }
+            // 省略字符
+            if (item.ellipsis && column.field && text) {
+              return (
+                <a-tooltip placement="right">
+                  <template slot="title">
+                    <span>{text}</span>
+                  </template>
+                  <span class="ve-table-body-td-span-ellipsis" style="-webkit-line-clamp: 1;">{text || '--'}</span>
+                </a-tooltip>
+              )
+            }
+            return item.customRender ? item.customRender(text) : text || '--'
+          }
+        })
+      }
+      return ret
+    },
+    /**
+     * 加载数据方法
+     * @param {Object} pagination 分页选项器
+     * @param {Object} filters 过滤条件
+     * @param {Object} sorter 排序条件
+     */
+    loadData (pagination, filters, sorter) {
+      this.localLoading = true
+      const parameter = Object.assign({
+        pageNo: this.showPagination && this.localPagination.current || 1,
+        pageSize: this.showPagination && this.localPagination.pageSize || 10
+      },
+      this.sortObj && { sortField: this.sortObj.field, sortOrder: this.sortObj.order } || {}
+      )
+      const result = this.data(parameter)
+      // 对接自己的通用数据接口需要修改下方代码中的 r.pageNo, r.count, r.data
+      if ((typeof result === 'object' || typeof result === 'function') && typeof result.then === 'function') {
+        result.then(r => {
+          const list = r.list || r.data || r || []
+          this.isSucceed = !!r
+          this.localPagination = this.showPagination && Object.assign({}, this.localPagination, {
+            current: r.pageNo || 1, // 返回结果中的当前分页数
+            total: Number(r.count) || 0, // 返回结果中的总记录数
+            pageSize: r.pageSize || this.localPagination.pageSize
+          }) || false
+
+          // 为防止删除数据后导致页面当前页面数据长度为 0 ,自动翻页到上一页
+          if (list.length === 0 && this.showPagination && this.localPagination.current > 1) {
+            this.localPagination.current--
+            this.loadData()
+            return
+          }
+
+          // 这里用于判断接口是否有返回 r.count 且 this.showPagination = true 且 pageNo 和 pageSize 存在 且 count 小于等于 pageNo * pageSize 的大小
+          // 当情况满足时,表示数据不满足分页大小,关闭 table 分页功能
+          try {
+            if ((['auto', true].includes(this.showPagination) && r.count <= (r.pageNo * this.localPagination.pageSize))) {
+              // this.localPagination.hideOnSinglePage = true
+            }
+          } catch (e) {
+            this.localPagination = false
+          }
+          this.localDataSource = list // 返回结果中的数组数据
+          this.localLoading = false
+        }).catch(err => {
+          this.clearTable()
+        })
+      }
+    },
+    // 页码变更
+    paginationChange (pageNumber) {
+      this.localPagination.current = pageNumber
+      this.loadData()
+    },
+    paginationShowSizeChange (current, pageSize) {
+      this.localPagination.current = current
+      this.localPagination.pageSize = pageSize
+      this.loadData()
+    },
+    // 排序
+    sortChange (params) {
+      this.sortObj = null
+      for (const a in params) {
+        if (params[a]) {
+          this.sortObj = {
+            field: a,
+            order: params[a] + 'end'
+          }
+        }
+      }
+      this.loadData()
+    },
+    /**
+     * 表格重新加载方法
+     * 如果参数为 true, 则强制刷新到第一页
+     * @param Boolean bool
+     */
+    refresh (bool = false) {
+      bool && (this.localPagination = Object.assign({}, {
+        current: 1, pageSize: this.localPagination.pageSize
+      }))
+      this.loadData()
+    },
+    // 重置表格为空
+    clearTable () {
+      this.localLoading = false
+      this.localDataSource = []
+      this.sortObj = null
+      this.clearSelected()
+      this.localPagination = Object.assign({}, {
+        current: 1, pageSize: this.localPagination.pageSize, total: 0
+      })
+    },
+    /**
+     * 清空 table 已选中项
+     */
+    clearSelected () {
+      if (this.rowSelection) {
+        this.selectedRows = []
+        this.selectedRowKeys = []
+        this.updateSelect()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .v-table {
+    width: 100%;
+    > div{
+      height: 100%;
+    }
+    .ant-spin-container{
+      height: 100%;
+    }
+    .empty-data{
+        color: #999;
+        text-align: center;
+        width: 100%;
+        display: flex;
+        align-items: center;
+        flex-direction: column;
+        justify-content: center;
+    }
+    .ve-pagination{
+      display:flex;
+      align-items: center;
+      padding: 20px 0 10px 0;
+    }
+    .ve-pagination-align-right{
+      justify-content: flex-end;
+    }
+    .ve-pagination-align-left{
+      justify-content: flex-start;
+    }
+    .ve-pagination-align-center{
+      justify-content: center;
+    }
+    /deep/ .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-body-tr td.ve-table-body-td,
+    .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-expand-tr td.ve-table-body-td{
+      div:empty::before {
+        content:'--'
+      }
+    }
+  }
+</style>

+ 2 - 0
src/components/index.js

@@ -21,6 +21,7 @@ import DescriptionList from '@/components/DescriptionList'
 import Tree from '@/components/Tree/Tree'
 import Trend from '@/components/Trend'
 import STable from '@/components/Table'
+import VTable from '@/components/VTable/index.vue'
 import MultiTab from '@/components/MultiTab'
 import Result from '@/components/Result'
 import IconSelector from '@/components/IconSelector'
@@ -54,6 +55,7 @@ export {
   DescriptionList as DetailList,
   Tree,
   STable,
+  VTable,
   VSelect,
   SelectInput,
   Upload,

+ 8 - 0
src/components/newThem.less

@@ -31,4 +31,12 @@
 }
 .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content thead.ve-table-header tr.ve-table-header-tr th.ve-table-header-th{
     font-weight: 900;
+}
+.ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content thead.ve-table-header .ve-table-header-tr .ve-table-header-th .ve-table-sort .ve-table-sort-icon.ve-table-sort-icon-top{
+  font-size: 12px;
+  top: 0;
+}
+.ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content thead.ve-table-header .ve-table-header-tr .ve-table-header-th .ve-table-sort .ve-table-sort-icon.ve-table-sort-icon-bottom{
+  font-size: 12px;
+  top: 7px;
 }

+ 3 - 0
src/main.js

@@ -19,7 +19,10 @@ Vue.component("ItemWrap",ItemWrap)
 Vue.component("Reacquire",Reacquire)
 
 // 引入组件库
+import "vue-easytable/libs/theme-default/index.css";
+import zhCN from "vue-easytable/libs/locale/lang/zh-CN.js";
 import VueEasytable from "vue-easytable";
+VueEasytable.VeLocale.use(zhCN);
 Vue.use(VueEasytable);
 
 // datav组件

+ 1 - 1
src/views/common/commonModal.vue

@@ -7,7 +7,7 @@
     :maskClosable="false"
     v-model="isShow"
     :title="modalTit"
-    :bodyStyle="bodyPadding?{padding:bodyPadding}:{padding: modalTit?'25px 32px 20px':'50px 32px 15px'}"
+    :bodyStyle="bodyPadding?{padding:bodyPadding,background:'#f8f8f8'}:{padding: modalTit?'25px 32px 20px':'50px 32px 15px',background:'#f8f8f8'}"
     @cancel="isShow=false"
     :width="width">
     <a-spin :spinning="spinning" tip="Loading...">

+ 67 - 0
src/views/common/hideCellMenus.js

@@ -0,0 +1,67 @@
+const HideCellMenus = {
+  template: `
+     <a-dropdown v-model="visibleMenu" @click="visibleMenu=true">
+       <a-menu slot="overlay">
+         <a-menu-item v-for="item in list" :key="item.key">
+           <a-checkbox :checked="item.checked" @change="e=>onHideKeyChange(e.target.checked,item.key)">
+             {{ item.title }}
+           </a-checkbox>
+         </a-menu-item>
+       </a-menu>
+       <a-button :size="size" :id="id"> {{placeholder}} <a-icon type="down" /> </a-button>
+     </a-dropdown>
+    `,
+  props: {
+    defHiddenKes: {
+      type: Array,
+      defatut: function(){
+        return []
+      }
+    },
+    id: {
+      type: String,
+      default: 'hideCellMenus'
+    },
+    placeholder: {
+      type: String,
+      default: '显示更多列'
+    },
+    size: {
+        type: String,
+        default: 'default'
+    },
+  },
+  data() {
+    return {
+      visibleMenu: false,
+      list: this.defHiddenKes.filter(item=> !item.disabled)
+    };
+  },
+  mounted() {
+  },
+  watch: {
+    defHiddenKes: {
+      handler: function (val) {
+        this.list = val.filter(item=> !item.disabled)
+      },
+      immediate: true
+    },
+    list: {
+      handler: function (val) {
+        const hidekey = this.list.filter(item => !item.checked).map(item => item.key)
+        this.$emit('change', hidekey);
+        this.$emit('input', hidekey);
+      },
+      immediate: true
+    }
+  },
+  methods: {
+    onHideKeyChange(checked, key) {
+      const row = this.list.find(item => item.key == key)
+      row.checked = checked
+      this.list.splice()
+    }
+  },
+};
+
+export default HideCellMenus

+ 4 - 4
src/views/financialManagement/financialCollection/selectGlSalesModal.vue

@@ -88,13 +88,13 @@
       <!-- 查看销售单或备货单详情 -->
       <commonModal
         :modalTit="detailType?'备货单详情':'销售单详情'"
-        bodyPadding="10px"
+        bodyPadding="0"
         width="70%"
         :showFooter="false"
         :openModal="showDetailModal"
         @cancel="cancelDetail">
-        <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn"></salesDetail>
-        <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn"></dispatchDetail>
+        <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn" @close="cancelDetail"></salesDetail>
+        <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn" @close="cancelDetail"></dispatchDetail>
       </commonModal>
     </a-spin>
   </a-modal>
@@ -105,7 +105,7 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { dispatchlList } from '@/api/dispatch'
 import commonModal from '@/views/common/commonModal.vue'
-import salesDetail from '@/views/salesManagement/salesQueryNew/detailAll.vue'
+import salesDetail from '@/views/salesManagement/salesQueryNew/detail.vue'
 import dispatchDetail from '@/views/salesManagement/pushOrderManagement/detail.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 export default {

+ 11 - 17
src/views/salesManagement/backorder/detailModal.vue

@@ -9,23 +9,17 @@
     @cancel="isShow=false"
     width="70%">
     <a-spin :spinning="spinning" tip="Loading...">
-      <div style="padding: 0 12px;text-align: right;" v-if="$hasPermissions('B_oosPrint')">
-        <a-button id="backorderDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')" style="margin-right: 15px;">打印预览</a-button>
-        <a-button type="primary" id="backorderDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
-      </div>
       <!-- 基础信息 -->
-      <div style="padding: 10px 12px 0" class="backorderDetail-cont">
-        <a-collapse :activeKey="['1']">
-          <a-collapse-panel key="1" header="基础信息">
-            <a-descriptions size="small" :column="2">
-              <a-descriptions-item label="销售单号">
-                {{ detailData&&detailData.salesBillNo || '--' }}
-                <a-badge count="促" v-if="detailData&&detailData.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
-              </a-descriptions-item>
-            </a-descriptions>
-          </a-collapse-panel>
-        </a-collapse>
-      </div>
+      <a-page-header :ghost="false" :backIcon="false" class="backorderDetail-cont">
+        <template slot="subTitle">
+          <span style="color: #666;font-weight: bold;">销售单号:{{ detailData&&detailData.salesBillNo || '--' }}</span>
+          <a-badge count="促" v-if="detailData&&detailData.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
+        </template>
+        <template slot="extra" v-if="$hasPermissions('B_oosPrint')">
+          <a-button id="backorderDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')" style="margin-right: 15px;">打印预览</a-button>
+          <a-button type="primary" id="backorderDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
+        </template>
+      </a-page-header>
       <a-card size="small" :bordered="false" class="backorderDetail-cont">
         <!-- alert -->
         <a-alert type="info" style="margin-bottom:10px">
@@ -123,7 +117,7 @@ export default {
         arr.push({ title: '缺货成本金额', dataIndex: 'totalShowCostAmount', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
       if (this.$hasPermissions('B_oosDetail_salesPrice')) { //  售价权限
-        arr.push({ title: '售价', dataIndex: 'price', width: '15%', align: 'right', scopedSlots: { customRender: 'price' }})
+        arr.push({ title: '售价', dataIndex: 'price', width: '15%', align: 'right', scopedSlots: { customRender: 'price' } })
         arr.push({ title: '缺货金额', dataIndex: 'totalAmount', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
       return arr

+ 9 - 13
src/views/salesManagement/backorder/list.vue

@@ -55,19 +55,15 @@
           :defaultLoadData="false"
           bordered>
           <template slot="salesBillNo" slot-scope="text, record">
-            <span style="padding-right: 15px;">{{ text }}</span>
-            <a-badge count="促" v-if="record.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
-          </template>
-          <!-- 操作 -->
-          <template slot="action" slot-scope="text, record">
             <a-button
-              size="small"
-              type="link"
-              class="button-success"
-              @click="handleDetail(record)"
               v-if="$hasPermissions('B_oosDetail')"
-              id="backorderList-detail-btn">详情</a-button>
-            <span v-else>--</span>
+              id="backorderList-detail-btn"
+              @click="handleDetail(record)"
+              type="link"
+              size="small"
+              class="button-info">{{ text }}</a-button>
+            <span v-else>{{ text }}</span>
+            <a-badge count="促" v-if="record.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
           </template>
         </s-table>
       </a-spin>
@@ -134,9 +130,9 @@ export default {
         { title: '客户名称', dataIndex: 'dealerName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         // { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '缺货款数', dataIndex: 'totalCategory', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '缺货数量', dataIndex: 'totalQty', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '缺货数量', dataIndex: 'totalQty', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
         // { title: '缺货金额', dataIndex: 'totalAmount', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '11%', align: 'center' }
+        // { title: '操作', scopedSlots: { customRender: 'action' }, width: '11%', align: 'center' }
       ]
       if (this.$hasPermissions('M_backorderList_salesPrice')) { //  售价权限
         arr.splice(6, 0, { title: '缺货金额', dataIndex: 'totalAmount', width: '11%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })

+ 4 - 4
src/views/salesManagement/examineVerify/list.vue

@@ -158,13 +158,13 @@
       <!-- 查看销售单或备货单详情 -->
       <commonModal
         :modalTit="detailType?'备货单详情':'销售单详情'"
-        bodyPadding="10px"
+        bodyPadding="0"
         width="70%"
         :showFooter="false"
         :openModal="showDetailModal"
         @cancel="cancelDetail">
-        <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn"></salesDetail>
-        <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn"></dispatchDetail>
+        <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn" @close="cancelDetail"></salesDetail>
+        <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn" @close="cancelDetail"></dispatchDetail>
       </commonModal>
     </a-card>
   </div>
@@ -174,7 +174,7 @@
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import commonModal from '@/views/common/commonModal.vue'
-import salesDetail from '@/views/salesManagement/salesQueryNew/detailAll.vue'
+import salesDetail from '@/views/salesManagement/salesQueryNew/detail.vue'
 import dispatchDetail from '@/views/salesManagement/pushOrderManagement/detail.vue'
 import getDate from '@/libs/getDate.js'
 import subarea from '@/views/common/subarea.js'

+ 4 - 4
src/views/salesManagement/matchSendOutOrder/list.vue

@@ -146,13 +146,13 @@
     <!-- 查看销售单或备货单详情 -->
     <commonModal
       :modalTit="detailType?'备货单详情':'销售单详情'"
-      bodyPadding="10px"
+      bodyPadding="0"
       width="70%"
       :showFooter="false"
       :openModal="showDetailModal"
       @cancel="cancelDetail">
-      <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn"></salesDetail>
-      <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn"></dispatchDetail>
+      <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn" @close="cancelDetail"></salesDetail>
+      <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn" @close="cancelDetail"></dispatchDetail>
     </commonModal>
   </div>
 </template>
@@ -168,7 +168,7 @@ import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import Area from '@/views/common/area.js'
 import { dispatchlList, dispatchCheck } from '@/api/dispatch'
 import commonModal from '@/views/common/commonModal.vue'
-import salesDetail from '@/views/salesManagement/salesQueryNew/detailAll.vue'
+import salesDetail from '@/views/salesManagement/salesQueryNew/detail.vue'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import customerService from '@/views/common/customerService'
 import dispatchDetail from '@/views/salesManagement/pushOrderManagement/detail.vue'

+ 3 - 28
src/views/salesManagement/pushOrderManagement/detail.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="pushOrder-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
-      <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont" :style="{marginBottom:!outBizSubSn&&!bizSn?'6px':'0px'}">
-        <template slot="subTitle" v-if="!outBizSubSn&&!bizSn">
-          <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
+      <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
+        <template slot="subTitle">
+          <a href="javascript:;" v-if="!outBizSubSn&&!bizSn" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
           <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ detailData&&detailData.dispatchBillNo }}</span>
           <span style="margin: 0 10px;color: #666;">客户名称:{{ detailData&&detailData.buyerName }}</span>
           <a-button type="link" size="small" class="button-default" @click="showDetail=!showDetail">
@@ -68,31 +68,6 @@
           </a-descriptions>
         </div>
       </a-card>
-      <!-- 弹框基础信息 -->
-      <div style="padding: 10px 12px 0 12px" v-show="outBizSubSn||bizSn">
-        <a-collapse :activeKey="['1']">
-          <a-collapse-panel key="1" header="基础信息">
-            <a-descriptions size="small" :column="3">
-              <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="销售单号">{{ detailData&&detailData.salesBillNo || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="备货单号">{{ detailData&&detailData.dispatchBillNo || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="收货客户名称">{{ detailData&&detailData.receiverName || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="发货编号">{{ detailData&&detailData.sendNo || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="收款方式">{{ detailData&&detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="收货人" v-if="detailData&&detailData.salesBillExtEntity">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="收货电话" v-if="detailData&&detailData.salesBillExtEntity">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="收货地址" :span="2" v-if="detailData&&detailData.salesBillExtEntity">
-                {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrProvinceName || '' }}
-                {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCityName || '' }}
-                {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCountyName || '' }}
-                {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddr || '' }}
-              </a-descriptions-item>
-              <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="备注">{{ detailData&&detailData.remarks || '--' }}</a-descriptions-item>
-            </a-descriptions>
-          </a-collapse-panel>
-        </a-collapse>
-      </div>
       <a-card size="small" :bordered="false" class="pages-wrap">
         <!-- 统计信息 -->
         <a-alert type="info" style="margin-bottom: 10px;" v-if="detailData!=null">

+ 3 - 3
src/views/salesManagement/pushOrderManagement/list.vue

@@ -181,12 +181,12 @@
         <!-- 查看销售单或备货单详情 -->
         <commonModal
           modalTit="销售单详情"
-          bodyPadding="10px"
+          bodyPadding="0"
           width="70%"
           :showFooter="false"
           :openModal="showDetailModal"
           @cancel="closeDetailModal">
-          <salesDetail v-if="showDetailModal" ref="salesDetail" :bizSn="bizSn"></salesDetail>
+          <salesDetail v-if="showDetailModal" ref="salesDetail" :bizSn="bizSn" @close="closeDetailModal"></salesDetail>
         </commonModal>
 
         <!-- 发货说明 -->
@@ -207,7 +207,7 @@ import Area from '@/views/common/area.js'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import commonModal from '@/views/common/commonModal.vue'
-import salesDetail from '@/views/salesManagement/salesQueryNew/detailAll.vue'
+import salesDetail from '@/views/salesManagement/salesQueryNew/detail.vue'
 import explainInfoModal from './explainInfoModal.vue'
 import { dispatchlList, dispatchQueryCount, dispatchPrintStatus } from '@/api/dispatch'
 import customerService from '@/views/common/customerService'

+ 3 - 3
src/views/salesManagement/salesCollection/list.vue

@@ -203,13 +203,13 @@
         <!-- 查看销售单或备货单详情 -->
         <commonModal
           :modalTit="detailType?'备货单详情':'销售单详情'"
-          bodyPadding="10px"
+          bodyPadding="0"
           width="70%"
           :showFooter="false"
           :openModal="showDetailModal"
           @cancel="cancelDetail">
-          <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn"></salesDetail>
-          <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn"></dispatchDetail>
+          <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn" @close="cancelDetail"></salesDetail>
+          <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn" @close="cancelDetail"></dispatchDetail>
         </commonModal>
       </a-spin>
     </a-card>

+ 5 - 4
src/views/salesManagement/salesList/list.vue

@@ -166,13 +166,13 @@
         <!-- 查看销售单或备货单详情 -->
         <commonModal
           :modalTit="detailType?'备货单详情':'销售单详情'"
-          bodyPadding="10px"
+          bodyPadding="0"
           width="70%"
           :showFooter="false"
           :openModal="showDetailModal"
           @cancel="closeDetailModal">
-          <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn"></salesDetail>
-          <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn"></dispatchDetail>
+          <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn" @close="closeDetailModal"></salesDetail>
+          <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn" @close="closeDetailModal"></dispatchDetail>
         </commonModal>
         <!-- 发货单详情 -->
         <detailModal v-drag ref="detailModal" :openModal="showTipModal" @cancel="showTipModal=false" @ok="sendSuccess"></detailModal>
@@ -192,7 +192,7 @@ import Area from '@/views/common/area.js'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import commonModal from '@/views/common/commonModal.vue'
 import customerService from '@/views/common/customerService.vue'
-import salesDetail from '@/views/salesManagement/salesQueryNew/detailAll.vue'
+import salesDetail from '@/views/salesManagement/salesQueryNew/detail.vue'
 import dispatchDetail from '@/views/salesManagement/pushOrderManagement/detail.vue'
 import detailModal from '@/views/salesManagement/sendOutOrder/detailModal.vue'
 import { salesOverviewQueryPage } from '@/api/salesNew'
@@ -365,6 +365,7 @@ export default {
       }
     },
     closeDetailModal () {
+      this.detailType = 3
       this.showDetailModal = false
       this.bizSn = null
     },

+ 49 - 30
src/views/salesManagement/salesQueryNew/comps/activeStatisticsList.vue

@@ -69,7 +69,7 @@ export default {
       handler (val) {
         if (!this.hasInit) {
           this.tableData = []
-          this.getDataList()
+          this.getDataList(val)
         }
       },
       immediate: true
@@ -100,7 +100,7 @@ export default {
           const endSelProduct = selectedRowKeys[selectedRowKeys.length - 1]
           // 叠加多选
           if (endSelProduct && row.promotion && row.promotion.stackFlag == '1') {
-            const rows = this.activeList.filter(item => selectedRowKeys.includes(item.salesPromoSn) && item.promotion && item.promotion.stackFlag == '1')
+            const rows = this.tableData.filter(item => selectedRowKeys.includes(item.salesPromoSn) && item.promotion && item.promotion.stackFlag == '1')
             this.checkboxOption.selectedRowKeys = rows.map(item => item.salesPromoSn)
           } else {
             // 非叠加单选
@@ -132,6 +132,15 @@ export default {
         bodyCellClass: ({ row, column, rowIndex }) => {
         }
       },
+      // 筛选
+      ruleTypeList: [
+        { value: 'BUY_PROD_GIVE_PROD', label: '卖产品送产品', selected: true },
+        { value: 'BUY_PROD_GIVE_MONEY', label: '卖产品送采购额', selected: true },
+        { value: 'PROMO_PROD', label: '特价活动', selected: true }
+      ],
+      searchData: {
+        ruleType: []
+      },
       // 表格列表
       tableData: [],
       openDetailModal: false, // 规则详情弹框
@@ -147,7 +156,7 @@ export default {
       const _this = this
       // 格式化数字金额单元格
       const formatTd = (row, column, rowIndex, uniKey, fun) => {
-        if (row[column.field] || row[column.field] == 0) {
+        if (row[column.field]) {
           return (<div onClick={() => fun ? fun(row, uniKey) : false}><span class={fun ? 'table-link-btn' : ''}>{row[column.field]}</span><span style="font-size:10px;zoom:0.7;margin-left:3px;">{row[uniKey]}</span></div>)
         } else {
           return ''
@@ -174,7 +183,7 @@ export default {
           fixed: 'left',
           renderBodyCell: ({ row, column, rowIndex }, h) => {
             const isTejia = row && row.promotionRule && row.promotionRule.promotionRuleType == 'PROMO_PROD' && _this.type == 'edit' // 是否特价
-            const tejiaLen = _this.activeList.filter(item => item.promotionRule && item.promotionRule.promotionRuleType == 'PROMO_PROD').length // 特价活动数量
+            const tejiaLen = _this.tableData.filter(item => item.promotionRule && item.promotionRule.promotionRuleType == 'PROMO_PROD').length // 特价活动数量
             // 特价活动上移下移排序
             const equalWord = <div class="table-arrow-box">
               {rowIndex != 0 ? <span class="up" onClick={() => _this.moveTjRow(row, rowIndex, 1)} title="上移">⇡</span> : ''}
@@ -192,6 +201,25 @@ export default {
                 {isTejia ? equalWord : ''}
               </div>)
             }
+          },
+          // 筛选项
+          filter: {
+            filterList: _this.ruleTypeList,
+            isMultiple: true,
+            // filter confirm
+            filterConfirm: (filterList) => {
+              const labels = filterList
+                .filter((x) => x.selected)
+                .map((x) => x.value)
+              _this.searchData.ruleType = labels
+              _this.filtrateList()
+            },
+            // filter reset
+            filterReset: (filterList) => {
+              filterList.map(x => { x.selected = true })
+              _this.searchData.ruleType = []
+              _this.filtrateList()
+            }
           }
         },
         { field: 'promotionRuleDesc',
@@ -419,7 +447,7 @@ export default {
         cols.push({
           field: '',
           key: '26',
-          title: '操作',
+          title: '产品',
           width: 130,
           center: 'center',
           fixed: 'right',
@@ -488,10 +516,17 @@ export default {
     }
   },
   methods: {
-    getDataList () {
+    // 筛选
+    filtrateList () {
+      const { ruleType } = this.searchData
+      const list = this.activeList.filter(item => ruleType.length === 0 || ruleType.includes(item.promotionRule.promotionRuleType))
+      this.tableData = []
+      this.getDataList(list)
+    },
+    getDataList (list) {
       this.hasInit = true
-      for (let i = 0; i < this.activeList.length; i++) {
-        const item = this.activeList[i]
+      for (let i = 0; i < list.length; i++) {
+        const item = list[i]
         // 门槛统计
         const isYuan = item.gateRuleUnit == 'YUAN'
         const gateUnit = isYuan ? '元' : '个' // 单位
@@ -528,6 +563,7 @@ export default {
         // 促销品
         this.tableData.push({
           ...item,
+          ruleType: item.promotionRule.promotionRuleType,
           promotionRuleType: item.promotionRule.promotionRuleTypeDictValue,
           promotionRuleDesc: item.promotionRule.description,
           // 门槛
@@ -560,6 +596,7 @@ export default {
           specialPriceBalance // 差额
         })
       }
+      // 获取禁用的活动规则
       this.disabledActiveIds()
     },
     // 禁用的活动规则
@@ -584,7 +621,7 @@ export default {
       salesPromoSaveSort({ salesBillSn: this.salesBillSn, salesPromoList: data }).then(res => {
         this.spinning = false
         if (res.status == 200) {
-          this.tableData = this.tableData.sort((a, b) => a.sort - b.sort)
+          this.$emit('refash', '', 'sort')
         } else {
           // 恢复排序
           item.sort = temp.sort
@@ -594,11 +631,11 @@ export default {
     },
     // 刷新当前规则
     refashRow (item, enable) {
-      console.log(enable, 'enable')
       // 刷新产品列表
-      this.$emit('refash', '')
+      this.$emit('refash', '', 'enable')
       const active = this.tableData.find(k => k.id == item.id)
       active.enabledFlag = enable
+      // 获取禁用的活动规则
       this.disabledActiveIds()
     },
     // 查看累计产品 详情
@@ -744,25 +781,7 @@ export default {
       salesBatchInsert(params).then(res => {
         if (res.status == 200) {
           this.$message.success('产品导入成功', 2.5)
-          this.$emit('refash', 'promo')
-        }
-      })
-    },
-    hanldeImportTotalOk (list, row, type) {
-      const params = {
-        salesBillSn: this.salesBillSn,
-        salesBillDetailList: list
-      }
-      // 活动导入
-      if (row.salesPromoSn) {
-        params.salesPromoSn = row.salesPromoSn
-        // params.promoRuleSn = row.promoRuleSn
-        params.promoProductClz = promoProductClz
-      }
-      importBorrowTotalProduct(params).then(res => {
-        if (res.status == 200) {
-          this.$message.success('产品导入成功', 2.5)
-          this.$emit('refash', 'promo')
+          this.$emit('refash', 'promo', 'import')
         }
       })
     },

+ 10 - 2
src/views/salesManagement/salesQueryNew/comps/chooseProduct.vue

@@ -8,7 +8,9 @@
     :get-container="false"
     :wrap-style="{ position: 'absolute' }"
     :headerStyle="{ padding: '10px' }"
-    wrapClassName="chooseProducts-modal">
+    wrapClassName="chooseProducts-modal"
+    @close="isShow=false"
+  >
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="products-con">
         <div>
@@ -67,7 +69,7 @@ export default {
   methods: {
     // 关闭弹框
     onClose () {
-      this.$emit('close', this.hasRefash)
+      this.$emit('close', this.hasRefash, this.cptype)
     },
     // 添加产品,
     // row 产品信息, promoProductClz 促销产品类型, 0 正常产品
@@ -97,6 +99,8 @@ export default {
       if (!newValue) {
         this.onClose()
         this.cptype = 3
+      } else {
+        this.hasRefash = false
       }
     }
   }
@@ -105,6 +109,10 @@ export default {
 
 <style lang="less" scoped>
   .chooseProducts-modal{
+    .ant-drawer-close{
+      height: 43px;
+      line-height: 43px;
+    }
     .products-con{
       .btn-con{
         text-align: center;

+ 79 - 75
src/views/salesManagement/salesQueryNew/comps/productActiveList.vue

@@ -100,19 +100,11 @@
               >批量操作<a-icon type="down" /> </a-button>
             </a-dropdown>
             <span v-if="selectTotal" style="margin:0 10px;">已选 {{ selectTotal }} 项</span>
-          </a-col>
-          <a-col :md="12" :sm="24" style="text-align:right;">
-            <a-button
-              :id="'salesEdit-searchBox-'+id"
-              type="link"
-              class="button-info"
-              @click="showSearchBox=!showSearchBox" ><a-icon :type="showSearchBox?'close':'search'"/> 筛选</a-button>
             <a-button
               :id="'salesEdit-allSetWare-'+id"
               type="link"
               class="button-info"
               size="small"
-              style="margin-right:10px;"
               @click="handleMenuClick({key:3})"
             ><a-icon type="setting"/> 全部仓库设置</a-button>
             <a-button
@@ -123,6 +115,13 @@
               @click="handleMenuClick({key:2})"
             ><a-icon type="delete"/> 全部删除</a-button>
           </a-col>
+          <a-col :md="12" :sm="24" style="text-align:right;">
+            <a-button
+              :id="'salesEdit-searchBox-'+id"
+              type="link"
+              class="button-info"
+              @click="showSearchBox=!showSearchBox" ><a-icon :type="showSearchBox?'close':'search'"/> 筛选</a-button>
+          </a-col>
         </a-row>
       </div>
 
@@ -141,6 +140,7 @@
         :table-data="dataSource"
         row-key-field-name="id"
         :checkbox-option="checkboxOption"
+        :cell-style-option="cellStyleOption"
       />
       <div v-show="dataSource.length==0" class="empty-data"><a-empty description="暂无数据" :image="simpleImage"/></div>
     </a-spin>
@@ -224,6 +224,13 @@ export default {
         // column resize min width
         minWidth: 50
       },
+      cellStyleOption: {
+        headerCellClass: ({ column, rowIndex }) => {
+          if (column.align != 'center') {
+            return 'table-header-cell-center'
+          }
+        }
+      },
       dataSource: [],
       showSearchBox: true, // 是否显示筛选条件
       openWarehouseModal: false, // 打开仓库设置
@@ -289,14 +296,14 @@ export default {
         return data || data == 0 ? data : '--'
       }
       const arr = [
-        { title: '', field: '', key: '0', width: 40, type: 'checkbox', align: 'center' },
-        { title: '序号', field: 'no', key: '1', width: 50, align: 'center', operationColumn: false },
+        { title: '', field: '', key: '0', width: 30, type: 'checkbox', align: 'center' },
+        { title: '序号', field: 'no', key: '1', width: 30, align: 'center', operationColumn: false },
         {
           title: '产品编码',
           field: 'productCode',
           key: '2',
-          align: 'center',
-          width: 120,
+          align: 'left',
+          width: 100,
           operationColumn: false,
           renderBodyCell: ({ row, column, rowIndex }, h) => {
             return (
@@ -311,12 +318,32 @@ export default {
             )
           }
         },
-        { title: '产品名称', field: 'productName', key: '3', width: 150, align: 'center', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row.productEntity.name || '--' } },
+        {
+          title: '产品名称',
+          field: 'productName',
+          key: '3',
+          width: 150,
+          align: 'left',
+          operationColumn: false,
+          ellipsis: { showTitle: true },
+          renderBodyCell: ({ row, column, rowIndex }, h) => {
+            return (
+              <div class="ellipsisCon">
+                <a-tooltip placement="rightBottom">
+                  <template slot="title">
+                    <span>{ row.productEntity.name || '--' }</span>
+                  </template>
+                  <span class="ellipsisText">{ row.productEntity.name || '--' }</span>
+                </a-tooltip>
+              </div>
+            )
+          }
+        },
         {
           title: '规则数量',
           field: 'rulesNums',
           key: '4',
-          width: 60,
+          width: 50,
           align: 'center',
           operationColumn: false,
           renderBodyCell: ({ row, column, rowIndex }, h) => {
@@ -339,7 +366,7 @@ export default {
                 </a-popover> : '--'
             )
           } },
-        { title: '起订量', field: 'promoUnit', key: '5', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '起订量', field: 'promoUnit', key: '5', width: 60, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
         {
           title: '销售数量',
           field: 'salesNums',
@@ -388,7 +415,7 @@ export default {
         {
           title: '出库仓库',
           field: 'warehouseBox',
-          width: 100,
+          width: 80,
           key: '8',
           align: 'center',
           operationColumn: false,
@@ -417,7 +444,7 @@ export default {
         {
           title: '操作',
           field: 'action',
-          width: 100,
+          width: 80,
           key: 'action',
           align: 'center',
           fixed: 'right',
@@ -431,7 +458,7 @@ export default {
                       id={'salesEdit-upactive-' + row.id}
                       size="small"
                       type="link"
-                      loading={_this.delLoading}
+                      disabled={_this.delLoading}
                       class="button-primary"
                       onClick={() => _this.handleUpdateActive(row)}
                     >换促销</a-button> : ''
@@ -442,7 +469,7 @@ export default {
                       id={'salesEdit-del-' + row.id}
                       size="small"
                       type="link"
-                      loading={_this.delLoading}
+                      disabled={_this.delLoading}
                       class="button-error"
                       onClick={() => _this.handleDel(row)}
                     >删除{row.regularPromotionSameFlag}</a-button> : ''
@@ -452,23 +479,28 @@ export default {
           }
         }
       ]
-      if (this.showStockCol) {
-        arr.splice(7, 0, { title: '第三方库存', field: 'thirdStockQty', key: 'thirdStockQty', width: 80, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
-      }
       // 售价权限
-      if (this.$hasPermissions('B_salesEdit_salesPrice')) {
-        arr.splice(4, 0, { title: '售价(原价)',
+      if (_this.$hasPermissions('B_salesEdit_salesPrice')) {
+        arr.splice(4, 0, {
+          title: '售价(原价)',
           field: 'price',
-          width: 120,
+          width: 100,
           key: 'price',
-          align: 'center',
+          align: 'right',
           operationColumn: false,
           renderBodyCell: ({ row, column, rowIndex }, h) => {
             return <div>{_this.toThousands(row[column.field])}<span style="color:#666;margin-left:3px;" title="原价">({_this.toThousands(row.origPrice)})</span></div>
           }
         })
-        arr.splice(5, 0, { title: '价格级别', field: 'priceLevelDictValue', width: 80, key: 'priceLevel', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } })
-        arr.splice((_this.showStockCol ? 10 : 9), 0, { title: '售价小计', field: 'totalAmount', key: 'totalAmount', width: 80, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
+        arr.splice(5, 0, { title: '价格级别', field: 'priceLevelDictValue', width: 60, key: 'priceLevel', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } })
+        if (_this.showStockCol) {
+          arr.splice(10, 0, { title: '第三方库存', field: 'thirdStockQty', key: 'thirdStockQty', width: 60, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+        }
+        arr.splice((_this.showStockCol ? 11 : 10), 0, { title: '售价小计', field: 'totalAmount', key: 'totalAmount', width: 60, align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
+      } else {
+        if (_this.showStockCol) {
+          arr.splice(8, 0, { title: '第三方库存', field: 'thirdStockQty', key: 'thirdStockQty', width: 60, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+        }
       }
       return arr
     }
@@ -557,8 +589,8 @@ export default {
     },
     // 查询第三方库存
     searchThreeStockOk () {
-      this.showStockCol = true
       this.resetSearchForm()
+      this.showStockCol = true
     },
     // 表格选中项
     rowSelectionFun (obj) {
@@ -585,7 +617,6 @@ export default {
       this.rowSelectionInfo = null
       this.getTableData()
       this.clearTableSelect()
-      this.showStockCol = false
     },
     // 查询产品,不重置
     searchProduct () {
@@ -629,7 +660,7 @@ export default {
         if (res.status == 200) {
           this.$message.success('产品添加成功', 2.5)
           this.resetSearchForm(true)
-          this.$emit('refash', 'promo')
+          this.$emit('refash', 'promo', 'add')
         }
         this.spinning = false
         this.isInster = false
@@ -664,7 +695,7 @@ export default {
           }
           this.$message.success('累计产品添加成功', 2.5)
           this.resetSearchForm(true)
-          this.$emit('refash', 'promo')
+          this.$emit('refash', 'promo', 'add')
         }
         this.spinning = false
         this.isInster = false
@@ -680,6 +711,7 @@ export default {
         _this.$message.warning('请先选择要批量取消的产品!')
         return
       }
+      const len = this.selectedRowKeys.length
       const rowSelect = this.dataSource.filter(item => this.selectedRowKeys.includes(item.id))
       // 判断是否全部为赠品
       const obj = []
@@ -714,11 +746,11 @@ export default {
             salesBillSn: _this.salesBillSn
           }
           // 更换活动
-          _this.$emit('upActive', '0', params)
+          _this.$emit('upActive', params, 1)
         }
       })
     },
-    // 删除全部产品 this.promo ? this.promo.salesPromoSn : ''
+    // 删除全部产品
     handleBatchDelAll () {
       const _this = this
       if (_this.dataSource.length == 0) {
@@ -731,10 +763,10 @@ export default {
         centered: true,
         onOk () {
           _this.spinning = true
-          deleteAll({ salesBillSn: _this.salesBillSn, salesPromoSn: '' }).then(res => {
+          deleteAll({ salesBillSn: _this.salesBillSn }).then(res => {
             if (res.status == 200) {
               _this.searchProduct()
-              _this.$emit('refash', 'promo')
+              _this.$emit('refash', 'promo', 'batchDel')
               _this.$message.success(res.message)
             }
             _this.spinning = false
@@ -759,12 +791,11 @@ export default {
           _this.spinning = true
           salesDetailBatchDel({
             salesBillSn: _this.salesBillSn,
-            salesPromoSn: '',
             salesBillDetailSnList: obj
           }).then(res => {
             if (res.status == 200) {
               _this.searchProduct()
-              _this.$emit('refash', 'promo')
+              _this.$emit('refash', 'promo', 'batchDel')
               _this.$message.success(res.message)
             }
             _this.spinning = false
@@ -778,8 +809,7 @@ export default {
       const ajax_data = {
         warehouseSn: row.warehouseSn,
         salesBillDetailSnList: snArr,
-        salesBillSn: this.salesBillSn,
-        salesPromoSn: ''
+        salesBillSn: this.salesBillSn
       }
       this.setWarehouseInfo(ajax_data)
     },
@@ -794,7 +824,6 @@ export default {
         warehouseSn: sn,
         salesBillDetailSnList: snArr,
         salesBillSn: _this.salesBillSn,
-        salesPromoSn: '',
         allFlag: _this.warehouseTit ? true : undefined
       }
       _this.setWarehouseInfo(ajax_data)
@@ -807,7 +836,7 @@ export default {
         console.log(res)
         if (res.status == 200) {
           _this.$message.success(res.message)
-          _this.$emit('refash', 'promo')
+          _this.$emit('refash', 'promo', 'update')
         }
         _this.openWarehouseModal = false
         _this.searchProduct()
@@ -837,6 +866,7 @@ export default {
       } else if (e.key == 4) { // 批量取消促销
         _this.handleBatchCancelActive()
       } else { // 全部删除
+        _this.clearTableSelect()
         _this.handleBatchDelAll()
       }
     },
@@ -859,11 +889,10 @@ export default {
         salesDetailUpdateQty({
           salesBillDetailSn: record.salesBillDetailSn,
           qty: record.qty,
-          salesBillSn: _this.salesBillSn,
-          salesPromoSn: ''
+          salesBillSn: _this.salesBillSn
         }).then(res => {
           if (res.status == 200) {
-            _this.$emit('refash', 'promo')
+            _this.$emit('refash', 'promo', 'update')
             _this.$message.success(res.message)
           }
           _this.searchProduct()
@@ -884,10 +913,10 @@ export default {
         onOk () {
           _this.delLoading = true
           _this.spinning = true
-          salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn, salesPromoSn: '' }).then(res => {
+          salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn }).then(res => {
             if (res.status == 200) {
               _this.searchProduct()
-              _this.$emit('refash', 'promo')
+              _this.$emit('refash', 'promo', 'del')
               _this.$message.success(res.message)
             }
             _this.delLoading = false
@@ -928,36 +957,11 @@ export default {
       position: absolute;
       bottom: 50px;
       width: 100%;
+  }
+  .table-header-cell-center{
+    text-align: center!important;
   }
    .ant-input-number-sm input{
     text-align: center;
    }
-   .alert-bar{
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    .countData{
-      span{
-        margin: 0 2px;
-        color: rgb(0, 153, 255);
-      }
-      span.cor1{
-        color: rgb(248, 132, 0);
-      }
-      b{
-        font-weight: bold;
-        span{
-          color: red;
-          font-weight: normal;
-        }
-      }
-    }
-    > div{
-      &:first-child{
-        flex-grow: 1;
-        width:70%;
-        padding-right: 100px;
-      }
-    }
-   }
 </style>

+ 80 - 74
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -70,19 +70,7 @@
               size="small"
             > 批量操作 <a-icon type="down" /> </a-button>
           </a-dropdown>
-          <span v-if="selectTotal" style="margin-left:10px;">已选 {{ selectTotal }} 项</span>
-        </a-col>
-        <a-col :md="16" :sm="24" style="text-align:right;">
-          <a-button
-            type="link"
-            class="button-info"
-            id="salesEdit-import-product"
-            @click="openGuideModal=true"><a-icon type="login" /> 导入产品</a-button>
-          <a-button
-            id="salesEdit-new-product"
-            type="link"
-            class="button-info"
-            @click="openCpModal"><a-icon type="plus" /> 添加产品</a-button>
+          <span v-if="selectTotal" style="margin:0 10px;">已选 {{ selectTotal }} 项</span>
           <a-button
             :id="'salesEdit-allSetWare'"
             type="link"
@@ -98,6 +86,18 @@
             @click="handleMenuClick({key:2})"
           ><a-icon type="delete"/> 全部删除</a-button>
         </a-col>
+        <a-col :md="16" :sm="24" style="text-align:right;">
+          <a-button
+            type="link"
+            class="button-info"
+            id="salesEdit-import-product"
+            @click="openGuideModal=true"><a-icon type="login" /> 导入产品</a-button>
+          <a-button
+            id="salesEdit-new-product"
+            type="link"
+            class="button-info"
+            @click="openCpModal"><a-icon type="plus" /> 添加产品</a-button>
+        </a-col>
       </a-row>
     </div>
 
@@ -110,7 +110,7 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :row-selection="{ columnWidth: 40 }"
+      :row-selection="{ columnWidth: 30 }"
       @rowSelection="rowSelectionFun"
       :pageSize="showTotal?10:30"
       :defaultLoadData="false"
@@ -131,7 +131,6 @@
             </template>
             <span class="ellipsisText">{{ text }}</span>
           </a-tooltip>
-          <a-badge :number-style="{ backgroundColor: '#52c41a' }" count="活动" v-if="record.promotableFlag == 1"></a-badge>
         </div>
       </template>
       <!-- 销售数量 -->
@@ -334,23 +333,23 @@ export default {
     // 表格列定义
     columns () {
       const arr = [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '12%', align: 'center' },
-        { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '20%', align: 'left' },
-        { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '7%', align: 'center' },
-        { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '7%', align: 'center' },
-        { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '10%', align: 'center' },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+        { title: '序号', dataIndex: 'no', width: '40px', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '100px', align: 'left' },
+        { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '150px', align: 'left' },
+        { 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: '单位', dataIndex: 'productEntity.unit', width: '60px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '100px', align: 'center' }
       ]
       if (this.showStockCol) {
-        arr.splice(5, 0, { title: '第三方库存', dataIndex: 'thirdStockQty', width: '8%', 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: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } })
-        arr.splice(this.showStockCol ? 8 : 7, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '8%', 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) : '--') })
       }
       return arr
     }
@@ -366,6 +365,12 @@ export default {
     warehouseLoad (sn, list) {
       this.warehouseDataList = list
     },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
     // 表格选中项
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
@@ -391,11 +396,34 @@ export default {
         }
       })
     },
+    // 删除产品
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要删除吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.delLoading = true
+          _this.spinning = true
+          salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh(false)
+              _this.$emit('refash', 'normal', 'del')
+            }
+            _this.delLoading = false
+            _this.spinning = false
+          })
+        }
+      })
+    },
     // 删除全部已选产品
     handleBatchDelAll () {
       const _this = this
       if (_this.dataSource.length == 0) {
-        _this.$message.warning('暂无可删除的已选产品!')
+        _this.$message.warning('暂无可删除的产品!')
         return
       }
       this.$confirm({
@@ -406,7 +434,7 @@ export default {
           _this.spinning = true
           deleteAll({ salesBillSn: _this.salesBillSn }).then(res => {
             if (res.status == 200) {
-              _this.$refs.table.refresh(false)
+              _this.resetSearchForm()
               // 触发事件给父级组件
               _this.$emit('refash', 'normal', 'batchDel')
               _this.$message.success(res.message)
@@ -419,14 +447,11 @@ export default {
     // 批量删除已选产品
     handleBatchDel () {
       const _this = this
-      if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
+      if (!_this.selectTotal) {
         _this.$message.warning('请先选择要批量删除的产品!')
         return
       }
-      const obj = []
-      _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
-        obj.push(item.salesBillDetailSn)
-      })
+      const obj = _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => item.salesBillDetailSn) || []
       this.$confirm({
         title: '提示',
         content: '已选产品' + obj.length + '项,确认要批量删除吗?',
@@ -438,7 +463,7 @@ export default {
             salesBillDetailSnList: obj
           }).then(res => {
             if (res.status == 200) {
-              _this.$refs.table.refresh(false)
+              _this.clearTable()
               // 触发事件给父级组件
               _this.$emit('refash', 'normal', 'batchDel')
               _this.$message.success(res.message)
@@ -458,7 +483,7 @@ export default {
       }
       this.setWarehouseInfo(ajax_data)
     },
-    // 选择仓库确认
+    // 全部或批量仓库设置确认
     chooseWarehouseOk (sn) {
       const _this = this
       const snArr = []
@@ -469,7 +494,7 @@ export default {
         warehouseSn: sn,
         salesBillDetailSnList: snArr,
         salesBillSn: _this.salesBillSn,
-        allFlag: _this.warehouseTit ? true : undefined
+        allFlag: snArr.length == 0 ? true : undefined
       }
       _this.setWarehouseInfo(ajax_data)
     },
@@ -481,23 +506,21 @@ export default {
         if (res.status == 200) {
           _this.$message.success(res.message)
           _this.$emit('refash', 'promo', 'update')
+          if (data.allFlag) {
+            _this.resetSearchForm()
+          } else {
+            _this.clearTable()
+          }
         }
-        _this.$refs.table.refresh(false)
         _this.openWarehouseModal = false
         _this.spinning = false
       })
     },
-    //  产品分类  change
-    changeProductType (val, opt) {
-      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
-      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
-      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
-    },
     // 操作下拉菜单
     handleMenuClick (e) {
       const _this = this
       if (e.key == 0) { // 仓库设置
-        if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
+        if (!this.selectTotal) {
           _this.$message.warning('请先选择要设置的产品!')
         } else {
           _this.openWarehouseModal = true
@@ -506,7 +529,6 @@ export default {
       } else if (e.key == 1) { // 删除已选项
         this.handleBatchDel()
       } else if (e.key == 3) {
-        _this.$refs.table.clearSelected()
         _this.warehouseTit = '全部仓库设置'
         _this.openWarehouseModal = true
       } else {
@@ -536,7 +558,7 @@ export default {
       }
     },
     // 重置查询
-    resetSearchForm (flag) {
+    resetSearchForm () {
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
       this.queryParam.warehouseSn = undefined
@@ -546,9 +568,16 @@ export default {
       this.queryParam.productTypeSn3 = ''
       this.productType = []
       this.$refs.table.clearSelected()
-      this.$refs.table.refresh(!!flag)
+      this.rowSelectionInfo = null
+      this.$refs.table.refresh(true)
     },
-    // 参与促销
+    // 清空选项并查询当前页
+    clearTable () {
+      this.$refs.table.clearSelected()
+      this.rowSelectionInfo = null
+      this.$refs.table.refresh(false)
+    },
+    // 参与促销选择弹框
     handleAddPromo (record) {
       this.$refs.updateActive.getActiveList({
         productSn: record.productSn,
@@ -576,29 +605,6 @@ export default {
       this.openUpActiveModal = false
       this.$refs.table.refresh(false)
     },
-    // 删除产品
-    handleDel (row) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确认要删除吗?',
-        centered: true,
-        closable: true,
-        onOk () {
-          _this.delLoading = true
-          _this.spinning = true
-          salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh(false)
-              _this.$emit('refash', 'normal', 'del')
-            }
-            _this.delLoading = false
-            _this.spinning = false
-          })
-        }
-      })
-    },
     // 保存添加的产品到销售列表
     saveNewProduct (row, promotionFlag) {
       // 防止多次添加产品
@@ -627,7 +633,7 @@ export default {
       }).then(res => {
         if (res.status == 200) {
           this.$message.success('产品添加成功', 2.5)
-          this.resetSearchForm(true)
+          this.resetSearchForm()
           // 触发事件给父级组件
           this.$emit('refash', 'normal', 'add')
         }
@@ -651,7 +657,7 @@ export default {
       salesBatchInsert(params).then(res => {
         if (res.status == 200) {
           this.$message.success('产品导入成功', 2.5)
-          this.resetSearchForm(true)
+          this.resetSearchForm()
           // 触发事件给父级组件
           this.$emit('refash', 'normal', 'import')
         }

+ 6 - 4
src/views/salesManagement/salesQueryNew/comps/totalProductDetailModal.vue

@@ -160,9 +160,9 @@ export default {
     // 页面数据初始化
     pageInit (objInfo) {
       this.parameter = { ...objInfo, ...this.parameter }
-      this.$nextTick(() => {
+      setTimeout(() => {
         this.$refs.table.refresh(true)
-      })
+      }, 200)
     },
     // 重置
     resetSearchForm () {
@@ -202,11 +202,13 @@ export default {
     }
   },
   watch: {
-    show (newValue, oldValue) {
-      this.opened = newValue
+    opened (newValue, oldValue) {
       if (!newValue) {
         this.$emit('cancel')
       }
+    },
+    show (newValue, oldValue) {
+      this.opened = newValue
     }
   }
 }

+ 1 - 1
src/views/salesManagement/salesQueryNew/comps/updateActiveModal.vue

@@ -29,7 +29,7 @@
           </aRadioGroup>
         </div>
         <!-- 叠加活动 -->
-        <div v-if="upActiveValArr&&upActiveValArr.length">
+        <div v-if="stackActiveList&&stackActiveList.length">
           <div>
             <strong >叠加活动</strong>
           </div>

+ 127 - 84
src/views/salesManagement/salesQueryNew/detail.vue

@@ -1,9 +1,9 @@
 <template>
-  <div class="salesDetail-wrap" :style="{paddingBottom:hideFooter?'0px':'45px'}">
+  <div class="salesDetail-wrap" :style="{paddingBottom:hideFooter||bizSn?'0px':'45px'}">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
-        <template slot="subTitle" v-if="!bizSn">
-          <a id="salesDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        <template slot="subTitle">
+          <a id="salesDetail-back-btn" href="javascript:;" v-if="!bizSn" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ detailData&&detailData.salesBillNo }}</span>
           <span v-if="detailData&&detailData.salesBillNoSource">(原:{{ detailData&&detailData.salesBillNoSource || '--' }})</span>
           <span style="margin: 0 10px;color: #666;">客户名称:{{ detailData&&detailData.buyerName }}</span>
@@ -69,30 +69,6 @@
         </div>
       </a-card>
       <a-card size="small" :bordered="false" class="pages-wrap" style="margin-bottom: 6px;" >
-        <!-- 统计信息 -->
-        <a-alert type="info" style="margin-bottom: 10px;">
-          <div slot="message">
-            <div>
-              总销售数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
-              已取消数量:<strong>{{ detailData&&(detailData.totalCancelQty || detailData.totalCancelQty==0) ? detailData.totalCancelQty : '--' }}</strong>;
-              已下推数量:<strong>{{ detailData&&(detailData.totalPushedQty || detailData.totalPushedQty==0) ? detailData.totalPushedQty : '--' }}</strong>;
-              待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;
-              已发货数量:<strong>{{ detailData&&(detailData.totalDispatchQty || detailData.totalDispatchQty==0) ? detailData.totalDispatchQty : '--' }}</strong>;
-              待发货数量:<strong>{{ detailData&&(detailData.totalUndispatchQty || detailData.totalUndispatchQty==0) ? detailData.totalUndispatchQty : '--' }}</strong>;<br/>
-              <span v-if="$hasPermissions(authCode + '_salesPrice')">总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_costPrice')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_costPrice')">总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_salesPrice')">已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? toThousands(detailData.totalCancelAmount) : '--' }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_salesPrice')">已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? toThousands(detailData.totalPushedAmount) : '--' }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_salesPrice')">待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? toThousands(detailData.totalUnpushedAmount) : '--' }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_salesPrice')">已发货金额:<strong>{{ detailData&&(detailData.totalDispatchAmount || detailData.totalDispatchAmount==0) ? toThousands(detailData.totalDispatchAmount) : '--' }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_salesPrice')">待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? toThousands(detailData.totalUndispatchAmount) : '--' }}</strong>;</span>
-              <span v-if="isCityPrice">市级总售价:<strong>{{ detailData&&(detailData.totalCityAmount || detailData.totalCityAmount==0) ? toThousands(detailData.totalCityAmount) : '--' }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_salesPrice')&&detailData&&detailData.totalDiscountAmount" style="color: red;">优惠金额:<strong>{{ Number(detailData.totalDiscountAmount).toFixed(2) }}</strong>;</span>
-              <span v-if="$hasPermissions(authCode + '_salesPrice')&&detailData&&detailData.totalConvertPromoGiftsAmount" style="color: red;">促销产品转采购额金额:<strong>{{ Number(detailData.totalConvertPromoGiftsAmount).toFixed(2) }}</strong>;</span>
-            </div>
-          </div>
-        </a-alert>
         <!-- 查询 -->
         <div class="table-page-search-wrapper">
           <div style="display: flex;justify-content: space-between;align-items: center;">
@@ -161,6 +137,30 @@
             </div>
           </div>
         </div>
+        <!-- 统计信息 -->
+        <a-alert type="info" style="margin-top: 10px;">
+          <div slot="message">
+            <div>
+              总销售数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
+              已取消数量:<strong>{{ detailData&&(detailData.totalCancelQty || detailData.totalCancelQty==0) ? detailData.totalCancelQty : '--' }}</strong>;
+              已下推数量:<strong>{{ detailData&&(detailData.totalPushedQty || detailData.totalPushedQty==0) ? detailData.totalPushedQty : '--' }}</strong>;
+              待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;
+              已发货数量:<strong>{{ detailData&&(detailData.totalDispatchQty || detailData.totalDispatchQty==0) ? detailData.totalDispatchQty : '--' }}</strong>;
+              待发货数量:<strong>{{ detailData&&(detailData.totalUndispatchQty || detailData.totalUndispatchQty==0) ? detailData.totalUndispatchQty : '--' }}</strong>;<br/>
+              <span v-if="$hasPermissions(authCode + '_salesPrice')">总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;</span>
+              <span v-if="$hasPermissions(authCode + '_costPrice')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;</span>
+              <span v-if="$hasPermissions(authCode + '_costPrice')">总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;</span>
+              <span v-if="$hasPermissions(authCode + '_salesPrice')">已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? toThousands(detailData.totalCancelAmount) : '--' }}</strong>;</span>
+              <span v-if="$hasPermissions(authCode + '_salesPrice')">已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? toThousands(detailData.totalPushedAmount) : '--' }}</strong>;</span>
+              <span v-if="$hasPermissions(authCode + '_salesPrice')">待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? toThousands(detailData.totalUnpushedAmount) : '--' }}</strong>;</span>
+              <span v-if="$hasPermissions(authCode + '_salesPrice')">已发货金额:<strong>{{ detailData&&(detailData.totalDispatchAmount || detailData.totalDispatchAmount==0) ? toThousands(detailData.totalDispatchAmount) : '--' }}</strong>;</span>
+              <span v-if="$hasPermissions(authCode + '_salesPrice')">待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? toThousands(detailData.totalUndispatchAmount) : '--' }}</strong>;</span>
+              <span v-if="isCityPrice">市级总售价:<strong>{{ detailData&&(detailData.totalCityAmount || detailData.totalCityAmount==0) ? toThousands(detailData.totalCityAmount) : '--' }}</strong>;</span>
+              <span v-if="$hasPermissions(authCode + '_salesPrice')&&detailData&&detailData.totalDiscountAmount" style="color: red;">优惠金额:<strong>{{ Number(detailData.totalDiscountAmount).toFixed(2) }}</strong>;</span>
+              <span v-if="$hasPermissions(authCode + '_salesPrice')&&detailData&&detailData.totalConvertPromoGiftsAmount" style="color: red;">促销产品转采购额金额:<strong>{{ Number(detailData.totalConvertPromoGiftsAmount).toFixed(2) }}</strong>;</span>
+            </div>
+          </div>
+        </a-alert>
         <!-- 正常产品列表 -->
         <div v-if="!hideNormalTable">
           <detailProductList
@@ -206,7 +206,7 @@
         </detailProductList>
       </a-card>
     </a-spin>
-    <div class="affix-cont" :style="{padding:hideFooter?0:'7px 0 4px'}">
+    <div class="affix-cont" :class="bizSn?'affix-footer-bar':''" :style="{padding:hideFooter?0:'7px 0 4px'}">
       <a-button
         style="width: 100px;margin-right:20px;"
         :disabled="spinning"
@@ -227,7 +227,7 @@
         v-if="detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'SUPERIOR_AUDIT_REJECT' || detailData.billStatus == 'TRANSFER_AUDIT_REJECT')&&$hasPermissions('B_salesAudit')&&$route.params.pageType!='salesNewDetailTransfer'"
         @click="handleAudit()"
       >
-        审核
+        {{ detailData.billStatus=='WAIT_UP_AUDIT_PASS'?'上级':'' }}审核
       </a-button>
       <!-- 转单审核 -->
       <a-button
@@ -300,10 +300,9 @@
     <!-- 审核时校验销售价低于成本价提示 -->
     <vaildPriceModal
       ref="vaildPriceModal"
-      modalType="0"
       :openModal="openVaildPriceModal"
       :dataObj="tempData"
-      @close="openVaildPriceModal=false"
+      @close="closeVaildPrice"
       @ok="vaildPriceOk"></vaildPriceModal>
     <!-- 发货经销商库存 弹窗 -->
     <dealerStockModal :itemSn="$route.params.sn" :openModal="openDealerStock" @close="openDealerStock = false" @ok="openDealerStockOk"></dealerStockModal>
@@ -427,7 +426,7 @@ export default {
     },
     // 表格高度计算
     pageHeight () {
-      if (this.hideNormalTable || this.hideActiveTable || this.activeList.length == 0) {
+      if (!this.bizSn && (this.hideNormalTable || this.hideActiveTable || this.activeList.length == 0)) {
         return window.innerHeight - 330 + (this.hideFooter ? 45 : 0)
       }
       return 'auto'
@@ -436,6 +435,7 @@ export default {
   methods: {
     //  返回
     handleBack () {
+      this.$emit('close')
       this.$router.push({ name: 'salesQueryNewList' })
     },
     // 打开 发货经销商库存弹窗
@@ -454,6 +454,7 @@ export default {
     // 编辑
     handleEdit () {
       const row = this.detailData
+      this.$emit('close')
       this.$router.push({ name: 'salesNewEdit', params: { sn: row.salesBillSn, wSn: row.warehouseSn } })
     },
     // 改单
@@ -473,6 +474,7 @@ export default {
             _this.$refs.tipModal.getShowInfo(obj)
             _this.openTipModal = true
           } else {
+            _this.$emit('close')
             _this.$router.push({ name: 'salesNewEdit', params: { sn: row.salesBillSn, wSn: row.warehouseSn } })
           }
         }
@@ -488,6 +490,7 @@ export default {
           this.$message.success(res.message)
           this.openTipModal = false
           this.$nextTick(() => {
+            this.$emit('close')
             this.$router.push({ name: 'salesNewEdit', params: { sn: row.salesBillSn, wSn: row.warehouseSn } })
           })
         }
@@ -496,34 +499,9 @@ export default {
     // 取消时,跳转编辑页面
     closeTipModal () {
       this.openTipModal = false
+      this.$emit('close')
       this.$router.push({ name: 'salesNewEdit', params: { sn: this.$route.params.sn || this.bizSn } })
     },
-    // 价格低于成本校验提示,继续审核
-    vaildPriceOk (type) {
-      // 不通过
-      if (type == 'AUDIT_REJECT') {
-        this.auditOrder(type)
-      } else {
-        // 如果时 待上级审核,调用
-        if (this.detailData.billStatus == 'WAIT_UP_AUDIT_PASS') {
-          this.auditOrder(type)
-          return
-        }
-        this.spinning = true
-        // 通过,业务状态变更 待上级审核
-        salesWriteUpAuditPass({
-          salesBillSn: this.bizSn || this.$route.params.sn,
-          billStatus: type
-        }).then(res => {
-          if (res.status == 200) {
-            this.$message.success(res.message)
-            this.handleBack()
-          }
-          this.$refs.vaildPriceModal.spinning = false
-          this.spinning = false
-        })
-      }
-    },
     // 查询第三方库存
     getThreeStock () {
       this.spinning = true
@@ -552,6 +530,7 @@ export default {
     },
     // 详情
     getDetail () {
+      this.spinning = true
       salesDetailBySn({ salesBillSn: this.bizSn || this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.detailData = res.data || null
@@ -571,6 +550,7 @@ export default {
           this.$refs.activeTjList.hasInit = false
         }
       })
+      this.spinning = false
       setTimeout(() => {
         this.resetSearchForm()
       }, 500)
@@ -589,6 +569,7 @@ export default {
     },
     // 下推
     handleDispatch (row) {
+      this.$emit('close')
       this.$router.push({ name: 'waitDispatchNew', params: { salesBillSn: row.salesBillSn } })
     },
     // 验证转单
@@ -648,12 +629,14 @@ export default {
     // 打开审核/一键审核弹框
     async handleAudit (isBatch) {
       const _this = this
+      this.spinning = true
       // 校验产品是否付个促销活动规则
       const vaildActive = await salesPromoValidaAudit({ salesBillSn: this.bizSn || this.$route.params.sn }).then(res => res.data)
       if (vaildActive && vaildActive.length > 0) {
         const a = vaildActive.filter(item => item.type == 1) // 不可提交
-        const b = vaildActive.filter(item => item.type == 0) // 可跳过继续提交
-        const d = vaildActive.filter(item => item.type == 'audit') // 售价是否低于参考成本价
+        const c = vaildActive.filter(item => item.type == 'price_less_0') // 不可提交
+        const b = vaildActive.filter(item => item.type == 0) // 文字提示,可跳过继续提交
+        const d = vaildActive.filter(item => item.type == 'price_less_cost' || item.type == 'wait_up_audit_price_less_cost') // 价格校验表格提示,可跳过继续提交
         // 弹出不符合规则弹框,不可提交
         if (a.length) {
           this.$info({
@@ -671,14 +654,29 @@ export default {
               <div style="padding:10px 0;text-align:center"><strong>请按照以上提示修改后再提交</strong></div>
             </div>
           })
-          this.spinning = false
-        } else if (b.length) {
+          _this.spinning = false
+          return
+        }
+        // 不可提交
+        if (c.length) {
+          // 弹框显示表格提示
+          if (!isBatch) {
+            _this.openVaildPrice(c[0])
+          } else {
+            // 弹框文字提示
+            _this.tempData = { vaildPriceList: c[0].data.map(item => item.productCode) }
+            _this.verificationSuccess(isBatch)
+          }
+          return
+        }
+        // 文字提示,可跳过继续提交
+        if (b.length) {
           // 弹出确认提示信息,可跳过继续提交
           _this.$confirm({
             title: '提示',
             centered: true,
             class: 'confirm-center',
-            okText: '提交',
+            okText: '确定',
             width: 600,
             content: <div style="padding-top:15px;">
               <ol>
@@ -688,33 +686,49 @@ export default {
               </ol>
             </div>,
             onOk () {
-              _this.verificationSuccess(isBatch)
+              // 售价是否低于参考成本价
+              if (d.length) {
+                if (isBatch) { // 一键审核,弹框文字提示
+                  _this.tempData = { vaildPriceList: d[0].data.map(item => item.productCode) }
+                  _this.verificationSuccess(isBatch)
+                } else {
+                  // 审核或上级审核,弹框表格提示
+                  d[0].type = 'audit_price_less_cost'
+                  _this.openVaildPrice(d[0])
+                }
+              } else {
+                _this.verificationSuccess(isBatch)
+              }
+            },
+            onCancel () {
+              _this.spinning = false
             }
           })
-          _this.spinning = false
-        } else if (d.length) {
-          // 售价是否低于参考成本价
-          if (isBatch) { // 一键审核
-            _this.tempData = { vaildPriceList: d[0].salesPromoDetailEntityList.map(item => item.productCode) }
-            this.verificationSuccess(isBatch)
-          } else {
-            // 审核
-            _this.tempData = d[0]
-            _this.openVaildPriceModal = true
-          }
-        } else {
-          this.verificationSuccess(isBatch)
         }
       } else {
-        this.verificationSuccess(isBatch)
+        _this.verificationSuccess(isBatch)
       }
     },
+    // 校验销售价低于成本价提示
+    openVaildPrice (data) {
+      this.tempData = data
+      this.openVaildPriceModal = true
+    },
+    // 关闭校验销售价低于成本价提示
+    closeVaildPrice () {
+      this.spinning = false
+      this.tempData = null
+      this.openVaildPriceModal = false
+    },
     // 消息提示
     messageInfo (content) {
       this.$info({
         title: '提示',
         content: content,
-        centered: true
+        centered: true,
+        onOk: () => {
+          this.spinning = false
+        }
       })
     },
     // 验证通过
@@ -733,7 +747,7 @@ export default {
           return
         }
         if (this.tempData && this.tempData.vaildPriceList) {
-          this.messageInfo(this.tempData.vaildPriceList + '售价已低于成本价,不可一键审核!')
+          this.messageInfo('产品' + this.tempData.vaildPriceList + '售价已低于成本价,不可一键审核!')
           return
         }
         // 一键审核成功
@@ -744,7 +758,7 @@ export default {
         this.visibleAudit = true
       }
     },
-    // 一键审核
+    // 一键审核确定
     handleOnceAudit (data) {
       const params = {
         salesBillSn: this.bizSn || this.$route.params.sn,
@@ -763,6 +777,32 @@ export default {
         this.spinning = false
       })
     },
+    // 价格低于成本校验提示,继续审核
+    vaildPriceOk (type) {
+      if (type == 'confirm') {
+        this.auditOrder(type)
+        return
+      }
+      // 不通过 或 是 如果是待上级审核,调用
+      if (type == 'AUDIT_REJECT' || this.detailData.billStatus == 'WAIT_UP_AUDIT_PASS') {
+        this.auditOrder(type)
+      } else {
+        this.spinning = true
+        // 通过审核,业务状态变更 待上级审核
+        salesWriteUpAuditPass({
+          salesBillSn: this.bizSn || this.$route.params.sn,
+          billStatus: type
+        }).then(res => {
+          if (res.status == 200) {
+            this.$message.success(res.message)
+            this.closeVaildPrice()
+            this.handleBack()
+          }
+          this.$refs.vaildPriceModal.spinning = false
+          this.spinning = false
+        })
+      }
+    },
     // 审核
     auditOrder (billStatus) {
       this.spinningAudit = true
@@ -776,11 +816,14 @@ export default {
           this.$message.success(res.message)
           this.spinningAudit = false
           const _this = this
+          this.closeVaildPrice()
           this.$nextTick(() => {
+            // 审核通过,跳转到带下推页面
             if (billStatus == 'AUDIT_PASS' && !_this.auditText) {
+              _this.$emit('close')
               _this.$router.push({ name: 'waitDispatchNew', params: { salesBillSn: _this.bizSn || _this.$route.params.sn } })
             } else {
-              //  关闭详情跳列表
+              // 不通过关闭详情返回列表
               _this.handleBack()
             }
           })
@@ -885,9 +928,9 @@ export default {
       justify-content: space-between;
       align-items: center;
     }
-    .footer-cont{
-      margin-top: 5px;
+    .affix-footer-bar{
       text-align: center;
+      background: #fff;
     }
     .redStyle{
       font-weight: bold;

+ 181 - 168
src/views/salesManagement/salesQueryNew/edit.vue

@@ -57,16 +57,16 @@
         v-if="activeList.length"
       >
         <div slot="title">
-          <div style="display: flex;justify-content: space-between;">
+          <div style="display: flex;justify-content: space-between;align-items: center;">
             <span>活动产品</span>
-            <a-button size="small" @click="getActiveList(true)" type="link" class="button-info"><a-icon type="reload"/> 刷新</a-button>
+            <a-button size="small" @click="getActiveList(false)" type="link" class="button-info"><a-icon type="reload"/> 刷新</a-button>
           </div>
         </div>
         <activeStatisticsList
           ref="activeTjList"
           @openCpModal="openProductModal"
           @refash="refashTableData"
-          @selected="getActiveProduct"
+          @selected="active => salesPromoSnSet = active"
           :activeList="activeList"
           :warehouseSn="warehouseSn"
           :salesBillSn="salesBillSn"
@@ -167,10 +167,9 @@
     <!-- 提交时校验销售价低于成本价提示 -->
     <vaildPriceModal
       ref="vaildPriceModal"
-      modalType="1"
       :openModal="openVaildPriceModal"
       :dataObj="tempData"
-      @close="openVaildPriceModal=false"
+      @close="closeVaildPrice"
       @ok="vaildPriceOk"></vaildPriceModal>
   </div>
 </template>
@@ -256,22 +255,6 @@ export default {
     handleBack () {
       this.$router.push({ name: 'salesQueryNewList', query: { closeLastOldTab: true } })
     },
-    //  销售单详情
-    getOrderDetail (flag, callback) {
-      this.spinning = true
-      salesDetailBySn({ salesBillSn: this.$route.params.sn }).then(res => {
-        this.spinning = false
-        if (res.status == 200) {
-          this.detailData = res.data
-          this.detailData.totalDiscountAmount = Number(this.detailData.totalOrigAmount || 0) - Number(this.detailData.totalAmount || 0)
-          if (callback) { callback() }
-        }
-        if (flag) {
-          // 获取活动列表
-          this.getActiveList()
-        }
-      })
-    },
     // 查看参与规则明细
     showRuleDetail (sn) {
       this.$refs.activeTjList.showDesc({ promoRuleSn: sn })
@@ -297,104 +280,24 @@ export default {
         this.spinning = false
       })
     },
-    // 获取销售单参与的活动列表
-    async getActiveList (flag) {
-      // 已参与活动列表
-      const list = await salesPromoQueryList({ salesBillSn: this.$route.params.sn }).then(res => res.data || [])
-      this.activeList = list.filter(item => item.promotion && item.promotionRule)
-      // 触发活动统计查询变量
-      this.$nextTick(() => {
-        if (this.activeList.length) this.$refs.activeTjList.hasInit = false
-      })
-      if (!flag) {
-        setTimeout(() => {
-          // 刷新正常产品列表
-          this.$refs.productNormalList.resetSearchForm()
-          // 刷新活动产品列表
-          if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
-        }, 500)
-      }
-    },
-    // 获取是否有新活动,
-    async getNewActive () {
-      const hasNewActive = await salesQueryUnPartPromo({ salesBillSn: this.$route.params.sn, enabledFlag: '1' }).then(res => res.data)
-      if (hasNewActive.length) {
-        this.newActiveList = hasNewActive
-        // 有则弹出弹框确认
-        this.showNewActiveModal = true
-      } else {
-        // 获取销售单详情
-        this.getOrderDetail(true)
-      }
-    },
-    // 新活动弹框确认后
-    showNewActiveOk (type) {
-      this.showNewActiveModal = false
-      // 特价规则排序
-      if (type == 1) {
-        this.getSalesPromoDiscountSort()
-      } else {
-        // 取消加入新活动
-        this.getOrderDetail(true)
-      }
-    },
-    // 特价规则排序列表
-    getSalesPromoDiscountSort () {
-      this.spinning = true
-      salesPromoDiscountSort({ salesBillSn: this.$route.params.sn }).then(res => {
-        if (res.status == 200) {
-          this.discountActiveList = res.data
-          this.showDiscountSortModal = res.data && res.data.length > 1
-          if (res.data && res.data.length <= 1) {
-            this.getOrderDetail(true)
-          }
-        }
-        this.spinning = false
-      })
-    },
-    // 特价规则排序完成或取消排序
-    showDiscountSortOk () {
-      this.showDiscountSortModal = false
-      this.getOrderDetail(true)
-    },
     // 打开选择产品弹框,type:0 正常产品,1活动产品,2累计产品
     openProductModal (type, promo) {
       this.$refs.chooseProduct.pageInit(this.detailData, promo, type)
       this.showCpModal = true
     },
     // 添加产品后,关闭弹框
-    closeProductModal (hasRefash) {
+    closeProductModal (hasRefash, type) {
       this.showCpModal = false
+      // 刷新产品列表和活动统计列表
       if (hasRefash) {
-        this.getActiveList()
-      }
-    },
-    // 获取指定活动的产品列表
-    getActiveProduct (active) {
-      this.salesPromoSnSet = active
-    },
-    // 添加活动产品成功的回调,刷新产品列表
-    // type:normal 正常列表 ,active 活动列表
-    // action:add 添加,del 删除,batchDel 批量删除,update 更新数据
-    refashTableData (type, action) {
-      // 如果是活动产品
-      if (type == 'promo') {
-        // 刷新正常产品列表
-        if (action != 'add') this.$refs.productNormalList.resetSearchForm()
-      } else if (type == 'normal') { // 如果是正常产品
-        // 刷新活动产品列表
-        if (this.activeList.length && action != 'add') this.$refs.productActiveList.resetSearchForm()
-      } else {
-        // 刷新正常产品列表
-        this.$refs.productNormalList.resetSearchForm()
-        // 刷新活动产品列表
-        if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
-      }
-      // 重新获取详情信息
-      this.getOrderDetail(false)
-      if (action != 'add') {
-        // 重新获取参与活动列表
-        this.getActiveList(true)
+        this.getActiveList(false)
+        if (type == 0) {
+          // 刷新活动产品列表
+          if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
+        } else {
+          // 刷新正常产品列表
+          this.$refs.productNormalList.resetSearchForm()
+        }
       }
     },
     // 确定新增产品到列表,
@@ -408,29 +311,24 @@ export default {
         if (cptype == 1) {
           if (this.activeList.length) this.$refs.productActiveList.saveNewProduct(row, promo, promoProductClz)
         }
+        // 累计产品
         if (cptype == 2) {
           if (this.activeList.length) this.$refs.productActiveList.accumulateProduct(row, promo, promoProductClz)
         }
       }
     },
-    // 更换活动,type 1 促销活动,0 正常活动
+    // type 1 更换活动,0 参与活动
     upActive (params, type) {
       salesChangePromo(params).then(res => {
         if (res.status == 200) {
+          // 刷新活动统计
+          this.getActiveList(false)
           if (type == 1) {
-            // 刷新活动产品
-            if (this.activeList.length) this.$refs.productActiveList.upAcitveSuccess()
-            // 刷新活动统计
-            if (this.activeList.length) this.$refs.activeTjList.getDataList()
-            // 刷新详情和正常产品列表
-            this.refashTableData('promo')
+            // 刷新正常产品列表
+            this.$refs.productNormalList.resetSearchForm()
           } else {
-            // 刷新正常活动
-            this.$refs.productNormalList.addAcitveSuccess()
-            // 刷新活动统计
-            if (this.activeList.length) this.$refs.activeTjList.getDataList()
-            // 刷新详情和活动产品列表
-            this.refashTableData('normal')
+            // 刷新活动产品列表
+            if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
           }
         }
       })
@@ -438,13 +336,16 @@ export default {
     // 提交销售单
     async submitResult () {
       const _this = this
-      const data = { salesBillSn: _this.salesBillSn }
+      this.spinning = true
       // 校验活动规则
       const vaildActive = await salesPromoValidaSubmit({ salesBillSn: this.salesBillSn }).then(res => res.data)
       const a = vaildActive.filter(item => item.type == 1) // 不可提交
-      const b = vaildActive.filter(item => item.type == 0) // 可跳过继续提交
-      // 弹出不符合规则弹框,不可提交
-      if (a.length) {
+      const d = vaildActive.filter(item => item.type == 'price_less_0') // 不可提交
+      const b = vaildActive.filter(item => item.type == 0) // 文字提示,可跳过继续提交
+      const c = vaildActive.filter(item => item.type == 'price_less_cost' || item.type == 'wait_up_audit_price_less_cost') // 价格校验表格提示,可跳过继续提交
+      // 不可提交
+      // 弹出不符合规则弹框
+      if (a.length > 0) {
         this.$info({
           title: '提示',
           centered: true,
@@ -460,57 +361,169 @@ export default {
             <div style="padding:10px 0;text-align:center"><strong>请按照以上提示修改后再提交</strong></div>
           </div>
         })
-        this.spinning = false
-      } else {
-        // 弹出确认提示信息,可跳过继续提交
-        if (b.length) {
-          this.$confirm({
-            title: '提示',
-            centered: true,
-            class: 'confirm-center',
-            okText: '提交',
-            width: 600,
-            content: <div style="padding-top:15px;">
-              <ol>
-                {b.map(item => (
-                  <li style="padding:3px 0;">{item.message}</li>
-                ))}
-              </ol>
-            </div>,
-            onOk () {
-              _this.submitOrder(data)
+        _this.spinning = false
+        return
+      }
+      if (d.length > 0) { // 价格校验弹框提示
+        _this.openVaildPrice(d[0])
+        return
+      }
+      // 弹出确认提示信息,可跳过继续提交
+      if (b.length > 0) {
+        this.$confirm({
+          title: '提示',
+          centered: true,
+          class: 'confirm-center',
+          okText: '提交',
+          width: 600,
+          content: <div style="padding-top:15px;">
+            <ol>
+              {b.map(item => (
+                <li style="padding:3px 0;">{item.message}</li>
+              ))}
+            </ol>
+          </div>,
+          onOk () {
+            // 价格校验弹框
+            if (c.length > 0) {
+              _this.openVaildPrice(c[0])
+            } else {
+              _this.submitOrder()
             }
-          })
-          _this.spinning = false
-        } else {
-          _this.submitOrder(data)
-        }
+          },
+          onCancel () {
+            _this.spinning = false
+          }
+        })
       }
     },
-    // 校验销售价低于成本价提示成功,关闭弹窗
-    vaildPriceOk () {
+    // 校验销售价低于成本价提示
+    openVaildPrice (data) {
+      this.tempData = data
+      this.openVaildPriceModal = true
+    },
+    // 关闭校验销售价低于成本价提示
+    closeVaildPrice () {
+      this.spinning = false
       this.tempData = null
       this.openVaildPriceModal = false
     },
+    // 校验销售价低于成本价提示成功,关闭弹窗
+    vaildPriceOk (type) {
+      if (type == 'confirm') {
+        this.submitOrder()
+      }
+    },
     // 提交销售单
-    async submitOrder (data) {
+    async submitOrder () {
       this.spinning = true
-      const res = await salesWriteSubmit(data)
+      const res = await salesWriteSubmit({ salesBillSn: this.salesBillSn })
       if (res.status == 200) {
-        // 售价是否低于参考成本价
-        if (res.data && res.data.length) {
-          const objData = {
-            salesPromoDetailEntityList: res.data,
-            message: '共' + res.data.length + '款产品售价小于等于0'
-          }
-          this.tempData = objData
-          this.openVaildPriceModal = true
-        } else {
-          this.handleBack()
-          this.$message.success(res.message)
-        }
+        this.closeVaildPrice()
+        this.handleBack()
+        this.$message.success(res.message)
+      }
+      this.spinning = false
+    },
+    // 刷新查询列表数据
+    getTableListData () {
+      // 刷新正常产品列表
+      this.$refs.productNormalList.resetSearchForm()
+      // 刷新活动产品列表
+      if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
+    },
+    // 添加活动产品成功的回调,刷新产品列表
+    // type:normal 正常列表 ,active 活动列表
+    // action:add 添加,del 删除,batchDel 批量删除,update 更新数据, enable 启用禁用,sort 排序
+    // 如果添加操作,不实时刷新列表,关闭后再刷新
+    refashTableData (type, action) {
+      // 重新获取详情信息
+      this.getOrderDetail(false)
+      // 如果是活动产品,刷新正常产品列表
+      if (type == 'promo') {
+        if (action != 'add') this.$refs.productNormalList.resetSearchForm()
+      } else if (type == 'normal') { // 如果是正常产品
+        // 刷新活动产品列表
+        if (this.activeList.length && action != 'add') this.$refs.productActiveList.resetSearchForm()
+      } else {
+        // 正常和活动列表都刷新
+        this.getTableListData()
+      }
+      // 非添加操作,重新获取参与活动列表
+      if (action != 'add') {
+        this.getActiveList(false)
+      }
+    },
+    // 获取销售单参与的活动列表,flag: true 查询产品明细列表,false 不查
+    async getActiveList (flag) {
+      this.spinning = true
+      // 触发活动统计查询变量
+      if (this.$refs.activeTjList) this.$refs.activeTjList.hasInit = false
+      // 已参与活动列表
+      const list = await salesPromoQueryList({ salesBillSn: this.$route.params.sn }).then(res => res.data || [])
+      this.activeList = list.filter(item => item.promotion && item.promotionRule)
+      this.spinning = false
+      if (flag) {
+        setTimeout(() => {
+          this.getTableListData()
+        }, 200)
+      }
+    },
+    //  销售单详情 flag: true 查询活动列表,false 不查
+    async getOrderDetail (flag) {
+      this.spinning = true
+      const detail = await salesDetailBySn({ salesBillSn: this.$route.params.sn }).then(res => res.data)
+      if (detail) {
+        this.detailData = detail
+        this.detailData.totalDiscountAmount = Number(this.detailData.totalOrigAmount || 0) - Number(this.detailData.totalAmount || 0)
       }
       this.spinning = false
+      if (flag) {
+        // 获取活动列表
+        this.getActiveList(true)
+      }
+    },
+    // 获取是否有新活动,
+    async getNewActive () {
+      const hasNewActive = await salesQueryUnPartPromo({ salesBillSn: this.$route.params.sn, enabledFlag: '1' }).then(res => res.data)
+      if (hasNewActive.length) {
+        this.newActiveList = hasNewActive
+        // 有则弹出参与新活动弹框
+        this.showNewActiveModal = true
+      } else {
+        // 获取销售单详情
+        this.getOrderDetail(true)
+      }
+    },
+    // 新活动弹框确认后
+    showNewActiveOk (type) {
+      this.showNewActiveModal = false
+      // 特价规则排序
+      if (type == 1) {
+        this.getSalesPromoDiscountSort()
+      } else {
+        // 取消加入新活动
+        this.getOrderDetail(true)
+      }
+    },
+    // 特价规则排序列表
+    getSalesPromoDiscountSort () {
+      this.spinning = true
+      salesPromoDiscountSort({ salesBillSn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.discountActiveList = res.data
+          this.showDiscountSortModal = res.data && res.data.length > 1
+          if (res.data && res.data.length <= 1) {
+            this.getOrderDetail(true)
+          }
+        }
+        this.spinning = false
+      })
+    },
+    // 特价规则排序完成或取消排序
+    showDiscountSortOk () {
+      this.showDiscountSortModal = false
+      this.getOrderDetail(true)
     },
     // 页面初始化
     pageInit () {

+ 36 - 52
src/views/salesManagement/salesQueryNew/list.vue

@@ -159,39 +159,32 @@
               </div>
             </div>
             <div>
-              <span>显示:</span>
-              <a-tree-select
-                size="small"
-                v-model="showCols"
-                style="min-width: 200px"
-                dropdownMatchSelectWidth
-                :maxTagCount="3"
-                :tree-data="colsArr"
-                tree-checkable
-                placeholder="请选择要显示的列(多选)"
-              />
+              <hideCellMenus :defHiddenKes="colsArr" v-model="showCols"></hideCellMenus>
             </div>
           </div>
         </div>
 
         <!-- 列表 -->
-        <s-table
+        <v-table
           class="sTable fixPagination"
           ref="table"
-          :style="{ height: tableHeight+87+'px' }"
-          size="small"
-          :rowKey="(record) => record.id"
+          :style="{ height: tableHeight+35+'px' }"
+          :pagination="{pageSize:20}"
           :columns="columns"
           :data="loadData"
           :scroll="{ y: tableHeight }"
           :defaultLoadData="false"
           bordered>
+          <!-- 时间表头 -->
+          <template slot="customDateTitle">
+            <a-tooltip placement="top" title="第一次提交时间">提交时间&nbsp;<a-icon type="question-circle" /></a-tooltip>
+          </template>
           <!-- 销售单号 -->
           <template slot="salesBillNo" slot-scope="text, record">
             <span v-if="$hasPermissions('B_salesDetail')" class="link-bule" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
             <span v-else>{{ record.salesBillNo }}</span>
-            <a-badge :count="'改'+record.changeTimes" :number-style="{ zoom:'80%' }" v-if="record.changeTimes>0"></a-badge>
-            <a-badge count="促" v-if="record.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
+            <a-badge :count="'改'+record.changeTimes" :number-style="{ zoom:'0.8' }" v-if="record.changeTimes>0"></a-badge>
+            <a-badge count="促" v-if="record.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'0.8' }"></a-badge>
           </template>
           <!-- 出库仓库 -->
           <template slot="warehouseBox" slot-scope="text, record">
@@ -205,10 +198,6 @@
             </a-tooltip>
             <div v-else>--</div>
           </template>
-          <!-- 总数量 -->
-          <template slot="totalQty" slot-scope="text, record">
-            {{ record.totalQty }}
-          </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
             <div>
@@ -278,7 +267,7 @@
               >转费用报销单</a-button>
             </div>
           </template>
-        </s-table>
+        </v-table>
       </a-spin>
       <!-- 选择客户弹框 -->
       <choose-custom-modal :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
@@ -319,7 +308,7 @@ import { hdExportExcel } from '@/libs/exportExcel'
 import subarea from '@/views/common/subarea.js'
 import Area from '@/views/common/area.js'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { STable, VSelect } from '@/components'
+import { VTable, VSelect } from '@/components'
 import commonModal from '@/views/common/commonModal.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
 import tipModal from './tipModal.vue'
@@ -328,6 +317,7 @@ import baseDataModal from '@/views/expenseManagement/expenseReimbursement/baseDa
 import reportModal from '@/views/common/reportModal.vue'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import customerService from '@/views/common/customerService'
+import hideCellMenus from '@/views/common/hideCellMenus'
 // 接口
 import { dispatchBatchPrintStatus, queryBySalesBillSn } from '@/api/dispatch'
 import { salesList, salesDel, salesCancle, salesCount, queryCreateBySalesBillSn, expenseAccountSave, changeBillCheckUpdatePrice, changeBillCheck } from '@/api/salesNew'
@@ -336,7 +326,7 @@ import { salesDetailExport } from '@/api/salesBillReport'
 export default {
   name: 'SalesQueryList',
   mixins: [commonMixin],
-  components: { STable, VSelect, tipModal, chooseCustomModal, dealerSubareaScopeList, Area, rangeDate, subarea, commonModal, reportModal, chooseWarehouse, baseDataModal, customerService },
+  components: { VTable, VSelect, tipModal, hideCellMenus, chooseCustomModal, dealerSubareaScopeList, Area, rangeDate, subarea, commonModal, reportModal, chooseWarehouse, baseDataModal, customerService },
   data () {
     return {
       spinning: false,
@@ -447,33 +437,32 @@ export default {
       colsArr: [
         {
           title: '已取消数量',
-          value: 'totalCancelQty',
           key: 'totalCancelQty',
-          disabled: false
+          disabled: false,
+          checked: false
         },
         {
           title: '待下推数量',
-          value: 'totalUnpushedQty',
           key: 'totalUnpushedQty',
-          disabled: false
+          disabled: false,
+          checked: false
         },
         {
           title: '待下推金额',
-          value: 'totalUnpushedAmount',
           key: 'totalUnpushedAmount',
           disabled: !this.$hasPermissions('M_salesQueryList_salesPrice')
         },
         {
           title: '转采购额数量',
-          value: 'totalConvertPromoGiftsQty',
           key: 'totalConvertPromoGiftsQty',
-          disabled: false
+          disabled: false,
+          checked: false
         },
         {
           title: '转采购额金额',
-          value: 'totalConvertPromoGiftsAmount',
           key: 'totalConvertPromoGiftsAmount',
-          disabled: !this.$hasPermissions('M_salesQueryList_salesPrice')
+          disabled: !this.$hasPermissions('M_salesQueryList_salesPrice'),
+          checked: false
         }
       ]
     }
@@ -481,13 +470,13 @@ export default {
   computed: {
     columns () {
       const _this = this
-      const arr = [
+      let arr = [
         { title: '创建时间', dataIndex: 'createDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
-        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '8%', align: 'center' },
-        { title: <a-tooltip placement='top' title='第一次提交时间'>提交时间&nbsp;<a-icon type="question-circle" /></a-tooltip>, dataIndex: 'firstSubmitDate', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') }, sorter: true },
-        { title: '客户名称', dataIndex: 'buyerName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '6%', align: 'center', ellipsis: true },
-        { title: '总数量', dataIndex: 'totalQty', scopedSlots: { customRender: 'totalQty' }, width: '4%', align: 'center' },
+        { 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: '客户名称', 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' },
         { title: '总售价', dataIndex: 'totalAmount', width: '4%', align: 'right', isShow: false, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '已下推数量', dataIndex: 'totalPushedQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '下推总金额', dataIndex: 'totalPushedAmount', width: '5%', align: 'right', isShow: false, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
@@ -499,22 +488,17 @@ export default {
         { 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: 'lastStockUpDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { 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%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
         { title: '备货打印状态', dataIndex: 'printStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
       // 根据权限及勾选按固定顺序动态显示列
-      arr.map(item => {
-        if (this.$hasPermissions('M_salesQueryList_salesPrice')) {
-          item.isShow = ['totalAmount', 'totalPushedAmount', 'totalUnpushedAmount', 'totalConvertPromoGiftsAmount'].includes(item.dataIndex)
-        }
-        if (this.colsArr.find(k => k.value == item.dataIndex)) {
-          item.isShow = this.showCols.includes(item.dataIndex)
-        }
-      })
-      return arr.filter(item => !this.colsArr.find(k => k.value == item.dataIndex) || item.isShow)
+      if (!this.$hasPermissions('M_salesQueryList_salesPrice')) {
+        arr = arr.filter(item => !['totalAmount', 'totalPushedAmount', 'totalUnpushedAmount', 'totalConvertPromoGiftsAmount'].includes(item.dataIndex))
+      }
+      return arr.filter(item => !this.showCols.includes(item.dataIndex))
     }
   },
   methods: {
@@ -809,7 +793,7 @@ export default {
     // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 260
+      this.tableHeight = window.innerHeight - tableSearchH - 210
     }
   },
   watch: {

+ 36 - 27
src/views/salesManagement/salesQueryNew/vaildPriceModal.vue

@@ -24,12 +24,15 @@
         <div style="padding: 20px;text-align: center;" v-if="dataObj&&dataObj.message">
           {{ dataObj.message }}
         </div>
-        <div style="margin-top:36px;text-align:center;" v-if="modalType==='0'">
-          <!-- <a-button @click="handleCancel" style="margin-right: 15px" id="chooseCustom-btn-back">关闭</a-button> -->
+        <div style="margin-top:36px;text-align:center;" v-if="modalType == 'wait_up_audit_price_less_cost'||modalType == 'audit_price_less_cost'">
           <a-button type="primary" style="margin-right: 15px" @click="handleSubmit('AUDIT_REJECT')" id="chooseCustom-btn-noPasss">审核不通过</a-button>
           <a-button type="primary" class="button-info" @click="handleSubmit('AUDIT_PASS')" id="chooseCustom-btn-Pass">审核通过</a-button>
         </div>
-        <div style="margin-top:36px;text-align:center;" v-else>
+        <div style="margin-top:36px;text-align:center;" v-if="modalType == 'price_less_cost'">
+          <a-button @click="handleCancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
+          <a-button type="primary" class="button-info" @click="handleSubmit('confirm')" id="chooseCustom-btn-Pass">确定</a-button>
+        </div>
+        <div style="margin-top:36px;text-align:center;" v-if="modalType == 'price_less_0'">
           <a-button @click="handleCancel" style="margin-right: 15px" id="chooseCustom-btn-back">关闭</a-button>
         </div>
       </div>
@@ -52,10 +55,6 @@ export default {
       default: () => {
         return null
       }
-    },
-    modalType: {// 0  来源审核页面  1来源提交页面
-      type: String,
-      default: '0'
     }
   },
   data () {
@@ -65,34 +64,44 @@ export default {
     }
   },
   computed: {
+    modalType () {
+      return this.dataObj && this.dataObj.type
+    },
     dataList () {
-      const list = this.dataObj && this.dataObj.salesPromoDetailEntityList || []
+      const list = this.dataObj && this.dataObj.data || []
       list.map(item => {
-        item.totalAmount = this.modalType == 0 ? item.promotionPrice * item.qty : item.totalAmount
-        item.totalCostAmount = item.showCost * item.qty
-        item.totalKsAmount = item.totalAmount - item.totalCostAmount
+        item.totalKsAmount = item.totalShowCost - item.totalAmount
       })
       return list
     },
     columns () {
       const _this = this
-      const arr = [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center', customRender: function (text, row, index) { return index + 1 } },
-        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '销售数量', dataIndex: 'qty', width: '10%', align: 'center', isShow: false, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价小计', dataIndex: 'totalAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
-      ]
-      if (_this.modalType == 0) {
-        arr.splice(2, 0, { title: '参考成本价', dataIndex: 'showCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(3, 0, { title: '售价', dataIndex: 'promotionPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(5, 0, { title: '单位', dataIndex: 'product.unit', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.push({ title: '参考成本价小计', dataIndex: 'totalCostAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.push({ title: '亏损金额', dataIndex: 'totalKsAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      } else {
-        arr.splice(2, 0, { title: '售价', dataIndex: 'price', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(4, 0, { title: '单位', dataIndex: 'productEntity.unit', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      // 特价产品,销售价小于等于0
+      if (this.modalType == 'price_less_0') {
+        return [
+          { title: '序号', dataIndex: 'no', width: '5%', align: 'center', customRender: function (text, row, index) { return index + 1 } },
+          { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '售价', dataIndex: 'price', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+          { title: '销售数量', dataIndex: 'qty', width: '10%', align: 'center', isShow: false, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '单位', dataIndex: 'productEntity.unit', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '售价小计', dataIndex: 'totalAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+        ]
+      }
+      // 特价产品,销售价是否低于成本价
+      if (this.modalType == 'price_less_cost' || _this.modalType == 'wait_up_audit_price_less_cost' || _this.modalType == 'audit_price_less_cost') {
+        return [
+          { title: '序号', dataIndex: 'no', width: '5%', align: 'center', customRender: function (text, row, index) { return index + 1 } },
+          { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '参考成本价', dataIndex: 'showCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+          { title: '售价', dataIndex: 'promotionPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+          { title: '销售数量', dataIndex: 'qty', width: '10%', align: 'center', isShow: false, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '单位', dataIndex: 'productEntity.unit', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '售价小计', dataIndex: 'totalAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+          { title: '参考成本价小计', dataIndex: 'totalShowCost', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+          { title: '亏损金额', dataIndex: 'totalKsAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+        ]
       }
-      return arr
+      return []
     }
   },
   methods: {

+ 56 - 46
src/views/salesManagement/shortageStatisticsC/list.vue

@@ -109,44 +109,44 @@
         <!-- alert -->
         <div class="tongji-bar">
           <div>
-            总客户数:<strong>{{ productTotal && (productTotal.totalBuyerQty || productTotal.totalBuyerQty==0) ? productTotal.totalBuyerQty : '--' }}</strong>,
-            总单数:<strong>{{ productTotal && (productTotal.totalRecord || productTotal.totalRecord==0) ? productTotal.totalRecord : '--' }}</strong>,
-            缺货总款数:<strong>{{ productTotal && (productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong>,
-            缺货总数量:<strong>{{ productTotal && (productTotal.totalQty || productTotal.totalQty==0) ? productTotal.totalQty : '--' }}</strong>,
-            <span v-if="$hasPermissions('M_shortageStatisticsCList_salesPrice')">缺货总金额:<strong>{{ productTotal && (productTotal.totalAmount || productTotal.totalAmount==0) ? toThousands(productTotal.totalAmount) : '--' }}</strong></span>
+            <div>
+              总客户数:<strong>{{ productTotal && (productTotal.totalBuyerQty || productTotal.totalBuyerQty==0) ? productTotal.totalBuyerQty : '--' }}</strong>,
+              总单数:<strong>{{ productTotal && (productTotal.totalRecord || productTotal.totalRecord==0) ? productTotal.totalRecord : '--' }}</strong>,
+              缺货总款数:<strong>{{ productTotal && (productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong>,
+              缺货总数量:<strong>{{ productTotal && (productTotal.totalQty || productTotal.totalQty==0) ? productTotal.totalQty : '--' }}</strong>,
+              <span v-if="$hasPermissions('M_shortageStatisticsCList_salesPrice')">缺货总金额:<strong>{{ productTotal && (productTotal.totalAmount || productTotal.totalAmount==0) ? toThousands(productTotal.totalAmount) : '--' }}</strong></span>
+            </div>
+            <div>
+              本页客户数:<strong>{{ currentTotal && (currentTotal.totalBuyerQty || currentTotal.totalBuyerQty==0) ? currentTotal.totalBuyerQty : '--' }}</strong>,
+              本页总单数:<strong>{{ currentTotal && (currentTotal.totalRecord || currentTotal.totalRecord==0) ? currentTotal.totalRecord : '--' }}</strong>,
+              本页缺货总款数:<strong>{{ currentTotal && (currentTotal.totalCategory || currentTotal.totalCategory==0) ? currentTotal.totalCategory : '--' }}</strong>,
+              本页缺货总数量:<strong>{{ currentTotal && (currentTotal.totalQty || currentTotal.totalQty==0) ? currentTotal.totalQty : '--' }}</strong>,
+              <span v-if="$hasPermissions('M_shortageStatisticsCList_salesPrice')">本页缺货总金额:<strong>{{ currentTotal && (currentTotal.totalAmount || currentTotal.totalAmount==0) ? toThousands(currentTotal.totalAmount) : '--' }}</strong></span>
+            </div>
           </div>
           <div>
-            本页客户数:<strong>{{ currentTotal && (currentTotal.totalBuyerQty || currentTotal.totalBuyerQty==0) ? currentTotal.totalBuyerQty : '--' }}</strong>,
-            本页总单数:<strong>{{ currentTotal && (currentTotal.totalRecord || currentTotal.totalRecord==0) ? currentTotal.totalRecord : '--' }}</strong>,
-            本页缺货总款数:<strong>{{ currentTotal && (currentTotal.totalCategory || currentTotal.totalCategory==0) ? currentTotal.totalCategory : '--' }}</strong>,
-            本页缺货总数量:<strong>{{ currentTotal && (currentTotal.totalQty || currentTotal.totalQty==0) ? currentTotal.totalQty : '--' }}</strong>,
-            <span v-if="$hasPermissions('M_shortageStatisticsCList_salesPrice')">本页缺货总金额:<strong>{{ currentTotal && (currentTotal.totalAmount || currentTotal.totalAmount==0) ? toThousands(currentTotal.totalAmount) : '--' }}</strong></span>
+            <hideCellMenus :defHiddenKes="defHiddenKes" v-model="hidekey"></hideCellMenus>
           </div>
         </div>
         <!-- 列表 -->
-        <s-table
+        <v-table
           class="sTable fixPagination"
           ref="table"
-          :style="{ height: tableHeight+65+'px' }"
+          :style="{ height: tableHeight+32+'px' }"
           size="small"
-          :rowKey="(record) => record.no"
           rowKeyName="no"
-          :pageSize="30"
+          :pagination="{pageSize:30}"
           :columns="columns"
           :data="loadData"
           :defaultLoadData="false"
-          :scroll="{ x: 2020, y: tableHeight }"
+          :scroll="{y: tableHeight }"
           bordered>
-          <!-- 单号 -->
-          <template slot="salesBillNo" slot-scope="text, record">
-            {{ record.salesBillNo }}
-          </template>
           <template slot="productCode" slot-scope="text, record">
-            <span style="padding-right: 15px;">{{ text }}</span>
-            <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
-            <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
+            <span style="padding-right: 10px;">{{ text }}</span>
+            <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'0.8' }"></a-badge>
+            <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'0.8' }"></a-badge>
           </template>
-        </s-table>
+        </v-table>
       </a-spin>
     </a-card>
   </div>
@@ -156,7 +156,7 @@
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
-import { STable, VSelect } from '@/components'
+import { VTable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import subarea from '@/views/common/subarea.js'
@@ -166,11 +166,12 @@ import ProductBrand from '@/views/common/productBrand.js'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import customerService from '@/views/common/customerService'
 import dealerType from '@/views/common/dealerType.js'
+import hideCellMenus from '@/views/common/hideCellMenus'
 import { oosBuyerList, oosBuyerDetailCount, oosBuyerDetailPageCount, oosDetailExport } from '@/api/oos'
 export default {
   name: 'ShortageStatisticsCList',
   mixins: [commonMixin],
-  components: { STable, VSelect, dealerSubareaScopeList, subarea, Area, rangeDate, ProductBrand, ProductType, chooseWarehouse, customerService, dealerType },
+  components: { VTable, VSelect, hideCellMenus, dealerSubareaScopeList, subarea, Area, rangeDate, ProductBrand, ProductType, chooseWarehouse, customerService, dealerType },
   data () {
     return {
       spinning: false,
@@ -221,6 +222,8 @@ export default {
               data.list[i].no = no + i + 1
               if (data.list[i].dealerEntity.dealerTypeName1) {
                 data.list[i].dealerTypeName = data.list[i].dealerEntity.dealerTypeName1 + '>' + data.list[i].dealerEntity.dealerTypeName2
+                data.list[i].offlineReasonType = data.list[i].productEntity.offlineReasonType
+                data.list[i].commonCode = data.list[i].productEntity.commonCode
               }
             }
             this.disabled = false
@@ -233,43 +236,45 @@ export default {
       },
       productType: [],
       productTotal: null,
-      currentTotal: null
+      currentTotal: null,
+      defHiddenKes: [
+        { title: '操作员', key: 'operatorName', checked: false },
+        { title: '缺货说明', key: 'offlineReasonType', checked: false },
+        { title: '通用编码', key: 'commonCode', checked: false }
+      ],
+      hidekey: []
     }
   },
   computed: {
     columns () {
       const arr = [
-        { title: '区域', dataIndex: 'subareaArea.subareaName', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: 100, align: 'center' },
-        { title: '省份', dataIndex: 'dealerEntity.provinceName', width: 60, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'dealerEntity.dealerName', width: 140, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓库', dataIndex: 'warehouseName', width: 80, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        // { title: '客户类型', dataIndex: 'dealerTypeName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '创建时间', dataIndex: 'createDate', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '区域', dataIndex: 'subareaArea.subareaName', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: 100, align: 'center' },
+        { title: '省份', dataIndex: 'dealerEntity.provinceName', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerEntity.dealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓库', dataIndex: 'warehouseName', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌', dataIndex: 'productEntity.productBrandName', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '二级分类', dataIndex: 'productEntity.productTypeName2', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: 180, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品编码', dataIndex: 'productCode', width: 120, align: 'left', scopedSlots: { customRender: 'productCode' } },
-        { title: '单位', dataIndex: 'productEntity.unit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 40, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品状态', dataIndex: 'productEntity.stateDictValue', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '缺货数量', dataIndex: 'qty', width: 60, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '缺货成本金额', dataIndex: 'totalCostAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '缺货实售金额', dataIndex: 'totalSalesAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '缺货开单金额', dataIndex: 'totalAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作员', dataIndex: 'operatorName', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '缺货说明', dataIndex: 'productEntity.offlineReasonType', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '通用编码', dataIndex: 'productEntity.commonCode', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '操作员', dataIndex: 'operatorName', key: 'operatorName', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '缺货说明', dataIndex: 'offlineReasonType', key: 'offlineReasonType', width: 80, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '通用编码', dataIndex: 'commonCode', key: 'commonCode', width: 80, align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_shortageStatisticsCList_costPrice')) { //  成本价权限
-        arr.splice(15, 0, { title: '缺货成本金额', dataIndex: 'totalShowCostAmount', width: 90, align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(15, 0, { title: '缺货成本金额', dataIndex: 'totalShowCostAmount', width: 80, align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
       if (this.$hasPermissions('M_shortageStatisticsCList_salesPrice')) { //  售价权限
         const ind = this.$hasPermissions('M_shortageStatisticsCList_costPrice') ? 16 : 15
-        arr.splice(ind, 0, { title: '缺货实售金额', dataIndex: 'totalRealSaleAmount', width: 90, align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.splice(ind + 1, 0, { title: '缺货开单金额', dataIndex: 'totalAmount', width: 90, align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(ind, 0, { title: '缺货实售金额', dataIndex: 'totalRealSaleAmount', width: 80, align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(ind + 1, 0, { title: '缺货开单金额', dataIndex: 'totalAmount', width: 80, align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
-      return arr
+      return arr.filter(item => !this.hidekey.includes(item.key))
     }
   },
   methods: {
@@ -395,7 +400,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 240
+      this.tableHeight = window.innerHeight - tableSearchH - 210
     }
   },
   watch: {
@@ -437,5 +442,10 @@ export default {
      .sTable{
        margin-top: 10px;
      }
+     .tongji-bar{
+       display: flex;
+       align-items: center;
+       justify-content:space-between;
+     }
   }
 </style>

+ 7 - 9
src/views/salesManagement/shortageStatisticsP/list.vue

@@ -91,16 +91,14 @@
           </div>
         </div>
         <!-- 列表 -->
-        <s-table
+        <v-table
           class="sTable fixPagination"
           ref="table"
-          :style="{ height: tableHeight+65+'px' }"
-          size="small"
-          :rowKey="(record) => record.no"
+          :style="{ height: tableHeight+32+'px' }"
           rowKeyName="no"
           :columns="columns"
           :data="loadData"
-          :pageSize="30"
+          :pagination="{pageSize:30}"
           :scroll="{ y: tableHeight }"
           :defaultLoadData="false"
           bordered>
@@ -109,7 +107,7 @@
             <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
             <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
           </template>
-        </s-table>
+        </v-table>
       </a-spin>
     </a-card>
   </div>
@@ -119,7 +117,7 @@
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
-import { STable, VSelect } from '@/components'
+import { VTable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import customerService from '@/views/common/customerService'
@@ -127,7 +125,7 @@ import { oosProductList, oosProductDetailCount, oosProductDetailPageCount, oosDe
 export default {
   name: 'ShortageStatisticsPList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, chooseWarehouse, customerService },
+  components: { VTable, VSelect, rangeDate, chooseWarehouse, customerService },
   data () {
     return {
       spinning: false,
@@ -287,7 +285,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 225
+      this.tableHeight = window.innerHeight - tableSearchH - 190
     }
   },
   watch: {

+ 32 - 49
src/views/salesManagement/stockPrint/list.vue

@@ -112,17 +112,7 @@
             </a-tabs>
           </div>
           <div>
-            <span>显示:</span>
-            <a-tree-select
-              size="small"
-              v-model="showCols"
-              style="min-width: 200px"
-              dropdownMatchSelectWidth
-              :maxTagCount="3"
-              :tree-data="colsArr"
-              tree-checkable
-              placeholder="请选择要显示的列"
-            />
+            <hideCellMenus :defHiddenKes="colsArr" v-model="showCols"></hideCellMenus>
           </div>
         </div>
         <!-- 列表 -->
@@ -191,13 +181,13 @@
         <!-- 查看销售单或备货单详情 -->
         <commonModal
           :modalTit="detailType?'备货单详情':'销售单详情'"
-          bodyPadding="10px"
+          bodyPadding="0"
           width="70%"
           :showFooter="false"
           :openModal="showDetailModal"
           @cancel="cancelDetail">
-          <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn"></salesDetail>
-          <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn"></dispatchDetail>
+          <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn" @close="cancelDetail"></salesDetail>
+          <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn" @close="cancelDetail"></dispatchDetail>
         </commonModal>
         <!-- 操作提示 -->
         <commonModal modalTit="操作提示" okText="暂不打印" :openModal="showPrintModal" @cancel="canselModal" @ok="updatePrintStatus">
@@ -228,15 +218,16 @@ import recordModal from './recordModal.vue'
 import commonModal from '@/views/common/commonModal.vue'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import customerService from '@/views/common/customerService'
-import salesDetail from '@/views/salesManagement/salesQueryNew/detailAll.vue'
+import salesDetail from '@/views/salesManagement/salesQueryNew/detail.vue'
 import dispatchDetail from '@/views/salesManagement/pushOrderManagement/detail.vue'
 import explainInfoModal from '@/views/salesManagement/pushOrderManagement/explainInfoModal.vue'
+import hideCellMenus from '@/views/common/hideCellMenus'
 import { dispatchlList, dispatchDetailPrint, dispatchPrintStatus } from '@/api/dispatch'
 import { printBase64Fun } from '@/libs/JGPrint.js'
 export default {
   name: 'StockPrintList',
   mixins: [commonMixin],
-  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, sendTypeModal, recordModal, Area, commonModal, salesDetail, dispatchDetail, explainInfoModal, chooseWarehouse, customerService },
+  components: { STable, VSelect, hideCellMenus, dealerSubareaScopeList, rangeDate, subarea, sendTypeModal, recordModal, Area, commonModal, salesDetail, dispatchDetail, explainInfoModal, chooseWarehouse, customerService },
   data () {
     return {
       spinning: false,
@@ -294,33 +285,39 @@ export default {
       colsArr: [
         {
           title: '销售单号',
-          value: 'salesBillNo',
-          key: 'salesBillNo'
+          key: 'salesBillNo',
+          disabled: false,
+          checked: false
         },
         {
           title: '仓库',
-          value: 'warehouseName',
-          key: 'warehouseName'
+          key: 'warehouseName',
+          disabled: false,
+          checked: false
         },
         {
           title: '业务状态',
-          value: 'billStatusDictValue',
-          key: 'billStatusDictValue'
+          key: 'billStatusDictValue',
+          disabled: false,
+          checked: false
         },
         {
           title: '单据状态',
-          value: 'voidFlagDictValue',
-          key: 'voidFlagDictValue'
+          key: 'voidFlagDictValue',
+          disabled: false,
+          checked: false
         },
         {
           title: '允许打印时间',
-          value: 'allowPrintTime',
-          key: 'allowPrintTime'
+          key: 'allowPrintTime',
+          disabled: false,
+          checked: false
         },
         {
           title: '打印次数',
-          value: 'stockUpPrintTimes',
-          key: 'stockUpPrintTimes'
+          key: 'stockUpPrintTimes',
+          disabled: false,
+          checked: false
         }
       ]
     }
@@ -338,9 +335,7 @@ export default {
         { title: '产品款数', dataIndex: 'totalCategory', width: '30px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '产品数量', dataIndex: 'totalQty', width: '30px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
-      if (this.showCols.includes('salesBillNo')) {
-        arr.splice(2, 0, { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '80px', align: 'center' })
-      }
+      arr.splice(2, 0, { title: '销售单号', dataIndex: 'salesBillNo', scopedSlots: { customRender: 'salesBillNo' }, width: '80px', align: 'center' })
 
       if (this.$hasPermissions('M_stockPrintList_salesPrice')) { //  售价权限
         const ind = this.isShowWarehouse ? 10 : 9
@@ -352,26 +347,14 @@ export default {
         arr.splice(ind + 5, 0, { title: '机油售价', dataIndex: 'receiveJyTotalAmount', width: '50px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
         arr.splice(ind + 6, 0, { title: '轮胎售价', dataIndex: 'receiveLtTotalAmount', width: '50px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
-
-      if (this.showCols.includes('warehouseName')) {
-        arr.push({ title: '仓库', dataIndex: 'warehouseName', width: '50px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
-      }
-      if (this.showCols.includes('billStatusDictValue')) {
-        arr.push({ title: '业务状态', dataIndex: 'billStatusDictValue', width: '40px', align: 'center', customRender: function (text) { return text || '--' } })
-      }
-      if (this.showCols.includes('voidFlagDictValue')) {
-        arr.push({ title: '单据状态', dataIndex: 'voidFlagDictValue', width: '40px', align: 'center', customRender: function (text) { return text || '--' } })
-      }
+      arr.push({ title: '仓库', dataIndex: 'warehouseName', width: '50px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
+      arr.push({ title: '业务状态', dataIndex: 'billStatusDictValue', width: '40px', align: 'center', customRender: function (text) { return text || '--' } })
+      arr.push({ title: '单据状态', dataIndex: 'voidFlagDictValue', width: '40px', align: 'center', customRender: function (text) { return text || '--' } })
       arr.push({ title: '备货打印状态', width: '40px', align: 'center', scopedSlots: { customRender: 'printStatus' } })
-      if (this.showCols.includes('allowPrintTime')) {
-        arr.push({ title: '允许打印时间', dataIndex: 'allowPrintTime', width: '50px', align: 'center', customRender: function (text) { return text || '--' } })
-      }
-      if (this.showCols.includes('stockUpPrintTimes')) {
-        arr.push({ title: '打印次数', dataIndex: 'stockUpPrintTimes', width: '40px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
-
+      arr.push({ title: '允许打印时间', dataIndex: 'allowPrintTime', width: '50px', align: 'center', customRender: function (text) { return text || '--' } })
+      arr.push({ title: '打印次数', dataIndex: 'stockUpPrintTimes', width: '40px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       arr.push({ title: '操作', scopedSlots: { customRender: 'action' }, width: '60px', align: 'center' })
-      return arr
+      return arr.filter(item => !this.showCols.includes(item.dataIndex))
     }
   },
   methods: {

+ 1 - 1
vue.config.js

@@ -108,7 +108,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.2.103:8602/ocs-admin',
+        // target: 'http://192.168.2.10/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
         target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,