detailList.vue 25 KB

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