list.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. <template>
  2. <div>
  3. <a-card size="small" :bordered="false" class="tireSalesDealerList-wrap searchBoxNormal">
  4. <!-- 搜索条件 -->
  5. <div class="table-page-search-wrapper" ref="tableSearch">
  6. <a-form-model
  7. id="tireSalesDealerList-form"
  8. ref="ruleForm"
  9. class="form-model-con"
  10. layout="inline"
  11. :rules="rules"
  12. :model="queryParam">
  13. <a-row :gutter="15">
  14. <a-col :md="6" :sm="24">
  15. <a-form-model-item label="日期" prop="time">
  16. <rangeDate
  17. ref="rangeDate"
  18. :showTime="false"
  19. :today="true"
  20. :value="queryParam.time"
  21. id="tireSalesDealerList-time"
  22. @change="dateChange" />
  23. </a-form-model-item>
  24. </a-col>
  25. <a-col :md="6" :sm="24">
  26. <a-form-model-item label="地区">
  27. <AreaList id="tireSalesDealerList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
  28. </a-form-model-item>
  29. </a-col>
  30. <a-col :md="6" :sm="24">
  31. <a-form-model-item label="区域/分区">
  32. <subarea id="tireSalesDealerList-subarea" ref="subarea" @change="subareaChange"></subarea>
  33. </a-form-model-item>
  34. </a-col>
  35. <template v-if="advanced">
  36. <a-col :md="6" :sm="24">
  37. <a-form-model-item label="客户名称">
  38. <dealerSubareaScopeList ref="dealerSubareaScopeList" id="tireSalesDealerList-dealerName" @change="custChange" />
  39. </a-form-model-item>
  40. </a-col>
  41. <a-col :md="6" :sm="24">
  42. <a-form-model-item label="客户级别">
  43. <v-select
  44. v-model="queryParam.dealer.dealerLevel"
  45. ref="dealerLevel"
  46. id="tireSalesDealerList-dealerLevel"
  47. code="DEALER_LEVEL"
  48. placeholder="请选择客户级别"
  49. allowClear></v-select>
  50. </a-form-model-item>
  51. </a-col>
  52. <a-col :md="6" :sm="24">
  53. <a-form-model-item label="轮胎省仓">
  54. <v-select
  55. v-model="queryParam.provinceFlag"
  56. id="tireSalesDealerList-provinceFlag"
  57. code="Flag"
  58. placeholder="请选择是否是轮胎省仓"
  59. allowClear></v-select>
  60. </a-form-model-item>
  61. </a-col>
  62. <a-col :md="6" :sm="24">
  63. <a-form-model-item label="轮胎省仓名称">
  64. <dealerSubareaScopeList ref="provinceDealerList" placeholder="请输入轮胎省仓名称" id="tireSalesDealerList-parentDealerName" @change="custProvinceChange" />
  65. </a-form-model-item>
  66. </a-col>
  67. <a-col :md="6" :sm="24">
  68. <a-form-model-item label="区域负责人">
  69. <BizUser id="tireSalesDealerList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
  70. </a-form-model-item>
  71. </a-col>
  72. <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
  73. <a-form-model-item label="客服">
  74. <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
  75. </a-form-model-item>
  76. </a-col>
  77. </template>
  78. <a-col :md="isShowCustomerSearch?6:24" :sm="24" :style="{textAlign:isShowCustomerSearch?'left':'center'}">
  79. <a-button
  80. style="margin-left: 5px"
  81. type="primary"
  82. @click="handleSearch"
  83. :disabled="disabled"
  84. id="tireSalesDealerList-refresh">查询</a-button>
  85. <a-button
  86. style="margin-left: 8px"
  87. @click="resetSearchForm"
  88. :disabled="disabled"
  89. id="tireSalesDealerList-reset">重置</a-button>
  90. <a-button
  91. style="margin-left: 10px"
  92. type="primary"
  93. class="button-warning"
  94. @click="handleExport"
  95. :disabled="disabled"
  96. :loading="exportLoading"
  97. v-if="$hasPermissions('B_tireReportExport')"
  98. id="tireSalesDealerList-export">导出</a-button>
  99. <a @click="advanced=!advanced" style="margin-left: 5px">
  100. {{ advanced ? '收起' : '展开' }}
  101. <a-icon :type="advanced ? 'up' : 'down'" />
  102. </a>
  103. </a-col>
  104. </a-row>
  105. </a-form-model>
  106. </div>
  107. </a-card>
  108. <a-card size="small" :bordered="false">
  109. <a-spin :spinning="spinning" tip="Loading...">
  110. <!-- 列表 -->
  111. <s-table
  112. class="sTable fixPagination"
  113. ref="table"
  114. size="small"
  115. :rowKey="(record) => record.no"
  116. :style="{ height: tableHeight+70+'px' }"
  117. rowKeyName="no"
  118. :columns="columns"
  119. :data="loadData"
  120. :scroll="{x:2200, y: tableHeight-110 }"
  121. :defaultLoadData="false"
  122. bordered>
  123. <template slot="addressInfo" slot-scope="text, record">
  124. {{ record.dealerEntity.provinceName }}{{ '/'+record.dealerEntity.cityName }}{{ '/'+record.dealerEntity.districtName }}
  125. </template>
  126. <template slot="footer">
  127. <a-row :gutter="15">
  128. <a-col :md="4" :sm="24">总部订货数量:{{ (totalData && (totalData.sysOrderQty || totalData.sysOrderQty==0)) ? totalData.sysOrderQty : '--' }}</a-col>
  129. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">总部订货金额:{{ (totalData && (totalData.sysOrderAmount || totalData.sysOrderAmount==0)) ? toThousands(totalData.sysOrderAmount): '--' }}</a-col>
  130. <a-col :md="4" :sm="24">上级订货数量:{{ (totalData && (totalData.upOrderQty || totalData.upOrderQty==0)) ?totalData.upOrderQty: '--' }}</a-col>
  131. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">上级订货金额:{{ (totalData && (totalData.upOrderAmount || totalData.upOrderAmount==0)) ? toThousands(totalData.upOrderAmount): '--' }}</a-col>
  132. <a-col :md="4" :sm="24">跨地区订货数量:{{ (totalData && (totalData.crossRegionQty || totalData.crossRegionQty==0)) ?totalData.crossRegionQty: '--' }}</a-col>
  133. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">跨地区订货金额:{{ (totalData && (totalData.crossRegionAmount || totalData.crossRegionAmount==0)) ? toThousands(totalData.crossRegionAmount): '--' }}</a-col>
  134. <a-col :md="4" :sm="24">累计入库数量:{{ (totalData && (totalData.putQty || totalData.putQty==0)) ?totalData.putQty: '--' }}</a-col>
  135. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">累计入库金额:{{ (totalData && (totalData.putAmount || totalData.putAmount==0)) ? toThousands(totalData.putAmount): '--' }}</a-col>
  136. <a-col :md="4" :sm="24">退货数量:{{ (totalData && (totalData.returnQty || totalData.returnQty==0)) ?totalData.returnQty: '--' }}</a-col>
  137. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">退货金额:{{ (totalData && (totalData.returnAmount || totalData.returnAmount==0)) ? toThousands(totalData.returnAmount): '--' }}</a-col>
  138. <a-col :md="4" :sm="24">客户现有库存数量:{{ (totalData &&totalData.rptDealerStockVO && (totalData.rptDealerStockVO.totalStockQty || totalData.rptDealerStockVO.totalStockQty==0)) ?totalData.rptDealerStockVO.totalStockQty: '--' }}</a-col>
  139. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">客户现有库存金额:{{ (totalData&&totalData.rptDealerStockVO && (totalData.rptDealerStockVO.totalStockAmount || totalData.rptDealerStockVO.totalStockAmount==0)) ? toThousands(totalData.rptDealerStockVO.totalStockAmount): '--' }}</a-col>
  140. <a-col :md="4" :sm="24">出库加盟商数量:{{ (totalData && (totalData.outQtyDealer || totalData.outQtyDealer==0)) ?totalData.outQtyDealer: '--' }}</a-col>
  141. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">出库加盟商金额:{{ (totalData && (totalData.outAmountDealer || totalData.outAmountDealer==0)) ? toThousands(totalData.outAmountDealer): '--' }}</a-col>
  142. <a-col :md="4" :sm="24">出库跨区域数量:{{ (totalData && (totalData.crossRegionOutQty || totalData.crossRegionOutQty==0)) ?totalData.crossRegionOutQty: '--' }}</a-col>
  143. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">出库跨区域金额:{{ (totalData && (totalData.crossRegionOutAmount || totalData.crossRegionOutAmount==0)) ? toThousands(totalData.crossRegionOutAmount): '--' }}</a-col>
  144. <a-col :md="4" :sm="24">出库终端数量:{{ (totalData && (totalData.outQtyTerminal || totalData.outQtyTerminal==0)) ?totalData.outQtyTerminal: '--' }}</a-col>
  145. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">出库终端金额:{{ (totalData && (totalData.outAmountTerminal || totalData.outAmountTerminal==0)) ? toThousands(totalData.outAmountTerminal): '--' }}</a-col>
  146. <a-col :md="4" :sm="24">累计出库数量:{{ (totalData && (totalData.outQty || totalData.outQty==0)) ?totalData.outQty: '--' }}</a-col>
  147. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">累计出库金额:{{ (totalData && (totalData.outAmount || totalData.outAmount==0)) ? toThousands(totalData.outAmount): '--' }}</a-col>
  148. <a-col :md="4" :sm="24">已绑质保单数量:{{ (totalData&&totalData.rptDealerStockVO && (totalData.rptDealerStockVO.totalWarrantyQty || totalData.rptDealerStockVO.totalWarrantyQty==0)) ?totalData.rptDealerStockVO.totalWarrantyQty: '--' }}</a-col>
  149. </a-row>
  150. </template>
  151. </s-table>
  152. </a-spin>
  153. </a-card>
  154. <!-- 导出提示框 -->
  155. <reportModal :visible="showExport" @close="showExport=false"></reportModal>
  156. </div>
  157. </template>
  158. <script>
  159. import { commonMixin } from '@/utils/mixin'
  160. import { hdExportExcel } from '@/libs/exportExcel'
  161. // 组件
  162. import { STable, VSelect } from '@/components'
  163. import rangeDate from '@/views/common/rangeDate.vue'
  164. import subarea from '@/views/common/subarea.js'
  165. import AreaList from '@/views/common/areaList.js'
  166. import BizUser from '@/views/common/bizUser.js'
  167. import reportModal from '@/views/common/reportModal.vue'
  168. import customerService from '@/views/common/customerService'
  169. import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
  170. // 接口
  171. import { tireReportList, queryTireCount, tireListExport } from '@/api/reportData'
  172. export default {
  173. name: 'TireSalesDealerList',
  174. mixins: [commonMixin],
  175. components: { STable, VSelect, rangeDate, subarea, AreaList, BizUser, dealerSubareaScopeList, reportModal, customerService },
  176. data () {
  177. return {
  178. spinning: false,
  179. advanced: true, // 高级搜索 展开/关闭
  180. disabled: false, // 查询、重置按钮是否可操作
  181. exportLoading: false, // 导出按钮加载状态
  182. showExport: false, // 导出弹窗
  183. tableHeight: 0, // 表格高度
  184. // 查询条件
  185. queryParam: {
  186. time: [], // 日期
  187. bizBeginDate: '', // 开始时间
  188. bizEndDate: '', // 结束时间
  189. dealer: {
  190. provinceSn: undefined, // 省份编码
  191. citySn: undefined, // 市编码
  192. districtSn: undefined, // 区编码
  193. dealerLevel: undefined // 客户等级
  194. },
  195. dealerName: undefined, // 客户名称
  196. dealerSn: undefined, // 客户sn
  197. subareaArea: {
  198. subareaSn: undefined, // 区域
  199. subareaAreaSn: undefined, // 分区
  200. bizUserSn: undefined // 区域负责人
  201. },
  202. parentDealerSn: undefined, // 轮胎省仓sn
  203. parentDealerName: undefined, // 轮胎省仓名称
  204. provinceFlag: undefined, // 是否是轮胎省仓 1是 0否
  205. bizUserSn: undefined// 客服
  206. },
  207. rules: {
  208. 'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
  209. },
  210. // 加载数据方法 必须为 Promise 对象
  211. loadData: parameter => {
  212. this.disabled = true
  213. this.spinning = true
  214. const oldParams = Object.assign(parameter, this.queryParam)
  215. const params = JSON.parse(JSON.stringify(oldParams))
  216. delete params.time
  217. // 获取列表数据 有分页
  218. return tireReportList(params).then(res => {
  219. let data
  220. if (res.status == 200 && res.data) {
  221. data = res.data
  222. // 计算列表序号
  223. const no = (data.pageNo - 1) * data.pageSize
  224. for (var i = 0; i < data.list.length; i++) {
  225. data.list[i].no = no + i + 1
  226. }
  227. this.disabled = false
  228. // 获取统计数据
  229. this.getCount(params)
  230. }
  231. this.spinning = false
  232. return data
  233. })
  234. },
  235. totalData: null
  236. }
  237. },
  238. watch: {
  239. // 展开关闭
  240. advanced (newValue, oldValue) {
  241. const _this = this
  242. this.$nextTick(() => { // 页面渲染完成后的回调
  243. _this.setTableH()
  244. })
  245. },
  246. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  247. this.setTableH()
  248. }
  249. },
  250. computed: {
  251. columns () {
  252. const _this = this
  253. const arr = [
  254. { title: '序号', dataIndex: 'no', width: '40px', align: 'center' },
  255. { title: '地区', scopedSlots: { customRender: 'addressInfo' }, width: '12%', align: 'center' },
  256. { title: '区域', dataIndex: 'subareaArea.subareaName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  257. { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  258. { title: '区域负责人', dataIndex: 'bizUserName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  259. { title: '客户名称', dataIndex: 'dealerEntity.dealerName', width: '150px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  260. { title: '客户级别', dataIndex: 'dealerEntity.dealerLevelDictValue', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
  261. { title: '轮胎省仓', dataIndex: 'provinceFlag', width: '9%', align: 'center', customRender: function (text) { return text == '1' ? '是' : '否' } },
  262. { title: '轮胎省仓名称', dataIndex: 'parentDealerName', width: '150px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  263. { title: '任务数量', dataIndex: 'dealerEntity.taskNum', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  264. { title: '总部订货数量', dataIndex: 'sysOrderQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  265. { title: '上级订货数量', dataIndex: 'upOrderQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  266. { title: '跨地区订货数量', dataIndex: 'crossRegionQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  267. { title: '累计入库数量', dataIndex: 'putQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  268. { title: '退货数量', dataIndex: 'returnQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  269. { title: '客户现有库存数量', dataIndex: 'rptDealerStockVO.totalStockQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  270. { title: '出库加盟商数量', dataIndex: 'outQtyDealer', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  271. { title: '出库跨区域数量', dataIndex: 'crossRegionOutQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  272. { title: '出库终端数量', dataIndex: 'outQtyTerminal', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  273. { title: '累计出库数量', dataIndex: 'outQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  274. { title: <div>已绑质保单<div>数量</div></div>, dataIndex: 'rptDealerStockVO.totalWarrantyQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
  275. ]
  276. if (this.$hasPermissions('M_tireSalesReportList_salesPrice')) {
  277. arr.splice(10, 0, { title: '授信金额', dataIndex: 'dealerEntity.taskAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  278. arr.splice(12, 0, { title: '总部订货金额', dataIndex: 'sysOrderAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  279. arr.splice(14, 0, { title: '上级订货金额', dataIndex: 'upOrderAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  280. arr.splice(16, 0, { title: '跨地区订货金额', dataIndex: 'crossRegionAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  281. arr.splice(18, 0, { title: '累计入库金额', dataIndex: 'putAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  282. arr.splice(20, 0, { title: '退货金额', dataIndex: 'returnAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  283. arr.splice(22, 0, { title: '客户现有库存金额', dataIndex: 'rptDealerStockVO.totalStockAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  284. arr.splice(24, 0, { title: '出库加盟商金额', dataIndex: 'outAmountDealer', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  285. arr.splice(26, 0, { title: '出库跨区域金额', dataIndex: 'crossRegionOutAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  286. arr.splice(28, 0, { title: '出库终端金额', dataIndex: 'outAmountTerminal', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  287. arr.splice(30, 0, { title: '累计出库金额', dataIndex: 'outAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  288. }
  289. return arr
  290. }
  291. },
  292. methods: {
  293. // 查询
  294. handleSearch () {
  295. const _this = this
  296. this.$refs.ruleForm.validate(valid => {
  297. if (valid) {
  298. _this.$refs.table.refresh(true)
  299. } else {
  300. _this.$message.error('请选择日期')
  301. return false
  302. }
  303. })
  304. },
  305. // 客户名称 change
  306. custChange (val) {
  307. this.queryParam.dealerName = val.name
  308. this.queryParam.dealerSn = val.key
  309. },
  310. // 轮胎省仓客户名称 change
  311. custProvinceChange (val) {
  312. this.queryParam.parentDealerName = val.name
  313. this.queryParam.parentDealerSn = val.key
  314. },
  315. // 统计
  316. getCount (params) {
  317. queryTireCount(params).then(res => {
  318. if (res.status == 200 && res.data) {
  319. this.totalData = res.data
  320. } else {
  321. this.totalData = null
  322. }
  323. })
  324. },
  325. // 地区
  326. areaChange (val) {
  327. this.queryParam.dealer.provinceSn = val[0] ? val[0] : undefined
  328. this.queryParam.dealer.citySn = val[1] ? val[1] : undefined
  329. this.queryParam.dealer.districtSn = val[2] ? val[2] : undefined
  330. },
  331. // 日期选择 change
  332. dateChange (date) {
  333. if (date[0] && date[1]) {
  334. this.queryParam.time = date
  335. } else {
  336. this.queryParam.time = []
  337. }
  338. this.queryParam.bizBeginDate = date[0] ? date[0].replace(/-/g, '') : ''
  339. this.queryParam.bizEndDate = date[1] ? date[1].replace(/-/g, '') : ''
  340. },
  341. // 区域分区 change
  342. subareaChange (val) {
  343. this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
  344. this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
  345. },
  346. // 重置
  347. resetSearchForm () {
  348. this.queryParam.time = []
  349. this.$refs.rangeDate.resetDate()
  350. this.queryParam.bizBeginDate = ''
  351. this.queryParam.bizEndDate = ''
  352. this.queryParam.dealer.provinceSn = undefined
  353. this.queryParam.dealer.citySn = undefined
  354. this.queryParam.dealer.districtSn = undefined
  355. this.queryParam.dealerName = undefined
  356. this.queryParam.dealerSn = undefined
  357. this.queryParam.subareaArea.subareaSn = undefined
  358. this.queryParam.subareaArea.subareaAreaSn = undefined
  359. this.queryParam.subareaArea.bizUserSn = undefined
  360. this.queryParam.dealer.dealerLevel = undefined
  361. this.queryParam.parentDealerSn = undefined
  362. this.queryParam.parentDealerName = undefined
  363. this.queryParam.provinceFlag = undefined
  364. this.queryParam.bizUserSn = undefined
  365. this.totalData = null
  366. this.$refs.areaList.clearData()
  367. if (this.advanced) {
  368. this.$refs.provinceDealerList.resetForm()
  369. this.$refs.dealerSubareaScopeList.resetForm()
  370. }
  371. this.$refs.subarea.clearData()
  372. this.$refs.table.clearTable()
  373. },
  374. // 导出 查询数据必填判断
  375. handleExport () {
  376. const _this = this
  377. this.$refs.ruleForm.validate(valid => {
  378. if (valid) {
  379. _this.exportList()
  380. } else {
  381. _this.$message.error('请选择日期')
  382. return false
  383. }
  384. })
  385. },
  386. // 导出
  387. exportList () {
  388. const _this = this
  389. const params = JSON.parse(JSON.stringify(_this.queryParam))
  390. _this.exportLoading = true
  391. _this.spinning = true
  392. _this.showExport = true
  393. _this.$store.state.app.curActionPermission = 'B_tireReportExport'
  394. params.exportFlag = 0
  395. delete params.time
  396. hdExportExcel(tireListExport, params, '轮胎统计报表', function () {
  397. _this.exportLoading = false
  398. _this.spinning = false
  399. _this.$store.state.app.curActionPermission = ''
  400. })
  401. },
  402. // 初始化
  403. pageInit () {
  404. const _this = this
  405. this.$nextTick(() => { // 页面渲染完成后的回调
  406. _this.setTableH()
  407. })
  408. },
  409. // 计算表格高度
  410. setTableH () {
  411. const tableSearchH = this.$refs.tableSearch.offsetHeight
  412. this.tableHeight = window.innerHeight - tableSearchH - 276
  413. }
  414. },
  415. mounted () {
  416. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  417. this.pageInit()
  418. }
  419. },
  420. activated () {
  421. // 如果是新页签打开,则重置当前页面
  422. if (this.$store.state.app.isNewTab) {
  423. this.pageInit()
  424. }
  425. },
  426. beforeRouteEnter (to, from, next) {
  427. next(vm => {})
  428. }
  429. }
  430. </script>