Browse Source

迭代46功能

lilei 10 months ago
parent
commit
ad1940f2db

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1723685666669
+  "version": 1724039386878
 }

+ 1 - 1
src/api/sales.js

@@ -179,7 +179,7 @@ export const supperCodeByVin = (params) => {
 // 销售 详情  打印
 export const salesDetailPrint = params => {
   const data = {
-    url: `/sales/print/${params.sn}/${params.type}/${params.printOrgCode}/${params.printAllName}/${params.remarksShowFlag}/${params.priceFlag}`,
+    url: `/sales/print/${params.sn}/${params.type}/${params.printOrgCode}/${params.printAllName}/${params.remarksShowFlag}/${params.priceFlag}/${params.printNo}`,
     method: 'get',
     headers:{
       'module': encodeURIComponent(params.type=='INK' ? '喷墨打印':'针式打印')

+ 25 - 0
src/config/router.config.js

@@ -2446,6 +2446,31 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/reportData/frozenProductReport',
+            redirect: '/reportData/frozenProductReport/list',
+            name: 'frozenProductReport',
+            component: BlankLayout,
+            meta: {
+              title: '冻结产品报表',
+              icon: 'profile',
+              // permission: 'M_frozenProductReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'frozenProductReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/frozenProductReport/list.vue'),
+                meta: {
+                  title: '冻结产品报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                  // permission: 'M_frozenProductReportList'
+                }
+              }
+            ]
+          },
           {
             path: '/reportData/storeReceivedSendStorageReport',
             redirect: '/reportData/storeReceivedSendStorageReport/list',

+ 25 - 2
src/views/common/productType.js

@@ -31,6 +31,10 @@ const ProductType = {
     tenantId: {
       type: String,
       default: ''
+    },
+    level:{
+      type: Number,
+      default: 3
     }
   },
   data () {
@@ -55,6 +59,24 @@ const ProductType = {
       this.defaultVal = value
       this.$emit('change', this.defaultVal)
     },
+    // 格式化数据
+    formatData(data){
+      if(this.level == 1){
+         data.forEach(item => {
+           if(item.children) item.children = []
+         })
+      }
+      if(this.level == 2){
+         data.forEach(item => {
+           if(item.children) {
+             item.children.forEach(child => {
+                if(child.children) child.children = []
+             })
+           }
+         })
+      }
+      return data
+    },
     //  产品分类列表 sysFlag: 1 箭冠 0 自建
     getProductType () {
       const params = {}
@@ -67,7 +89,8 @@ const ProductType = {
       if(this.isDealer){
         dealerProductTypeList(params).then(res => {
           if (res.status == 200) {
-            this.productTypeList = res.data
+            this.productTypeList = this.formatData(res.data)
+            console.log(this.formatData(res.data))
           } else {
             this.productTypeList = []
           }
@@ -75,7 +98,7 @@ const ProductType = {
       }else{
         productTypeQuery(params).then(res => {
           if (res.status == 200) {
-            this.productTypeList = res.data
+            this.productTypeList = this.formatData(res.data)
           } else {
             this.productTypeList = []
           }

+ 12 - 8
src/views/customerManagement/customerInfo/edit.vue

@@ -74,12 +74,6 @@
               </a-form-model-item>
             </a-col>
             <a-col :span="8" v-if="form.relationTypeDictValue">
-              <!-- <a-form-model-item label="是否卫星仓客户" prop="satelliteFlag">
-                <span style="padding-left: 11px;">{{ form.satelliteFlag == 1 ? '是' : '否' }}</span>
-              </a-form-model-item> -->
-              <!--  <a-form-model-item label="是否为下级" prop="satelliteFlag">
-                <span style="padding-left: 11px;">{{ form.satelliteFlag == 1 ? '是' : '否' }}</span>
-              </a-form-model-item> -->
               <a-form-model-item label="客户关系" prop="relationTypeDictValue">
                 <span style="padding-left: 11px;">{{ form.relationTypeDictValue || '--' }}</span>
               </a-form-model-item>
@@ -104,6 +98,13 @@
               </a-form-model-item>
             </a-col>
           </a-row>
+          <a-row :gutter="15">
+            <a-col :span="8" v-if="form.relationType=='child'">
+              <a-form-model-item label="采购范围" prop="scope">
+                <a-checkbox v-model="form.scope" :checked="form.scope" id="customerManagementEdit-scope">自建产品</a-checkbox>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
           <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;margin-top: 30px;">
             <a-button type="primary" @click="handleSubmit" size="large" id="customerManagementEdit-btn-submit" style="padding: 0 60px;">保存</a-button>
           </a-form-model-item>
@@ -155,7 +156,8 @@ export default {
         relationTypeDictValue: undefined, // 客户关系
         customerTypeSn: undefined, //  客户类型
         priceType: '', //  价格类型
-        settleStyleSn: undefined //  收款方式
+        settleStyleSn: undefined, //  收款方式
+        scope: true // 采购范围
       },
       areaVal: [], // 地区值
       rules: {
@@ -163,7 +165,8 @@ export default {
         contactMobile: [{ required: false, pattern: /^\d{11}$/, message: '请输入正确的手机号', trigger: 'blur' }],
         countySn: [{ required: true, message: '请选择客户地址', trigger: 'change' }],
         priceType: [{ required: true, message: '请选择价格类型', trigger: 'change' }],
-        settleStyleSn: [{ required: true, message: '请选择收款方式', trigger: 'change' }]
+        settleStyleSn: [{ required: true, message: '请选择收款方式', trigger: 'change' }],
+        scope: [{ required: true, message: '请选择采购范围', trigger: 'change' }]
       },
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
@@ -220,6 +223,7 @@ export default {
           const form = JSON.stringify(_this.form)
           const formInfo = JSON.parse(form)
           delete formInfo.satelliteFlag
+          formInfo.scope = formInfo.scope ? 1 : 0 // 采购范围
           formInfo.id = this.$route.params.id && this.model == 'page' ? this.$route.params.id : null
           _this.spinning = true
           custSave(formInfo).then(res => {

+ 67 - 17
src/views/inventoryManagement/inventoryQuery/detailModal.vue

@@ -7,7 +7,7 @@
     :title="modalTit"
     v-model="isShow"
     @cancel="isShow=false"
-    :width="960">
+    width="75%">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 合计 -->
       <a-alert type="info" style="margin-bottom:10px">
@@ -31,8 +31,28 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ y: 500 }"
+        :scroll="{ y: 500,x: tableWidth }"
         bordered>
+        <!-- 操作 -->
+        <template slot="putCost" slot-scope="text, record">
+          <a-input-number
+            :id="'salesEdit-price-'+record.productSn"
+            size="small"
+            v-model="record.putCost"
+            :precision="2"
+            :min="0"
+            :max="999999"
+            placeholder="请输入"
+            @blur="e => priceBlur(e.target.value, record)"
+            style="width: 100%;" />
+        </template>
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-primary"
+            :id="'inventoryQueryDetail-editPrice-'+record.id">修改成本单价</a-button>
+        </template>
       </s-table>
       <div class="btn-cont">
         <a-button id="inventoryQueryDetail-detail-modal-back" @click="isShow = false">返回列表</a-button>
@@ -66,24 +86,27 @@ export default {
     modalTit () {
       return '库存详情'
     },
+    tableWidth () {
+      return window.innerWidth * 0.75 - 30
+    },
     // 列
     columns () {
-      const _this = this
       const arr = [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '17%', align: 'left', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库时间', dataIndex: 'putTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '10%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '可用库存数量', dataIndex: 'currentQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '冻结库存数量', dataIndex: 'freezeQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-        // { title: '成本单价', dataIndex: 'putCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '序号', dataIndex: 'no', width: 40, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: 150, align: 'left', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '批次号', dataIndex: 'batchNo', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库时间', dataIndex: 'putTime', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '可用库存数量', dataIndex: 'currentQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '冻结库存数量', dataIndex: 'freezeQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(10, 0, { title: '成本单价', dataIndex: 'putCost', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '成本单价', dataIndex: 'putCost', width: 100, align: 'right', scopedSlots: { customRender: 'putCost' }, fixed: 'right' })
+        // arr.push({ title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' })
       }
       return arr
     }
@@ -96,17 +119,19 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return stockDetailList(Object.assign(parameter, { stockSn: this.nowData && this.nowData.stockSn || '', existStockFlag: '1' })).then(res => {
+        const queryParams = Object.assign(parameter, { stockSn: this.nowData && this.nowData.stockSn || '', existStockFlag: '1' })
+        return stockDetailList(queryParams).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              data.list[i].putCostBackups = data.list[i].putCost
             }
             this.disabled = false
             // 总计
-            this.getTotal(Object.assign(parameter, { stockSn: this.nowData && this.nowData.stockSn || '', existStockFlag: '1' }))
+            this.getTotal(queryParams)
           }
           this.spinning = false
           return data
@@ -125,6 +150,28 @@ export default {
           this.currentStock = null
         }
       })
+    },
+    // 已选产品 售价 input 输入框 blur
+    priceBlur (val, record) {
+      this.dataSource = record || []
+      //  光标移出,值发生改变再调用编辑接口
+      if (val && val != record.putCostBackups) {
+        this.spinning = true
+        salesDetailUpdatePrice({
+          id: record.id,
+          newConst: record.putCost,
+          putCost: record.putCostBackups
+        }).then(res => {
+          if (res.status == 200) {
+            this.$message.info(res.message)
+          } else {
+            record.putCost = record.putCostBackups
+          }
+          this.spinning = false
+        })
+      } else {
+        record.putCost = record.putCostBackups
+      }
     }
   },
   watch: {
@@ -146,6 +193,9 @@ export default {
 
 <style lang="less">
   .inventoryQueryDetail-modal{
+    .ant-input-number-sm input{
+      text-align:right;
+    }
     .btn-cont {
       text-align: center;
       margin: 5px 0 10px;

+ 299 - 0
src/views/reportData/frozenProductReport/list.vue

@@ -0,0 +1,299 @@
+<template>
+  <a-card size="small" :bordered="false" class="frozenProductReportList-wrap">
+    <!-- 搜索条件 -->
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="frozenProductReportList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="queryParam"
+          :rules="rules"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          @keyup.enter.native="handleSearch" >
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="冻结生成时间">
+                <rangeDate id="frozenProductReportList-time" ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品编码">
+                <a-input id="frozenProductReportList-code" v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品名称">
+                <a-input id="frozenProductReportList-name" v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
+              </a-form-model-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="关联单据号">
+                  <a-input id="frozenProductReportList-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入关联单据号"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="单据类型">
+                  <v-select
+                    v-model="queryParam.bizType"
+                    ref="bizType"
+                    :isEnable="true"
+                    id="frozenProductReportList-bizType"
+                    code="SETTLE_FLOW_BIZ_TYPE"
+                    placeholder="请选择单据类型"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="单位名称">
+                  <a-input id="frozenProductReportList-burName" v-model.trim="queryParam.burName" allowClear placeholder="请输入单位名称"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="仓库仓位">
+                  <a-cascader
+                    v-model="queryParam.warehouseCascade"
+                    expand-trigger="hover"
+                    :options="warehouseCascadeData"
+                    :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
+                    id="frozenProductReportList-warehouseCascade"
+                    placeholder="请选择仓库仓位"
+                    @change="warehouseCascadeChange"
+                    allowClear
+                    style="width: 100%;" />
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="frozenProductReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="frozenProductReportList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                v-if="$hasPermissions('B_receivedSendStorageReportExport')"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="frozenProductReportList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px" id="frozenProductReportList-advanced">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <a-alert type="info" style="margin-bottom:10px">
+        <div slot="message">
+          冻结数量:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
+          总成本:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? toThousands(totalData.totalAmount) : '--' }}</strong>;
+          总售价:<strong>{{ totalData&&(totalData.discountAmount || totalData.discountAmount==0) ? toThousands(totalData.discountAmount) : '--' }}</strong>;
+          折后总售价:<strong>{{ totalData&&(totalData.discountedAmount || totalData.discountedAmount==0) ? toThousands(totalData.discountedAmount) : '--' }}</strong>;
+        </div>
+      </a-alert>
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1500 }"
+        :defaultLoadData="false"
+        bordered>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import getDate from '@/libs/getDate.js'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
+import moment from 'moment'
+import { warehouseCascadeList } from '@/api/warehouse'
+import { reportPageList, reportStockPutOutCount, reportStockPutOutExport } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate, ProductType, ProductBrand },
+  mixins: [commonMixin],
+  data () {
+    const _this = this
+    return {
+      advanced: true, // 高级搜索 展开/关闭
+      spinning: false,
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        time: [ // 时间
+          getDate.getMonthDays(3).starttime,
+          getDate.getMonthDays(3).endtime
+        ],
+        beginDate: getDate.getMonthDays(3).starttime, // 开始时间
+        endDate: getDate.getMonthDays(3).endtime, // 结束时间
+        productEntity: {
+          code: '', //  产品编码
+          name: '' //  产品名称
+        },
+        warehouseCascade: [], // 仓库仓位列表
+        warehouseSn: undefined, //  仓库
+        warehouseLocationSn: undefined // 仓位
+      },
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      rules: {
+        'time': [{ required: true, message: '请选择日期(最多查看一年)', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 50, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 120, align: 'left', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: 150, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 120, align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '关联单据号', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据类型', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据审核时间', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位名称', dataIndex: 'productEntity.unit', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '冻结数量', dataIndex: 'freezeQty', width: 100, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总成本(¥)', dataIndex: 'freezePrice', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '总售价(¥)', dataIndex: 'freezeAmount', width: 100, align: 'right', sorter: true, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折后总售价(¥)', dataIndex: 'freezeAmount', width: 100, align: 'right', sorter: true, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.spinning = true
+        delete params.warehouseCascade
+        return reportPageList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            // 总计
+            this.getCount(params)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      totalData: {}, // 合计
+      warehouseCascadeData: [] //  仓库仓位
+    }
+  },
+  methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.table.refresh(true)
+    },
+    // 查询总计
+    getCount (params) {
+      reportStockPutOutCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getMonthDays(3).starttime
+      this.queryParam.endDate = getDate.getMonthDays(3).endtime
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.productEntity.code = ''
+      this.queryParam.productEntity.name = ''
+      this.queryParam.warehouseSn = undefined
+      this.queryParam.warehouseLocationSn = undefined
+      this.queryParam.warehouseCascade = []
+      this.totalData = null
+      this.$refs.table.clearTable()
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.refresh(true)
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          reportStockPutOutExport(params).then(res => {
+            downloadExcel(res, '收发存报表')
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    //  仓库仓位  级联  列表
+    getWarehouseCascade () {
+      warehouseCascadeList({}).then(res => {
+        if (res.status == 200) {
+          res.data.map(item => {
+            item.sn = item.warehouseSn
+            if (item.warehouseLocationList) {
+              item.warehouseLocationList.map(subItem => {
+                subItem.sn = subItem.warehouseLocationSn
+              })
+            }
+          })
+          this.warehouseCascadeData = res.data
+        } else {
+          this.warehouseCascadeData = []
+        }
+      })
+    },
+    // 仓库仓位change
+    warehouseCascadeChange (val) {
+      if (val && val.length > 0) {
+        this.queryParam.warehouseSn = val[0] || ''
+        this.queryParam.warehouseLocationSn = val[1] || ''
+      } else {
+        this.queryParam.warehouseSn = ''
+        this.queryParam.warehouseLocationSn = ''
+      }
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>

+ 10 - 9
src/views/reportData/purchaseReceiptReport/purchaseReceiptDetail.vue

@@ -121,16 +121,17 @@ export default {
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '采购入库单号', dataIndex: 'receivingBillNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '采购入库单号', dataIndex: 'receivingBillNo', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商名称', dataIndex: 'purchaseTargetName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '19%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '采购数量', dataIndex: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库数量', dataIndex: 'putQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '采购成本', dataIndex: 'totalAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '入库成本', dataIndex: 'putAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '财务审核时间', dataIndex: 'auditTime', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '采购数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库数量', dataIndex: 'putQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购成本', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '入库成本', dataIndex: 'putAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '财务审核时间', dataIndex: 'auditTime', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {

+ 8 - 7
src/views/reportData/purchaseReceiptReport/purchaseReceiptOrder.vue

@@ -84,13 +84,14 @@ export default {
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '采购入库单号', dataIndex: 'receivingBillNo', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库款数', dataIndex: 'totalPutCategory', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '采购数量', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库数量', dataIndex: 'totalPutQty', 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: 'totalPutAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '采购入库单号', dataIndex: 'receivingBillNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商名称', dataIndex: 'purchaseTargetName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库款数', dataIndex: 'totalPutCategory', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购数量', dataIndex: 'totalQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库数量', dataIndex: 'totalPutQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购成本', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '入库成本', dataIndex: 'totalPutAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '财务审核时间', dataIndex: 'auditTime', width: '16%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       // 加载数据方法 必须为 Promise 对象

+ 8 - 6
src/views/reportData/receivedSendStorageReport/list.vue

@@ -79,7 +79,9 @@
             发出数量:{{ (totalData && (totalData.outQty || totalData.outQty==0)) ? totalData.outQty : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             发出金额:{{ (totalData && (totalData.outAmount || totalData.outAmount==0)) ? toThousands(totalData.outAmount) : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             结存数量:{{ (totalData && (totalData.endQty || totalData.endQty==0)) ? totalData.endQty : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-            结存金额:{{ (totalData && (totalData.endAmount || totalData.endAmount==0)) ? toThousands(totalData.endAmount) : '--' }}
+            结存金额:{{ (totalData && (totalData.endAmount || totalData.endAmount==0)) ? toThousands(totalData.endAmount) : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            冻结数量:{{ (totalData && (totalData.freezeQty || totalData.freezeQty==0)) ? totalData.freezeQty : '--' }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            冻结金额:{{ (totalData && (totalData.freezeAmount || totalData.freezeAmount==0)) ? toThousands(totalData.freezeAmount) : '--' }}
           </span>
         </template>
       </s-table>
@@ -134,14 +136,11 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: 120, align: 'left', customRender: function (text) { return text || '--' }, sorter: true },
-        { title: '产品名称', dataIndex: 'productEntity.name', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: 150, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '品牌', dataIndex: 'productEntity.productBrandName', width: 130, align: 'left', customRender: function (text) { return text || '--' } },
         { title: '三级分类', dataIndex: 'productEntity.productTypeName3', width: 130, align: 'left', customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 120, align: 'left', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'productEntity.unit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '期初数量', dataIndex: 'beginQty', width: 80, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '期初单价(¥)', dataIndex: 'beginPrice', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        // { title: '期初金额(¥)', dataIndex: 'beginAmount', width: 100, align: 'right', sorter: true, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '收入数量', dataIndex: 'putQty', width: 80, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '收入单价(¥)', dataIndex: 'putPrice', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '收入金额(¥)', dataIndex: 'putAmount', width: 100, align: 'right', sorter: true, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
@@ -150,7 +149,10 @@ export default {
         { title: '发出金额(¥)', dataIndex: 'outAmount', width: 100, align: 'right', sorter: true, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '结存数量', dataIndex: 'endQty', width: 80, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '结存单价(¥)', dataIndex: 'endPrice', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '结存金额(¥)', dataIndex: 'endAmount', width: 100, align: 'right', sorter: true, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+        { title: '结存金额(¥)', dataIndex: 'endAmount', width: 100, align: 'right', sorter: true, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '冻结数量', dataIndex: 'freezeQty', width: 80, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '冻结单价(¥)', dataIndex: 'freezePrice', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '冻结金额(¥)', dataIndex: 'freezeAmount', width: 100, align: 'right', sorter: true, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {

+ 11 - 4
src/views/reportData/salesDetailReport/list.vue

@@ -58,7 +58,13 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="产品分类">
-                <ProductType id="salesDetailReportList-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
+                <ProductType
+                  id="salesDetailReportList-productType"
+                  placeholder="请选择产品分类"
+                  :level="2"
+                  :isDealer="true"
+                  @change="changeProductType"
+                  v-model="productType"></ProductType>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -223,7 +229,8 @@ export default {
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
               if (data.list[i].productEntity) {
-                data.list[i].productTypeName = data.list[i].productEntity.productTypeName1 + '>' + data.list[i].productEntity.productTypeName2 + '>' + data.list[i].productEntity.productTypeName3
+                data.list[i].productTypeName = data.list[i].productEntity.productTypeName2
+                // data.list[i].productTypeName = data.list[i].productEntity.productTypeName1 + '>' + data.list[i].productEntity.productTypeName2 + '>' + data.list[i].productEntity.productTypeName3
               }
             }
             this.disabled = false
@@ -251,8 +258,8 @@ export default {
         { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'productEntity.code', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌', dataIndex: 'productEntity.productBrandName', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分类', dataIndex: 'productTypeName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '12%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '二级分类', dataIndex: 'productTypeName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'productEntity.unit', width: '3%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '数量', dataIndex: 'productQty', width: '3%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },

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

@@ -247,7 +247,7 @@ export default {
       const _this = this
       _this.spinning = true
       let url = salesDetailPrint
-      const params = { sn: this.outBizSn || this.$route.params.sn, printOrgCode: this.printOrgCode ? 1 : 0, printAllName: this.printAllName ? 1 : 0, remarksShowFlag: 0, priceFlag: 1 }
+      const params = { sn: this.outBizSn || this.$route.params.sn, printOrgCode: this.printOrgCode ? 1 : 0, printAllName: this.printAllName ? 1 : 0, remarksShowFlag: 0, priceFlag: 1, printNo: 1 }
       if (type == 'export') { //  导出
         url = salesDetailExport
       }

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

@@ -360,7 +360,7 @@ export default {
       const _this = this
       _this.spinning = true
       let url = salesDetailPrint
-      const params = { sn: this.outBizSn || this.$route.params.sn, printOrgCode: this.printOrgCode ? 1 : 0, printAllName: this.printAllName ? 1 : 0, remarksShowFlag: 0, priceFlag: 1 }
+      const params = { sn: this.outBizSn || this.$route.params.sn, printOrgCode: this.printOrgCode ? 1 : 0, printAllName: this.printAllName ? 1 : 0, remarksShowFlag: 0, priceFlag: 1, printNo: 1 }
       if (type == 'export') { //  导出
         url = salesDetailExport
       }

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

@@ -86,7 +86,7 @@ export default {
         { title: '销售时间', dataIndex: 'salesBillEntity.createDate', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '销售价', dataIndex: 'price', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '销售数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '客户名称', dataIndex: 'salesBillEntity.buyerNameCurrent', width: 250, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'salesBillEntity.buyerNameCurrent', width: 250, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据来源', dataIndex: 'salesBillEntity.sourceTypeDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
       ],
       list: [], // 列表数据

+ 11 - 1
src/views/salesManagement/salesQueryNew/detail.vue

@@ -17,11 +17,13 @@
         <template slot="extra" v-if="outBizSn ? $hasPermissions('B_outboundOrderDetail') : $hasPermissions('B_salesPrint')">
           <div style="margin-top: 5px;">
             <PrintPanel ref="printBox" position="bottomRight" :disabled="localDataSource.length==0" @handlePrint="handlePrint">
-              <div style="padding:10px;" slot="extendCons">
+              <div style="padding:10px;line-height: 30px;" slot="extendCons">
                 <a-checkbox v-model="printAllName" :checked="printAllName" id="salesQuery-printAllName">打印完整产品名称</a-checkbox>
                 <a-checkbox v-model="printOrgCode" :checked="printOrgCode" id="salesQuery-printOrgCode">打印原厂编码</a-checkbox>
                 <a-checkbox v-model="printPrice" :checked="printPrice" id="salesQuery-printPrice">打印售价</a-checkbox>
+                <br>
                 <a-checkbox v-model="printRemarks" :checked="printRemarks" id="salesQuery-printRemarks">打印备注</a-checkbox>
+                <a-checkbox v-model="printNo" :checked="printNo" id="salesQuery-printNo">打印销售单号</a-checkbox>
               </div>
             </PrintPanel>
           </div>
@@ -166,6 +168,7 @@ export default {
       printAllName: false, // 是否打印全部名称
       printRemarks: false, // 是否打印备注
       printPrice: false, // 是否打印价格
+      printNo: true, // 是否打印销售单号
       showOutInModal: false, // 出库明细弹框
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -260,6 +263,7 @@ export default {
         printOrgCode: this.printOrgCode ? 1 : 0,
         printAllName: this.printAllName ? 1 : 0,
         remarksShowFlag: this.printRemarks ? 1 : 0,
+        printNo: this.printNo ? 1 : 0,
         priceFlag: this.printPrice ? 1 : 0
       }
       if (type == 'export') { //  导出
@@ -300,6 +304,9 @@ export default {
         vm.printAllName = localStorage.getItem('printAllName-' + this.$store.state.user.info.orgId) == 'true'
         vm.printRemarks = localStorage.getItem('printRemarks-' + this.$store.state.user.info.orgId) == 'true'
         vm.printPrice = localStorage.getItem('printPrice-' + this.$store.state.user.info.orgId) == 'true'
+        const printNo = localStorage.getItem('printNo-' + this.$store.state.user.info.orgId)
+        console.log(printNo)
+        vm.printNo = printNo ? printNo == 'true' : true
         // 查询列表
         vm.$refs.table.refresh(true)
         // 获取单据详情
@@ -320,6 +327,9 @@ export default {
     },
     printAllName (newValue, oldValue) {
       localStorage.setItem('printAllName-' + this.$store.state.user.info.orgId, newValue)
+    },
+    printNo (newValue, oldValue) {
+      localStorage.setItem('printNo-' + this.$store.state.user.info.orgId, newValue)
     }
   },
   mounted () {

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

@@ -27,6 +27,7 @@
               <a-checkbox v-model="printOrgCode" :checked="printOrgCode" id="salesQuery-printOrgCode">打印原厂编码</a-checkbox>
               <a-checkbox v-model="printPrice" :checked="printPrice" id="salesQuery-printPrice">打印售价</a-checkbox>
               <a-checkbox v-model="printRemarks" :checked="printRemarks" id="salesQuery-printRemarks">打印备注</a-checkbox>
+              <a-checkbox v-model="printNo" :checked="printNo" id="salesQuery-printNo">打印销售单号</a-checkbox>
             </div>
           </PrintPanel>
           <a-divider type="vertical" v-if="detailData&&detailData.totalCategory" />
@@ -383,6 +384,7 @@ export default {
       printOrgCode: false, // 是否打印原创编码
       printAllName: false, // 是否打印全部名称
       printRemarks: false, // 是否打印备注
+      printNo: true, // 是否打印销售单号
       printPrice: false, // 是否打印价格
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -488,6 +490,7 @@ export default {
         printOrgCode: this.printOrgCode ? 1 : 0,
         printAllName: this.printAllName ? 1 : 0,
         remarksShowFlag: this.printRemarks ? 1 : 0,
+        printNo: this.printNo ? 1 : 0,
         priceFlag: this.printPrice ? 1 : 0
       }
       if (type == 'export') { //  导出
@@ -930,6 +933,8 @@ export default {
         vm.printAllName = localStorage.getItem('printAllName-' + this.$store.state.user.info.orgId) == 'true'
         vm.printRemarks = localStorage.getItem('printRemarks-' + this.$store.state.user.info.orgId) == 'true'
         vm.printPrice = localStorage.getItem('printPrice-' + this.$store.state.user.info.orgId) == 'true'
+        const printNo = localStorage.getItem('printNo-' + this.$store.state.user.info.orgId)
+        vm.printNo = printNo ? printNo == 'true' : true
         // 获取详情
         vm.getOrderDetail(true)
       })
@@ -949,6 +954,9 @@ export default {
     printRemarks (newValue, oldValue) {
       localStorage.setItem('printRemarks-' + this.$store.state.user.info.orgId, newValue)
     },
+    printNo (newValue, oldValue) {
+      localStorage.setItem('printNo-' + this.$store.state.user.info.orgId, newValue)
+    },
     showSearch (newValue, oldValue) {
       this.setTableH()
     },

+ 38 - 71
src/views/salesManagement/salesQueryNew/productSalesRecordModal.vue

@@ -8,7 +8,7 @@
     @close="isShow=false"
     :z-index="150"
     wrapClassName="salesRecord-modal jg-drawer-wrap"
-    width="70%">
+    width="80%">
     <div v-if="isShow">
       <div ref="searchBox">
         <div style="padding: 0 0 10px 0;line-height: 24px;" v-if="baseData">
@@ -21,27 +21,18 @@
         </a-tabs>
       </div>
       <!-- 表格 -->
-      <a-table
-        class="sTable"
+      <s-table
+        class="sTable fixPagination"
         ref="table"
+        :style="{ height: tableHeight+84+'px' }"
         size="small"
         :rowKey="(record) => record.id"
-        :scroll="{ y: tableHeight }"
         :columns="columns"
-        :dataSource="list"
-        :loading="loading"
-        :pagination="false"
+        :data="loadData"
+        :scroll="{ y:tableHeight }"
+        :defaultLoadData="false"
         bordered>
-      </a-table>
-      <!-- 分页 -->
-      <tablePagination
-        id="sales-record-pgeination"
-        ref="tablePagination"
-        :total="paginationProps.total"
-        :current="paginationProps.current"
-        :pageSize="paginationProps.pageSize"
-        @changePageSize="changePageSize"
-        @changePage="changePage" />
+      </s-table>
     </div>
   </a-drawer>
 </template>
@@ -81,21 +72,35 @@ export default {
       },
       // 表头
       columns: [
-        { title: '销售单号', dataIndex: 'salesBillNo', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售时间', dataIndex: 'salesBillEntity.createDate', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售价', dataIndex: 'price', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '销售数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '客户名称', dataIndex: 'salesBillEntity.buyerNameCurrent', width: 250, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单据来源', dataIndex: 'salesBillEntity.sourceTypeDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '序号', dataIndex: 'no', align: 'center', width: '5%' },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售时间', dataIndex: 'salesBillEntity.createDate', width: '10%', align: 'center', customRender: function (text) { return 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', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '客户名称', dataIndex: 'salesBillEntity.buyerNameCurrent', width: '45%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据来源', dataIndex: 'salesBillEntity.sourceTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      list: [], // 列表数据
-      loading: false,
-      curTab: '1', // 当前页签
-      paginationProps: {
-        total: 0, //  分页总条数
-        current: 1, // 当前页
-        pageSize: 20 // 每页数
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        // 查询列表
+        return salesRecordlList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          this.setTableH()
+          return data
+        })
       },
+      curTab: '1', // 当前页签
       baseData: null // 基础信息
     }
   },
@@ -104,7 +109,7 @@ export default {
     setTableH () {
       this.$nextTick(() => {
         const searchBoxH = this.$refs.searchBox.offsetHeight
-        this.tableHeight = window.innerHeight - searchBoxH - 235
+        this.tableHeight = window.innerHeight - searchBoxH - 255
       })
     },
     //  获取详情
@@ -116,45 +121,11 @@ export default {
         delete this.queryParam.buyerSn
       }
       this.queryParam.productSn = productSn
-      this.handelSearch(1)
       this.baseData = row
-    },
-    // 查询列表
-    handelSearch (pageNo) {
-      this.paginationProps.current = pageNo || this.paginationProps.current
-      const params = {
-        pageNo: this.paginationProps.current,
-        pageSize: this.paginationProps.pageSize
-      }
-      // 开始查询
-      this.loading = true
-      salesRecordlList({ ...params, ...this.queryParam }).then(res => {
-        this.loading = false
-        if (res.status == 200) {
-          const data = res.data
-          this.paginationProps.total = Number(res.data.count) || 0
-          this.paginationProps.current = data.pageNo
-          this.list = data.list
-        } else {
-          this.paginationProps.total = 0
-          this.paginationProps.current = 1
-          this.paginationProps.pageSize = 20
-          this.list = []
-        }
-        this.setTableH()
+      this.$nextTick(() => {
+        this.$refs.table.refresh(true)
       })
     },
-    //  分页  一页多少条change
-    changePageSize (current, pageSize) {
-      this.paginationProps.current = current
-      this.paginationProps.pageSize = pageSize
-      this.handelSearch()
-    },
-    //  分页 页码change
-    changePage (current) {
-      this.paginationProps.current = current
-      this.handelSearch()
-    },
     // 选择选项卡tab后
     callback (key) {
       this.curTab = key
@@ -174,11 +145,7 @@ export default {
       if (!newValue) {
         this.$emit('close')
         // 重置数据
-        this.paginationProps.total = 0
-        this.paginationProps.current = 1
-        this.paginationProps.pageSize = 20
         this.curTab = '1'
-        this.list = []
       }
     }
   }