index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. <template>
  2. <div>
  3. <a-spin :spinning="spinning" tip="Loading...">
  4. <a-tabs default-active-key="1" @change="handleChange" :tabBarStyle="{'background':'#fff'}">
  5. <a-tab-pane key="1" tab="促销销售单报表">
  6. <a-card size="small" :bordered="false" class="promotionSalesRealTimeReport-wrap searchBoxNormal">
  7. <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
  8. <!-- 查询条件 -->
  9. <a-form-model
  10. layout="inline"
  11. ref="ruleForm"
  12. id="promotionSalesRealTimeReport-form"
  13. :rules="rules"
  14. :model="queryParam">
  15. <a-row :gutter="15">
  16. <a-col :md="6" :sm="24">
  17. <a-form-model-item label="销售审核时间" prop="salesDate">
  18. <rangeDate ref="rangeDate" id="promotionSalesRealTimeReport-salesDate" :value="queryParam.salesDate" @change="salesDateChange" />
  19. </a-form-model-item>
  20. </a-col>
  21. <a-col :md="6" :sm="24">
  22. <a-form-model-item label="促销名称">
  23. <a-input id="promotionSalesRealTimeReport-title" v-model.trim="queryParam.promoRuleReport.title" allowClear placeholder="请输入促销名称"/>
  24. </a-form-model-item>
  25. </a-col>
  26. <a-col :md="6" :sm="24">
  27. <a-form-model-item label="促销类型">
  28. <v-select
  29. v-model="queryParam.promoRuleReport.promotionRuleType"
  30. ref="ruleType"
  31. id="promotionSalesRealTimeReport-ruleType"
  32. code="PROMOTION_RULE_TYPE"
  33. placeholder="请选择促销类型"
  34. allowClear></v-select>
  35. </a-form-model-item>
  36. </a-col>
  37. <a-col :md="6" :sm="24">
  38. <a-form-model-item label="销售单号">
  39. <a-input id="promotionSalesRealTimeReport-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
  40. </a-form-model-item>
  41. </a-col>
  42. <template v-if="advanced">
  43. <a-col :md="6" :sm="24">
  44. <a-form-model-item label="促销开始时间">
  45. <a-range-picker
  46. id="promotionSalesRealTimeReport-time"
  47. style="width:100%"
  48. v-model="time"
  49. :format="dateFormat"
  50. :placeholder="['开始时间', '结束时间']"
  51. @change="dateChange"></a-range-picker>
  52. </a-form-model-item>
  53. </a-col>
  54. <a-col :md="6" :sm="24">
  55. <a-form-model-item label="规则">
  56. <a-input id="promotionSalesRealTimeReport-ruleInfo" v-model.trim="queryParam.promoRuleReport.ruleInfo" allowClear placeholder="请输入规则关键字"/>
  57. </a-form-model-item>
  58. </a-col>
  59. <a-col :md="6" :sm="24">
  60. <a-form-model-item label="客户级别">
  61. <v-select
  62. v-model="queryParam.buyerLevel"
  63. ref="buyerLevel"
  64. id="promotionSalesRealTimeReport-buyerLevel"
  65. code="DEALER_LEVEL"
  66. placeholder="请选择客户级别"
  67. allowClear></v-select>
  68. </a-form-model-item>
  69. </a-col>
  70. <a-col :md="6" :sm="24">
  71. <a-form-model-item label="客户名称">
  72. <a-input id="promotionSalesRealTimeReport-buyerName" v-model.trim="queryParam.buyerName" allowClear placeholder="请输入客户名称"/>
  73. </a-form-model-item>
  74. </a-col>
  75. <a-col :md="6" :sm="24">
  76. <a-form-model-item label="所在区域">
  77. <subarea ref="subarea" id="promotionSalesRealTimeReport-subarea" @change="subareaChange"></subarea>
  78. </a-form-model-item>
  79. </a-col>
  80. <a-col :md="6" :sm="24">
  81. <a-form-model-item label="地区">
  82. <AreaList id="promotionSalesRealTimeReport-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
  83. </a-form-model-item>
  84. </a-col>
  85. <a-col :md="6" :sm="24">
  86. <a-form-model-item label="采购额">
  87. <v-select
  88. v-model="queryParam.giveMoney"
  89. ref="giveMoney"
  90. id="promotionSalesRealTimeReport-giveMoney"
  91. code="GIVE_MONEY"
  92. placeholder="请选择采购额"
  93. allowClear></v-select>
  94. </a-form-model-item>
  95. </a-col>
  96. <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
  97. <a-form-model-item label="客服">
  98. <customerService id="promotionSalesRealTimeReport-customerName" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
  99. </a-form-model-item>
  100. </a-col>
  101. </template>
  102. <a-col :md="24" :sm="24" style="text-align:center">
  103. <div class="table-page-search-submitButtons">
  104. <a-button type="primary" id="promotionSalesRealTimeReport-refresh" :disabled="disabled" @click="testForm('search')" >查询</a-button>
  105. <a-button style="margin-left: 8px" id="promotionSalesRealTimeReport-reset" :disabled="disabled" @click="resetSearchForm">重置</a-button>
  106. <a-button
  107. style="margin-left: 10px"
  108. type="primary"
  109. class="button-warning"
  110. @click="testForm('export')"
  111. :disabled="disabled"
  112. :loading="exportLoading"
  113. id="promotionSalesRealTimeReport-export"
  114. v-if="$hasPermissions('B_promotionSalesExport')"
  115. >导出</a-button>
  116. <a @click="advanced=!advanced" style="margin-left: 8px">
  117. {{ advanced ? '收起' : '展开' }}
  118. <a-icon :type="advanced ? 'up' : 'down'"/>
  119. </a>
  120. </div>
  121. </a-col>
  122. </a-row>
  123. </a-form-model>
  124. </div>
  125. </a-card>
  126. <!-- 列表 -->
  127. <a-card size="small" :bordered="false">
  128. <s-table
  129. class="sTable fixPagination"
  130. ref="table"
  131. size="small"
  132. :rowKey="(record) => record.no"
  133. rowKeyName="no"
  134. :columns="columns"
  135. :data="loadData"
  136. :pageSize="30"
  137. :style="{ height: tableHeight+84.5+'px' }"
  138. :scroll="{ x:1890,y: tableHeight-34}"
  139. :defaultLoadData="false"
  140. bordered>
  141. <!-- 促销时间 -->
  142. <template slot="promotionTime" slot-scope="text, record">
  143. <span v-if="record.promotion && record.promotion.promotionDateStart">{{ record.promotion.promotionDateStart }}-{{ record.promotion.promotionDateEnd }}</span>
  144. <span v-else>--</span>
  145. </template>
  146. <!-- 规则 -->
  147. <template slot="promotionDesc" slot-scope="text, record">
  148. <div v-if="record.ruleInfo" v-html="record.ruleInfo"></div>
  149. <span v-else>--</span>
  150. </template>
  151. <!-- 地区 -->
  152. <template slot="addressInfo" slot-scope="text, record">
  153. <span v-if="record.provinceName">{{ record.provinceName }}{{ record.cityName?'/'+record.cityName:'' }}{{ record.districtName?'/'+record.districtName :'' }}</span>
  154. <span v-else>--</span>
  155. </template>
  156. <template slot="footer">
  157. <a-row>
  158. <a-col span="24">
  159. <a-row>
  160. <a-col span="4">数量(非促):{{ (totalData && (totalData.notGiftQty || totalData.notGiftQty==0)) ? totalData.notGiftQty : '--' }}</a-col>
  161. <a-col span="4">数量(促):{{ (totalData && (totalData.giftQty || totalData.giftQty==0)) ? totalData.giftQty: '--' }}</a-col>
  162. <a-col span="4">实售金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? toThousands(totalData.totalRealAmount) : '--' }}</a-col>
  163. <a-col span="4">开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
  164. <a-col span="4">成本金额:{{ (totalData && (totalData.totalRealCost || totalData.totalRealCost==0)) ? totalData.totalRealCost : '--' }}</a-col>
  165. <a-col span="4">损失成本:{{ (totalData && (totalData.lossCost || totalData.lossCost==0)) ? toThousands(totalData.lossCost) : '--' }}</a-col>
  166. <a-col span="4">损失费用:{{ (totalData && (totalData.lossAmount || totalData.lossAmount==0)) ? toThousands(totalData.lossAmount) : '--' }}</a-col>
  167. <a-col span="4">采购额结余:{{ (totalData && (totalData.surplusPromoGiftsAmount || totalData.surplusPromoGiftsAmount==0)) ? toThousands(totalData.surplusPromoGiftsAmount) : '--' }}</a-col>
  168. <a-col span="4">采购额超出:{{ (totalData && (totalData.outPromoGiftsAmount || totalData.outPromoGiftsAmount==0)) ? toThousands(totalData.outPromoGiftsAmount) : '--' }}</a-col>
  169. <a-col span="4">转采购额数量:{{ (totalData && (totalData.convertPromoGiftsQty || totalData.convertPromoGiftsQty==0)) ? totalData.convertPromoGiftsQty : '--' }}</a-col>
  170. <a-col span="4">转采购额金额:{{ (totalData && (totalData.convertPromoGiftsAmount || totalData.convertPromoGiftsAmount==0)) ? toThousands(totalData.convertPromoGiftsAmount) : '--' }}</a-col>
  171. <a-col span="4">促销金额:{{ (totalData && (totalData.promoAmount || totalData.promoAmount==0)) ? toThousands(totalData.promoAmount) : '--' }}</a-col>
  172. </a-row>
  173. </a-col>
  174. </a-row>
  175. </template>
  176. </s-table>
  177. </a-card>
  178. </a-tab-pane>
  179. <a-tab-pane key="2" tab="促销销售单实时报表" force-render>
  180. <gatherList></gatherList>
  181. </a-tab-pane>
  182. </a-tabs>
  183. <!-- 导出提示框 -->
  184. <reportModal :visible="showExport" @close="showExport=false"></reportModal>
  185. </a-spin>
  186. </div>
  187. </template>
  188. <script>
  189. import { commonMixin } from '@/utils/mixin'
  190. import getDate from '@/libs/getDate.js'
  191. import { hdExportExcel } from '@/libs/exportExcel'
  192. // 组件
  193. import { STable, VSelect } from '@/components'
  194. import reportModal from '@/views/common/reportModal.vue'
  195. import gatherList from './list'
  196. import rangeDate from '@/views/common/rangeDate.vue'
  197. import subarea from '@/views/common/subarea.js'
  198. import AreaList from '@/views/common/areaList.js'
  199. import customerService from '@/views/common/customerService'
  200. // 接口
  201. import { salesPromoReportList, salesPromoReportQueryCount, exportSalesPromoReport } from '@/api/reportData'
  202. export default {
  203. name: 'PriceDifferenceDetailReportList',
  204. mixins: [commonMixin],
  205. components: { STable, VSelect, gatherList, reportModal, AreaList, rangeDate, subarea, customerService },
  206. data () {
  207. const _this = this
  208. return {
  209. spinning: false,
  210. advanced: true, // 高级搜索 展开/关闭
  211. time: undefined, // 促销开始时间
  212. queryParam: {
  213. // 促销审核时间默认值
  214. salesDate: [
  215. getDate.getCurrMonthDays().starttime,
  216. getDate.getCurrMonthDays().endtime
  217. ],
  218. beginAuditDate: getDate.getCurrMonthDays().starttime, // 审核开始时间
  219. endAuditDate: getDate.getCurrMonthDays().endtime, // 审核结束时间
  220. promoRuleReport: {
  221. promotionDateStart: undefined, // 促销时间-开始
  222. promotionDateEnd: undefined, // 促销时间-结束
  223. title: '', // 促销名称
  224. promotionRuleType: undefined, // 促销类型
  225. ruleInfo: ''// 规则
  226. },
  227. salesBillNo: '', // 销售单号
  228. buyerLevel: undefined, // 客户级别
  229. buyerName: '', // 客户名称
  230. subareaArea: {
  231. subareaSn: '', // 区域
  232. subareaAreaSn: ''// 分区
  233. },
  234. dealerProvinceSn: undefined, // 省份编码
  235. dealerCitySn: undefined, // 城市编码
  236. dealerDistrictSn: undefined, // 区域编码
  237. giveMoney: undefined, // 采购额
  238. bizUserSn: undefined// 客服
  239. },
  240. rules: {
  241. salesDate: [{ required: true, message: '请选择销售审核时间', trigger: 'change' }]
  242. },
  243. dateFormat: 'YYYY-MM-DD', // 时间格式
  244. tabVal: 1, // tab值 1促销销售单报表 2促销销售单实时报表
  245. disabled: false, // 查询、重置按钮是否可操作
  246. tableHeight: 0, // 表格高度
  247. totalData: null, // 合计
  248. exportLoading: false, // 导出按钮加载状态
  249. showExport: false, // 导出弹窗
  250. columns: [
  251. { title: '促销名称', dataIndex: 'promotion.title', width: '160px', align: 'left', customRender: function (text) { return text || '--' }, fixed: 'left', ellipsis: true },
  252. { title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '130px', align: 'center', fixed: 'left' },
  253. { title: '费用所属部门', dataIndex: 'departmentName', width: '160px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, fixed: 'left' },
  254. { title: '促销类型', dataIndex: 'promotionRule.promotionRuleTypeDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
  255. { title: '规则', dataIndex: 'promotionRule.ruleInfo', width: '180px', align: 'left', scopedSlots: { customRender: 'promotionDesc' }, fixed: 'left' },
  256. { title: '销售单号', dataIndex: 'salesBillNo', width: '120px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
  257. { title: '区域', dataIndex: 'subareaArea.subareaName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
  258. { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
  259. { title: '地区', dataIndex: 'provinceName', width: '160px', align: 'center', scopedSlots: { customRender: 'addressInfo' } },
  260. { title: '客户名称', dataIndex: 'buyerName', width: '140px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  261. { title: '客户级别', dataIndex: 'buyerLevelDictValue', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
  262. { title: '销售审核时间', dataIndex: 'auditDate', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
  263. { title: '数量(非促)', dataIndex: 'notGiftQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  264. { title: '数量(促)', dataIndex: 'giftQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  265. { title: '实售金额', dataIndex: 'totalRealAmount', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  266. { title: '开单金额', dataIndex: 'totalAmount', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  267. { title: '成本金额', dataIndex: 'totalRealCost', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  268. { title: '损失成本', dataIndex: 'lossCost', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  269. { title: '损失费用', dataIndex: 'lossAmount', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  270. { title: <a-tooltip placement='top' title='即在下推时促销产品已转采购额的数量'>转采购额数量&nbsp;<a-icon type="question-circle" /></a-tooltip>, dataIndex: 'convertPromoGiftsQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  271. { title: <a-tooltip placement='top' title='即促销产品转采购额金额,促销产品转采购额数量*销售价'>转采购额金额&nbsp;<a-icon type="question-circle" /></a-tooltip>, dataIndex: 'convertPromoGiftsAmount', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  272. { title: '采购额结余', dataIndex: 'surplusPromoGiftsAmount', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  273. { title: '采购额超出', dataIndex: 'outPromoGiftsAmount', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  274. { title: '促销金额', dataIndex: 'promoAmount', width: '90px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  275. { title: '促销品费用归属品牌', dataIndex: 'promoProductBrandName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
  276. { title: '促销品费用归属分类', dataIndex: 'promoProductTypeName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } }
  277. ],
  278. // 加载数据方法 必须为 Promise 对象
  279. loadData: parameter => {
  280. this.disabled = true
  281. const params = Object.assign(parameter, this.queryParam)
  282. const newParams = JSON.parse(JSON.stringify(params))
  283. delete newParams.salesDate
  284. this.spinning = true
  285. // 促销销售单报表 列表 有分页
  286. return salesPromoReportList(newParams).then(res => {
  287. let data
  288. if (res.status == 200) {
  289. data = res.data
  290. // 序号计算
  291. const no = (data.pageNo - 1) * data.pageSize
  292. for (var i = 0; i < data.list.length; i++) {
  293. data.list[i].no = no + i + 1
  294. }
  295. this.disabled = false
  296. }
  297. this.spinning = false
  298. return data
  299. })
  300. }
  301. }
  302. },
  303. methods: {
  304. // 销售审核时间 change
  305. salesDateChange (date) {
  306. if (date[0] && date[1]) {
  307. this.queryParam.salesDate = date
  308. } else {
  309. this.queryParam.salesDate = []
  310. }
  311. this.queryParam.beginAuditDate = date[0] || ''
  312. this.queryParam.endAuditDate = date[1] || ''
  313. },
  314. // 促销开始时间 change
  315. dateChange (date, dateString) {
  316. this.time = date
  317. if (dateString[0] != '' && dateString[1] != '') {
  318. this.queryParam.promoRuleReport.promotionDateStart = dateString[0] + ' 00:00:00'
  319. this.queryParam.promoRuleReport.promotionDateEnd = dateString[1] + ' 23:59:59'
  320. } else {
  321. this.$set(this.queryParam.promoRuleReport, 'promotionDateStart', undefined)
  322. this.$set(this.queryParam.promoRuleReport, 'promotionDateEnd', undefined)
  323. }
  324. },
  325. // 统计
  326. getCount (params) {
  327. salesPromoReportQueryCount(params).then(res => {
  328. if (res.status == 200) {
  329. this.totalData = res.data
  330. } else {
  331. this.totalData = null
  332. }
  333. })
  334. },
  335. // 区域分区
  336. subareaChange (val) {
  337. this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
  338. this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
  339. },
  340. // tab 切换 change
  341. handleChange (val) {
  342. this.tabVal = val
  343. },
  344. // 导出
  345. handleExport () {
  346. const _this = this
  347. const params = this.queryParam
  348. _this.exportLoading = true
  349. _this.spinning = true
  350. const ajaxUrl = _this.tabVal == 1 ? exportSalesPromoReport : exportSalesPromoRealReport
  351. const ajaxName = _this.tabVal == 1 ? '促销销售单报表导出' : '促销销售单实时报表导出'
  352. hdExportExcel(ajaxUrl, params, ajaxName, function () {
  353. _this.exportLoading = false
  354. _this.spinning = false
  355. _this.showExport = true
  356. })
  357. },
  358. // 验证表单 type值 search查询 export导出
  359. testForm (type) {
  360. const _this = this
  361. if (!_this.queryParam.salesDate[0] || !_this.queryParam.salesDate[1]) {
  362. _this.$message.error('请选择销售审核时间')
  363. return
  364. }
  365. _this.$refs.ruleForm.validate(valid => {
  366. if (valid) {
  367. if (type == 'search') {
  368. _this.handleSearch()
  369. } else {
  370. _this.handleExport()
  371. }
  372. } else {
  373. _this.$message.error('请选择销售审核时间')
  374. return false
  375. }
  376. })
  377. },
  378. // 地区
  379. areaChange (val) {
  380. this.queryParam.dealerProvinceSn = val[0] ? val[0] : ''
  381. this.queryParam.dealerCitySn = val[1] ? val[1] : ''
  382. this.queryParam.dealerDistrictSn = val[2] ? val[2] : ''
  383. },
  384. // 查询
  385. handleSearch () {
  386. const _this = this
  387. const paramData = JSON.parse(JSON.stringify(this.queryParam))
  388. delete paramData.salesDate
  389. // 获取统计数据
  390. _this.getCount(paramData)
  391. _this.$refs.table.refresh(true)
  392. },
  393. // 重置
  394. resetSearchForm () {
  395. this.$refs.ruleForm.resetFields()
  396. this.queryParam = {
  397. salesDate: [
  398. getDate.getCurrMonthDays().starttime,
  399. getDate.getCurrMonthDays().endtime
  400. ],
  401. beginAuditDate: getDate.getCurrMonthDays().starttime, // 审核开始时间
  402. endAuditDate: getDate.getCurrMonthDays().endtime, // 审核结束时间
  403. promoRuleReport: {
  404. promotionDateStart: undefined, // 促销时间-开始
  405. promotionDateEnd: undefined, // 促销时间-结束
  406. title: '', // 促销名称
  407. promotionRuleType: undefined, // 促销类型
  408. ruleInfo: ''// 规则
  409. },
  410. salesBillNo: '', // 销售单号
  411. buyerLevel: undefined, // 客户级别
  412. buyerName: '', // 客户名称
  413. subareaArea: {
  414. subareaSn: '',
  415. subareaAreaSn: ''
  416. },
  417. dealerProvinceSn: undefined, // 省份编码
  418. dealerCitySn: undefined, // 城市编码
  419. dealerDistrictSn: undefined, // 区域编码
  420. giveMoney: undefined,
  421. bizUserSn: undefined // 客服
  422. }
  423. this.time = undefined
  424. this.$refs.subarea.clearData()
  425. this.$refs.areaList.clearData()
  426. this.$refs.rangeDate.resetDate(this.queryParam.salesDate)
  427. this.$refs.table.clearTable()
  428. this.totalData = null
  429. },
  430. // 初始化
  431. pageInit () {
  432. const _this = this
  433. this.$nextTick(() => { // 页面渲染完成后的回调
  434. _this.setTableH()
  435. })
  436. },
  437. // 计算表格高度
  438. setTableH () {
  439. const tableSearchH = this.$refs.tableSearch.offsetHeight
  440. this.tableHeight = window.innerHeight - tableSearchH - 260
  441. }
  442. },
  443. watch: {
  444. // 展开关闭
  445. advanced (newValue, oldValue) {
  446. const _this = this
  447. this.$nextTick(() => { // 页面渲染完成后的回调
  448. _this.setTableH()
  449. })
  450. },
  451. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  452. this.setTableH()
  453. }
  454. },
  455. mounted () {
  456. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  457. this.pageInit()
  458. }
  459. },
  460. activated () {
  461. // 如果是新页签打开,则重置当前页面
  462. if (this.$store.state.app.isNewTab) {
  463. this.pageInit()
  464. }
  465. }
  466. }
  467. </script>
  468. <style lang="less" scoped>
  469. .monthBox{
  470. /deep/.ant-calendar-picker-icon{
  471. display:none !important;
  472. }
  473. /deep/.ant-calendar-picker input{
  474. text-align:center;
  475. }
  476. }
  477. .promotionSalesRealTimeReport-wrap{
  478. /deep/ .ant-card-body:first-child{
  479. padding-bottom: 0;
  480. }
  481. }
  482. .ant-tabs-tabpane.ant-tabs-tabpane-active{
  483. margin-top:-11px !important;
  484. }
  485. </style>