Browse Source

新增页面

chenrui 2 years ago
parent
commit
6d615236ec

+ 458 - 0
src/views/reportData/urchaseDetailReturn/detailList.vue

@@ -0,0 +1,458 @@
+<template>
+  <a-card size="small" :bordered="false" class="salesReturnDetailList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="salesSlipReportList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="queryParam"
+          :rules="rules"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="退货完成日期" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="入库单号">
+                <a-input id="salesReturnDetailList-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入退货单号"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="产品编码">
+                <a-input id="salesReturnDetailList-productCode" v-model.trim="queryParam.productCode" 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="salesReturnDetailList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="供应商名称">
+                  <a-input id="salesReturnDetailList-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入客户名称"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="品牌分类">
+                  <v-select code="BRAND_TYPE" id="salesReturnDetailList-productBrandTypeSn" v-model="queryParam.productBrandTypeSn" allowClear placeholder="请选择品牌分类"></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品品牌">
+                  <ProductBrand id="salesReturnDetailList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品分类">
+                  <a-cascader
+                    @change="changeProductType"
+                    expand-trigger="hover"
+                    change-on-select
+                    :options="productTypeList"
+                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                    id="salesReturnDetailList-productType"
+                    placeholder="请选择产品分类"
+                    allowClear
+                    v-model="productType" />
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="所在区域">
+                  <subarea id="salesReturnDetailList-subareaSn" v-model="queryParam.subareaSn"></subarea>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="12" :sm="24">
+                <a-row>
+                  <a-form-model-item label="地区">
+                    <a-col span="7">
+                      <a-form-model-item prop="dealerProvinceSn" style="margin: 0;">
+                        <a-select v-model="queryParam.dealerProvinceSn" allowClear @change="getCityList" placeholder="请选择省">
+                          <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+                        </a-select>
+                      </a-form-model-item>
+                    </a-col>
+                    <a-col span="7" offset="1">
+                      <a-form-model-item prop="dealerCitySn" style="margin: 0;">
+                        <a-select v-model="queryParam.dealerCitySn" allowClear @change="getAreaList" placeholder="请选择市">
+                          <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+                        </a-select>
+                      </a-form-model-item>
+                    </a-col>
+                    <a-col span="7" offset="1">
+                      <a-form-model-item prop="dealerCountySn" style="margin: 0;">
+                        <a-select v-model="queryParam.dealerCountySn" allowClear placeholder="请选择区/县">
+                          <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                        </a-select>
+                      </a-form-model-item>
+                    </a-col>
+                  </a-form-model-item>
+                </a-row>
+              </a-col>
+            </template>
+            <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
+              <a-button
+                type="primary"
+                class="button-info"
+                size="small"
+                @click="handleStock"
+                id="salesReturnDetailList-stockDate">盘点区间日期</a-button>
+              <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="salesReturnDetailList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="salesReturnDetailList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('B_salerReturnDetailTable_export')"
+                id="salesReturnDetailList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 2960 }"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="footer">
+          <a-row :gutter="15">
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">入库单据量:{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? totalData.totalPrice : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">供应商数量:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? totalData.totalRealAmount : '--' }}</a-col>
+            <a-col :md="4" :sm="24">产品款数:{{ (totalData && (totalData.receiveQty || totalData.receiveQty==0)) ? totalData.receiveQty : '--' }}</a-col>
+            <a-col :md="4" :sm="24">入库数量:{{ (totalData && (totalData.totalBadQty || totalData.totalBadQty==0)) ? totalData.totalBadQty : '--' }}</a-col>
+            <a-col :md="4" :sm="24">退货数量:{{ (totalData && (totalData.goodQty || totalData.goodQty==0)) ? totalData.goodQty : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">退货金额:{{ (totalData && (totalData.totalNormalPrice || totalData.totalNormalPrice==0)) ? totalData.totalNormalPrice : '--' }}</a-col>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
+    <!-- 导出提示框 -->
+    <reportModal :visible="showExport" @close="showExport=false"></reportModal>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import getDate from '@/libs/getDate.js'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import subarea from '@/views/common/subarea.js'
+import custList from '@/views/common/custList.vue'
+import reportModal from '@/views/common/reportModal.vue'
+import { getArea } from '@/api/data'
+import { productBrandQuery } from '@/api/productBrand'
+import { productTypeQuery } from '@/api/productType'
+import ProductBrand from '@/views/common/productBrand.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { reportSalesReturnDetailList, reportSalesReturnDetailCount, reportSalesReturnDetailExport } from '@/api/reportData'
+export default {
+  name: 'SalesReturnDetailReportList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, rangeDate, custList, subarea, ProductBrand, reportModal },
+  data () {
+    return {
+      spinning: false,
+      advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      showExport: false,
+      queryParam: { //  查询条件
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        salesReturnBillNo: '',
+        productCode: '',
+        productName: '',
+        dealerName: '',
+        dealerLevel: undefined,
+        productBrandTypeSn: undefined,
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        subareaSn: undefined,
+        dealerProvinceSn: undefined,
+        dealerCitySn: undefined,
+        dealerCountySn: undefined
+      },
+      productType: [],
+      rules: {
+        'time': [{ required: true, message: '请选择退货完成日期', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        delete params.time
+        return reportSalesReturnDetailList(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: null,
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [], //  区下拉
+      productBrandList: [], //  品牌下拉数据
+      productTypeList: [] //  分类下拉数据
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '区域', dataIndex: 'subareaNames', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库单号', dataIndex: 'salesReturnBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'dealerProvinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '供应商名称', dataIndex: 'dealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货原因', dataIndex: 'returnReason', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货完成日期', dataIndex: 'salesReturnDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'productCode', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productUnit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库单价', dataIndex: 'initialQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库数量', dataIndex: 'receiveQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已退数量', dataIndex: 'badQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '申请退货数量', dataIndex: 'goodQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作员', dataIndex: 'goodQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        const ind = this.$hasPermissions('B_isShowCost') ? 29 : 28
+        arr.splice(20, 0, { title: '退货开单价', dataIndex: 'price', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(21, 0, { title: '退货开单金额', dataIndex: 'totalPrice', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(22, 0, { title: '退货实售价', dataIndex: 'realPrice', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(23, 0, { title: '退货实售金额', dataIndex: 'totalRealAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(24, 0, { title: '市级价金额', dataIndex: 'totalWholesalePrice2', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(25, 0, { title: '直接差价', dataIndex: 'directRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(26, 0, { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind, 0, { title: '正常退货金额', dataIndex: 'totalNormalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
+        const ind = this.$hasPermissions('B_isShowPrice') ? 27 : 20
+        arr.splice(ind, 0, { title: '再入库单价', dataIndex: 'cost', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 3, 0, { title: '正常再入库金额', dataIndex: 'totalNormalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(ind + 4, 0, { title: '正常退货入库差额', dataIndex: 'totalNormalBalance', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    // 盘点库存日期
+    handleStock () {
+      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
+    },
+    // 总计
+    getCount (params) {
+      reportSalesReturnDetailCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    custChange (val) {
+      this.queryParam.dealerSn = val.key
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.salesReturnBillNo = ''
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.dealerName = ''
+      this.queryParam.dealerLevel = undefined
+      this.queryParam.productBrandTypeSn = undefined
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.subareaSn = undefined
+      this.queryParam.dealerProvinceSn = undefined
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.dealerCountySn = undefined
+      this.productType = []
+      this.totalData = null
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.showExport = true
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(reportSalesReturnDetailExport, params, '销售退货明细报表', function () {
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    //  产品分类  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] : ''
+    },
+    //  产品品牌  列表
+    getProductBrand () {
+      productBrandQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productBrandList = res.data
+        } else {
+          this.productBrandList = []
+        }
+      })
+    },
+    //  产品分类  列表
+    getProductType () {
+      productTypeQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productTypeList = res.data
+        } else {
+          this.productTypeList = []
+        }
+      })
+    },
+    // 获取城市列表
+    getCityList (val) {
+      this.addrCityList = []
+      this.addrDistrictList = []
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.dealerCountySn = undefined
+      if (val) {
+        this.getArea('city', val)
+      }
+    },
+    // 获取区县列表
+    getAreaList (val) {
+      this.addrDistrictList = []
+      this.queryParam.dealerCountySn = undefined
+      if (val) {
+        this.getArea('district', val)
+      }
+    },
+    //  省/市/区
+    getArea (leve, sn) {
+      let params
+      if (leve == 'province') {
+        params = { type: '2' }
+      } else {
+        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
+      }
+      getArea(params).then(res => {
+        if (res.status == 200) {
+          if (leve == 'province') {
+            this.addrProvinceList = res.data || []
+          } else if (leve == 'city') {
+            this.addrCityList = res.data || []
+          } else if (leve == 'district') {
+            this.addrDistrictList = res.data || []
+          }
+        } else {
+          if (leve == 'province') {
+            this.addrProvinceList = []
+          } else if (leve == 'city') {
+            this.addrCityList = []
+          } else if (leve == 'district') {
+            this.addrDistrictList = []
+          }
+        }
+      })
+    },
+    pageInit () {
+      this.getProductBrand()
+      this.getProductType()
+      this.getArea('province')
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>

+ 354 - 0
src/views/reportData/urchaseReturn/list.vue

@@ -0,0 +1,354 @@
+<template>
+  <a-card size="small" :bordered="false" class="salesReturnsReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="salesReturnsReportList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="queryParam"
+          :rules="rules"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
+            <a-col :md="7" :sm="24">
+              <a-form-model-item label="退货完成日期" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="入库单号">
+                <a-input id="salesReturnsReportList-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入退货单号"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-model-item label="所在区域">
+                <subarea id="salesReturnsReportList-subareaSn" v-model="queryParam.subareaSn"></subarea>
+              </a-form-model-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="供应商名称">
+                  <custList id="salesReturnsReportList-dealerName" ref="custList" :itemSn="queryParam.dealerSn" @change="custChange"></custList>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="11" :sm="24">
+                <a-row>
+                  <a-form-model-item label="地区" style="margin-bottom: 0!important;">
+                    <a-col span="7">
+                      <a-form-model-item prop="dealerProvinceSn" style="margin: 0;">
+                        <a-select v-model="queryParam.dealerProvinceSn" allowClear @change="getCityList" placeholder="请选择省">
+                          <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+                        </a-select>
+                      </a-form-model-item>
+                    </a-col>
+                    <a-col span="7" offset="1">
+                      <a-form-model-item prop="dealerCitySn" style="margin: 0;">
+                        <a-select v-model="queryParam.dealerCitySn" allowClear @change="getAreaList" placeholder="请选择市">
+                          <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+                        </a-select>
+                      </a-form-model-item>
+                    </a-col>
+                    <a-col span="7" offset="1">
+                      <a-form-model-item prop="dealerCountySn" style="margin: 0;">
+                        <a-select v-model="queryParam.dealerCountySn" allowClear placeholder="请选择区/县">
+                          <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                        </a-select>
+                      </a-form-model-item>
+                    </a-col>
+                  </a-form-model-item>
+                </a-row>
+              </a-col>
+            </template>
+            <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
+              <a-button
+                type="primary"
+                class="button-info"
+                size="small"
+                @click="handleStock"
+                id="salesReturnsReportList-stockDate">盘点区间日期</a-button>
+              <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="salesReturnsReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReturnsReportList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('B_salesReturns_report')"
+                id="salesReturnsReportList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1740 }"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="footer">
+          <a-row :gutter="15">
+            <a-col :md="4" :sm="24">总数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">入库单据量:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">供应商数量:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? totalData.totalRealAmount : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">入库数量:{{ (totalData && (totalData.totalWholesalePrice2 || totalData.totalWholesalePrice2==0)) ? totalData.totalWholesalePrice2 : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">已退数量:{{ (totalData && (totalData.totalWholesalePrice1 || totalData.totalWholesalePrice1==0)) ? totalData.totalWholesalePrice1 : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">退货金额:{{ (totalData && (totalData.totalWholesalePrice3 || totalData.totalWholesalePrice3==0)) ? totalData.totalWholesalePrice3 : '--' }}</a-col>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
+    <!-- 导出提示框 -->
+    <reportModal :visible="showExport" @close="showExport=false"></reportModal>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import getDate from '@/libs/getDate.js'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import subarea from '@/views/common/subarea.js'
+import custList from '@/views/common/custList.vue'
+import reportModal from '@/views/common/reportModal.vue'
+import { getArea } from '@/api/data'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { reportSalesReturnList, reportSalesReturnCount, salesReturnsExport } from '@/api/reportData'
+export default {
+  name: 'SalesReturnsReportList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, rangeDate, subarea, custList, reportModal },
+  data () {
+    return {
+      spinning: false,
+      exportLoading: false,
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      showExport: false,
+      queryParam: { //  查询条件
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        salesReturnBillNo: '',
+        subareaSn: undefined,
+        dealerSn: '',
+        dealerLevel: undefined,
+        dealerProvinceSn: undefined,
+        dealerCitySn: undefined,
+        dealerCountySn: undefined
+      },
+      rules: {
+        'time': [{ required: true, message: '请选择退货完成日期', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        delete params.time
+        return reportSalesReturnList(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: null,
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [] //  区下拉
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '入库单号', dataIndex: 'salesReturnBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货完成日期', dataIndex: 'salesReturnDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商名称', dataIndex: 'dealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货原因', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库数量', dataIndex: 'totalQty', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已退数量', dataIndex: 'totalBadQty', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退款金额', dataIndex: 'totalBadQty', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作员', dataIndex: 'operatorName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ]
+      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
+        arr.splice(7, 0, { title: '入库单据量', dataIndex: 'totalAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '供应商数量', dataIndex: 'totalWholesalePrice2', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(9, 0, { title: '入库数量', dataIndex: 'totalWholesalePrice1', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(10, 0, { title: '已退数量', dataIndex: 'totalWholesalePrice3', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(11, 0, { title: '退货金额', dataIndex: 'totalRealAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.showExport = true
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(salesReturnsExport, params, '销售退货单报表', function () {
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    // 盘点库存日期
+    handleStock () {
+      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
+    },
+    // 总计
+    getCount (params) {
+      reportSalesReturnCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    custChange (val) {
+      this.queryParam.dealerSn = val.key
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.salesReturnBillNo = ''
+      this.queryParam.subareaSn = undefined
+      this.queryParam.dealerSn = undefined
+      this.queryParam.dealerLevel = undefined
+      this.queryParam.dealerProvinceSn = undefined
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.dealerCountySn = undefined
+      if (this.advanced) {
+        this.$refs.custList.resetForm()
+      }
+      this.totalData = null
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+    },
+    // 获取城市列表
+    getCityList (val) {
+      this.addrCityList = []
+      this.addrDistrictList = []
+      this.queryParam.dealerCitySn = undefined
+      this.queryParam.dealerCountySn = undefined
+      if (val) {
+        this.getArea('city', val)
+      }
+    },
+    // 获取区县列表
+    getAreaList (val) {
+      this.addrDistrictList = []
+      this.queryParam.dealerCountySn = undefined
+      if (val) {
+        this.getArea('district', val)
+      }
+    },
+    //  省/市/区
+    getArea (leve, sn) {
+      let params
+      if (leve == 'province') {
+        params = { type: '2' }
+      } else {
+        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
+      }
+      getArea(params).then(res => {
+        if (res.status == 200) {
+          if (leve == 'province') {
+            this.addrProvinceList = res.data || []
+          } else if (leve == 'city') {
+            this.addrCityList = res.data || []
+          } else if (leve == 'district') {
+            this.addrDistrictList = res.data || []
+          }
+        } else {
+          if (leve == 'province') {
+            this.addrProvinceList = []
+          } else if (leve == 'city') {
+            this.addrCityList = []
+          } else if (leve == 'district') {
+            this.addrDistrictList = []
+          }
+        }
+      })
+    },
+    pageInit () {
+      this.getArea('province')
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>

+ 33 - 2
src/views/salesReturnManagement/receiveCheck/list.vue

@@ -77,10 +77,25 @@
               v-if="record.billStatus == 'WAIT_CHECK'&&$hasPermissions('B_salesReturnCheck')"
               @click="handleCheck(record)"
               id="salesReturn-eexamine-btn">品检</a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-warning"
+                @click="handleOpenPrintModal(record)"
+                id="salesReturn-eexamine-btn">打印</a-button>
           </div>
         </template>
       </s-table>
     </a-spin>
+    <commonModal
+      modalTit="品检打印预览"
+      bodyPadding="10px"
+      width="600px"
+      :showFooter="false"
+      :openModal="showTipModal"
+      @cancel="canselPrintView">
+      <printModel ref="printModel" @cancel="showTipModal=false"></printModel>
+    </commonModal>
   </a-card>
 </template>
 
@@ -91,6 +106,8 @@ import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import employee from '../../expenseManagement/expenseReimbursement/employee.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { salesReturnList } from '@/api/salesReturn'
+import printModal from './printModal.vue'
+import commonModal from '@/views/common/commonModal.vue'
 export default {
   name: 'ReceiveCheckList',
   mixins: [commonMixin],
@@ -99,7 +116,9 @@ export default {
     VSelect,
     dealerSubareaScopeList,
     employee,
-    rangeDate
+    rangeDate,
+    printModal,
+    commonModal
   },
   data () {
     return {
@@ -139,7 +158,8 @@ export default {
       },
       visibleAudit: false,
       auditInfo: null,
-      spinningAudit: false
+      spinningAudit: false,
+      showTipModal:false
     }
   },
   computed: {
@@ -200,6 +220,17 @@ export default {
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 175
+    },
+    canselPrintView () {
+      this.showTipModal = false
+      this.$refs.printModel.handleCommonCancel()
+    },
+    handleOpenPrintModal(con){
+      this.showTipModal=true
+      let arr = [{num:1,code:'编码',name:'名称',danwei:'个',numInfo:1,allNum:2,reson:'原因',desc:'备注'},{num:1,code:'编码',name:'名称',danwei:'个',numInfo:1,allNum:2,reson:'原因',desc:'备注'},{num:1,code:'编码',name:'名称',danwei:'个',numInfo:1,allNum:2,reson:'原因',desc:'备注'}]
+      this.$nextTick(() => {
+        this.$refs.printModel.getData(con, arr)
+      })
     }
   },
   watch: {

+ 159 - 0
src/views/salesReturnManagement/receiveCheck/printModal.vue

@@ -0,0 +1,159 @@
+<template>
+  <!-- 发货打印 -->
+  <div style="position:absolute;left:-10000px;top:-10000px;height:0;overflow: hidden;">
+    <div id="sendGood-print" v-if="financeBookList && financeBookList.length">
+      <div v-for="(fcItem, index) in financeBookList" class="sendGood-print-box" :key="index + '-fcitem'" style="width:564pt;margin:0 auto;">
+        <table ref="printBox" cellspacing="0" cellpadding="0" style="border-collapse: collapse;width: 564pt;font-size:14px;">
+          <tr>
+            <td>
+              <div class="print-box" style="width: 564pt;margin-left:1.5pt;">
+                <div style="text-align:center;margin:15pt 0 5pt;font-size:22px;font-weight: bold;">箭冠退货单</div>
+                <div>
+                  <div>
+                    <table border="1" style="width: 564pt;border-collapse: collapse;text-align: center;">
+                      <tr>
+                        <th style="line-height: 20pt;width: 56pt;background:#f6f6f6;">日期</th>
+                        <th style="line-height: 20pt;width: 62pt;background:#f6f6f6;">客户名称</th>
+                        <th style="line-height: 20pt;width: 62pt;background:#f6f6f6;">营业执照名称</th>
+                        <th style="line-height: 20pt;width: 54pt;background:#f6f6f6;">订单金额</th>
+                        <th style="line-height: 20pt;width: 54pt;background:#f6f6f6;">收款金额</th>
+                        <th style="line-height: 20pt;width: 54pt;background:#f6f6f6;">使用授信</th>
+                        <th style="line-height: 20pt;width: 54pt;background:#f6f6f6;">余款抵扣</th>
+                        <th style="line-height: 20pt;width: 54pt;background:#f6f6f6;">汇入银行</th>
+                        <th style="line-height: 20pt;width: 54pt;background:#f6f6f6;">足额打款</th>
+                        <th style="line-height: 20pt;width: 60pt;background:#f6f6f6;">说明</th>
+                      </tr>
+                      <tr v-for="item in fcItem.subList" :key="item.bookDetailSn">
+                        <td style="padding:3pt;width: 50pt;">{{ moment(item.receiptDate).format('YYYY/MM/DD') }}</td>
+                        <td style="padding:3pt;width: 56pt;text-align:left;">
+                          {{ item.payerName }}
+                          <div>{{ item.dealerEntity ? item.dealerEntity.kdMidCustomerFnumber : '' }}</div>
+                        </td>
+                        <td style="padding:3pt;width: 56pt;text-align:left;">{{ item.payerAccountInfo }}</td>
+                        <td style="padding:3pt;width: 48pt;text-align:center;">{{ item.orderAmount ? item.orderAmount.toFixed(2) : '0.00' }}</td>
+                        <td style="padding:3pt;width: 48pt;text-align:center;">{{ item.receiptAmount ? item.receiptAmount.toFixed(2) : '0.00' }}</td>
+                        <td style="padding:3pt;width: 48pt;text-align:center;">{{ getTotal(item.detailItemUseList || []) }}</td>
+                        <td style="padding:3pt;width: 48pt;text-align:center;">{{ item.balanceAmount ? item.balanceAmount.toFixed(2) : '0.00' }}</td>
+                        <td style="padding:3pt;width: 48pt;">
+                          {{ item.bankAccount }}
+                          <br />
+                          {{ item.bankName }}
+                        </td>
+                        <td style="padding:3pt;width: 48pt;">{{ item.fullPaymentFlagDictValue }}</td>
+                        <td style="padding:3pt;width: 54pt;word-break:break-all;">{{ item.explainInfo }}</td>
+                      </tr>
+                    </table>
+
+                    <div style="padding:5pt 0;border-bottom: 1px solid #333;">使用授信明细:{{ fcItem.detail || '暂无。' }}</div>
+                    <div style="padding:5pt 0;" v-if="fcItem.audit && fcItem.audit.taskVOList">
+                      审批人员:
+                      <span v-for="audit in fcItem.audit.taskVOList" :key="audit.processInstanceId" v-if="audit.userType == '审批人'">
+                        {{ audit.userName }}({{ audit.state }});
+                      </span>
+                    </div>
+                    <div style="padding:5pt 0;" v-else>审批人员:</div>
+                  </div>
+                </div>
+              </div>
+            </td>
+          </tr>
+        </table>
+      </div>
+    </div>
+    <div class="btn-box" style="display:flex;align-item:center;justify-content: center;">
+      <a-button @click="handleCommonCancel">取消</a-button>
+      <a-button :loading="spinning" type="primary" @click="handleCommonOk">立即打印</a-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import { jGPlPrint } from '@/libs/JGPrint.js';
+import moment from 'moment';
+export default {
+  data() {
+    return {
+      // spinning: false,
+      detail: null,
+      financeBookList: [],
+      printNums: []
+    };
+  },
+  methods: {
+    moment,
+    getTotal(data) {
+      let ret = 0;
+      data.map(item => {
+        ret = ret + item.itemAmount;
+        delete item.id;
+      });
+      return ret.toFixed(2);
+    },
+    handleCommonOk() {
+      const _this = this;
+      const html = document.getElementsByClassName('sendGood-print-box');
+      const printCons = [];
+      for (let i = 0; i < html.length; i++) {
+        const h = html[i].clientHeight;
+        printCons.push({
+          h: h,
+          t: html[i].innerHTML
+        });
+      }
+
+      // 排序从小到大
+      printCons.sort((a, b) => {
+        return a['h'] - b['h'];
+      });
+
+      const htmlStr = [];
+      for (let i = 0; i < printCons.length; i++) {
+        if (printCons[i].h > 560) {
+          htmlStr.push('');
+        }
+        htmlStr.push(printCons[i].t);
+      }
+
+      // html, type, callback, printLogParams
+      jGPlPrint(
+        htmlStr,
+        'preview',
+        function(res) {
+          _this.handleCommonCancel();
+          _this.$emit('printOk');
+        },
+        this.printNums,
+        this.financeBookList
+      );
+    },
+    getData(data, list) {
+      console.log(data);
+      this.financeBookList = data;
+      list.map(item => {
+        this.printNums.push({
+          billType: 'FINANCE_BOOK_DETAIL',
+          billSn: item.num,
+          billNo: item.name,
+          printType: '收款打印'
+        });
+      });
+
+      // 打印预览
+      this.$nextTick(() => {
+        this.handleCommonOk();
+      });
+    },
+    handleCommonCancel() {
+      this.$emit('cancel');
+      this.clearData();
+    },
+    clearData() {
+      this.detail = null;
+      this.financeBookList = [];
+      this.printNums = [];
+    }
+  }
+};
+</script>
+
+<style></style>

+ 204 - 0
src/views/supplierManagement/supplierRecord/list.vue

@@ -0,0 +1,204 @@
+<template>
+  <a-card size="small" :bordered="false" class="associatedProductList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" 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="associatedProductList-productName" v-model.trim="queryParam.product.name" allowClear placeholder="请输入产品名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品编码/原厂编码">
+                <a-input id="associatedProductList-productCode" v-model.trim="queryParam.product.queryWord" allowClear placeholder="请输入产品编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="品牌">
+                <ProductBrand id="associatedProduct-productBrandSn" v-model="queryParam.product.productBrandSn"></ProductBrand>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品分类">
+                <ProductType id="associatedProduct-productType" v-model="productType" @change="changeProductType"></ProductType>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="供应商名称">
+                <a-input id="associatedProductList-productName" v-model.trim="queryParam.supplierName" allowClear placeholder="请输入供应商名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="associatedProductList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="associatedProductList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('B_salerReturnDetailTable_export')"
+                id="salesReturnDetailList-export">导出</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 产品分类 -->
+        <template slot="productType" slot-scope="text, record">
+          <span v-if="record.product&&(record.product.productTypeName2 || record.product.productTypeName3)">{{ record.product.productTypeName2 }} {{ record.product.productTypeName3 ? '>' : '' }} {{ record.product.productTypeName3 }}</span>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import ProductType from '@/views/common/productType.js'
+import ProductBrand from '@/views/common/productBrand.js'
+import { supplierProductList } from '@/api/supplier'
+export default {
+  name: 'AssociatedProductDetailsList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, ProductBrand, ProductType },
+  data () {
+    return {
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        supplierName: '',
+        product: {
+          name: '', //  产品名称
+          queryWord: '', // 产品编码/原厂编码
+          productBrandSn: undefined, //  产品品牌
+          productTypeSn1: '', //  产品一级分类
+          productTypeSn2: '', //  产品二级分类
+          productTypeSn3: '' //  产品三级分类
+        }
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      productType: [],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return supplierProductList(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
+          return data
+        })
+      }
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '变更时间', dataIndex: 'product.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'product.code', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '成本价(¥)', dataIndex: 'cost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '原厂编码', dataIndex: 'product.origCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'product.productBrandName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '18%', align: 'center' },
+        { title: '供应商名称', dataIndex: 'supplierName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '变更前', dataIndex: 'supplierName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '变更后', dataIndex: 'supplierName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
+
+      ]
+      if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
+        arr.splice(6, 0, { title: '成本价(¥)', dataIndex: 'cost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    //  重置
+    resetSearchForm () {
+      this.queryParam.supplierName = ''
+      this.queryParam.product.name = ''
+      this.queryParam.product.queryWord = ''
+      this.queryParam.product.productBrandSn = undefined
+      this.queryParam.product.productTypeSn1 = ''
+      this.queryParam.product.productTypeSn2 = ''
+      this.queryParam.product.productTypeSn3 = ''
+      this.productType = []
+      this.$refs.table.refresh(true)
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.product.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.product.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.product.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 195
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>