lilei 1 week ago
parent
commit
671012bbed

+ 15 - 2
src/views/reportData/promotionFeeReport/customerFeeList.vue

@@ -44,16 +44,27 @@
                   <subarea id="customerFeeList-subarea" ref="subarea" @change="subareaChange"></subarea>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-model-item label="区域负责人">
                   <BizUser id="customerFeeList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-model-item label="地区">
                   <AreaList id="customerFeeList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
                 </a-form-model-item>
               </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-model-item label="是否包含特价">
+                  <v-select
+                    v-model="queryParam.specialFlag"
+                    ref="specialFlag"
+                    id="customerFeeList-specialFlag"
+                    code="FLAG"
+                    placeholder="请选择是否包含特价"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="客服">
                   <customerService ref="customerName" id="customerFeeList-customerName" v-model="queryParam.kfSn"></customerService>
@@ -152,6 +163,7 @@ export default {
           subareaAreaSn: '', // 分区
           bizUserSn: undefined// 区域负责人
         },
+        specialFlag: undefined, // 是否包含特价
         kfSn: undefined// 客服
       },
       columns: [], // 表头
@@ -287,6 +299,7 @@ export default {
       this.queryParam.subareaArea.bizUserSn = undefined
       this.queryParam.dealerLevel = undefined
       this.queryParam.kfSn = undefined
+      this.queryParam.specialFlag = undefined
       this.$refs.dealerSubareaScopeList.resetForm()
       if (this.advanced) {
         this.$refs.subarea && this.$refs.subarea.clearData()

+ 15 - 2
src/views/reportData/promotionFeeReport/promoFeeList.vue

@@ -44,16 +44,27 @@
                   <subarea id="promotionFeeList-subarea" ref="subarea" @change="subareaChange"></subarea>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-model-item label="区域负责人">
                   <BizUser id="promotionFeeList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-model-item label="地区">
                   <AreaList id="promotionFeeList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
                 </a-form-model-item>
               </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-model-item label="是否包含特价">
+                  <v-select
+                    v-model="queryParam.specialFlag"
+                    ref="specialFlag"
+                    id="customerFeeList-specialFlag"
+                    code="FLAG"
+                    placeholder="请选择是否包含特价"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
             </template>
             <a-col :md="6" :sm="24">
               <a-button
@@ -146,6 +157,7 @@ export default {
         endDate: moment().endOf('month').format('YYYY-MM-DD') + ' 23:59:59', // 月份结束时间
         dealerLevel: undefined, // 客户级别
         dealerSn: undefined, // 客户sn
+        specialFlag: undefined, // 是否特价
         dealerEntity: {
           dealerName: undefined, // 客户名称
           provinceSn: undefined, // 省
@@ -305,6 +317,7 @@ export default {
       this.queryParam.districtSn = undefined
       this.queryParam.dealerEntity.dealerName = undefined
       this.queryParam.dealerSn = undefined
+      this.queryParam.specialFlag = undefined
       this.queryParam.subareaArea.subareaSn = ''
       this.queryParam.subareaArea.subareaAreaSn = ''
       this.queryParam.subareaArea.bizUserSn = undefined

+ 18 - 5
src/views/reportData/promotionFeeReport/provinceFeeList.vue

@@ -10,8 +10,8 @@
           layout="inline"
           :rules="rules"
           :model="queryParam">
-          <a-row :gutter="15">
-            <a-col :md="5" :sm="24">
+          <a-row :gutter="15" type="flex">
+            <a-col :md="3" :sm="24">
               <a-form-model-item label="月份" prop="beginDate">
                 <a-month-picker
                   id="provinceFeeList-monthBox"
@@ -22,7 +22,7 @@
                   @change="onChangeMonth" />
               </a-form-model-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :md="3" :sm="24">
               <a-form-model-item label="地区">
                 <Area id="provinceFeeList-areaList" v-model="queryParam.provinceSn" placeholder="请选择省份"></Area>
               </a-form-model-item>
@@ -32,12 +32,23 @@
                 <subarea id="provinceFeeList-subarea" ref="subarea" @change="subareaChange"></subarea>
               </a-form-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :md="3" :sm="24">
               <a-form-model-item label="区域负责人">
                 <BizUser id="provinceFeeList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
               </a-form-model-item>
             </a-col>
-            <a-col :md="4" :sm="24">
+            <a-col :md="3" :sm="24">
+              <a-form-model-item label="是否包含特价">
+                <v-select
+                  v-model="queryParam.specialFlag"
+                  ref="specialFlag"
+                  id="customerFeeList-specialFlag"
+                  code="FLAG"
+                  placeholder="请选择是否包含特价"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="7" :sm="24">
               <a-button
                 type="primary"
                 @click="handleSearch"
@@ -111,6 +122,7 @@ export default {
         beginDate: moment().startOf('month').format('YYYY-MM-DD') + ' 00:00:00', // 月份开始时间
         endDate: moment().endOf('month').format('YYYY-MM-DD') + ' 23:59:59', // 月份结束时间
         provinceSn: undefined, // 省
+        specialFlag: undefined, // 是否包含特价
         subareaArea: {
           subareaSn: '', // 区域
           subareaAreaSn: '', // 分区
@@ -228,6 +240,7 @@ export default {
       this.queryParam.subareaArea.subareaSn = ''
       this.queryParam.subareaArea.subareaAreaSn = ''
       this.queryParam.subareaArea.bizUserSn = undefined
+      this.queryParam.specialFlag = undefined
       this.totalData = null
       this.$refs.subarea && this.$refs.subarea.clearData()
       this.$refs.areaList && this.$refs.areaList.clearData()

+ 41 - 44
src/views/reportData/regionTypeBusinessReport/list.vue

@@ -91,28 +91,28 @@ import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import getDate from '@/libs/getDate'
 // 接口
 import { manageAnalysisReportQuery, manageAnalysisReportExport } from '@/api/reportData'
-const strongRow = []
-const redRow = []
-const renderContent = (value, row, index) => {
-  const ret = value || value == 0 ? value : ''
-  const retVal = ret == 0 ? '0.00' : ret
-  const isStrong = strongRow.indexOf(index) >= 0
-  const isRed = redRow.indexOf(index) >= 0
-  if (isStrong || isRed) {
-    return {
-      children: retVal == '--' ? '' : retVal,
-      attrs: {
-        style: 'font-weight: bold;color:red;font-size:14px;'
-      }
-    }
-  }
-  return retVal == '--' ? '' : retVal
-}
 export default {
   name: 'RegionTypeBusinessReportList',
   mixins: [commonMixin],
   components: { STable, VSelect, Area, dealerSubareaScopeList },
   data () {
+    const strongRow = []
+    const redRow = []
+    const renderContent = (value, row, index) => {
+      const ret = value || value == 0 ? value : ''
+      const retVal = ret == 0 && typeof (ret) === 'string' ? '0.00' : ret
+      const isStrong = strongRow.indexOf(index) >= 0
+      const isRed = redRow.indexOf(index) >= 0
+      if (isStrong || isRed) {
+        return {
+          children: retVal == '--' ? '' : retVal,
+          attrs: {
+            style: 'font-weight: bold;color:red;font-size:14px;'
+          }
+        }
+      }
+      return retVal == '--' ? '' : retVal
+    }
     return {
       spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
@@ -132,6 +132,29 @@ export default {
       rules: {
         'queryDate': [{ required: true, message: '请选择查询月份', trigger: 'change' }]
       },
+      columns: [
+        { title: '类别',
+          dataIndex: 'category',
+          width: '15%',
+          align: 'center',
+          customRender: (text, row, index) => {
+            const isStrong = row.category.indexOf('合计') >= 0
+            const isRed = row.category == '全品类(含NGK)' || row.category == '箭牌喇叭' || row.category == '轮胎'
+            if (isStrong || isRed) {
+              return <a-button size="small" type="link" class="button-error" style="font-weight:bold;font-size:14px;">{text}</a-button>
+            }
+            return <a-button size="small" type="link" class="button-default">{text}</a-button>
+          }
+        },
+        { title: '成本', dataIndex: 'cost', width: '10%', align: 'center', customRender: renderContent },
+        { title: '销售数量', dataIndex: 'qty', width: '10%', align: 'center', customRender: renderContent },
+        { title: '销售额', dataIndex: 'amount', width: '10%', align: 'center', customRender: renderContent },
+        { title: '毛利', dataIndex: 'gross', width: '10%', align: 'center', customRender: renderContent },
+        { title: '毛利率', dataIndex: 'grossMargin', width: '10%', align: 'center', customRender: renderContent },
+        { title: '促销费用', dataIndex: 'promo', width: '10%', align: 'center', customRender: renderContent },
+        { title: '减促销费用的毛利', dataIndex: 'removePromoGross', width: '10%', align: 'center', customRender: renderContent },
+        { title: '促销费用占比', dataIndex: 'promoRatio', width: '10%', align: 'center', customRender: renderContent }
+      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -151,6 +174,7 @@ export default {
               data[i].grossMargin = (data[i].grossMargin || data[i].grossMargin == 0) && data[i].amount ? data[i].grossMargin.toFixed(2) + '%' : '--'
               data[i].promoRatio = (data[i].promoRatio || data[i].promoRatio == 0) && data[i].amount ? data[i].promoRatio.toFixed(2) + '%' : '--'
               data[i].cost = data[i].cost ? data[i].cost.toFixed(2) : (isqml ? '--' : '0.00')
+              data[i].qty = 0
               data[i].amount = data[i].amount ? data[i].amount.toFixed(2) : (isqml ? '--' : '0.00')
               data[i].gross = data[i].gross ? data[i].gross.toFixed(2) : (isqml ? '--' : '0.00')
               data[i].promo = data[i].promo || data[i].promo == 0 ? data[i].promo.toFixed(2) : (isqml ? '--' : '0.00')
@@ -183,33 +207,6 @@ export default {
       this.setTableH()
     }
   },
-  computed: {
-    columns () {
-      const arr = [
-        { title: '类别',
-          dataIndex: 'category',
-          width: '15%',
-          align: 'center',
-          customRender: (text, row, index) => {
-            const isStrong = row.category.indexOf('合计') >= 0
-            const isRed = row.category == '全品类(含NGK)' || row.category == '箭牌喇叭' || row.category == '轮胎'
-            if (isStrong || isRed) {
-              return <a-button size="small" type="link" class="button-error" style="font-weight:bold;font-size:14px;">{text}</a-button>
-            }
-            return <a-button size="small" type="link" class="button-default">{text}</a-button>
-          }
-        },
-        { title: '成本', dataIndex: 'cost', width: '10%', align: 'center', customRender: renderContent },
-        { title: '销售额', dataIndex: 'amount', width: '10%', align: 'center', customRender: renderContent },
-        { title: '毛利', dataIndex: 'gross', width: '10%', align: 'center', customRender: renderContent },
-        { title: '毛利率', dataIndex: 'grossMargin', width: '10%', align: 'center', customRender: renderContent },
-        { title: '促销费用', dataIndex: 'promo', width: '10%', align: 'center', customRender: renderContent },
-        { title: '减促销费用的毛利', dataIndex: 'removePromoGross', width: '10%', align: 'center', customRender: renderContent },
-        { title: '促销费用占比', dataIndex: 'promoRatio', width: '10%', align: 'center', customRender: renderContent }
-      ]
-      return arr
-    }
-  },
   methods: {
     // 选择月份  禁用选择当月以后日期
     disabledDate (current) {

+ 258 - 0
src/views/setting/dailyReportSettings/baseModal.vue

@@ -0,0 +1,258 @@
+<template>
+  <a-modal
+    v-model="opened"
+    :title="title"
+    centered
+    :maskClosable="false"
+    :confirmLoading="confirmLoading"
+    :width="560"
+    :footer="null"
+    @cancel="cancel"
+  >
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="chooseCustom-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-row :gutter="15">
+          <a-col :span="20">
+            <a-form-model-item label="销售退单号" prop="buyerSn">
+              <a-select
+                show-search
+                id="chooseCustom-buyerSn"
+                v-model="form.buyerSn"
+                placeholder="请输入名称搜索"
+                :filter-option="false"
+                :not-found-content="fetching ? undefined : null"
+                @search="fetchUser"
+                @change="handleChange"
+              >
+                <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+                <a-select-option v-for="item in dealerData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="20">
+            <a-form-model-item label="客户名称" prop="syncFlag">
+              {{ form.dearlerName||'--' }}
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="20">
+            <a-form-model-item label="全国销售日报" prop="goodFlag">
+              <a-radio-group name="radioGroup">
+                <a-radio value="1">剔除</a-radio>
+                <a-radio value="2">不剔除</a-radio>
+              </a-radio-group>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="20">
+            <a-form-model-item label="项目销售日报1" prop="goodFlag">
+              <a-radio-group name="radioGroup">
+                <a-radio value="1">剔除</a-radio>
+                <a-radio value="2">不剔除</a-radio>
+              </a-radio-group>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="20">
+            <a-form-model-item label="项目销售日报2" prop="goodFlag">
+              <a-radio-group name="radioGroup">
+                <a-radio value="1">剔除</a-radio>
+                <a-radio value="2">不剔除</a-radio>
+              </a-radio-group>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="20">
+            <a-form-model-item label="分区销售日报" prop="goodFlag">
+              <a-radio-group name="radioGroup">
+                <a-radio value="1">剔除</a-radio>
+                <a-radio value="2">不剔除</a-radio>
+              </a-radio-group>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+          <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
+          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect } from '@/components'
+import debounce from 'lodash/debounce'
+import warehouse from '@/views/common/chooseWarehouse.js'
+import { dealerSubareaScopeList, dealerDetailBySn } from '@/api/dealer'
+import { getDefaultWarehouse } from '@/api/warehouse'
+import { salesReturnInsert } from '@/api/salesReturn'
+export default {
+  name: 'BaseModal',
+  mixins: [commonMixin],
+  components: { VSelect, warehouse },
+  props: {
+    show: [Boolean]
+  },
+  data () {
+    this.lastFetchId = 0
+    this.fetchUser = debounce(this.fetchUser, 800)
+    return {
+      opened: this.show,
+      spinning: false,
+      title: '新增销售退货单——选择客户',
+      confirmLoading: false,
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        salesReturnBillSource: 'SALES',
+        buyerName: '', // 客户名称
+        buyerSn: undefined, // 客户sn
+        contactTel: '', //  联系电话
+        contactName: '', //  联系人
+        provinceSn: '', //  省
+        provinceName: '',
+        citySn: '', // 市
+        cityName: '',
+        countySn: '', // 区
+        countyName: '',
+        customerAddr: '', //  详细地址
+        warehouseSn: undefined, // 退货仓库
+        syncFlag: undefined, // 是否同步
+        goodFlag: undefined
+      },
+      rules: {
+        buyerSn: [{ required: true, message: '请选择客户', trigger: ['change', 'blur'] }],
+        warehouseSn: [{ required: true, message: '请选择退货仓库', trigger: 'change' }],
+        syncFlag: [{ required: true, message: '请选择是否同步', trigger: ['change', 'blur'] }],
+        goodFlag: [{ required: true, message: '请选择退货类别', trigger: ['change', 'blur'] }]
+      },
+      fetching: false,
+      dealerData: []
+    }
+  },
+  methods: {
+    fetchUser (dealerName) {
+      if (dealerName == '') return
+      this.lastFetchId += 1
+      const fetchId = this.lastFetchId
+      this.dealerData = []
+      this.fetching = true
+      dealerSubareaScopeList({ nameLike: dealerName.replace(/\s+/g, ''), pageNo: 1, pageSize: 20 }).then(res => {
+        if (fetchId !== this.lastFetchId) {
+          return
+        }
+        this.dealerData = res.data && res.data.list ? res.data.list : []
+        this.fetching = false
+      })
+    },
+    // 客户  change
+    handleChange (value) {
+      dealerDetailBySn({ sn: this.form.buyerSn }).then(res => {
+        if (res.data) {
+          const data = res.data
+          this.form = Object.assign(this.form, {
+            buyerName: data.dealerName, // 客户名称
+            buyerSn: data.dealerSn, // 客户sn
+            contactTel: data.contactMobile, //  联系电话
+            contactName: data.contact, //  联系人
+            provinceSn: data.provinceSn, //  省
+            provinceName: data.provinceName,
+            citySn: data.citySn, // 市
+            cityName: data.cityName,
+            countySn: data.districtSn, // 区
+            countyName: data.districtName,
+            customerAddr: data.address //  详细地址
+          })
+          console.log(this.form)
+        } else {
+          this.$message.error('获取客户信息失败')
+        }
+      })
+    },
+    //  保存
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          // 保存销售单
+          _this.salesSaveFun()
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 新建销售退货单
+    salesSaveFun () {
+      const _this = this
+      const form = this.form
+      console.log(form, 'save data')
+      _this.spinning = true
+      salesReturnInsert(form).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$emit('ok', res.data)
+          _this.cancel()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    getDefaultWarehouse () {
+      getDefaultWarehouse().then(res => {
+        this.form.warehouseSn = res.data ? res.data.warehouseSn : undefined
+      })
+    },
+    cancel () {
+      this.opened = false
+      this.form = {
+        salesReturnBillSource: 'SALES',
+        buyerName: '', // 客户名称
+        buyerSn: undefined, // 客户sn
+        contactTel: '', //  联系电话
+        contactName: '', //  联系人
+        provinceSn: '', //  省
+        provinceName: '',
+        citySn: '', // 市
+        cityName: '',
+        countySn: '', // 区
+        countyName: '',
+        customerAddr: '', //  详细地址
+        warehouseSn: undefined,
+        syncFlag: undefined, // 是否同步
+        goodFlag: undefined
+      }
+      this.$refs.ruleForm.resetFields()
+      this.dealerData = []
+      this.$emit('cancel')
+    }
+  },
+  watch: {
+    show (newValue, oldValue) {
+      this.opened = newValue
+      if (newValue) {
+        this.getDefaultWarehouse()
+      }
+    }
+  }
+}
+</script>

+ 6 - 2
src/views/setting/dailyReportSettings/index.vue

@@ -17,6 +17,9 @@
         <a-tab-pane key="5" tab="分区月目标" force-render>
           <partitionTargetList pageType="PARTITION_MONTHLY_TARGET"></partitionTargetList>
         </a-tab-pane>
+        <a-tab-pane key="6" tab="销售退货剔除" force-render>
+          <salesReturnRemove></salesReturnRemove>
+        </a-tab-pane>
       </a-tabs>
     </a-card>
   </div>
@@ -27,13 +30,14 @@ import { commonMixin } from '@/utils/mixin'
 import estimatedOrderList from './estimatedOrderList.vue'
 import categoryTargetList from './categoryTargetList.vue'
 import partitionTargetList from './partitionTargetList.vue'
+import salesReturnRemove from './salesReturnRemove.vue'
 export default {
   name: 'DailyReportSettingsIndex',
   mixins: [commonMixin],
-  components: { estimatedOrderList, categoryTargetList, partitionTargetList },
+  components: { estimatedOrderList, categoryTargetList, partitionTargetList, salesReturnRemove },
   data () {
     return {
-      tabVal: '1'// tab值  1区域预估订单 2轮胎月目标 3品类月目标 4品类经理月目标  5分区月目标
+      tabVal: '1'// tab值  1区域预估订单 2轮胎月目标 3品类月目标 4品类经理月目标  5分区月目标 6销售退货剔除
     }
   }
 }

+ 277 - 0
src/views/setting/dailyReportSettings/salesReturnRemove.vue

@@ -0,0 +1,277 @@
+<template>
+  <div>
+    <a-card size="small" :bordered="false" class="searchBoxNormal">
+      <!-- 搜索条件 -->
+      <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="退货日期">
+                <rangeDate ref="rangeCreateDate" id="salesReturnRemove-createDate" :value="createDate" @change="dateCreateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+                <dealerSubareaScopeList ref="dealerSubareaScopeList" id="salesReturnRemove-buyerSn" @change="custChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="总部销退单号">
+                <a-input id="salesReturnRemove-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入总部销退单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button id="salesReturnRemove-search" type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button id="salesReturnRemove-reset" style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                <a-button
+                  style="margin-left: 10px"
+                  type="primary"
+                  class="button-warning"
+                  @click="handleExport"
+                  :disabled="disabled"
+                  :loading="exportLoading"
+                  id="salesReturnRemove-export">导出</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <a-spin :spinning="spinning" tip="Loading...">
+        <div class="table-operator" style="flex-grow: 1;display: flex;justify-content: space-between;align-items: center;">
+          <div style="flex-grow: 1;display: flex;align-items: center;">
+            <!-- 操作按钮 -->
+            <div>
+              <a-button type="primary" v-if="$hasPermissions('B_salesReturnNew')" @click="handleEdit">新增</a-button>
+            </div>
+          </div>
+          <div></div>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+75+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record, index">
+            <div>
+              <a-button
+                size="small"
+                type="link"
+                class="button-info"
+                @click="handleEdit(record)"
+                :id="'salesReturnRemove-edit-btn'+index">编辑</a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-error"
+                @click="handleDel(record)"
+                :id="'salesReturnRemove-del-btn'+index">删除</a-button>
+            </div>
+          </template>
+        </s-table>
+      </a-spin>
+      <!-- 选择客户弹框 -->
+      <baseModal :show="openModal" ref="openModal" @ok="handleEdit" @cancel="openModal=false"></baseModal>
+    </a-card>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import baseModal from './baseModal.vue'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { salesReturnList, salesReturnQueryCount, salesReturnDel, salesReturnCancelBill, salesReturnSubmit, submitVerify } from '@/api/salesReturn'
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
+export default {
+  name: 'SalesReturnList',
+  mixins: [commonMixin],
+  components: {
+    STable,
+    VSelect,
+    baseModal,
+    dealerSubareaScopeList,
+    rangeDate
+  },
+  data () {
+    return {
+      spinning: false,
+      // 高级搜索 展开/关闭
+      advanced: true,
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      createDate: [
+        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ], //  创建时间
+      openModal: false, // 选择客户弹框是否显示
+      openDepartUserModal: false,
+      // 查询参数
+      queryParam: {
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        buyerSn: undefined, //  客户名称
+        salesReturnBillNo: undefined //  总部销退单号
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        return salesReturnList(params).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
+        })
+      },
+      visibleAudit: false
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '编号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总部销退单号', dataIndex: 'salesReturnBillNo', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货日期', dataIndex: 'createDate', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'buyerName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '全国销售日报', dataIndex: 'goodFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '项目销售日报1', dataIndex: 'salesReturnTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '项目销售日报2', dataIndex: 'billStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区销售日报', dataIndex: 'billStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'billStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    //  创建时间  change
+    dateCreateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    // 选择客户
+    custChange (val) {
+      this.queryParam.buyerSn = val.key
+    },
+    //  导出  必填判断
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.exportList()
+        } else {
+          _this.$message.error('请选择时间')
+          return false
+        }
+      })
+    },
+    // 导出
+    exportList () {
+      const _this = this
+      const params = JSON.parse(JSON.stringify(_this.queryParam))
+      _this.exportLoading = true
+      _this.spinning = true
+      hdExportExcel(manageAnalysisReportExport, params, '各品类经营分析表-' + this.monthVal + '-', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+      })
+    },
+    // 编辑
+    handleEdit (row) {
+      this.openModal = true
+      this.$refs.openModal.edit(row)
+    },
+    // 删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要删除吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          salesReturnDel({ salesReturnBillSn: row.salesReturnBillSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    resetSearchForm () {
+      this.$refs.rangeCreateDate.resetDate(this.createDate)
+      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.buyerSn = undefined
+      this.$refs.dealerSubareaScopeList.resetForm()
+      this.queryParam.salesReturnBillNo = ''
+
+      this.$refs.table.refresh(true)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 305
+    }
+  },
+  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>