list.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. <template>
  2. <div>
  3. <a-card size="small" :bordered="false" class="promotionSalesList-wrap searchBoxNormal">
  4. <!-- 搜索条件 -->
  5. <div class="table-page-search-wrapper newTableSearchName" ref="tableSearch">
  6. <a-form-model
  7. id="promotionSalesList-form"
  8. ref="ruleForm"
  9. class="form-model-con"
  10. layout="inline"
  11. :model="form"
  12. :rules="rules"
  13. @keyup.enter.native="handleSearch">
  14. <a-row :gutter="15">
  15. <a-col :md="6" :sm="24">
  16. <a-form-model-item label="统计月份" prop="monthInfo">
  17. <div class="monthBox" style="display:flex;align-item:center;">
  18. <a-month-picker
  19. id="promotionSalesList-startValue"
  20. :disabled-date="disabledStartDate"
  21. format="YYYY-MM"
  22. v-model="startValue"
  23. placeholder="开始月份"
  24. @openChange="handleStartOpenChange"
  25. @change="getStartDate"
  26. />
  27. <span>~</span>
  28. <a-month-picker
  29. id="promotionSalesList-endValue"
  30. :disabled-date="disabledEndDate"
  31. format="YYYY-MM"
  32. v-model="endValue"
  33. placeholder="结束月份"
  34. :open="endOpen"
  35. @openChange="handleEndOpenChange"
  36. @change="getEndDate"
  37. />
  38. </div>
  39. </a-form-model-item>
  40. </a-col>
  41. <a-col :md="6" :sm="24">
  42. <a-form-model-item label="区域/分区">
  43. <subarea id="promotionSalesList-subareaSn" ref="subarea" @change="subareaChange"></subarea>
  44. </a-form-model-item>
  45. </a-col>
  46. <a-col :md="6" :sm="24">
  47. <a-form-model-item label="区域负责人">
  48. <BizUser id="promotionSalesList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
  49. </a-form-model-item>
  50. </a-col>
  51. <template v-if="advanced">
  52. <a-form-model-item label="省份">
  53. <Area id="promotionSalesList-provinceSn" v-model="queryParam.provinceSn" placeholder="请选择省"></Area>
  54. </a-form-model-item>
  55. <a-col :md="6" :sm="24">
  56. <a-form-model-item label="客户名称">
  57. <dealerSubareaScopeList ref="custList" id="salesAmountReportList-dealerSn" @change="custChange" />
  58. </a-form-model-item>
  59. </a-col>
  60. <a-col :md="6" :sm="24">
  61. <a-form-model-item label="客户级别">
  62. <v-select
  63. v-model="queryParam.dealerLevel"
  64. ref="dealerLevel"
  65. id="promotionSalesList-dealerLevel"
  66. code="DEALER_LEVEL"
  67. placeholder="请选择客户级别"
  68. allowClear></v-select>
  69. </a-form-model-item>
  70. </a-col>
  71. <a-col :md="6" :sm="24">
  72. <a-form-model-item label="产品品牌">
  73. <ProductBrand id="productInfoList-productBrand" v-model="queryParam.productBrand"></ProductBrand>
  74. </a-form-model-item>
  75. </a-col>
  76. <a-col :md="6" :sm="24">
  77. <a-form-model-item label="产品分类">
  78. <productTypeAll
  79. expandType="click"
  80. :changeOnSelect="false"
  81. placeholder="请选择产品分类"
  82. :level="2"
  83. @change="changeProductType"
  84. v-model="productType"
  85. id="productInfoList-productType"></productTypeAll>
  86. </a-form-model-item>
  87. </a-col>
  88. <a-col :md="6" :sm="24">
  89. <a-form-model-item label="新/老客户">
  90. <a-select id="productInfoList-dealerNewFlag" v-model="queryParam.dealerNewFlag" placeholder="请选择" allowClear>
  91. <a-select-option value="1">新客户</a-select-option>
  92. <a-select-option value="0">老客户</a-select-option>
  93. </a-select>
  94. </a-form-model-item>
  95. </a-col>
  96. </template>
  97. <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
  98. <a-button type="primary" @click="handleSearch" :disabled="disabled" id="promotionSalesList-refresh">查询</a-button>
  99. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="promotionSalesList-reset">重置</a-button>
  100. <a-button
  101. style="margin-left: 10px"
  102. type="primary"
  103. class="button-warning"
  104. @click="handleExport"
  105. :disabled="disabled"
  106. :loading="exportLoading"
  107. v-if="$hasPermissions('B_brandTypeReportExport')"
  108. id="promotionSalesList-export">导出</a-button>
  109. <a @click="advanced=!advanced" style="margin-left: 8px">
  110. {{ advanced ? '收起' : '展开' }}
  111. <a-icon :type="advanced ? 'up' : 'down'"/>
  112. </a>
  113. </a-col>
  114. </a-row>
  115. </a-form-model>
  116. </div>
  117. </a-card>
  118. <a-card size="small" :bordered="false">
  119. <a-spin :spinning="spinning" tip="Loading...">
  120. <!-- 列表 -->
  121. <s-table
  122. class="sTable fixPagination"
  123. ref="table"
  124. size="small"
  125. :defaultLoadData="true"
  126. :rowKey="(record) => record.no"
  127. rowKeyName="no"
  128. :columns="columns"
  129. :data="loadData"
  130. :pageSize="30"
  131. :style="{ height: tableHeight+84.5+'px' }"
  132. :scroll="{ x:1890,y: tableHeight-136 }"
  133. bordered>
  134. <!-- 品牌-->
  135. <template slot="brandName" slot-scope="text, record">
  136. {{ record.allProductBrandFlag==1?'全品牌':record.brandName?record.brandName:'--' }}
  137. </template>
  138. <!-- 分类 -->
  139. <template slot="brandtypeName" slot-scope="text, record">
  140. {{ record.allProductTypeFlag==1?'全分类':record.brandtypeName?record.brandtypeName:'--' }}
  141. </template>
  142. <template slot="footer" v-if="totalData">
  143. <a-row>
  144. <a-col span="24">
  145. <a-row>
  146. <a-col
  147. span="4"
  148. v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">销售额:{{ (totalData.totalSaleAmount || totalData.totalSaleAmount==0) ? toThousands(totalData.totalSaleAmount) : '--' }}</a-col>
  149. <a-col
  150. span="4"
  151. v-if="$hasPermissions('M_promotionSalesOrderReportList_costPrice')">促销成本费用:{{ (totalData.promoCostFee || totalData.promoCostFee==0) ? toThousands(totalData.promoCostFee) : '--' }}</a-col>
  152. <a-col
  153. span="4"
  154. v-if="$hasPermissions('M_promotionSalesOrderReportList_costPrice')">促销成本费用比:{{ totalData.promoCostFeeRate ? (totalData.promoCostFeeRate*100).toFixed(2)+'%' : '--' }}</a-col>
  155. <a-col
  156. span="4"
  157. v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">促销销售费用:{{ (totalData.promoSaleFee || totalData.promoSaleFee==0) ? toThousands(totalData.promoSaleFee) : '--' }}</a-col>
  158. <a-col
  159. span="4"
  160. v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">促销销售费用比:{{ totalData.promoSaleFeeRate ? (totalData.promoSaleFeeRate*100).toFixed(2)+'%' : '--' }}</a-col>
  161. <a-col
  162. span="4"
  163. v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">参与活动销售额:{{ (totalData.promoSaleAmount || totalData.promoSaleAmount==0) ? toThousands(totalData.promoSaleAmount) : '--' }}</a-col>
  164. <a-col
  165. span="4"
  166. v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">未参与活动销售额:{{ (totalData.notpromotionSale || totalData.notpromotionSale==0) ? toThousands(totalData.notpromotionSale) : '--' }}</a-col>
  167. <a-col
  168. span="4"
  169. v-if="$hasPermissions('M_promotionSalesOrderReportList_costPrice')">产品赠品成本费用:{{ (totalData.allocateGiftCost || totalData.allocateGiftCost==0) ? toThousands(totalData.allocateGiftCost) : '--' }}</a-col>
  170. <a-col
  171. span="4"
  172. v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">产品赠品销售费用:{{ (totalData.allocateGiftAmount || totalData.allocateGiftAmount==0) ? toThousands(totalData.allocateGiftAmount) : '--' }}</a-col>
  173. <a-col
  174. span="4"
  175. v-if="$hasPermissions('M_promotionSalesOrderReportList_costPrice')">物料赠品成本费用:{{ (totalData.allocateCost || totalData.allocateCost==0) ? toThousands(totalData.allocateCost) : '--' }}</a-col>
  176. <a-col
  177. span="4"
  178. v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">物料赠品销售费用:{{ (totalData.allocateSaleAmount || totalData.allocateSaleAmount==0) ? toThousands(totalData.allocateSaleAmount) : '--' }}</a-col>
  179. <a-col
  180. span="4"
  181. v-if="$hasPermissions('M_promotionSalesOrderReportList_costPrice')">成本费用合计(促销+产品+物料):{{ (totalData.promoCostFeeAndAllocateCost || totalData.promoCostFeeAndAllocateCost==0)? toThousands(totalData.promoCostFeeAndAllocateCost) : '--' }}</a-col>
  182. <a-col
  183. span="4"
  184. v-if="$hasPermissions('M_promotionSalesOrderReportList_costPrice')">成本合计占比:{{ totalData.totalCostRate ? (totalData.totalCostRate*100).toFixed(2)+'%' : '--' }}</a-col>
  185. <a-col
  186. span="4"
  187. v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">销售费用合计(促销+产品+物料):{{ (totalData.promoSaleFeeAndAllocateAmount || totalData.promoSaleFeeAndAllocateAmount==0) ? toThousands(totalData.promoSaleFeeAndAllocateAmount) : '--' }}</a-col>
  188. <a-col
  189. span="4"
  190. v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">销售合计占比:{{ totalData.totalSaleRate ? (totalData.totalSaleRate*100).toFixed(2)+'%' : '--' }}</a-col>
  191. </a-row>
  192. </a-col>
  193. </a-row>
  194. </template>
  195. </s-table>
  196. </a-spin>
  197. <!-- 导出提示框 -->
  198. <reportModal :visible="showExport" @close="showExport=false"></reportModal>
  199. </a-card>
  200. </div>
  201. </template>
  202. <script>
  203. import { commonMixin } from '@/utils/mixin'
  204. import moment from 'moment'
  205. import { hdExportExcel } from '@/libs/exportExcel'
  206. // 组件
  207. import { STable, VSelect } from '@/components'
  208. import ProductBrand from '@/views/common/productBrand.js'
  209. import productTypeAll from '@/views/common/productType.js'
  210. import subarea from '@/views/common/subarea.js'
  211. import reportModal from '@/views/common/reportModal.vue'
  212. import Area from '@/views/common/area.js'
  213. import BizUser from '@/views/common/bizUser.js'
  214. import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
  215. // 接口
  216. import { brandTypeReportList, brandTypeReportCount, brandTypeReportExport } from '@/api/reportData'
  217. export default {
  218. name: 'PromotionSalesOrderReport',
  219. mixins: [commonMixin],
  220. components: { STable, VSelect, subarea, dealerSubareaScopeList, reportModal, Area, BizUser, ProductBrand, productTypeAll },
  221. data () {
  222. return {
  223. spinning: false,
  224. advanced: true, // 高级搜索 展开/关闭
  225. tableHeight: 0, // 表格高度
  226. disabled: false, // 查询、重置按钮是否可操作
  227. exportLoading: false, // 导出按钮加载状态
  228. showExport: false, // 导出弹窗
  229. // 查询条件
  230. queryParam: {
  231. brandTypeBeginDate: moment().format('YYYYMM'), // 开始月份
  232. brandTypeEndDate: moment().format('YYYYMM'), // 结束月份
  233. dealerSn: undefined, // 客户 sn
  234. provinceSn: undefined, // 省份
  235. subareaArea: {
  236. subareaSn: undefined, // 区域
  237. subareaAreaSn: undefined, // 分区
  238. bizUserSn: undefined// 区域负责人
  239. },
  240. productBrand: undefined, // 产品品牌
  241. productTypeSn1: '', // 产品一级分类
  242. productType: '', // 产品二级分类
  243. dealerLevel: undefined// 客户等级
  244. },
  245. productType: [], // 产品分类
  246. form: {
  247. monthInfo: [moment().format('YYYY-MM'), moment().format('YYYY-MM')]
  248. },
  249. rules: {
  250. monthInfo: [{ required: true, message: '请选择统计月份', trigger: 'change' }]
  251. },
  252. startValue: moment().format('YYYY-MM'), // 统计月份 开始
  253. endValue: moment().format('YYYY-MM'), // 统计月份 结束
  254. endOpen: false, // 打开结束月份弹窗
  255. // 加载数据方法 必须为 Promise 对象
  256. loadData: parameter => {
  257. this.disabled = true
  258. this.spinning = true
  259. const newParamsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) // 有分页
  260. const paramsPage = JSON.parse(JSON.stringify(newParamsPage))
  261. delete paramsPage.productTypeSn1
  262. if (!paramsPage.subareaArea.subareaSn && !paramsPage.subareaArea.subareaAreaSn && !paramsPage.subareaArea.bizUserSn) {
  263. delete paramsPage.subareaArea
  264. }
  265. // 获取列表数据 有分页
  266. return brandTypeReportList(paramsPage).then(res => {
  267. let data
  268. if (res.status == 200) {
  269. data = res.data
  270. this.getCount(paramsPage)
  271. // 计算列表序号
  272. const no = (data.pageNo - 1) * data.pageSize
  273. for (var i = 0; i < data.list.length; i++) {
  274. data.list[i].no = no + i + 1
  275. }
  276. this.disabled = false
  277. }
  278. this.spinning = false
  279. return data
  280. })
  281. },
  282. totalData: null
  283. }
  284. },
  285. computed: {
  286. columns () {
  287. const _this = this
  288. const isCostFlag = this.$hasPermissions('M_promotionSalesOrderReportList_costPrice')
  289. const isSellFlag = this.$hasPermissions('M_promotionSalesOrderReportList_salesPrice')
  290. const arr = [
  291. { title: '区域', dataIndex: 'subareaArea.subareaName', show: true, width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
  292. { title: '分区', dataIndex: 'subareaArea.subareaAreaName', show: true, width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
  293. { title: '区域负责人', dataIndex: 'bizUserName', show: true, width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
  294. { title: '省份', dataIndex: 'dealerInfo.provinceName', show: true, width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
  295. { title: '客户名称', dataIndex: 'dealerInfo.dealerName', show: true, width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  296. { title: '客户级别', dataIndex: 'dealerInfo.dealerLevelDictValue', show: true, width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
  297. { title: '品牌', dataIndex: 'brandName', show: true, width: '80px', align: 'center', scopedSlots: { customRender: 'brandName' } },
  298. { title: '二级分类', dataIndex: 'brandtypeName', show: true, width: '90px', align: 'center', scopedSlots: { customRender: 'brandtypeName' } },
  299. { title: '销售额', dataIndex: 'totalSaleAmount', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
  300. { title: '促销成本费用', dataIndex: 'promoCostFee', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  301. { title: '促销成本费用比', dataIndex: 'promoCostFeeRate', show: true, width: '60px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
  302. { title: '促销销售费用', dataIndex: 'promoSaleFee', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
  303. { title: '促销销售费用比', dataIndex: 'promoSaleFeeRate', show: true, width: '60px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
  304. { title: '参与活动销售额', dataIndex: 'promoSaleAmount', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
  305. { title: '未参与活动销售额', dataIndex: 'notpromotionSale', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
  306. { title: '产品赠品成本费用', dataIndex: 'allocateGiftCost', show: isCostFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
  307. { title: '产品赠品销售费用', dataIndex: 'allocateGiftAmount', show: isSellFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
  308. { title: '物料赠品成本费用', dataIndex: 'allocateCost', show: isCostFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
  309. { title: '物料赠品销售费用', dataIndex: 'allocateSaleAmount', show: isSellFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
  310. { title: '成本费用合计(促销+产品+物料)', dataIndex: 'promoCostFeeAndAllocateCost', show: isCostFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
  311. { title: '成本合计占比', dataIndex: 'totalCostRate', show: isCostFlag, width: '60px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
  312. { title: '销售费用合计(促销+产品+物料)', dataIndex: 'promoSaleFeeAndAllocateAmount', show: isSellFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
  313. { title: '销售合计占比', dataIndex: 'totalSaleRate', show: isSellFlag, width: '60px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') }
  314. ]
  315. return arr.filter(item => item.show)
  316. }
  317. },
  318. watch: {
  319. // 展开关闭
  320. advanced (newValue, oldValue) {
  321. const _this = this
  322. this.$nextTick(() => { // 页面渲染完成后的回调
  323. _this.setTableH()
  324. })
  325. },
  326. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  327. this.setTableH()
  328. }
  329. },
  330. methods: {
  331. // 统计月份 选择月份限制
  332. disabledStartDate (current) {
  333. const endValue = this.endValue
  334. const md = moment(current).startOf('month').valueOf()
  335. const cd = moment().startOf('month').valueOf() // 当前月份
  336. if (!current || !endValue) {
  337. return md > cd
  338. }
  339. const ed = moment(endValue).startOf('month').valueOf()
  340. return md > ed || md > cd
  341. },
  342. disabledEndDate (current) {
  343. const startValue = this.startValue
  344. const md = moment(current).startOf('month').valueOf()
  345. const cd = moment().startOf('month').valueOf() // 当前月份
  346. if (!current || !startValue) {
  347. return md > cd
  348. }
  349. const sd = moment(startValue).startOf('month').valueOf()
  350. return md < sd || md > cd
  351. },
  352. // 开始时间
  353. handleStartOpenChange (open) {
  354. if (!open) {
  355. this.endOpen = true
  356. }
  357. },
  358. getStartDate (date, dateString) {
  359. this.form.monthInfo[0] = dateString
  360. this.queryParam.brandTypeBeginDate = date ? moment(dateString).startOf('month').format('YYYYMM') : ''
  361. },
  362. // 结束时间
  363. handleEndOpenChange (open) {
  364. this.endOpen = open
  365. },
  366. getEndDate (date, dateString) {
  367. this.form.monthInfo[1] = dateString
  368. this.queryParam.brandTypeEndDate = date ? moment(dateString).endOf('month').format('YYYYMM') : ''
  369. },
  370. // 导出
  371. handleExport () {
  372. const _this = this
  373. this.$refs.ruleForm.validate(valid => {
  374. if (valid) {
  375. const params = _this.queryParam
  376. _this.showExport = true
  377. _this.exportLoading = true
  378. _this.spinning = true
  379. _this.$store.state.app.curActionPermission = 'B_brandTypeReportExport'
  380. hdExportExcel(brandTypeReportExport, params, '促销销售单报表(统计)', function () {
  381. _this.exportLoading = false
  382. _this.spinning = false
  383. _this.$store.state.app.curActionPermission = ''
  384. })
  385. } else {
  386. return false
  387. }
  388. })
  389. },
  390. // 总计
  391. getCount (params) {
  392. brandTypeReportCount(params).then(res => {
  393. if (res.status == 200) {
  394. this.totalData = res.data || null
  395. } else {
  396. this.totalData = null
  397. }
  398. })
  399. },
  400. // 查询
  401. handleSearch () {
  402. const _this = this
  403. if (!_this.form.monthInfo[0] || !_this.form.monthInfo[1]) {
  404. _this.$message.error('请选择统计月份')
  405. return
  406. }
  407. this.$refs.ruleForm.validate(valid => {
  408. if (valid) {
  409. _this.$refs.table.refresh(true)
  410. } else {
  411. _this.$message.error('请选择统计月份')
  412. return false
  413. }
  414. })
  415. },
  416. // 客户名称
  417. custChange (val) {
  418. this.queryParam.dealerSn = val.key
  419. },
  420. // 区域分区
  421. subareaChange (val) {
  422. this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
  423. this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
  424. },
  425. // 产品分类 change
  426. changeProductType (val, opt) {
  427. this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
  428. this.queryParam.productType = val[1] ? val[1] : ''
  429. },
  430. // 重置
  431. resetSearchForm () {
  432. this.form.monthInfo = [moment().format('YYYY-MM'), moment().format('YYYY-MM')]
  433. this.startValue = moment().format('YYYY-MM')
  434. this.endValue = moment().format('YYYY-MM')
  435. this.queryParam.brandTypeBeginDate = moment().format('YYYYMM')
  436. this.queryParam.brandTypeEndDate = moment().format('YYYYMM')
  437. this.queryParam.dealerSn = undefined
  438. this.queryParam.provinceSn = undefined
  439. this.queryParam.subareaArea.subareaSn = undefined
  440. this.queryParam.subareaArea.subareaAreaSn = undefined
  441. this.queryParam.subareaArea.bizUserSn = undefined
  442. this.queryParam.productBrand = undefined
  443. this.queryParam.productTypeSn1 = undefined
  444. this.queryParam.productType = undefined
  445. this.queryParam.dealerLevel = undefined
  446. this.productType = []
  447. this.totalData = null
  448. if (this.advanced) {
  449. this.$refs.custList.resetForm()
  450. }
  451. this.$refs.subarea.clearData()
  452. this.$refs.ruleForm.resetFields()
  453. this.$refs.table.refresh()
  454. },
  455. // 计算表格高度
  456. setTableH () {
  457. const tableSearchH = this.$refs.tableSearch.offsetHeight
  458. this.tableHeight = window.innerHeight - tableSearchH - 215
  459. }
  460. },
  461. mounted () {
  462. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  463. this.setTableH()
  464. }
  465. },
  466. activated () {
  467. // 如果是新页签打开,则重置当前页面
  468. if (this.$store.state.app.isNewTab) {
  469. this.setTableH()
  470. }
  471. },
  472. beforeRouteEnter (to, from, next) {
  473. next(vm => {})
  474. }
  475. }
  476. </script>
  477. <style lang="less" scoped>
  478. .monthBox{
  479. /deep/.ant-calendar-picker-icon{
  480. display:none !important;
  481. }
  482. /deep/.ant-calendar-picker input{
  483. text-align:center;
  484. }
  485. }
  486. </style>