lilei 4 年之前
父節點
當前提交
e487fa6cce

+ 12 - 0
src/api/salesDetail.js

@@ -48,6 +48,18 @@ export const salesDetailList = (params) => {
   })
 }
 
+// 销售详情列表不分页
+export const salesDetailAllList = (params) => {
+  const url = `/sales/detail/query`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
 // 修改销售明细取消数量
 export const salesDetailUpdateCancelQty = (params) => {
   return axios({

+ 66 - 0
src/api/waitDispatchDetail.js

@@ -0,0 +1,66 @@
+import { axios } from '@/utils/request'
+
+//  批量删除
+export const deleteBatch = (params) => {
+  return axios({
+    url: '/waitDispatchDetail/deleteBatch',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 下推
+export const pushDown = (params) => {
+  return axios({
+    url: `/waitDispatchDetail/pushDown/${params.salesBillSn}`,
+    method: 'get'
+  })
+}
+
+// 统计查询
+export const queryCount = (params) => {
+  return axios({
+    url: `/waitDispatchDetail/queryCount/${params.salesBillSn}`,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 列表  有分页
+export const waitDispatchDetailList = (params) => {
+  const url = `/waitDispatchDetail/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 列表  不分页
+export const waitDispatchDetailAllList = (params) => {
+  const url = `/waitDispatchDetail/query`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+//  数量修改
+export const updateQty = (params) => {
+  return axios({
+    url: '/waitDispatchDetail/updateQty',
+    data: params,
+    method: 'post'
+  })
+}
+ 
+
+
+
+
+

+ 12 - 1
src/config/router.config.js

@@ -724,7 +724,18 @@ export const asyncRouterMap = [
                   hidden: true
                   // permission: 'M_salesNew'
                 }
-              }
+              },
+              {
+                  path: 'waitDispatch/:sn',
+                  name: 'waitDispatch',
+                  component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/waitDispatch/edit.vue'),
+                  meta: {
+                    title: '下推',
+                    icon: 'monitor',
+                    hidden: true
+                    // permission: 'M_salesNew'
+                  }
+                }
             ]
           },
           {

+ 1 - 1
src/views/salesManagement/salesQuery/list.vue

@@ -293,7 +293,7 @@ export default {
     },
     // 下推
     handleDispatch (row) {
-
+      this.$router.push({ name: 'waitDispatch', params: { sn: row.salesBillSn } })
     },
     //  审核
     handleEexamine (row) {

+ 0 - 163
src/views/salesManagement/salesQuery/productSalesRecordModal.vue

@@ -1,163 +0,0 @@
-<template>
-  <a-modal
-    centered
-    class="salesRecord-modal"
-    :footer="null"
-    :maskClosable="false"
-    :title="modalTit"
-    v-model="isShow"
-    @cancle="isShow=false"
-    width="80%">
-    <div>
-      <a-tabs size="small" type="card" v-model="curTab" @change="callback">
-        <a-tab-pane key="1" tab="当前客户">
-        </a-tab-pane>
-        <a-tab-pane key="2" tab="全部客户">
-        </a-tab-pane>
-      </a-tabs>
-      <!-- 表格 -->
-      <a-table
-        class="sTable"
-        ref="table"
-        size="small"
-        :data-source="list"
-        :pagination="pagination"
-        :loading="loading"
-        :row-key="(record) => record.id"
-        :columns="columns"
-        @change="handleTableChange"
-        bordered>
-      </a-table>
-    </div>
-  </a-modal>
-</template>
-
-<script>
-import { salesRecordlList } from '@/api/salesDetail.js'
-import { STable } from '@/components'
-export default {
-  name: 'SalesRecordModal',
-  components: { STable },
-  props: {
-    openModal: { //  弹框显示状态
-      type: Boolean,
-      default: false
-    },
-    itemId: {
-      type: [Number, String],
-      default: ''
-    }
-  },
-  computed: {
-    modalTit () {
-      return '销售记录'
-    }
-  },
-  data () {
-    return {
-      isShow: this.openModal, //  是否打开弹框
-      buyerSn: null,
-      queryParam: {
-        productSn: null,
-        pageNo: 1,
-        pageSize: 10
-      },
-      // 表头
-      columns: [
-        {
-          title: '销售时间',
-          dataIndex: 'salesBillEntity.createDate',
-          align: 'center',
-          width: 250
-        },
-        {
-          title: '销售价(¥)',
-          dataIndex: 'price',
-          align: 'center',
-          width: 150
-        },
-        {
-          title: '销售数量',
-          dataIndex: 'qty',
-          align: 'center',
-          width: 150
-        },
-        {
-          title: '客户名称',
-          dataIndex: 'salesBillEntity.buyerName',
-          align: 'center'
-        }
-      ],
-      list: [],
-      pagination: {},
-      loading: false,
-      curTab: '1'
-    }
-  },
-  methods: {
-    handleTableChange (pagination, filters, sorter) {
-      console.log(pagination)
-      const pager = { ...this.pagination }
-      pager.current = pagination.current
-      this.pagination = pager
-      this.loading = true
-      this.queryParam = Object.assign(this.queryParam, {
-        results: pagination.pageSize,
-        page: pagination.current,
-        sortField: sorter.field,
-        sortOrder: sorter.order,
-        ...filters
-      })
-
-      salesRecordlList(this.queryParam).then(res => {
-        this.list = res.data.list || []
-        this.loading = false
-      })
-    },
-    //  获取详情
-    getDetail (buyerSn, productSn) {
-      this.buyerSn = buyerSn
-      if (this.curTab == 1) {
-        this.queryParam.buyerSn = buyerSn
-      } else {
-        delete this.queryParam.buyerSn
-      }
-      this.queryParam.productSn = productSn
-      this.queryParam.pageNo = 1
-      this.queryParam.pageSize = 10
-      this.loading = true
-      salesRecordlList(this.queryParam).then(res => {
-        this.list = res.data.list || []
-        this.loading = false
-      })
-    },
-    callback (key) {
-      console.log(key)
-      this.curTab = key
-      this.getDetail(this.buyerSn, this.queryParam.productSn)
-    }
-  },
-  watch: {
-    //  父页面传过来的弹框状态
-    openModal (newValue, oldValue) {
-      this.isShow = newValue
-    },
-    //  重定义的弹框状态
-    isShow (newValue, oldValue) {
-      if (!newValue) {
-        this.$emit('close')
-        this.curTab = '1'
-        this.list = []
-      }
-    }
-  }
-}
-</script>
-
-<style lang="less">
-  .salesRecord-modal{
-    .ant-modal-body {
-    	padding: 10px;
-    }
-  }
-</style>

+ 373 - 0
src/views/salesManagement/waitDispatch/edit.vue

@@ -0,0 +1,373 @@
+<template>
+  <div class="waitDispatch-wrap">
+    <a-page-header :ghost="false" :backIcon="false" @back="handleBack" >
+      <!-- 自定义的二级文字标题 -->
+      <template slot="subTitle">
+        <a id="waitDispatch-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        <span style="margin: 0 15px;color: #666;">客户名称:{{ detailData&&detailData.buyerName }}</span>
+        <!-- <a-button id="waitDispatch-edit-btn" size="small" @click="handleEdit" style="margin-left:10px" key="0">编辑</a-button> -->
+      </template>
+      <!-- 操作区,位于 title 行的行尾 -->
+      <template slot="extra">
+        <a-button key="2" id="waitDispatch-preview-btn">打印预览</a-button>
+        <a-button key="1" type="primary" id="waitDispatch-print-btn">快速打印</a-button>
+      </template>
+    </a-page-header>
+    <a-card size="small" :bordered="false" class="waitDispatch-cont" v-if="salesBillSn">
+      <!-- 查询配件列表 -->
+      <queryPart
+        ref="partQuery"
+        :salesBillSn="salesBillSn"
+        :detailData="detailData"
+        :newLoading="isInster"
+        @oneDispatch="oneDispatch"
+        @cancelProduct="cancelProduct"
+        @addProduct="insterProduct"></queryPart>
+    </a-card>
+    <a-card :bordered="false" class="waitDispatch-cont">
+      <div slot="title">
+        <div class="p-title">
+          待下推产品
+        </div>
+      </div>
+      <div class="table-operator">
+        <a-button
+          type="primary"
+          @click="delSalerDetailAll"
+          :loading="delLoading"
+          id="waitDispatch-del-all">批量移除</a-button>
+      </div>
+      <!-- 总计 -->
+      <a-alert type="info" v-if="totalData">
+        <div slot="message" class="total-bar">
+          <div>
+            本次下推款数:<strong>¥{{ totalData&&totalData.totalAmount || 0 }}</strong>;
+            本次下推数量:<strong>{{ totalData&&totalData.totalCategory || 0 }}</strong>;
+          </div>
+          <div>
+          </div>
+        </div>
+      </a-alert>
+
+      <!-- 已选配件列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :showPagination="false"
+        :scroll="{ x:1000, y: 300 }"
+        bordered>
+        <!-- 产品编码 -->
+        <template slot="productCode" slot-scope="text, record">
+          <a-badge count="促" v-if="record.promotionFlag == 1">
+            <div style="padding-right: 15px;">{{ text }}</div>
+          </a-badge>
+          <span v-else>{{ text }}</span>
+        </template>
+        <!-- 本次下推数 -->
+        <template slot="salesNums" slot-scope="text, record">
+          <editable-cell
+            size="small"
+            :text="record.qty"
+            :max="999999"
+            :min="1"
+            :precision="0"
+            @change="onCellChange(record.id, 'qty', $event)" />
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="primary"
+            :loading="delLoading"
+            class="button-error"
+            @click="handleDel(record)"
+          >移除</a-button>
+        </template>
+      </s-table>
+    </a-card>
+    <a-affix :offset-bottom="0">
+      <div
+        style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
+        <a-button
+          size="large"
+          style="width: 150px;"
+          type="primary"
+          class="button-primary"
+          @click="handleSubmit()"
+          id="productInfoList-handleSubmit">下推</a-button>
+      </div>
+    </a-affix>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import queryPart from './queryPart.vue'
+import { salesDetailBySn } from '@/api/sales'
+import { salesDetailDispatchByOneKey, insertBatchOfWaitDispatch } from '@/api/salesDetail'
+import EditableCell from '@/views/common/editInput.js'
+import { deleteBatch, pushDown, queryCount, waitDispatchDetailAllList, updateQty } from '@/api/waitDispatchDetail'
+export default {
+  name: 'SalesDetail',
+  components: { STable, VSelect, queryPart, EditableCell },
+  data () {
+    return {
+      salesBillSn: null, // 销售单sn
+      disabled: false, //  查询、重置按钮是否可操作
+      isInster: false, // 是否正在添加产品
+      delLoading: false,
+      detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
+      dataSource: [],
+      productForm: {
+        salesBillSn: ''
+      },
+      selectedRowKeys: [], // Check here to configure the default column
+      selectedRows: [],
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: 300, align: 'center' },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '剩余待下推', dataIndex: 'surplusQty', width: 150, align: 'center' },
+        { title: '本次下推数', scopedSlots: { customRender: 'salesNums' }, width: 150, align: 'center' },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.productForm.salesBillSn = this.$route.params.sn
+
+        // 查询统计
+        this.getTotalData(Object.assign(parameter, this.productForm))
+        return waitDispatchDetailAllList(Object.assign(parameter, this.productForm)).then(res => {
+          const data = res.data
+          const no = 0
+          for (var i = 0; i < data.length; i++) {
+            data[i].no = no + i + 1
+          }
+          this.disabled = false
+          this.dataSource = data
+          return data
+        })
+      },
+      totalData: null
+    }
+  },
+  methods: {
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    // 统计查询
+    getTotalData (params) {
+      queryCount(params).then(res => {
+        this.totalData = res.data || null
+      })
+    },
+    // 修改数量
+    onCellChange (id, key, value) {
+      console.log(id, key, value)
+      const dataSource = [...this.dataSource]
+      const row = dataSource.find(item => item.id === id)
+      if (row) {
+        row[key] = Number(value)
+        this.dataSource = dataSource
+      }
+      if (key == 'qty') {
+        updateQty({
+          salesBillDetailSn: row.salesBillDetailSn,
+          qty: row.qty,
+          salesBillSn: this.salesBillSn
+        }).then(res => {
+          this.resetSearchForm(true)
+          if (res.status == 200) {
+            this.$refs.partQuery.resetCurForm()
+            this.$message.success(res.message)
+          }
+        })
+      }
+    },
+    //  重置
+    resetSearchForm (flag) {
+      this.$refs.table.refresh(!!flag)
+      this.getOrderDetail()
+    },
+    // 重置列表
+    resetForm () {
+      this.$refs.table.refresh()
+    },
+    //  返回
+    handleBack () {
+      this.$router.push({ name: 'salesQueryList' })
+    },
+    // 批量删除
+    delSalerDetailAll () {
+      const _this = this
+      if (_this.selectedRowKeys.length < 1) {
+        _this.$message.warning('请在选择待下推产品!')
+        return
+      }
+      const obj = []
+      _this.selectedRows.map(item => {
+        obj.push(item.productSn)
+      })
+
+      this.$confirm({
+        title: '提示',
+        content: '确认要批量删除吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.deleteFun(obj, 1)
+        }
+      })
+    },
+    // 删除产品
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要删除吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.deleteFun(row, 0)
+        }
+      })
+    },
+    // 移除操作
+    deleteFun (row, type) {
+      const _this = this
+      _this.delLoading = true
+      deleteBatch({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn }).then(res => {
+        if (res.status == 200) {
+          _this.resetSearchForm(true)
+          _this.$message.success(res.message)
+        }
+        _this.delLoading = false
+      })
+    },
+    // 添加产品
+    insterProduct (row, promotionFlag) {
+      console.log(row)
+      // 防止多次添加产品
+      if (this.isInster) { return }
+      const _this = this
+      _this.saveNewProduct(row, promotionFlag)
+    },
+    // 保存添加的产品到销售列表
+    saveNewProduct (row, promotionFlag) {
+      this.$message.loading('正在添加产品...', 1)
+      this.isInster = true
+      insertBatchOfWaitDispatch({
+        packQty: row.productPackQty,
+        productSn: row.productSn,
+        showCos: row.lastStockCost,
+        price: row.productPrice,
+        qty: row.salesNums,
+        salesBillSn: this.detailData.salesBillSn,
+        salesBillNo: this.detailData.salesBillNo,
+        purchaseBillSn: this.detailData.purchaseBillSn,
+        purchaseBillNo: this.detailData.purchaseBillNo,
+        stockSn: row.stockSn,
+        promotableFlag: 0, // 可促销标记 有活动的传1,没活动的传0
+        promotionFlag: promotionFlag // 促销标记 正品传0,促销品传1
+      }).then(res => {
+        if (res.status == 200) {
+          this.resetSearchForm()
+          this.$refs.partQuery.resetCurForm()
+          this.$message.success('产品添加成功', 2.5)
+        }
+        this.isInster = false
+      })
+    },
+    // 批量取消产品
+    cancelProduct (row) {
+
+    },
+    // 一键下推
+    oneDispatch () {
+      this.isInster = true
+      salesDetailDispatchByOneKey({ salesBillSn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.resetSearchForm()
+          this.$refs.partQuery.resetCurForm()
+        }
+        this.isInster = false
+      })
+    },
+    //  销售单详情
+    getOrderDetail () {
+      salesDetailBySn({ salesBillSn: this.$route.params.sn }).then(res => {
+        console.log('getOrderDetail')
+        if (res.status == 200) {
+          this.detailData = res.data
+          console.log(this.detailData)
+        }
+      })
+    },
+    // 提交下推
+    handleSubmit () {
+      pushDown({ salesBillSn: this.salesBillSn }).then(res => {
+        if (res.status == 200) {
+          this.handleBack()
+          this.$message.success(res.message)
+        }
+      })
+    }
+  },
+  mounted () {
+    this.getOrderDetail()
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      console.log('beforeRouteEnter')
+      vm.salesBillSn = vm.$route.params.sn
+    })
+  }
+}
+</script>
+
+<style lang="less">
+  .waitDispatch-wrap{
+    .waitDispatch-cont{
+      margin-top: 15px;
+    }
+    .sTable{
+      margin-top: 15px;
+    }
+    .p-title{
+      font-weight: bold;
+    }
+    .p-notes{
+      span{
+        color: #FF9900;
+      }
+    }
+    .total-bar{
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      > div{
+        &:last-child{
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+          > div{
+            padding: 0 10px;
+          }
+        }
+      }
+    }
+    .redBg-row{
+      background-color: #f5cdc8;
+    }
+  }
+
+</style>

+ 248 - 0
src/views/salesManagement/waitDispatch/queryPart.vue

@@ -0,0 +1,248 @@
+<template>
+  <div class="productInfoList-wrap">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品名称">
+              <a-input id="productInfoList-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品编码">
+              <a-input id="productInfoList-code" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="4" :sm="24">
+            <a-form-item label="是否促销品">
+              <v-select
+                code="FLAG"
+                id="productInfoList-promotionFlag"
+                v-model="queryParam.promotionFlag"
+                allowClear
+                placeholder="请选择是否"
+              ></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="4" :sm="24">
+            <a-form-item label="类型">
+              <a-select default-value="0" @change="handlePtypeChange">
+                <a-select-option value="0">
+                  全部产品
+                </a-select-option>
+                <a-select-option value="1">
+                  剩余待下推数量>0的产品
+                </a-select-option>
+                <a-select-option value="2">
+                  可全部下推的产品
+                </a-select-option>
+                <a-select-option value="3">
+                  不可全部下推的产品
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="4" :sm="24">
+            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
+            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" id="productInfoList-reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 按钮 -->
+    <div class="table-operator">
+      <a-button type="primary" class="button-error" @click="handlePlAdd">批量添加</a-button>
+      <a-button type="primary" class="button-info" @click="handlePlCancel">批量取消</a-button>
+      <a-button type="primary" class="button-warning" @click="handleOneDispatch">有货一键下推</a-button>
+    </div>
+    <!-- alert -->
+    <a-alert type="info" style="margin-bottom: 15px;" v-if="detailData">
+      <div slot="message">
+        总销售数量:<strong>{{ detailData.totalQty || 0 }}</strong>;已取消数量:<strong>{{ detailData.totalCancelQty || 0 }}</strong>;已下推数量:<strong>{{ detailData.totalPushedQty || 0 }}</strong>;待下推数量:<strong>{{ detailData.totalUnpushedQty || 0 }}</strong>;<br/>
+        总售价:<strong>{{ detailData.totalAmount || 0 }}</strong>;总成本:<strong>{{ detailData.totalCost || 0 }}</strong>;总毛利:<strong>{{ detailData.grossProfit || 0 }}</strong>;已取消金额:<strong>{{ detailData.totalCancelAmount || 0 }}</strong>;已下推金额:<strong>{{ detailData.totalPushedAmount || 0 }}</strong>;待下推金额:<strong>{{ detailData.totalUnpushedAmount || 0 }}</strong>;
+      </div>
+    </a-alert>
+
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :showPagination="false"
+      :data="loadData"
+      :scroll="{ x: 1400, y: 300 }"
+      bordered>
+      <!-- 取消数量 -->
+      <template slot="nums" slot-scope="text, record">
+        <div v-if="record.surplusQty>0" @dblclick.stop>
+          <a-input-number
+            size="small"
+            v-model="record.cancelNums"
+            :precision="0"
+            :min="0"
+            :max="999999"
+            placeholder="请输入" />
+        </div>
+        <div v-else>--</div>
+      </template>
+      <!-- 产品编码 -->
+      <template slot="productCode" slot-scope="text, record">
+        <a-badge count="促" v-if="record.promotionFlag == 1">
+          <div style="padding-right: 15px;">{{ text }}</div>
+        </a-badge>
+        <span v-else>{{ text }}</span>
+      </template>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button
+          size="small"
+          type="primary"
+          class="button-info"
+          :loading="newLoading"
+          @click="handleAdd(record)"
+          id="productInfoList-edit-btn">添加</a-button>
+      </template>
+    </s-table>
+  </div>
+</template>
+
+<script>
+import { salesDetailAllList } from '@/api/salesDetail'
+import { STable, VSelect } from '@/components'
+export default {
+  name: 'QueryPart',
+  components: { STable, VSelect },
+  props: {
+    salesBillSn: {
+      type: [Number, String],
+      default: ''
+    },
+    newLoading: Boolean,
+    detailData: Object
+  },
+  data () {
+    return {
+      advanced: false, // 高级搜索 展开/关闭
+      showSetting: false, // 设置弹框
+      productType: [],
+      queryParam: {
+        productCode: '', //  产品编码
+        productName: '', //  产品名称
+        promotionFlag: undefined, //  是否促销品
+        brandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '' //  产品三级分类
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出loading
+      selectedRowKeys: [], // Check here to configure the default column
+      selectedRows: [],
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: 200, align: 'center' },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: 200, align: 'center' },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 140, align: 'center', customRender: function (text) { return text == '' ? text : '--' } },
+        { title: '成本价', dataIndex: 'showCost', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '销售价', dataIndex: 'price', width: 150, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '可用库存', dataIndex: 'kc', width: 150, align: 'center' },
+        { title: '销售数量', dataIndex: 'qty', width: 150, align: 'center' },
+        { title: '已取消', dataIndex: 'cancelQty', width: 150, align: 'center' },
+        { title: '已下推', dataIndex: 'pushedQty', width: 150, align: 'center' },
+        { title: '剩余待下推', dataIndex: 'surplusQty', width: 150, align: 'center' },
+        { title: '取消数量', dataIndex: 'cancelNums', scopedSlots: { customRender: 'nums' }, width: 150, align: 'center' },
+        { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.queryParam.salesBillSn = this.salesBillSn
+        return salesDetailAllList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data = res.data
+          data = data.filter(item => item != null)
+          const no = 0
+          for (var i = 0; i < data.length; i++) {
+            data[i].no = no + i + 1
+            data[i].cancelNums = 1
+          }
+          this.disabled = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    // 类型变化,过滤列表
+    handlePtypeChange () {
+
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.promotionFlag = undefined
+      this.queryParam.brandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.productType = []
+      this.$refs.table.refresh(true)
+    },
+    // 刷新当前页面
+    resetCurForm () {
+      this.$refs.table.refresh()
+    },
+    // 添加
+    handleAdd (row) {
+      this.$emit('add', row)
+    },
+    // 批量添加
+    handlePlAdd () {
+      const _this = this
+      if (_this.selectedRowKeys.length < 1) {
+        _this.$message.warning('请在选择产品!')
+        return
+      }
+      const obj = []
+      _this.selectedRows.map(item => {
+        obj.push(item.productSn)
+      })
+
+      this.$emit('addProduct', obj)
+    },
+    // 批量取消
+    handlePlCancel () {
+      const _this = this
+      if (_this.selectedRowKeys.length < 1) {
+        _this.$message.warning('请在选择产品!')
+        return
+      }
+      const obj = []
+      _this.selectedRows.map(item => {
+        obj.push(item.productSn)
+      })
+
+      this.$emit('cancelProduct', obj)
+    },
+    // 一键下推
+    handleOneDispatch () {
+      this.$emit('oneDispatch')
+    },
+    //  产品分类  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] : ''
+    }
+  }
+}
+</script>