list.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  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 debounce from 'lodash/debounce'
  258. import { dealerPromotionList, dealerPromotionDel, modifyEnabledFlag, promotionAudit, promotionIsOver, handleCopyData, midwaySubmit, dealerMidwayAudit, updateDealerSnList } from '@/api/promotion'
  259. export default {
  260. name: 'PromotionManagementList',
  261. mixins: [commonMixin],
  262. components: { STable, supplier, VSelect, rangeDate, warehouse, lookUpCustomersModal, addModal, editActiveEndTime, creatorList, custList },
  263. data () {
  264. this.handleAuditModal = debounce(this.handleAuditModal, 800)
  265. return {
  266. spinning: false,
  267. disabled: false, // 查询、重置按钮是否可操作
  268. openModal: false, // 新增弹框是否显示
  269. openCustomerModal: false, // 参与客户弹窗
  270. editEndModal: false, // 更改促销时间
  271. openDetailModal: false, // 详情弹窗
  272. tableHeight: 0,
  273. // 查询参数
  274. queryParam: {
  275. beginDate: undefined,
  276. endDate: undefined,
  277. queryWord: '',
  278. enabledFlag: undefined, // 发布状态
  279. state: undefined,
  280. creatorId: undefined,
  281. dealerAuditFlag: undefined,
  282. dealerSn: undefined
  283. },
  284. columns: [
  285. { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
  286. { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  287. { title: '促销名称', scopedSlots: { customRender: 'promotionName' }, width: '16%', align: 'left' },
  288. { title: '促销简称', dataIndex: 'description', width: '13%', align: 'left', customRender: function (text) { return text || '--' } },
  289. { title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '13%', align: 'center' },
  290. { title: '参与客户', scopedSlots: { customRender: 'joinCustomers' }, width: '11%', align: 'center', ellipsis: true },
  291. { title: '促销描述', dataIndex: 'content', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  292. { title: '创建人', dataIndex: 'creatorName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  293. { title: '活动状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
  294. { title: '发布状态', scopedSlots: { customRender: 'releaseStatus' }, width: '6%', align: 'center', ellipsis: true },
  295. { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
  296. ],
  297. // 加载数据方法 必须为 Promise 对象
  298. loadData: parameter => {
  299. this.disabled = true
  300. this.spinning = true
  301. return dealerPromotionList(Object.assign(parameter, this.queryParam)).then(res => {
  302. let data
  303. if (res.status == 200) {
  304. data = res.data
  305. const no = (data.pageNo - 1) * data.pageSize
  306. for (var i = 0; i < data.list.length; i++) {
  307. data.list[i].no = no + i + 1
  308. }
  309. this.disabled = false
  310. }
  311. this.spinning = false
  312. return data
  313. })
  314. },
  315. itemSn: null, // 经销商促销活动SN
  316. openAuditModal: false, // 审核弹窗,
  317. openCopyModal: false, // 复制弹窗
  318. itemPromotionSn: '',
  319. itemStatusType: '',
  320. chooseDealerArr: [], // 所选择经销商列表
  321. loadingAudit: false
  322. }
  323. },
  324. methods: {
  325. // 经销商列表查询
  326. custChange (val) {
  327. this.queryParam.dealerSn = val.key
  328. },
  329. // 创建人
  330. creatorChange (val) {
  331. this.queryParam.creatorId = val.key
  332. },
  333. // 详情
  334. handleDetail (row) {
  335. this.$router.push({ name: 'dealerPromotionManagementDetail', query: { sn: row.promotionSn } })
  336. },
  337. // 创建时间
  338. dateChange (date) {
  339. this.queryParam.beginDate = date[0]
  340. this.queryParam.endDate = date[1]
  341. },
  342. // 新增
  343. handleAdd () {
  344. this.itemSn = null
  345. this.openModal = true
  346. },
  347. // 参与客户
  348. handleCustomers (row) {
  349. this.itemPromotionSn = row.promotionSn
  350. if ((row.state === 'NOT_START' || row.state === 'RUNNING') && row.dealerAuditFlag && (row.dealerAuditFlag == 0 || row.dealerAuditFlag == 2)) {
  351. this.itemStatusType = 'isEdit'
  352. } else if ((row.state === 'NOT_START' || row.state === 'RUNNING') && row.dealerAuditFlag && row.dealerAuditFlag == 1) {
  353. this.itemStatusType = 'isAudit'
  354. } else {
  355. this.itemStatusType = 'isClose'
  356. }
  357. this.getDealerSnList({ promotionSn: row.promotionSn })
  358. },
  359. async getDealerSnList (ajaxData) {
  360. const dealerSnArr = await updateDealerSnList(ajaxData)
  361. this.chooseDealerArr = dealerSnArr.data
  362. this.openCustomerModal = true
  363. },
  364. // 基本信息 保存
  365. handleOk () {
  366. this.itemSn = null
  367. this.resetSearchForm()
  368. },
  369. // 编辑
  370. handleEdit (row) {
  371. this.openModal = true
  372. this.itemSn = row.promotionSn
  373. },
  374. // 发布状态
  375. changeStatus (record) {
  376. const params = {
  377. promotionSn: record.promotionSn,
  378. enabledFlag: record.enabledFlag == 1 ? '0' : '1'
  379. }
  380. this.spinning = true
  381. modifyEnabledFlag(params).then(res => {
  382. if (res.status == 200) {
  383. this.$message.success(res.message)
  384. this.$refs.table.refresh()
  385. this.spinning = false
  386. } else {
  387. this.$refs.table.refresh()
  388. this.spinning = false
  389. }
  390. })
  391. },
  392. // 规则设置
  393. handleSetRules (row) {
  394. this.$router.push({ name: 'dealerPromotionManagementRule', query: { type: 'rule', sn: row.promotionSn } })
  395. },
  396. // 审核参与客户
  397. handleDealerAudit (val) {
  398. this.queryParam.dealerAuditFlag = val.target.checked ? '1' : undefined
  399. this.$nextTick(() => {
  400. this.$refs.table.refresh(true)
  401. })
  402. },
  403. // 审核
  404. handleCheck (row) {
  405. const _this = this
  406. _this.itemSn = row.promotionSn
  407. _this.openAuditModal = true
  408. },
  409. handleAuditModal () {
  410. this.loadingAudit = true
  411. this.handleAudit({ promotionSn: this.itemSn, auditFlag: 1 })
  412. },
  413. closeAuditModal () {
  414. this.handleAudit({ promotionSn: this.itemSn, auditFlag: 0 })
  415. },
  416. handleAudit (ajaxData) {
  417. const _this = this
  418. _this.spinning = true
  419. promotionAudit(ajaxData).then(res => {
  420. if (res.status == 200) {
  421. _this.$message.success(res.message)
  422. _this.$refs.table.refresh()
  423. }
  424. _this.itemSn = null
  425. _this.openAuditModal = false
  426. _this.spinning = false
  427. _this.loadingAudit = false
  428. })
  429. },
  430. // 复制
  431. handleCopyModal (row) {
  432. this.itemSn = row.promotionSn
  433. this.$nextTick(() => {
  434. this.openCopyModal = true
  435. })
  436. },
  437. handleCopy () {
  438. const _this = this
  439. _this.spinning = true
  440. handleCopyData({ promotionSn: this.itemSn }).then(res => {
  441. if (res.status == 200) {
  442. _this.$message.success(res.message)
  443. _this.$refs.table.refresh()
  444. }
  445. _this.itemSn = null
  446. _this.openCopyModal = false
  447. _this.spinning = false
  448. })
  449. },
  450. closeCopyModal () {
  451. this.itemSn = null
  452. this.openCopyModal = false
  453. },
  454. // 促销时间变更
  455. handleTime (row) {
  456. this.editEndModal = true
  457. const showData = {
  458. sn: row.promotionSn,
  459. name: row.title,
  460. timeStart: row.promotionDateStart,
  461. timeEnd: row.promotionDateEnd
  462. }
  463. this.$refs.editTime.setData(showData)
  464. },
  465. // 终止
  466. handleEnd (row) {
  467. const _this = this
  468. this.$confirm({
  469. title: '提示',
  470. content: '确定要终止该促销?',
  471. centered: true,
  472. onOk () {
  473. _this.spinning = true
  474. promotionIsOver({ sn: row.promotionSn }).then(res => {
  475. if (res.status == 200) {
  476. _this.$message.success(res.message)
  477. _this.$refs.table.refresh()
  478. _this.spinning = false
  479. } else {
  480. _this.spinning = false
  481. }
  482. })
  483. }
  484. })
  485. },
  486. // 关闭采购退货详情弹框
  487. closeDetailModal () {
  488. this.itemSn = null
  489. this.openDetailModal = false
  490. },
  491. // 删除
  492. handleDel (row) {
  493. const _this = this
  494. this.$confirm({
  495. title: '提示',
  496. content: '确认要删除该活动吗?',
  497. centered: true,
  498. onOk () {
  499. _this.spinning = true
  500. dealerPromotionDel({ sn: row.promotionSn }).then(res => {
  501. if (res.status == 200) {
  502. _this.$message.success(res.message)
  503. _this.$refs.table.refresh()
  504. _this.spinning = false
  505. } else {
  506. _this.spinning = false
  507. }
  508. })
  509. }
  510. })
  511. },
  512. // 修改参与客户 参与客户提交审核
  513. editCustomerOk () {
  514. const _this = this
  515. midwaySubmit({ promotionSn: _this.itemPromotionSn }).then(res => {
  516. if (res.status == 200) {
  517. _this.$message.success(res.message)
  518. _this.$refs.table.refresh()
  519. }
  520. })
  521. },
  522. auditCustomerOk (con) {
  523. const _this = this
  524. dealerMidwayAudit({ promotionSn: _this.itemPromotionSn, dealerAuditStatus: con }).then(res => {
  525. if (res.status == 200) {
  526. _this.$message.success(res.message)
  527. _this.$refs.table.refresh()
  528. }
  529. })
  530. },
  531. closeCustomer () {
  532. this.openCustomerModal = false
  533. this.itemPromotionSn = ''
  534. this.chooseDealerArr = []
  535. },
  536. // 重置
  537. resetSearchForm () {
  538. // 获取创建人默认值
  539. const creatorObj = this.$store.state.user.info
  540. const newObj = {
  541. key: creatorObj.userid,
  542. name: creatorObj.userNameCN,
  543. label: creatorObj.userNameCN
  544. }
  545. this.$refs.creatorList.setDefaultVal(newObj)
  546. this.queryParam = {
  547. beginDate: undefined,
  548. endDate: undefined,
  549. queryWord: '',
  550. enabledFlag: undefined, // 发布状态
  551. state: undefined,
  552. creatorId: creatorObj.userid,
  553. dealerAuditFlag: undefined,
  554. dealerSn: undefined
  555. }
  556. this.$refs.custList.resetForm()
  557. this.$refs.rangeDate.resetDate()
  558. this.$refs.table.refresh(true)
  559. },
  560. pageInit () {
  561. const _this = this
  562. this.$nextTick(() => { // 页面渲染完成后的回调
  563. _this.setTableH()
  564. })
  565. this.openModal = false
  566. this.openDetailModal = false
  567. this.itemSn = null
  568. this.$refs.table.clearTable()
  569. },
  570. setTableH () {
  571. const tableSearchH = this.$refs.tableSearch.offsetHeight
  572. this.tableHeight = window.innerHeight - tableSearchH - 235
  573. }
  574. },
  575. watch: {
  576. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  577. this.setTableH()
  578. }
  579. },
  580. mounted () {
  581. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  582. this.pageInit()
  583. this.resetSearchForm()
  584. }
  585. },
  586. activated () {
  587. // 如果是新页签打开,则重置当前页面
  588. if (this.$store.state.app.isNewTab) {
  589. this.pageInit()
  590. this.resetSearchForm()
  591. }
  592. // 仅刷新列表,不重置页面
  593. if (this.$store.state.app.updateList) {
  594. this.pageInit()
  595. this.$refs.table.refresh()
  596. }
  597. },
  598. beforeRouteEnter (to, from, next) {
  599. next(vm => {})
  600. }
  601. }
  602. </script>
  603. <style lang="less" scoped>
  604. .promotionList-wrap{
  605. .nameBox{
  606. padding:0 5px;
  607. }
  608. }
  609. .joinCustomer{
  610. cursor:pointer;
  611. }
  612. .copyContent{
  613. margin:30px 10px 20px;
  614. p{
  615. margin-bottom:6px !important;
  616. font-size:14px;
  617. }
  618. p:last-child{
  619. font-size:12px;
  620. color:#666;
  621. text-align:right;
  622. }
  623. }
  624. .copyBtn{
  625. text-align:center;
  626. button{
  627. width: 45%;
  628. height:40px;
  629. line-height:40px;
  630. }
  631. }
  632. .tableBtnSet{
  633. display: flex;
  634. align-items: center;
  635. justify-content: space-between;
  636. }
  637. </style>