list.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. <template>
  2. <div>
  3. <a-card size="small" :bordered="false" class="searchBoxNormal">
  4. <!-- 搜索条件 -->
  5. <div ref="tableSearch" class="table-page-search-wrapper">
  6. <a-form-model
  7. layout="inline"
  8. ref="ruleForm"
  9. :model="queryParam"
  10. :rules="rules"
  11. id="purchaseReceiptList-form"
  12. @keyup.enter.native="handleSearch">
  13. <a-row :gutter="15">
  14. <a-col :md="6" :sm="24">
  15. <a-form-model-item label="创建时间" prop="time">
  16. <rangeDate ref="rangeDate" id="purchaseReceiptList-time" @change="dateChange" />
  17. </a-form-model-item>
  18. </a-col>
  19. <a-col :md="6" :sm="24">
  20. <a-form-model-item label="采购单号">
  21. <a-input id="purchaseReceiptList-sparePartsNo" v-model.trim="queryParam.sparePartsNo" allowClear placeholder="请输入采购单号"/>
  22. </a-form-model-item>
  23. </a-col>
  24. <a-col :md="6" :sm="24">
  25. <a-form-model-item label="供应商名称">
  26. <supplier
  27. id="purchaseReceiptList-supplierSn"
  28. enableFlag="1"
  29. pageSn="福麦斯"
  30. v-model="queryParam.supplierSn"
  31. isPermission
  32. placeholder="请输入供应商名称"></supplier>
  33. </a-form-model-item>
  34. </a-col>
  35. <template v-if="advanced">
  36. <a-col :md="6" :sm="24">
  37. <a-form-model-item label="业务状态">
  38. <v-select
  39. v-model="queryParam.state"
  40. ref="state"
  41. id="purchaseReceiptList-state"
  42. code="PURCHASE_STATE"
  43. placeholder="请选择业务状态"
  44. allowClear
  45. ></v-select>
  46. </a-form-model-item>
  47. </a-col>
  48. <a-col :md="6" :sm="24">
  49. <a-form-model-item label="客户名称">
  50. <custList ref="custList" id="purchaseReceiptList-buyerSn" @change="custChange"></custList>
  51. </a-form-model-item>
  52. </a-col>
  53. <a-col :md="6" :sm="24">
  54. <a-form-model-item label="关联单号">
  55. <a-input id="purchaseReceiptList-relationNo" v-model.trim="queryParam.relationNo" allowClear placeholder="请输入关联单号"/>
  56. </a-form-model-item>
  57. </a-col>
  58. <a-col :md="6" :sm="24">
  59. <a-form-model-item label="供应商状态">
  60. <v-select
  61. v-model="queryParam.thirdpartyBizState"
  62. ref="thirdpartyBizState"
  63. id="purchaseReceiptList-thirdpartyBizState"
  64. code="THIRD_PARTY_BIZ_STATE"
  65. placeholder="请选择供应商状态"
  66. allowClear
  67. ></v-select>
  68. </a-form-model-item>
  69. </a-col>
  70. </template>
  71. <a-col :md="6" :sm="24">
  72. <span class="table-page-search-submitButtons">
  73. <a-button type="primary" @click="handleSearch" :disabled="disabled" id="purchaseReceiptList-refresh">查询</a-button>
  74. <a-button style="margin-left: 10px" @click="resetSearchForm()" :disabled="disabled" id="purchaseReceiptList-reset">重置</a-button>
  75. <a @click="advanced=!advanced" style="margin-left: 8px" id="purchaseReceiptList-advanced">
  76. {{ advanced ? '收起' : '展开' }}
  77. <a-icon :type="advanced ? 'up' : 'down'"/>
  78. </a>
  79. </span>
  80. </a-col>
  81. </a-row>
  82. </a-form-model>
  83. </div>
  84. </a-card>
  85. <a-card size="small" :bordered="false" class="purchaseReceiptList-wrap">
  86. <a-spin :spinning="spinning" tip="Loading...">
  87. <!-- 统计数据 -->
  88. <div class="tongji-bar">
  89. 总单数:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
  90. 总款数:<strong>{{ totalData&&(totalData.productTotalCategory || totalData.productTotalCategory==0) ? totalData.productTotalCategory : '--' }}</strong>;
  91. 总采购数量:<strong>{{ totalData&&(totalData.productTotalQty || totalData.productTotalQty==0) ? totalData.productTotalQty : '--' }}</strong>;
  92. <span v-if="$hasPermissions('M_purchaseReceiptList_costPrice')">总采购金额:<strong>{{ totalData&&(totalData.productTotalCost || totalData.productTotalCost==0) ? toThousands(totalData.productTotalCost) : '--' }}</strong>;</span>
  93. <span v-if="$hasPermissions('M_purchaseReceiptList_costPrice')">已完结金额:<strong>{{ totalData&&(totalData.finishProductTotalCost || totalData.finishProductTotalCost==0) ? toThousands(totalData.finishProductTotalCost) : '--' }}</strong>;</span>
  94. </div>
  95. <!-- 列表 -->
  96. <s-table
  97. class="sTable fixPagination"
  98. ref="table"
  99. :style="{ height: tableHeight+70+'px' }"
  100. size="small"
  101. :rowKey="(record) => record.id"
  102. :columns="columns"
  103. :data="loadData"
  104. :pageSize="30"
  105. :scroll="{ y: tableHeight }"
  106. :defaultLoadData="false"
  107. bordered>
  108. <!-- 采购退货单号 -->
  109. <template slot="purchaseReceiptNo" slot-scope="text, record">
  110. <span v-if="$hasPermissions('B_purchaseReceiptDetail')" :id="'purchaseReceiptList-detail-btn'+record.id" class="link-bule" @click="handleDetail(record)">{{ record.sparePartsNo }}</span>
  111. <span v-else>{{ record.sparePartsNo }}</span>
  112. </template>
  113. <!-- 操作 -->
  114. <!-- state 取消 CANCEL 待提交 WAIT_SUBMIT 待审核 WAIT_AUDIT 待入库 WAIT_PUT 已完结 FINISH 审核通过 PASS 审核不通过 REJECT -->
  115. <!-- thirdpartyBizState 审核通过 AUDIT_PASS 审核不通过 AUDIT_REJECT 已取消 CANCEL 已出库 FINISH 待审核 WAIT_AUDIT 待发货 WAIT_RECEIVE -->
  116. <template slot="action" slot-scope="text, record">
  117. <a-button
  118. size="small"
  119. type="link"
  120. class="button-warning"
  121. @click="handleCheck(record)"
  122. v-if="$hasPermissions('B_purchaseReceiptAudit') && record.state ==='WAIT_AUDIT'&&(!record.thirdpartyBizState)"
  123. :id="'purchaseReceiptList-examine-btn'+record.id">审核</a-button>
  124. <a-button
  125. size="small"
  126. type="link"
  127. @click="handleEdit(record)"
  128. class="button-info"
  129. v-if="$hasPermissions('M_purchaseReceiptEdit') && (record.state ==='WAIT_SUBMIT'||record.state ==='WAIT_AUDIT'||record.state ==='REJECT') && (!record.thirdpartyBizState)"
  130. :id="'purchaseReceiptList-edit-btn'+record.id">编辑</a-button>
  131. <a-button
  132. size="small"
  133. type="link"
  134. v-if="$hasPermissions('B_purchaseReceiptDel')&&isShowCancelBtn(record)"
  135. @click="handleDel(record)"
  136. class="button-error"
  137. :id="'purchaseReceiptList-del-btn'+record.id">取消</a-button>
  138. <a-button
  139. v-if="$hasPermissions('B_purchaseReceiptTransportNo') && (record.state === 'WAIT_PUT'&&record.thirdpartyBizState==='FINISH')||(record.state === 'FINISH'&&record.thirdpartyBizState==='FINISH')"
  140. size="small"
  141. type="link"
  142. class="button-warning"
  143. :id="'purchaseReceiptList-logistics-btn'+record.id"
  144. @click="handleFlow(record)"
  145. >
  146. 物流
  147. </a-button>
  148. <a-button
  149. size="small"
  150. type="link"
  151. class="button-warning"
  152. @click="addVoucher(record)"
  153. v-if="$hasPermissions('B_purchaseReceiptAddVoucher') && isShowUploadBtn(record)"
  154. :id="'purchaseReceiptList-addVoucher-btn'+record.id">上传凭证</a-button>
  155. <a-button
  156. size="small"
  157. type="link"
  158. class="button-warning"
  159. @click="seeVoucher(record)"
  160. v-if="$hasPermissions('B_purchaseReceiptSeeVoucher') && isShowCheckBtn(record)"
  161. :id="'purchaseReceiptList-seeVoucher-btn'+record.id">查看凭证</a-button>
  162. <span v-if="(!$hasPermissions('B_purchaseReceiptSeeVoucher')&&!$hasPermissions('B_purchaseReceiptAddVoucher')&&!$hasPermissions('B_purchaseReceiptTransportNo')&&!$hasPermissions('B_purchaseReceiptDel')&&!$hasPermissions('M_purchaseReceiptEdit')&&!$hasPermissions('B_purchaseReceiptAudit'))||isShowNoBtn(record)">--</span>
  163. </template>
  164. </s-table>
  165. </a-spin>
  166. <!-- 查看物流单号 -->
  167. <viewLogistics v-drag :openModal="openFlowModal" :itemNo="noInfo" @close="closeFlowModal"></viewLogistics>
  168. <!-- 详情弹窗 -->
  169. <detailModal v-drag :openModal="openDetailModal" :itemSn="itemSn" @close="closeDetailModal" />
  170. <!-- 审核弹窗 -->
  171. <reviewModal v-drag :openModal="openReviewModal" :itemSn="itemSn" @ok="okReviewModal" @close="closeReviewModal"></reviewModal>
  172. <!-- 上传凭证 -->
  173. <uploadVoucherModal v-drag :openModal="openVoucherModal" :itemSn="itemSn" @ok="handleSearch" @close="openVoucherModal=false"></uploadVoucherModal>
  174. <!-- 查看上传凭证 -->
  175. <seeVoucherModal v-drag :openModal="openSeeVoucherModal" :itemData="itemSeeData" @close="openSeeVoucherModal=false;itemSeeData=null"></seeVoucherModal>
  176. </a-card>
  177. </div>
  178. </template>
  179. <script>
  180. import { commonMixin } from '@/utils/mixin'
  181. import moment from 'moment'
  182. import getDate from '@/libs/getDate.js'
  183. // 组件
  184. import { STable, VSelect } from '@/components'
  185. import rangeDate from '@/views/common/rangeDate.vue'
  186. import custList from '@/views/common/custList.vue'
  187. import supplier from '@/views/common/supplier.js'
  188. import reviewModal from './reviewModal.vue'
  189. import detailModal from './detailModal.vue'
  190. import uploadVoucherModal from './uploadVoucherModal.vue'
  191. import seeVoucherModal from './seeVoucherModal.vue'
  192. import viewLogistics from './viewLogisticsModal.vue'
  193. // 接口
  194. import { purchaseList, purchasePageCount, purchaseCancel, purchaseAudit } from '@/api/purchase'
  195. export default {
  196. name: 'PurchaseReceiptList',
  197. mixins: [commonMixin],
  198. components: { STable, supplier, VSelect, custList, rangeDate, reviewModal, detailModal, uploadVoucherModal, seeVoucherModal, viewLogistics },
  199. data () {
  200. return {
  201. spinning: false,
  202. disabled: false, // 查询、重置按钮是否可操作
  203. tableHeight: 0, // 表格高度
  204. advanced: true, // 高级搜索 展开/关闭
  205. // 查询参数
  206. queryParam: {
  207. // 创建时间默认值
  208. time: [ moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
  209. moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')],
  210. beginDate: getDate.getThreeMonthDays().starttime, // 创建开始时间
  211. endDate: getDate.getCurrMonthDays().endtime, // 创建结束时间
  212. sparePartsNo: undefined, // 采购单号
  213. supplierSn: undefined, // 供应商名称
  214. lockBizDealerSn: undefined, // 客户名称
  215. relationNo: undefined, // 关联单号
  216. state: undefined, // 业务状态
  217. thirdpartyBizState: undefined// 供应商状态
  218. },
  219. openReviewModal: false, // 审核弹窗
  220. openVoucherModal: false, // 上传凭证
  221. openSeeVoucherModal: false, // 查看上传凭证弹窗
  222. openDetailModal: false, // 详情弹窗
  223. itemSn: null, // 采购入库sn
  224. itemSeeData: null, // 查看凭证数据
  225. totalData: null, // 统计数据
  226. openFlowModal: false, // 物流弹窗
  227. noInfo: '', // 物流单号
  228. // 加载数据方法 必须为 Promise 对象
  229. loadData: parameter => {
  230. this.disabled = true
  231. this.spinning = true
  232. const params = Object.assign(parameter, this.queryParam)
  233. const newParams = JSON.parse(JSON.stringify(params))
  234. delete newParams.time
  235. // 获取列表数据 有分页
  236. return purchaseList(newParams).then(res => {
  237. let data
  238. if (res.status == 200) {
  239. data = res.data
  240. // 获取统计数据
  241. this.getCount(newParams)
  242. // 计算列表序号
  243. const no = (data.pageNo - 1) * data.pageSize
  244. for (var i = 0; i < data.list.length; i++) {
  245. data.list[i].no = no + i + 1
  246. }
  247. this.disabled = false
  248. }
  249. this.spinning = false
  250. return data
  251. })
  252. },
  253. rules: {
  254. 'time': [{ required: true, message: '请选择创建时间', trigger: 'change' }]
  255. }
  256. }
  257. },
  258. computed: {
  259. columns () {
  260. const _this = this
  261. const arr = [
  262. { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
  263. { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  264. { title: '采购单号', scopedSlots: { customRender: 'purchaseReceiptNo' }, width: '9%', align: 'center' },
  265. { title: '提交时间', dataIndex: 'updateDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  266. { title: '供应商名称', dataIndex: 'supplierName', align: 'left', width: '14%', customRender: function (text) { return text || '--' }, ellipsis: true },
  267. { title: '采购数量', dataIndex: 'productTotalQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  268. // { title: '采购金额', dataIndex: 'productTotalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
  269. { title: '入库仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  270. { title: '关联单号', dataIndex: 'lockBizNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  271. { title: '客户名称', dataIndex: 'lockBizDealerName', width: '14%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  272. { title: '业务状态', dataIndex: 'stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  273. { title: '供应商状态', dataIndex: 'thirdpartyBizStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  274. { title: '备注', dataIndex: 'bizRemark', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  275. { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
  276. ]
  277. if (this.$hasPermissions('M_purchaseReceiptList_costPrice')) { // 成本价权限
  278. arr.splice(6, 0, { title: '采购金额', dataIndex: 'productTotalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
  279. }
  280. return arr
  281. }
  282. },
  283. methods: {
  284. // 是否显示取消按钮
  285. isShowCancelBtn (row) {
  286. const res = ((row.state === 'WAIT_SUBMIT' || row.state === 'WAIT_AUDIT' || row.state === 'REJECT') && !row.thirdpartyBizState) || (row.state === 'PASS' && row.thirdpartyBizState === 'WAIT_AUDIT')
  287. return res
  288. },
  289. // 是否显示上传凭证按钮
  290. isShowUploadBtn (con) {
  291. const res = ((con.state === 'WAIT_PUT' && con.thirdpartyBizState === 'AUDIT_PASS') || (con.state === 'WAIT_PUT' && con.thirdpartyBizState === 'FINISH') || (con.state === 'FINISH' && con.thirdpartyBizState === 'AUDIT_PASS') || (con.state === 'FINISH' && con.thirdpartyBizState === 'FINISH') || (con.state === 'WAIT_PUT' && con.thirdpartyBizState === 'CANCEL')) && !con.attachmentList
  292. return res
  293. },
  294. // 是否显示查看凭证按钮
  295. isShowCheckBtn (con) {
  296. const res = ((con.state === 'WAIT_PUT' && con.thirdpartyBizState === 'AUDIT_PASS') || (con.state === 'WAIT_PUT' && con.thirdpartyBizState === 'FINISH') || (con.state === 'FINISH' && con.thirdpartyBizState === 'AUDIT_PASS') || (con.state === 'FINISH' && con.thirdpartyBizState === 'FINISH') || (con.state === 'WAIT_PUT' && con.thirdpartyBizState === 'CANCEL')) && (con.attachmentList && con.attachmentList.length > 0)
  297. return res
  298. },
  299. // 是否显示 --
  300. isShowNoBtn (rowVal) {
  301. const res = (rowVal.state === 'CANCEL' && !rowVal.thirdpartyBizState) || (rowVal.state === 'CANCEL' && rowVal.thirdpartyBizState === 'WAIT_AUDIT') || (rowVal.state === 'PASS' && rowVal.thirdpartyBizState === 'AUDIT_REJECT') || (rowVal.state === 'WAIT_PUT' && rowVal.thirdpartyBizState === 'CANCEL')
  302. return res
  303. },
  304. // 创建时间
  305. dateChange (date) {
  306. if (date[0] && date[1]) {
  307. this.queryParam.time = date
  308. } else {
  309. this.queryParam.time = []
  310. }
  311. this.queryParam.beginDate = date[0] || undefined
  312. this.queryParam.endDate = date[1] || undefined
  313. },
  314. // 查询
  315. handleSearch () {
  316. const _this = this
  317. this.$refs.ruleForm.validate(valid => {
  318. if (valid) {
  319. _this.$refs.table.refresh(true)
  320. } else {
  321. _this.$message.error('请选择创建时间')
  322. return false
  323. }
  324. })
  325. },
  326. // 获取统计数据
  327. getCount (params) {
  328. purchasePageCount(params).then(res => {
  329. if (res.status == 200 && res.data) {
  330. this.totalData = res.data
  331. } else {
  332. this.totalData = null
  333. }
  334. })
  335. },
  336. // 编辑
  337. handleEdit (row) {
  338. this.$router.push({ name: 'purchaseReceiptEdit', query: { sn: row.sparePartsSn } })
  339. },
  340. // 审核
  341. handleCheck (row) {
  342. const _this = this
  343. _this.itemSn = row.sparePartsSn
  344. _this.openReviewModal = true
  345. },
  346. // 审核结果
  347. okReviewModal (val) {
  348. const _this = this
  349. const ajaxData = {
  350. sparePartsSn: _this.itemSn,
  351. auditState: val
  352. }
  353. _this.spinning = true
  354. purchaseAudit(ajaxData).then(res => {
  355. if (res.status == 200) {
  356. _this.$message.success(res.message)
  357. _this.$refs.table.refresh(true)
  358. _this.spinning = false
  359. _this.closeReviewModal()
  360. } else {
  361. _this.spinning = false
  362. }
  363. })
  364. },
  365. // 审核完成,清理sn数据
  366. closeReviewModal () {
  367. this.itemSn = null
  368. this.openReviewModal = false
  369. },
  370. // 采购单号 打开详情弹窗
  371. handleDetail (row) {
  372. this.itemSn = row.sparePartsSn
  373. this.openDetailModal = true
  374. },
  375. // 关闭采购入库详情弹框
  376. closeDetailModal () {
  377. this.itemSn = null
  378. this.openDetailModal = false
  379. },
  380. // 上传凭证
  381. addVoucher (row) {
  382. this.itemSn = row.sparePartsSn
  383. this.openVoucherModal = true
  384. },
  385. // 查看凭证
  386. seeVoucher (row) {
  387. this.itemSeeData = row.attachmentList
  388. this.$nextTick(() => {
  389. this.openSeeVoucherModal = true
  390. })
  391. },
  392. // 取消
  393. handleDel (row) {
  394. const _this = this
  395. this.$confirm({
  396. title: '提示',
  397. content: '确认取消吗?取消后不可恢复?',
  398. centered: true,
  399. onOk () {
  400. _this.spinning = true
  401. purchaseCancel({ sn: row.sparePartsSn }).then(res => {
  402. if (res.status == 200) {
  403. _this.$message.success(res.message)
  404. _this.$refs.table.refresh()
  405. _this.spinning = false
  406. } else {
  407. _this.spinning = false
  408. }
  409. })
  410. }
  411. })
  412. },
  413. // 客户名称 change
  414. custChange (obj) {
  415. this.queryParam.lockBizDealerSn = obj.key
  416. },
  417. // 重置
  418. resetSearchForm () {
  419. this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
  420. this.queryParam.endDate = getDate.getCurrMonthDays().endtime
  421. this.queryParam.time = [
  422. getDate.getThreeMonthDays().starttime,
  423. getDate.getCurrMonthDays().endtime
  424. ]
  425. this.$refs.rangeDate.resetDate(this.queryParam.time)
  426. this.queryParam.sparePartsNo = undefined
  427. this.queryParam.supplierSn = undefined
  428. this.queryParam.lockBizDealerSn = undefined
  429. this.queryParam.relationNo = undefined
  430. this.queryParam.state = undefined
  431. this.queryParam.thirdpartyBizState = undefined
  432. this.itemSn = null
  433. this.$refs.custList.resetForm()
  434. this.$refs.ruleForm.resetFields()
  435. this.$refs.table.refresh(true)
  436. },
  437. // 打开物流弹窗
  438. handleFlow (row) {
  439. this.noInfo = row.transportNo
  440. this.openFlowModal = true
  441. },
  442. // 关闭物流弹窗
  443. closeFlowModal () {
  444. this.noInfo = ''
  445. this.openFlowModal = false
  446. },
  447. // 初始化数据
  448. pageInit () {
  449. const _this = this
  450. this.$nextTick(() => { // 页面渲染完成后的回调
  451. _this.setTableH()
  452. })
  453. },
  454. // 计算表格高度
  455. setTableH () {
  456. const tableSearchH = this.$refs.tableSearch.offsetHeight
  457. this.tableHeight = window.innerHeight - tableSearchH - 225
  458. }
  459. },
  460. watch: {
  461. // 展开关闭 监听页面高度变化
  462. advanced (newValue, oldValue) {
  463. const _this = this
  464. this.$nextTick(() => { // 页面渲染完成后的回调
  465. _this.setTableH()
  466. })
  467. },
  468. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  469. this.setTableH()
  470. }
  471. },
  472. mounted () {
  473. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  474. this.pageInit()
  475. this.resetSearchForm()
  476. }
  477. },
  478. activated () {
  479. // 如果是新页签打开,则重置当前页面
  480. if (this.$store.state.app.isNewTab) {
  481. this.pageInit()
  482. this.resetSearchForm()
  483. }
  484. // 仅刷新列表,不重置页面
  485. if (this.$store.state.app.updateList) {
  486. this.pageInit()
  487. this.$refs.table.refresh()
  488. }
  489. },
  490. beforeRouteEnter (to, from, next) {
  491. next(vm => {})
  492. }
  493. }
  494. </script>
  495. <style lang="less" scoped>
  496. .purchaseReceiptList-wrap{
  497. .tongji-bar{
  498. margin-bottom:13px;
  499. }
  500. }
  501. </style>