list.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. <template>
  2. <div>
  3. <a-card size="small" :bordered="false" class="salesDetailsList-wrap searchBoxNormal">
  4. <!-- 搜索条件 -->
  5. <div class="table-page-search-wrapper" ref="tableSearch">
  6. <a-form-model
  7. id="salesSlipReportList-form"
  8. ref="ruleForm"
  9. class="form-model-con"
  10. layout="inline"
  11. :model="queryParam"
  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="time">
  17. <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
  18. </a-form-model-item>
  19. </a-col>
  20. <a-col :md="6" :sm="24">
  21. <a-form-model-item label="销售单号">
  22. <a-input id="salesDetailsList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
  23. </a-form-model-item>
  24. </a-col>
  25. <a-col :md="6" :sm="24">
  26. <a-form-model-item label="备货单号">
  27. <a-input id="salesDetailsList-dispatchBillNo" v-model.trim="queryParam.dispatchBillNo" allowClear placeholder="请输入备货单号"/>
  28. </a-form-model-item>
  29. </a-col>
  30. <a-col :md="6" :sm="24">
  31. <a-form-model-item label="产品编码">
  32. <a-input id="salesDetailsList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
  33. </a-form-model-item>
  34. </a-col>
  35. <a-col :md="6" :sm="24">
  36. <a-form-model-item label="产品名称">
  37. <a-input id="salesDetailsList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
  38. </a-form-model-item>
  39. </a-col>
  40. <a-col :md="6" :sm="24">
  41. <a-form-model-item label="客户名称">
  42. <a-input id="salesDetailsList-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入客户名称"/>
  43. </a-form-model-item>
  44. </a-col>
  45. <a-col :md="6" :sm="24">
  46. <a-form-model-item label="客户级别">
  47. <v-select
  48. v-model="queryParam.dealerLevel"
  49. ref="dealerLevel"
  50. id="salesDetailsList-dealerLevel"
  51. code="DEALER_LEVEL"
  52. placeholder="请选择客户级别"
  53. allowClear></v-select>
  54. </a-form-model-item>
  55. </a-col>
  56. <a-col :md="6" :sm="24" v-if="isShowCustomerSearch">
  57. <a-form-model-item label="品牌分类">
  58. <v-select code="BRAND_TYPE" id="salesDetailsList-productBrandTypeSn" v-model="queryParam.productBrandTypeSn" allowClear placeholder="请选择品牌分类"></v-select>
  59. </a-form-model-item>
  60. </a-col>
  61. <template v-if="advanced">
  62. <a-col :md="6" :sm="24" v-if="!isShowCustomerSearch">
  63. <a-form-model-item label="品牌分类">
  64. <v-select code="BRAND_TYPE" id="salesDetailsList-productBrandTypeSn" v-model="queryParam.productBrandTypeSn" allowClear placeholder="请选择品牌分类"></v-select>
  65. </a-form-model-item>
  66. </a-col>
  67. <a-col :md="6" :sm="24">
  68. <a-form-model-item label="产品品牌">
  69. <ProductBrand id="salesDetailsList-productBrandSn" :brandType="queryParam.productBrandTypeSn" v-model="queryParam.productBrandSn"></ProductBrand>
  70. </a-form-model-item>
  71. </a-col>
  72. <a-col :md="6" :sm="24">
  73. <a-form-model-item label="产品分类">
  74. <ProductType id="salesDetailsList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
  75. </a-form-model-item>
  76. </a-col>
  77. <a-col :md="6" :sm="24">
  78. <a-form-model-item label="出库仓库">
  79. <chooseWarehouse ref="warehouse" isPermission v-model="queryParam.warehouseSn"></chooseWarehouse>
  80. </a-form-model-item>
  81. </a-col>
  82. <a-col :md="6" :sm="24">
  83. <a-form-model-item label="所在区域">
  84. <subarea id="salesDetailsList-subareaSn" ref="subarea" @change="subareaChange"></subarea>
  85. </a-form-model-item>
  86. </a-col>
  87. <a-col :md="6" :sm="24">
  88. <a-form-model-item label="区域负责人">
  89. <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
  90. </a-form-model-item>
  91. </a-col>
  92. <a-col :md="6" :sm="24">
  93. <a-form-model-item label="地区">
  94. <AreaList id="salesDetailsList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
  95. </a-form-model-item>
  96. </a-col>
  97. <a-col :md="6" :sm="24">
  98. <a-form-model-item label="促销产品">
  99. <a-select v-model="queryParam.giftFLag" placeholder="请选择促销产品" allowClear>
  100. <a-select-option value="1">
  101. </a-select-option>
  102. <a-select-option value="0">
  103. </a-select-option>
  104. </a-select>
  105. </a-form-model-item>
  106. </a-col>
  107. <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
  108. <a-form-item label="客服">
  109. <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
  110. </a-form-item>
  111. </a-col>
  112. </template>
  113. <a-col :md="isShowCustomerSearch?24:6" :sm="24" style="margin-bottom: 10px;" :style="{textAlign: isShowCustomerSearch?'center':''}">
  114. <!-- <a-button
  115. type="primary"
  116. class="button-info"
  117. size="small"
  118. @click="handleStock"
  119. id="salesDetailsList-stockDate">盘点区间日期</a-button> -->
  120. <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="salesDetailsList-refresh">查询</a-button>
  121. <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesDetailsList-reset">重置</a-button>
  122. <a-button
  123. style="margin-left: 5px"
  124. type="primary"
  125. class="button-warning"
  126. @click="handleExport"
  127. :disabled="disabled"
  128. :loading="exportLoading"
  129. v-if="$hasPermissions('B_salesDetailsExport')"
  130. id="salesDetailsList-export">导出</a-button>
  131. <a @click="advanced=!advanced" style="margin-left: 5px">
  132. {{ advanced ? '收起' : '展开' }}
  133. <a-icon :type="advanced ? 'up' : 'down'"/>
  134. </a>
  135. </a-col>
  136. </a-row>
  137. </a-form-model>
  138. </div>
  139. </a-card>
  140. <a-card size="small" :bordered="false">
  141. <a-spin :spinning="spinning" tip="Loading...">
  142. <!-- 列表 -->
  143. <s-table
  144. class="sTable fixPagination"
  145. ref="table"
  146. size="small"
  147. :rowKey="(record) => record.no"
  148. rowKeyName="no"
  149. :columns="columns"
  150. :data="loadData"
  151. :pageSize="30"
  152. :style="{ height: tableHeight+84.5+'px' }"
  153. :scroll="{ x: 2480 , y: tableHeight - 30 }"
  154. :defaultLoadData="false"
  155. bordered>
  156. <template slot="footer">
  157. <a-row :gutter="15">
  158. <a-col :md="4" :sm="24">下推数量:{{ (totalData && (totalData.qty || totalData.qty==0)) ? totalData.qty : '--' }}</a-col>
  159. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">实售金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? toThousands(totalData.totalRealAmount) : '--' }}</a-col>
  160. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
  161. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_costPrice')">成本金额:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? toThousands(totalData.totalCost) : '--' }}</a-col>
  162. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">优惠金额:{{ (totalData && (totalData.discountAmount || totalData.discountAmount==0)) ? toThousands(totalData.discountAmount) : '--' }}</a-col>
  163. <!-- <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">折后金额:{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? toThousands(totalData.discountedAmount) : '--' }}</a-col>
  164. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">折扣金额:{{ (totalData && (totalData.discountAmount || totalData.discountAmount==0)) ? toThousands(totalData.discountAmount) : '--' }}</a-col> -->
  165. </a-row>
  166. </template>
  167. </s-table>
  168. </a-spin>
  169. <!-- 导出提示框 -->
  170. <reportModal :visible="showExport" @close="showExport=false"></reportModal>
  171. </a-card>
  172. </div>
  173. </template>
  174. <script>
  175. import { commonMixin } from '@/utils/mixin'
  176. import getDate from '@/libs/getDate.js'
  177. import { STable, VSelect } from '@/components'
  178. import rangeDate from '@/views/common/rangeDate.vue'
  179. import subarea from '@/views/common/subarea.js'
  180. import custList from '@/views/common/custList.vue'
  181. import reportModal from '@/views/common/reportModal.vue'
  182. import AreaList from '@/views/common/areaList.js'
  183. import ProductBrand from '@/views/common/productBrand.js'
  184. import ProductType from '@/views/common/productType.js'
  185. import chooseWarehouse from '@/views/common/chooseWarehouse'
  186. import customerService from '@/views/common/customerService'
  187. import BizUser from '@/views/common/bizUser.js'
  188. import { hdExportExcel } from '@/libs/exportExcel'
  189. import { reportSalesBillDetailList, reportSalesBillDetailCount, reportSalesBillDetailExport } from '@/api/reportData'
  190. export default {
  191. name: 'SalesDetailsList',
  192. mixins: [commonMixin],
  193. components: { STable, VSelect, rangeDate, custList, subarea, ProductBrand, ProductType, reportModal, AreaList, chooseWarehouse, BizUser, customerService },
  194. data () {
  195. return {
  196. spinning: false,
  197. advanced: false, // 高级搜索 展开/关闭
  198. tableHeight: 0,
  199. showExport: false,
  200. queryParam: { // 查询条件
  201. time: [
  202. getDate.getCurrMonthDays().starttime,
  203. getDate.getCurrMonthDays().endtime
  204. ],
  205. beginDate: getDate.getCurrMonthDays().starttime,
  206. endDate: getDate.getCurrMonthDays().endtime,
  207. salesBillNo: '',
  208. dispatchBillNo: '', // 备货单号
  209. productCode: '',
  210. productName: '',
  211. dealerName: '',
  212. dealerLevel: undefined,
  213. productBrandTypeSn: undefined,
  214. productBrandSn: undefined, // 产品品牌
  215. productTypeSn1: '', // 产品一级分类
  216. productTypeSn2: '', // 产品二级分类
  217. productTypeSn3: '', // 产品三级分类
  218. subareaArea: {
  219. subareaSn: undefined,
  220. subareaAreaSn: undefined,
  221. bizUserSn: undefined
  222. },
  223. dealerProvinceSn: undefined,
  224. dealerCitySn: undefined,
  225. dealerCountySn: undefined,
  226. warehouseSn: undefined,
  227. giftFLag: undefined,
  228. bizUserSn: undefined // 客服
  229. },
  230. productType: [],
  231. rules: {
  232. 'time': [{ required: true, message: '请选择下推时间', trigger: 'change' }]
  233. },
  234. disabled: false, // 查询、重置按钮是否可操作
  235. exportLoading: false,
  236. // 加载数据方法 必须为 Promise 对象
  237. loadData: parameter => {
  238. this.disabled = true
  239. this.spinning = true
  240. const params = Object.assign(parameter, this.queryParam)
  241. return reportSalesBillDetailList(params).then(res => {
  242. let data
  243. if (res.status == 200) {
  244. data = res.data
  245. this.getCount(params)
  246. const no = (data.pageNo - 1) * data.pageSize
  247. for (var i = 0; i < data.list.length; i++) {
  248. data.list[i].no = no + i + 1
  249. }
  250. this.disabled = false
  251. }
  252. this.spinning = false
  253. return data
  254. })
  255. },
  256. totalData: null
  257. }
  258. },
  259. computed: {
  260. columns () {
  261. const _this = this
  262. const arr = [
  263. { title: '区域', dataIndex: 'subareaArea.subareaName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
  264. { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
  265. { title: '区域负责人', dataIndex: 'subareaArea.bizUserName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  266. { title: '销售单号', dataIndex: 'salesBillNo', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
  267. { title: '备货单号', dataIndex: 'dispatchBillNo', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
  268. { title: '出库仓库', dataIndex: 'warehouseName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  269. { title: '省份', dataIndex: 'dealerProvinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  270. { title: '客户名称', dataIndex: 'dealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  271. { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  272. { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  273. { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  274. { title: '创建时间', dataIndex: 'createDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
  275. { title: '销售审核时间', dataIndex: 'auditDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
  276. { title: '下推时间', dataIndex: 'pushedDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
  277. { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  278. { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
  279. { title: '产品名称', dataIndex: 'productName', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  280. { title: '产品编码', dataIndex: 'productCode', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
  281. { title: '单位', dataIndex: 'productUnit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
  282. { title: '下推数量', dataIndex: 'qty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
  283. // { title: '成本价', dataIndex: 'totalCost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  284. // { title: '实售价', dataIndex: 'totalRealAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  285. // { title: '开单价', dataIndex: 'totalAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  286. // { title: '市级价', dataIndex: 'totalCityAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  287. // { title: '直接差价', dataIndex: 'directRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  288. // { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  289. // { title: '折后单价', dataIndex: 'discountedPrice', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  290. // { title: '折扣金额', dataIndex: 'discountAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  291. ]
  292. if (this.$hasPermissions('M_salesDetailsList_costPrice')) { // 成本价权限
  293. arr.splice(21, 0, { title: '成本金额', dataIndex: 'totalCost', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  294. }
  295. if (this.$hasPermissions('M_salesDetailsList_salesPrice')) { // 售价权限
  296. arr.push({ title: '实售金额', dataIndex: 'totalRealAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  297. arr.push({ title: '开单金额', dataIndex: 'totalAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  298. }
  299. if (this.$hasPermissions('M_salesDetailsList_cityPrice')) { // 市级价权限
  300. arr.push({ title: '市级金额', dataIndex: 'totalCityAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  301. }
  302. if (this.$hasPermissions('M_salesDetailsList_salesPrice')) { // 售价权限
  303. arr.push({ title: '直接差金额', dataIndex: 'directRebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  304. arr.push({ title: '间接差金额', dataIndex: 'indirectRebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  305. arr.push({ title: '优惠金额', dataIndex: 'discountAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  306. // arr.push({ title: '折后单价', dataIndex: 'discountedPrice', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  307. // arr.push({ title: '折扣金额', dataIndex: 'discountAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  308. }
  309. arr.push({ title: '操作员', dataIndex: 'operatorName', width: 150, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
  310. return arr
  311. }
  312. },
  313. watch: {
  314. advanced (newValue, oldValue) {
  315. const _this = this
  316. this.$nextTick(() => { // 页面渲染完成后的回调
  317. _this.setTableH()
  318. })
  319. },
  320. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  321. this.setTableH()
  322. }
  323. },
  324. methods: {
  325. // 盘点库存日期
  326. handleStock () {
  327. this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
  328. },
  329. // 总计
  330. getCount (params) {
  331. reportSalesBillDetailCount(params).then(res => {
  332. if (res.status == 200 && res.data) {
  333. this.totalData = res.data
  334. } else {
  335. this.totalData = null
  336. }
  337. })
  338. },
  339. handleSearch () {
  340. const _this = this
  341. this.$refs.ruleForm.validate(valid => {
  342. if (valid) {
  343. _this.$refs.table.refresh(true)
  344. } else {
  345. _this.$message.error('请选择下推时间')
  346. return false
  347. }
  348. })
  349. },
  350. // 创建时间 change
  351. dateChange (date) {
  352. if (date[0] && date[1]) {
  353. this.queryParam.time = date
  354. } else {
  355. this.queryParam.time = []
  356. }
  357. this.queryParam.beginDate = date[0] || ''
  358. this.queryParam.endDate = date[1] || ''
  359. },
  360. custChange (val) {
  361. this.queryParam.dealerSn = val.key
  362. },
  363. subareaChange (val) {
  364. this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
  365. this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
  366. },
  367. // 重置
  368. resetSearchForm () {
  369. this.queryParam.time = [
  370. getDate.getCurrMonthDays().starttime,
  371. getDate.getCurrMonthDays().endtime
  372. ]
  373. this.$refs.rangeDate.resetDate(this.queryParam.time)
  374. this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
  375. this.queryParam.endDate = getDate.getCurrMonthDays().endtime
  376. this.queryParam.salesBillNo = ''
  377. this.queryParam.dispatchBillNo = ''
  378. this.queryParam.productCode = ''
  379. this.queryParam.productName = ''
  380. this.queryParam.dealerName = ''
  381. this.queryParam.dealerLevel = undefined
  382. this.queryParam.productBrandTypeSn = undefined
  383. this.queryParam.productBrandSn = undefined
  384. this.queryParam.productTypeSn1 = ''
  385. this.queryParam.productTypeSn2 = ''
  386. this.queryParam.productTypeSn3 = ''
  387. this.queryParam.subareaArea.subareaSn = undefined
  388. this.queryParam.subareaArea.subareaAreaSn = undefined
  389. this.queryParam.subareaArea.bizUserSn = undefined
  390. this.queryParam.dealerProvinceSn = undefined
  391. this.queryParam.dealerCitySn = undefined
  392. this.queryParam.dealerCountySn = undefined
  393. this.queryParam.warehouseSn = undefined
  394. this.queryParam.giftFLag = undefined
  395. this.queryParam.bizUserSn = undefined
  396. if (this.advanced) {
  397. this.$refs.subarea.clearData()
  398. this.$refs.areaList.clearData()
  399. }
  400. this.productType = []
  401. this.totalData = null
  402. this.$refs.ruleForm.resetFields()
  403. this.$refs.table.clearTable()
  404. },
  405. // 导出
  406. handleExport () {
  407. const _this = this
  408. this.$refs.ruleForm.validate(valid => {
  409. if (valid) {
  410. const params = _this.queryParam
  411. _this.$store.state.app.curActionPermission = 'B_salesDetailsExport'
  412. _this.showExport = true
  413. _this.exportLoading = true
  414. _this.spinning = true
  415. hdExportExcel(reportSalesBillDetailExport, params, '销售明细(开单统计)报表', function () {
  416. _this.exportLoading = false
  417. _this.spinning = false
  418. _this.$store.state.app.curActionPermission = ''
  419. })
  420. } else {
  421. return false
  422. }
  423. })
  424. },
  425. // 产品分类 change
  426. changeProductType (val, opt) {
  427. this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
  428. this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
  429. this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
  430. },
  431. areaChange (val) {
  432. this.queryParam.dealerProvinceSn = val[0] ? val[0] : ''
  433. this.queryParam.dealerCitySn = val[1] ? val[1] : ''
  434. this.queryParam.dealerCountySn = val[2] ? val[2] : ''
  435. },
  436. pageInit () {
  437. const _this = this
  438. this.$nextTick(() => { // 页面渲染完成后的回调
  439. _this.setTableH()
  440. })
  441. _this.resetSearchForm()
  442. },
  443. setTableH () {
  444. const tableSearchH = this.$refs.tableSearch.offsetHeight
  445. this.tableHeight = window.innerHeight - tableSearchH - 215
  446. }
  447. },
  448. mounted () {
  449. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  450. this.pageInit()
  451. }
  452. },
  453. activated () {
  454. // 如果是新页签打开,则重置当前页面
  455. if (this.$store.state.app.isNewTab) {
  456. this.pageInit()
  457. }
  458. },
  459. beforeRouteEnter (to, from, next) {
  460. next(vm => {})
  461. }
  462. }
  463. </script>