list.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. <template>
  2. <div>
  3. <a-card size="small" :bordered="false" class="promotionList-wrap searchBoxNormal">
  4. <!-- 搜索条件 -->
  5. <div ref="tableSearch" class="table-page-search-wrapper">
  6. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  7. <a-row :gutter="15">
  8. <a-col :md="6" :sm="24">
  9. <a-form-item label="创建时间">
  10. <rangeDate ref="rangeDate" @change="dateChange" />
  11. </a-form-item>
  12. </a-col>
  13. <a-col :md="6" :sm="24">
  14. <a-form-item label="促销名称/简称">
  15. <a-input id="promotionList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入促销名称/简称"/>
  16. </a-form-item>
  17. </a-col>
  18. <a-col :md="6" :sm="24">
  19. <a-form-item label="发布状态">
  20. <v-select
  21. v-model="queryParam.enabledFlag"
  22. ref="enabledFlag"
  23. id="promotionList-enabledFlag"
  24. code="PUBLISH_STATE"
  25. placeholder="请选择发布状态"
  26. allowClear></v-select>
  27. </a-form-item>
  28. </a-col>
  29. <a-col :md="6" :sm="24">
  30. <a-form-item label="活动状态">
  31. <v-select
  32. v-model="queryParam.state"
  33. ref="state"
  34. id="promotionList-state"
  35. code="PROMOTION_STATE"
  36. placeholder="请选择活动状态"
  37. allowClear
  38. ></v-select>
  39. </a-form-item>
  40. </a-col>
  41. <a-col :md="6" :sm="24">
  42. <a-form-item label="创建人">
  43. <creatorList ref="creatorList" id="promotionList-creatorId" @change="creatorChange" />
  44. </a-form-item>
  45. </a-col>
  46. <a-col :md="6" :sm="24">
  47. <a-form-item label="经销商名称">
  48. <custList ref="custList" id="promotionList-tenantSn" @change="custChange"></custList>
  49. </a-form-item>
  50. </a-col>
  51. <a-col :md="6" :sm="24">
  52. <span class="table-page-search-submitButtons">
  53. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="promotionList-refresh">查询</a-button>
  54. <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="promotionList-reset">重置</a-button>
  55. <!-- <a-button
  56. style="margin-left: 10px"
  57. type="primary"
  58. class="button-warning"
  59. @click="handleExport"
  60. :disabled="disabled"
  61. :loading="exportLoading"
  62. >导出</a-button> -->
  63. <!-- v-if="$hasPermissions('B_promotionListExport')" -->
  64. </span>
  65. </a-col>
  66. </a-row>
  67. </a-form>
  68. </div>
  69. </a-card>
  70. <a-card size="small" :bordered="false">
  71. <a-spin :spinning="spinning" tip="Loading...">
  72. <!-- 操作按钮 -->
  73. <div class="table-operator tableBtnSet" >
  74. <a-button v-if="$hasPermissions('B_dealerPromotionAdd')" id="promotionList-add" type="primary" @click="handleAdd">新增</a-button>
  75. <a-checkbox @change="handleDealerAudit" v-if="$hasPermissions('B_dealerAudit')" :checked="queryParam.dealerAuditFlag &&queryParam.dealerAuditFlag==1">
  76. 待审核(修改参与客户)
  77. </a-checkbox>
  78. </div>
  79. <!-- 列表 -->
  80. <s-table
  81. class="sTable fixPagination"
  82. ref="table"
  83. :style="{ height: tableHeight+70+'px' }"
  84. size="small"
  85. :rowKey="(record) => record.sparePartsReturnNo"
  86. :columns="columns"
  87. :data="loadData"
  88. :scroll="{ y: tableHeight }"
  89. :defaultLoadData="false"
  90. bordered>
  91. <!-- 促销名称 -->
  92. <template slot="promotionName" slot-scope="text, record">
  93. <div v-if="$hasPermissions('B_dealerPromotionDetail')" class="link-bule nameBox text-overflows2" @click="handleDetail(record)">{{ record.title }}</div>
  94. <div v-else class="nameBox text-overflows2">{{ record.title }}</div>
  95. </template>
  96. <!-- 促销时间-->
  97. <template slot="promotionTime" slot-scope="text, record">
  98. <div>{{ record.promotionDateStart }}-{{ record.promotionDateEnd }}</div>
  99. </template>
  100. <!-- 参与客户 -->
  101. <template slot="joinCustomers" slot-scope="text, record">
  102. <span class="joinCustomer" v-if="record.dealerScope ==='ALL_DEALER'" @click="handleCustomers(record)">全部客户</span>
  103. <span class="joinCustomer" v-else @click="handleCustomers(record)">共有<span style="color:#39f;vertical-align:top;">{{ record.dealerQty ||0 }}</span>个客户</span>
  104. <a-badge count="审" v-show="record.dealerAuditFlag == 1 &&(record.state==='NOT_START'||record.state==='RUNNING') " :number-style="{ backgroundColor: '#F5222D', zoom:'80%' }" />
  105. </template>
  106. <!-- 发布状态 -->
  107. <template slot="releaseStatus" slot-scope="text, record">
  108. <a-switch
  109. v-if="$hasPermissions('B_dealerPromotionStatus')"
  110. id="promotionList-enable"
  111. @change="changeStatus(record)"
  112. :disabled="record.state!='NOT_START' && record.state!='RUNNING'"
  113. :checked="record.enabledFlag == 1 ? true : false"></a-switch>
  114. <span v-else>--</span>
  115. </template>
  116. <!-- 操作 -->
  117. <!-- state 待提交:WAIT_SUBMIT 待审核:WAIT_AUDIT 未开始:NOT_START 进行中:RUNNING 审核不通过:AUDIT_REJECT 已结束:IS_OVER -->
  118. <template slot="action" slot-scope="text, record">
  119. <a-button
  120. size="small"
  121. type="link"
  122. class="button-warning"
  123. @click="handleSetRules(record)"
  124. v-if="$hasPermissions('B_dealerPromotionRules')&&(record.state =='WAIT_SUBMIT'||record.state == 'AUDIT_REJECT')"
  125. id="allocateBillList-examine-btn">规则设置</a-button>
  126. <a-button
  127. size="small"
  128. type="link"
  129. v-if="$hasPermissions('B_dealerPromotionEdit')&&(record.state == 'WAIT_SUBMIT' ||record.state == 'AUDIT_REJECT')"
  130. @click="handleEdit(record)"
  131. class="button-info"
  132. id="promotionList-edit-btn">编辑</a-button>
  133. <a-button
  134. size="small"
  135. type="link"
  136. v-if="$hasPermissions('B_dealerPromotionAudit')&&record.state == 'WAIT_AUDIT'"
  137. @click="handleCheck(record)"
  138. class="button-info"
  139. id="promotionList-edit-btn">审核</a-button>
  140. <a-button
  141. size="small"
  142. type="link"
  143. v-if="$hasPermissions('B_editTime')&&(record.state == 'NOT_START' || record.state=='RUNNING' ||record.state == 'IS_OVER')"
  144. @click="handleTime(record)"
  145. class="button-info"
  146. id="promotionList-edit-btn">时间变更</a-button>
  147. <a-button
  148. size="small"
  149. type="link"
  150. v-if="$hasPermissions('B_overActive')&&(record.state == 'NO_START' || record.state=='RUNNING')"
  151. @click="handleEnd(record)"
  152. class="button-info"
  153. id="promotionList-edit-btn">终止</a-button>
  154. <a-button
  155. size="small"
  156. type="link"
  157. v-if="$hasPermissions('B_dealerPromotionDel')&&(record.state == 'WAIT_SUBMIT'||record.state == 'AUDIT_REJECT')"
  158. @click="handleDel(record)"
  159. class="button-error"
  160. id="promotionList-del-btn">删除</a-button>
  161. <a-button
  162. size="small"
  163. type="link"
  164. v-if="record.state != 'AUDIT_REJECT' &&$hasPermissions('B_dealerPromotionCopy')"
  165. @click="handleCopyModal(record)"
  166. class="button-info"
  167. id="promotionList-edit-btn">复制</a-button>
  168. </template>
  169. </s-table>
  170. </a-spin>
  171. <!-- 参与客户 -->
  172. <lookUp-customers-modal
  173. :itemSn="itemPromotionSn"
  174. :showType="itemStatusType"
  175. ref="lookUpCustomers"
  176. :openModal="openCustomerModal"
  177. :chooseDealerList="chooseDealerArr"
  178. @submitAudit="editCustomerOk"
  179. @handleAudit="auditCustomerOk"
  180. @close="closeCustomer"></lookUp-customers-modal>
  181. <!-- 新增/编辑弹窗-->
  182. <add-modal v-drag :itemSn="itemSn" :openModal="openModal" @ok="handleOk" @close="openModal=false" />
  183. <!-- 促销时间变更 -->
  184. <edit-active-end-time ref="editTime" v-drag :openModal="editEndModal" @ok="$refs.table.refresh()" @close="editEndModal=false" />
  185. <!-- 审核弹窗 -->
  186. <a-modal
  187. closable
  188. v-model="openAuditModal"
  189. :footer="null"
  190. width="416px"
  191. centered>
  192. <div style="display:flex;margin:30px 0 20px 20px;">
  193. <a-icon type="question-circle" :style="{fontSize:'23px',color:'#faad14'}"/>
  194. <div style="margin-left:10px;">
  195. <p style="font-size:16px;font-wight:bold;">提示</p>
  196. <p>请点击下方按钮确认操作?</p>
  197. </div>
  198. </div>
  199. <!-- 按钮 -->
  200. <div style="text-align: right;">
  201. <a-button
  202. id="auditModal-cancel"
  203. class="button-cancel"
  204. @click="closeAuditModal"
  205. style="margin-right: 15px;">审核不通过</a-button>
  206. <a-button
  207. type="primary"
  208. id="auditModal-save"
  209. class="button-primary"
  210. :loading="loadingAudit"
  211. @click="handleAuditModal"
  212. >审核通过</a-button>
  213. </div>
  214. </a-modal>
  215. <!-- 复制弹窗 -->
  216. <a-modal
  217. closable
  218. v-model="openCopyModal"
  219. :footer="null"
  220. width="416px"
  221. centered>
  222. <div class="copyContent">
  223. <p>提示:</p>
  224. <p>复制选择的促销活动,将在列表生成一条相同的【待提交】的促销活动,可进行编辑!</p>
  225. <p>是否确认生成?</p>
  226. <p>附件无法复制,请重新上传</p>
  227. </div>
  228. <!-- 按钮 -->
  229. <div class="copyBtn">
  230. <a-button
  231. id="copyModal-cancel"
  232. class="button-cancel"
  233. @click="closeCopyModal"
  234. style="margin-right: 15px;">取消</a-button>
  235. <a-button
  236. type="primary"
  237. id="copyModal-save"
  238. class="button-primary"
  239. @click="handleCopy"
  240. >确定</a-button>
  241. </div>
  242. </a-modal>
  243. </a-card>
  244. </div>
  245. </template>
  246. <script>
  247. import { commonMixin } from '@/utils/mixin'
  248. import { STable, VSelect } from '@/components'
  249. import addModal from './addModal.vue'
  250. import lookUpCustomersModal from './lookUpCustomersModal'
  251. import rangeDate from '@/views/common/rangeDate.vue'
  252. import creatorList from '@/views/common/creatorList.vue'
  253. import editActiveEndTime from './editActiveEndTime.vue'
  254. import supplier from '@/views/common/supplier.js'
  255. import warehouse from '@/views/common/chooseWarehouse.js'
  256. import custList from '@/views/common/custList.vue'
  257. import { dealerPromotionList, dealerPromotionDel, modifyEnabledFlag, promotionAudit, promotionIsOver, handleCopyData, midwaySubmit, dealerMidwayAudit, updateDealerSnList } from '@/api/promotion'
  258. export default {
  259. name: 'PromotionManagementList',
  260. mixins: [commonMixin],
  261. components: { STable, supplier, VSelect, rangeDate, warehouse, lookUpCustomersModal, addModal, editActiveEndTime, creatorList, custList },
  262. data () {
  263. return {
  264. spinning: false,
  265. disabled: false, // 查询、重置按钮是否可操作
  266. openModal: false, // 新增弹框是否显示
  267. openCustomerModal: false, // 参与客户弹窗
  268. editEndModal: false, // 更改促销时间
  269. openDetailModal: false, // 详情弹窗
  270. tableHeight: 0,
  271. // 查询参数
  272. queryParam: {
  273. beginDate: undefined,
  274. endDate: undefined,
  275. queryWord: '',
  276. enabledFlag: undefined, // 发布状态
  277. state: undefined,
  278. creatorId: undefined,
  279. dealerAuditFlag: undefined,
  280. dealerSn: undefined
  281. },
  282. columns: [
  283. { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
  284. { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  285. { title: '促销名称', scopedSlots: { customRender: 'promotionName' }, width: '16%', align: 'left' },
  286. { title: '促销简称', dataIndex: 'description', width: '13%', align: 'left', customRender: function (text) { return text || '--' } },
  287. { title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '13%', align: 'center' },
  288. { title: '参与客户', scopedSlots: { customRender: 'joinCustomers' }, width: '11%', align: 'center', ellipsis: true },
  289. { title: '促销描述', dataIndex: 'content', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  290. { title: '创建人', dataIndex: 'creatorName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  291. { title: '活动状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
  292. { title: '发布状态', scopedSlots: { customRender: 'releaseStatus' }, width: '6%', align: 'center', ellipsis: true },
  293. { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
  294. ],
  295. // 加载数据方法 必须为 Promise 对象
  296. loadData: parameter => {
  297. this.disabled = true
  298. this.spinning = true
  299. return dealerPromotionList(Object.assign(parameter, this.queryParam)).then(res => {
  300. let data
  301. if (res.status == 200) {
  302. data = res.data
  303. const no = (data.pageNo - 1) * data.pageSize
  304. for (var i = 0; i < data.list.length; i++) {
  305. data.list[i].no = no + i + 1
  306. }
  307. this.disabled = false
  308. }
  309. this.spinning = false
  310. return data
  311. })
  312. },
  313. itemSn: null, // 经销商促销活动SN
  314. openAuditModal: false, // 审核弹窗,
  315. openCopyModal: false, // 复制弹窗
  316. itemPromotionSn: '',
  317. itemStatusType: '',
  318. chooseDealerArr: [], // 所选择经销商列表
  319. loadingAudit: false
  320. }
  321. },
  322. methods: {
  323. // 经销商列表查询
  324. custChange (val) {
  325. this.queryParam.dealerSn = val.key
  326. },
  327. // 创建人
  328. creatorChange (val) {
  329. this.queryParam.creatorId = val.key
  330. },
  331. // 详情
  332. handleDetail (row) {
  333. this.$router.push({ name: 'dealerPromotionManagementDetail', query: { sn: row.promotionSn } })
  334. },
  335. // 创建时间
  336. dateChange (date) {
  337. this.queryParam.beginDate = date[0]
  338. this.queryParam.endDate = date[1]
  339. },
  340. // 新增
  341. handleAdd () {
  342. this.itemSn = null
  343. this.openModal = true
  344. },
  345. // 参与客户
  346. handleCustomers (row) {
  347. this.itemPromotionSn = row.promotionSn
  348. if ((row.state === 'NOT_START' || row.state === 'RUNNING') && row.dealerAuditFlag && (row.dealerAuditFlag == 0 || row.dealerAuditFlag == 2)) {
  349. this.itemStatusType = 'isEdit'
  350. } else if ((row.state === 'NOT_START' || row.state === 'RUNNING') && row.dealerAuditFlag && row.dealerAuditFlag == 1) {
  351. this.itemStatusType = 'isAudit'
  352. } else {
  353. this.itemStatusType = 'isClose'
  354. }
  355. this.getDealerSnList({ promotionSn: row.promotionSn })
  356. },
  357. async getDealerSnList (ajaxData) {
  358. const dealerSnArr = await updateDealerSnList(ajaxData)
  359. this.chooseDealerArr = dealerSnArr.data
  360. this.openCustomerModal = true
  361. },
  362. // 基本信息 保存
  363. handleOk () {
  364. this.itemSn = null
  365. this.resetSearchForm()
  366. },
  367. // 编辑
  368. handleEdit (row) {
  369. this.openModal = true
  370. this.itemSn = row.promotionSn
  371. },
  372. // 发布状态
  373. changeStatus (record) {
  374. const params = {
  375. promotionSn: record.promotionSn,
  376. enabledFlag: record.enabledFlag == 1 ? '0' : '1'
  377. }
  378. this.spinning = true
  379. modifyEnabledFlag(params).then(res => {
  380. if (res.status == 200) {
  381. this.$message.success(res.message)
  382. this.$refs.table.refresh()
  383. this.spinning = false
  384. } else {
  385. this.$refs.table.refresh()
  386. this.spinning = false
  387. }
  388. })
  389. },
  390. // 规则设置
  391. handleSetRules (row) {
  392. this.$router.push({ name: 'dealerPromotionManagementRule', query: { type: 'rule', sn: row.promotionSn } })
  393. },
  394. // 审核参与客户
  395. handleDealerAudit (val) {
  396. this.queryParam.dealerAuditFlag = val.target.checked ? '1' : undefined
  397. this.$nextTick(() => {
  398. this.$refs.table.refresh(true)
  399. })
  400. },
  401. // 审核
  402. handleCheck (row) {
  403. const _this = this
  404. _this.itemSn = row.promotionSn
  405. _this.openAuditModal = true
  406. },
  407. handleAuditModal () {
  408. this.loadingAudit = true
  409. this.handleAudit({ promotionSn: this.itemSn, auditFlag: 1 })
  410. },
  411. closeAuditModal () {
  412. this.handleAudit({ promotionSn: this.itemSn, auditFlag: 0 })
  413. },
  414. handleAudit (ajaxData) {
  415. const _this = this
  416. _this.spinning = true
  417. promotionAudit(ajaxData).then(res => {
  418. if (res.status == 200) {
  419. _this.$message.success(res.message)
  420. _this.$refs.table.refresh()
  421. }
  422. _this.itemSn = null
  423. _this.openAuditModal = false
  424. _this.spinning = false
  425. _this.loadingAudit = false
  426. })
  427. },
  428. // 复制
  429. handleCopyModal (row) {
  430. this.itemSn = row.promotionSn
  431. this.$nextTick(() => {
  432. this.openCopyModal = true
  433. })
  434. },
  435. handleCopy () {
  436. const _this = this
  437. _this.spinning = true
  438. handleCopyData({ promotionSn: this.itemSn }).then(res => {
  439. if (res.status == 200) {
  440. _this.$message.success(res.message)
  441. _this.$refs.table.refresh()
  442. }
  443. _this.itemSn = null
  444. _this.openCopyModal = false
  445. _this.spinning = false
  446. })
  447. },
  448. closeCopyModal () {
  449. this.itemSn = null
  450. this.openCopyModal = false
  451. },
  452. // 促销时间变更
  453. handleTime (row) {
  454. this.editEndModal = true
  455. const showData = {
  456. sn: row.promotionSn,
  457. name: row.title,
  458. timeStart: row.promotionDateStart,
  459. timeEnd: row.promotionDateEnd
  460. }
  461. this.$refs.editTime.setData(showData)
  462. },
  463. // 终止
  464. handleEnd (row) {
  465. const _this = this
  466. this.$confirm({
  467. title: '提示',
  468. content: '确定要终止该促销?',
  469. centered: true,
  470. onOk () {
  471. _this.spinning = true
  472. promotionIsOver({ sn: row.promotionSn }).then(res => {
  473. if (res.status == 200) {
  474. _this.$message.success(res.message)
  475. _this.$refs.table.refresh()
  476. _this.spinning = false
  477. } else {
  478. _this.spinning = false
  479. }
  480. })
  481. }
  482. })
  483. },
  484. // 关闭采购退货详情弹框
  485. closeDetailModal () {
  486. this.itemSn = null
  487. this.openDetailModal = false
  488. },
  489. // 删除
  490. handleDel (row) {
  491. const _this = this
  492. this.$confirm({
  493. title: '提示',
  494. content: '确认要删除该活动吗?',
  495. centered: true,
  496. onOk () {
  497. _this.spinning = true
  498. dealerPromotionDel({ sn: row.promotionSn }).then(res => {
  499. if (res.status == 200) {
  500. _this.$message.success(res.message)
  501. _this.$refs.table.refresh()
  502. _this.spinning = false
  503. } else {
  504. _this.spinning = false
  505. }
  506. })
  507. }
  508. })
  509. },
  510. // 修改参与客户 参与客户提交审核
  511. editCustomerOk () {
  512. const _this = this
  513. midwaySubmit({ promotionSn: _this.itemPromotionSn }).then(res => {
  514. if (res.status == 200) {
  515. _this.$message.success(res.message)
  516. _this.$refs.table.refresh()
  517. }
  518. })
  519. },
  520. auditCustomerOk (con) {
  521. const _this = this
  522. dealerMidwayAudit({ promotionSn: _this.itemPromotionSn, dealerAuditStatus: con }).then(res => {
  523. if (res.status == 200) {
  524. _this.$message.success(res.message)
  525. _this.$refs.table.refresh()
  526. }
  527. })
  528. },
  529. closeCustomer () {
  530. this.openCustomerModal = false
  531. this.itemPromotionSn = ''
  532. this.chooseDealerArr = []
  533. },
  534. // 重置
  535. resetSearchForm () {
  536. // 获取创建人默认值
  537. const creatorObj = this.$store.state.user.info
  538. const newObj = {
  539. key: creatorObj.userid,
  540. name: creatorObj.userNameCN,
  541. label: creatorObj.userNameCN
  542. }
  543. this.$refs.creatorList.setDefaultVal(newObj)
  544. this.queryParam = {
  545. beginDate: undefined,
  546. endDate: undefined,
  547. queryWord: '',
  548. enabledFlag: undefined, // 发布状态
  549. state: undefined,
  550. creatorId: creatorObj.userid,
  551. dealerAuditFlag: undefined,
  552. dealerSn: undefined
  553. }
  554. this.$refs.custList.resetForm()
  555. this.$refs.rangeDate.resetDate()
  556. this.$refs.table.refresh(true)
  557. },
  558. pageInit () {
  559. const _this = this
  560. this.$nextTick(() => { // 页面渲染完成后的回调
  561. _this.setTableH()
  562. })
  563. this.openModal = false
  564. this.openDetailModal = false
  565. this.itemSn = null
  566. this.$refs.table.clearTable()
  567. },
  568. setTableH () {
  569. const tableSearchH = this.$refs.tableSearch.offsetHeight
  570. this.tableHeight = window.innerHeight - tableSearchH - 235
  571. }
  572. },
  573. watch: {
  574. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  575. this.setTableH()
  576. }
  577. },
  578. mounted () {
  579. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  580. this.pageInit()
  581. this.resetSearchForm()
  582. }
  583. },
  584. activated () {
  585. // 如果是新页签打开,则重置当前页面
  586. if (this.$store.state.app.isNewTab) {
  587. this.pageInit()
  588. this.resetSearchForm()
  589. }
  590. // 仅刷新列表,不重置页面
  591. if (this.$store.state.app.updateList) {
  592. this.pageInit()
  593. this.$refs.table.refresh()
  594. }
  595. },
  596. beforeRouteEnter (to, from, next) {
  597. next(vm => {})
  598. }
  599. }
  600. </script>
  601. <style lang="less" scoped>
  602. .promotionList-wrap{
  603. .nameBox{
  604. padding:0 5px;
  605. }
  606. }
  607. .joinCustomer{
  608. cursor:pointer;
  609. }
  610. .copyContent{
  611. margin:30px 10px 20px;
  612. p{
  613. margin-bottom:6px !important;
  614. font-size:14px;
  615. }
  616. p:last-child{
  617. font-size:12px;
  618. color:#666;
  619. text-align:right;
  620. }
  621. }
  622. .copyBtn{
  623. text-align:center;
  624. button{
  625. width: 45%;
  626. height:40px;
  627. line-height:40px;
  628. }
  629. }
  630. .tableBtnSet{
  631. display: flex;
  632. align-items: center;
  633. justify-content: space-between;
  634. }
  635. </style>