list.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. <template>
  2. <a-card size="small" :bordered="false" class="inventoryQueryList-wrap">
  3. <a-spin :spinning="spinning" tip="Loading...">
  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. <a-input id="inventoryQueryList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
  11. </a-form-item>
  12. </a-col>
  13. <a-col :md="6" :sm="24">
  14. <a-form-item label="原厂编码">
  15. <a-input id="inventoryQueryList-productOrigCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
  16. </a-form-item>
  17. </a-col>
  18. <a-col :md="6" :sm="24">
  19. <a-form-item label="产品名称">
  20. <a-input id="inventoryQueryList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
  21. </a-form-item>
  22. </a-col>
  23. <a-col :md="6" :sm="24">
  24. <a-form-model-item label="产品品牌">
  25. <ProductBrand id="inventoryQueryList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
  26. </a-form-model-item>
  27. </a-col>
  28. <a-col :md="6" :sm="24">
  29. <a-form-model-item label="产品分类">
  30. <ProductType id="inventoryQueryList-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeType" v-model="productTypeSn"></ProductType>
  31. </a-form-model-item>
  32. </a-col>
  33. <a-col :md="6" :sm="24">
  34. <a-form-model-item label="仓库仓位">
  35. <Warehouse id="inventoryQueryList-warehouse" :showDefault="false" :changeOnSelect="true" ref="warehouse" v-model="queryParam.warehouse"></Warehouse>
  36. </a-form-model-item>
  37. </a-col>
  38. <template v-if="advanced">
  39. <a-col :md="6" :sm="24">
  40. <a-form-model-item label="滞销天数">
  41. <a-input-group>
  42. <a-row>
  43. <a-col :span="11">
  44. <a-input-number
  45. id="shelfMonitoringList-minUnsalableDays"
  46. v-model="queryParam.minUnsalableDays"
  47. :precision="0"
  48. :min="0"
  49. :max="999999"
  50. placeholder="起始天数"
  51. style="width: 100%;display: inline-block;" />
  52. </a-col>
  53. <a-col :span="2"><span style="display: block;text-align: center;line-height: 32px;">至</span></a-col>
  54. <a-col :span="11">
  55. <a-input-number
  56. id="shelfMonitoringList-maxUnsalableDays"
  57. v-model="queryParam.maxUnsalableDays"
  58. :precision="0"
  59. :min="0"
  60. :max="999999"
  61. placeholder="截止天数"
  62. style="width: 100%;display: inline-block;" />
  63. </a-col>
  64. </a-row>
  65. </a-input-group>
  66. </a-form-model-item>
  67. </a-col>
  68. <a-col :md="6" :sm="24">
  69. <a-form-item label="产品来源">
  70. <a-select
  71. allowClear
  72. placeholder="请选择产品来源"
  73. v-model="queryParam.productSysFlag"
  74. id="shelfMonitoringList-productSysFlag"
  75. >
  76. <a-select-option value="1" id="shelfMonitoringList-productSysFlag-1">
  77. 箭冠
  78. </a-select-option>
  79. <a-select-option value="0" id="shelfMonitoringList-productSysFlag-0">
  80. 自建
  81. </a-select-option>
  82. </a-select>
  83. </a-form-item>
  84. </a-col>
  85. </template>
  86. <a-col :md="6" :sm="24">
  87. <div style="margin-top: 6px;">
  88. <a-checkbox v-model="queryParam.zeroQtyFlag" id="inventoryQueryList-zeroQtyFlag">只查看有库存</a-checkbox>
  89. <a-checkbox v-model="queryParam.enableFlag" :checked="queryParam.enableFlag" id="inventoryQueryList-enableFlag">包括禁用产品</a-checkbox>
  90. <a-checkbox v-model="queryParam.freezeFlag" :checked="queryParam.freezeFlag" id="inventoryQueryList-freezeFlag">只查冻结产品</a-checkbox>
  91. </div>
  92. </a-col>
  93. <a-col :md="6" :sm="24">
  94. <div style="margin-bottom: 10px;">
  95. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryQueryList-refresh">查询</a-button>
  96. <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryList-reset">重置</a-button>
  97. <a-button
  98. type="primary"
  99. v-if="$hasPermissions('B_inventoryInventoryQueryExport')"
  100. class="button-warning"
  101. @click="handleExport"
  102. :disabled="disabled"
  103. :loading="exportLoading"
  104. id="inventoryQueryList-export">导出</a-button>
  105. <a @click="advanced=!advanced" style="margin-left: 5px" id="shelfMonitoringList-advanced">
  106. {{ advanced ? '收起' : '展开' }}
  107. <a-icon :type="advanced ? 'up' : 'down'"/>
  108. </a>
  109. </div>
  110. </a-col>
  111. </a-row>
  112. </a-form>
  113. </div>
  114. <!-- 合计 -->
  115. <a-alert type="info" style="margin-bottom:10px">
  116. <div class="ftext" slot="message">
  117. 可用总库存:<strong>{{ currentStock&&(currentStock.totalCurrentStockQty || currentStock.totalCurrentStockQty==0) ? currentStock.totalCurrentStockQty : '--' }}个</strong>;
  118. <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
  119. 可用库存总成本:<strong>{{ currentStock&&(currentStock.totalCurrentStockCost || currentStock.totalCurrentStockCost==0) ? toThousands(currentStock.totalCurrentStockCost) : '--' }}</strong>;
  120. </div>
  121. 冻结总库存:<strong>{{ currentStock&&(currentStock.totalFreezeQty || currentStock.totalFreezeQty==0) ? currentStock.totalFreezeQty : '--' }}个</strong>;
  122. </div>
  123. </a-alert>
  124. <!-- 列表 -->
  125. <s-table
  126. class="sTable fixPagination"
  127. ref="table"
  128. :style="{ height: tableHeight+68.5+'px' }"
  129. size="small"
  130. :rowKey="(record) => record.id"
  131. :columns="columns"
  132. :data="loadData"
  133. :scroll="{ y: tableHeight }"
  134. :defaultLoadData="false"
  135. bordered>
  136. <!-- 产品分类 -->
  137. <template slot="productTypeName" slot-scope="text, record">
  138. <span v-if="record.productTypeName2">{{ record.productTypeName2 || '' }} ></span>
  139. <span v-if="record.productTypeName3">{{ record.productTypeName3 || '' }}</span>
  140. </template>
  141. <!-- 直销天数 -->
  142. <template slot="unsalableDays" slot-scope="text, record" >
  143. <span v-if="record.unsalableDays>=180&&record.unsalableDays<=360" style="color:#FF9900">{{ num(record.unsalableDays) }}</span>
  144. <span v-else-if="record.unsalableDays>360" style="color:#FF0000">{{ num(record.unsalableDays) }}</span>
  145. <span v-else >{{ num(record.unsalableDays) }}</span>
  146. </template>
  147. <!-- 操作 -->
  148. <template slot="action" slot-scope="text, record">
  149. <a-button
  150. size="small"
  151. type="link"
  152. v-if="$hasPermissions('B_inventoryInventoryQueryDetail')"
  153. class="button-success"
  154. @click="goDetail(record)"
  155. :id="'inventoryQueryList-detail-'+record.id">库存详情</a-button>
  156. <a-button
  157. size="small"
  158. type="link"
  159. v-if="$hasPermissions('B_inventoryInventoryQueryStock')"
  160. class="button-primary"
  161. @click="goWarehouseDetail(record)"
  162. :id="'inventoryQueryList-outdetail-'+record.id">出入库明细</a-button>
  163. <a-button
  164. v-if="record.dealerProduct.sysFlag==1&&record.dealerProduct.onlineFalg==1&&$hasPermissions('M_shoppingCart')"
  165. type="link"
  166. :id="'inventoryQueryList-shopCar-'+record.id"
  167. @click="addShopCar(record)">加入购物车</a-button>
  168. <span v-if="!$hasPermissions('B_inventoryInventoryQueryDetail') && !$hasPermissions('B_inventoryInventoryQueryStock')">--</span>
  169. </template>
  170. </s-table>
  171. </a-spin>
  172. <!-- 库存详情 -->
  173. <inventory-query-detail-modal v-drag :openModal="openModal" :nowData="nowData" @close="closeModal" />
  174. <!-- 设置采购数量 -->
  175. <set-purchase-qty ref="setPurchaseQty" :openModal="openPurchaseModal" @close="openPurchaseModal=false" v-drag></set-purchase-qty>
  176. </a-card>
  177. </template>
  178. <script>
  179. import { commonMixin } from '@/utils/mixin'
  180. import { STable, VSelect } from '@/components'
  181. import { downloadExcel } from '@/libs/JGPrint.js'
  182. import ProductType from '../../common/productType.js'
  183. import ProductBrand from '../../common/productBrand.js'
  184. import Warehouse from '@/views/common/warehouse.js'
  185. import inventoryQueryDetailModal from './detailModal.vue'
  186. import setPurchaseQty from './setPurchaseQty.vue'
  187. import { stockList, stockCount, stockExport } from '@/api/stock'
  188. import { purchaseCartExistProduct } from '@/api/purchaseCart'
  189. export default {
  190. name: 'InventoryQueryList',
  191. components: { STable, VSelect, inventoryQueryDetailModal, ProductType, ProductBrand, Warehouse, setPurchaseQty },
  192. mixins: [commonMixin],
  193. data () {
  194. return {
  195. spinning: false,
  196. advanced: true, // 高级搜索 展开/关闭
  197. tableHeight: 0,
  198. queryParam: { // 查询条件
  199. productCode: '', // 产品编码
  200. productName: '', // 产品名称
  201. productOrigCode: '', // 原厂编码
  202. productBrandSn: undefined, // 产品品牌
  203. productTypeSn1: '', // 产品分类1
  204. productTypeSn2: '', // 产品分类2
  205. productTypeSn3: '', // 产品分类3
  206. warehouse: [], // 仓库默认值
  207. warehouseSn: '', // 仓库sn
  208. warehouseLocationSn: '', // 仓位sn
  209. zeroQtyFlag: false, // 库存情况
  210. enableFlag: true, // 显示禁用产品
  211. freezeFlag: false, // 冻结产品
  212. minUnsalableDays: undefined, // 滞销天数最小值
  213. maxUnsalableDays: undefined, // 滞销天数最大值
  214. productSysFlag: undefined // 产品来源,箭冠or自建
  215. },
  216. productTypeSn: [], // 产品类型sn
  217. exportLoading: false, // 导出loading
  218. disabled: false, // 查询、重置按钮是否可操作
  219. zeroQtyData: [ // 库存情况
  220. { name: '库存数量为0', id: '1' },
  221. { name: '库存数量不为0', id: '0' }
  222. ],
  223. openPurchaseModal: false, // 设置采购数量弹框
  224. // 加载数据方法 必须为 Promise 对象
  225. loadData: parameter => {
  226. // 查询条件有直销天数先校验滞销天数
  227. if (this.checkValueRange()) {
  228. this.disabled = true
  229. this.spinning = true
  230. // 排序
  231. if (parameter.sortField == 'currentStockQty') {
  232. parameter.sortField = 'currentStockQty'
  233. parameter.sortAlias = ''
  234. }
  235. if (parameter.sortField == 'currentStockCost') {
  236. parameter.sortField = 'currentStockCost'
  237. parameter.sortAlias = 'stock'
  238. }
  239. if (parameter.sortField == 'unsalableDays') {
  240. parameter.sortField = 'unsalableDays'
  241. parameter.sortAlias = ''
  242. }
  243. const params = Object.assign(parameter, this.queryParam)
  244. // 格式化数据
  245. params.zeroQtyFlag = params.zeroQtyFlag ? '0' : ''
  246. params.enableFlag = params.enableFlag ? '' : '1'
  247. params.freezeFlag = params.freezeFlag ? '0' : ''
  248. params.product = {
  249. sysFlag: params.productSysFlag || undefined
  250. }
  251. // 仓库仓位
  252. params.warehouseSn = params.warehouse[0]
  253. params.warehouseLocationSn = params.warehouse[1]
  254. return stockList(params).then(res => {
  255. let data
  256. if (res.status == 200) {
  257. data = res.data
  258. const no = (data.pageNo - 1) * data.pageSize
  259. for (var i = 0; i < data.list.length; i++) {
  260. data.list[i].no = no + i + 1
  261. }
  262. this.disabled = false
  263. // 总计
  264. this.getTotal(params)
  265. }
  266. this.spinning = false
  267. return data
  268. })
  269. } else {
  270. const _this = this
  271. this.disabled = true
  272. this.spinning = true
  273. return new Promise(function (resolve, reject) {
  274. const data = { list: [], count: 0, pageNo: 1, pageSize: 10 }
  275. _this.disabled = false
  276. _this.spinning = false
  277. resolve(data)
  278. })
  279. }
  280. },
  281. openModal: false, // 查看库存详情 弹框
  282. nowData: null, // 当前操作数据
  283. currentStock: null // 可用库存合计
  284. }
  285. },
  286. computed: {
  287. columns () {
  288. const _this = this
  289. const arr = [
  290. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  291. { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  292. { title: '产品名称', dataIndex: 'productName', width: '15%', align: 'left', ellipsis: true, customRender: function (text) { return text || '--' } },
  293. { title: '原厂编码', dataIndex: 'productOrigCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
  294. { title: '产品品牌', dataIndex: 'brandName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  295. { title: '产品分类', scopedSlots: { customRender: 'productTypeName' }, width: '13%', align: 'center' },
  296. { title: '可用库存(个)', dataIndex: 'currentStockQty', width: '8%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  297. // { title: '可用库存成本(¥)', dataIndex: 'currentStockCost', width: '8%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  298. { title: '冻结库存(个)', dataIndex: 'freezeQty', width: '8%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  299. { title: <div><a-tooltip placement='top' title='1:产品距离最近一次销售的时间,30天算一个月 2:采购退货,调拨等不算销售,不用来计算滞销天数'><a-icon type="question-circle" /></a-tooltip>&nbsp;滞销天数</div>, width: '10%', align: 'center', dataIndex: 'unsalableDays', scopedSlots: { customRender: 'unsalableDays' }, sorter: true },
  300. { title: <div><a-tooltip placement='top' title='注意:购物车仅限添加箭冠已上线产品。'><a-icon type="question-circle" /></a-tooltip>&nbsp;操作</div>, scopedSlots: { customRender: 'action' }, width: '16%', align: 'center' }
  301. ]
  302. // 成本权限
  303. if (this.$hasPermissions('M_ShowAllCost')) {
  304. arr.splice(7, 0, { title: '可用库存成本(¥)', dataIndex: 'currentStockCost', width: '10%', align: 'right', sorter: true, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  305. }
  306. return arr
  307. }
  308. },
  309. methods: {
  310. // 加入购物车
  311. addShopCar (row) {
  312. this.spinning = true
  313. purchaseCartExistProduct({
  314. productSn: row.productSn
  315. }).then(res => {
  316. if (res.status == 200) {
  317. if (res.data) {
  318. this.$message.info('此产品已添加到购物车!')
  319. } else {
  320. this.$refs.setPurchaseQty.setData(row)
  321. this.openPurchaseModal = true
  322. }
  323. }
  324. this.spinning = false
  325. })
  326. },
  327. // 校验滞销天数数值范围
  328. checkValueRange () {
  329. const isONull = this.queryParam.minUnsalableDays === null || this.queryParam.minUnsalableDays === undefined
  330. const isOEmpty = this.queryParam.minUnsalableDays === ''
  331. const isOZero = this.queryParam.minUnsalableDays === 0
  332. const isTNull = this.queryParam.maxUnsalableDays === null || this.queryParam.maxUnsalableDays === undefined
  333. const isTEmpty = this.queryParam.maxUnsalableDays === ''
  334. const isTZero = this.queryParam.maxUnsalableDays === 0
  335. // 第一个为空(可为null可为空字符)第二个不为空
  336. // 第一个不为空第二个为空(可为null可为空字符)
  337. // 第一个大于第二个
  338. if ((isONull || isOEmpty) && (this.queryParam.maxUnsalableDays || isTZero)) {
  339. this.$message.info('请输入正确的滞销天数查询范围!')
  340. return false
  341. }
  342. if ((this.queryParam.minUnsalableDays || isOZero) && (isTNull || isTEmpty)) {
  343. this.$message.info('请输入正确的滞销天数查询范围!')
  344. return false
  345. }
  346. if (this.queryParam.minUnsalableDays > this.queryParam.maxUnsalableDays) {
  347. this.$message.info('请输入正确的滞销天数查询范围!')
  348. return false
  349. }
  350. this.queryParam.minUnsalableDays = this.queryParam.minUnsalableDays > 999999999 ? 999999999 : this.queryParam.minUnsalableDays
  351. this.queryParam.maxUnsalableDays = this.queryParam.maxUnsalableDays > 999999999 ? 999999999 : this.queryParam.maxUnsalableDays
  352. return true
  353. },
  354. // 格式化滞销天数为几个月零几天
  355. num (val) {
  356. let days
  357. if (val != null && val != undefined) {
  358. if (val >= 30) {
  359. const a = Math.floor(val / 30)
  360. const b = val - a * 30
  361. if (b > 0) {
  362. days = a + '个月' + b + '天'
  363. } else {
  364. days = a + '个月'
  365. }
  366. } else {
  367. days = val + '天'
  368. }
  369. } else {
  370. days = '--'
  371. }
  372. return days
  373. },
  374. // 重置
  375. resetSearchForm () {
  376. this.queryParam.productBrandSn = undefined
  377. this.queryParam.productTypeSn1 = ''
  378. this.queryParam.productTypeSn2 = ''
  379. this.queryParam.productTypeSn3 = ''
  380. this.queryParam.productCode = ''
  381. this.queryParam.productOrigCode = ''
  382. this.queryParam.productName = ''
  383. this.queryParam.brandName = undefined
  384. this.queryParam.productTypeName = undefined
  385. this.queryParam.zeroQtyFlag = false
  386. this.queryParam.freezeFlag = false
  387. this.queryParam.warehouse = []
  388. this.queryParam.warehouseSn = ''
  389. this.queryParam.warehouseLocationSn = ''
  390. this.$refs.warehouse.setDefaultVal()
  391. this.productTypeSn = []
  392. this.queryParam.minUnsalableDays = undefined // 滞销天数最小值
  393. this.queryParam.maxUnsalableDays = undefined // 滞销天数最大值
  394. this.queryParam.productSysFlag = undefined
  395. this.$refs.table.refresh(true)
  396. },
  397. // 合计
  398. getTotal (param) {
  399. stockCount(param).then(res => {
  400. if (res.status == 200 && res.data) {
  401. this.currentStock = res.data
  402. } else {
  403. this.currentStock = null
  404. }
  405. })
  406. },
  407. // 库存详情
  408. goDetail (row) {
  409. this.nowData = row
  410. this.openModal = true
  411. },
  412. // 关闭弹框
  413. closeModal () {
  414. this.nowData = null
  415. this.openModal = false
  416. },
  417. // 出入库明细
  418. goWarehouseDetail (row) {
  419. this.$router.push({ name: 'inventoryQueryWarehouseDetail', params: { sn: row.productSn } })
  420. },
  421. // 导出
  422. handleExport () {
  423. const _this = this
  424. const params = JSON.parse(JSON.stringify(this.queryParam))
  425. params.zeroQtyFlag = params.zeroQtyFlag ? '0' : ''
  426. params.enableFlag = params.enableFlag ? '' : '1'
  427. params.freezeFlag = params.freezeFlag ? '0' : ''
  428. params.showCost = this.$hasPermissions('M_ShowAllCost') ? 1 : 0
  429. // 仓库仓位
  430. params.warehouseSn = params.warehouse[0]
  431. params.warehouseLocationSn = params.warehouse[1]
  432. this.exportLoading = true
  433. _this.spinning = true
  434. stockExport(params).then(res => {
  435. this.exportLoading = false
  436. _this.spinning = false
  437. if (res.type == 'application/json') {
  438. var reader = new FileReader()
  439. reader.addEventListener('loadend', function () {
  440. const obj = JSON.parse(reader.result)
  441. _this.$notification.error({
  442. message: '提示',
  443. description: obj.message
  444. })
  445. })
  446. reader.readAsText(res)
  447. } else {
  448. downloadExcel(res, '库存查询')
  449. }
  450. })
  451. },
  452. // 产品分类 changeType
  453. changeType (val, selectedOptions) {
  454. for (let i = 0; i < val.length; i++) {
  455. this.queryParam['productTypeSn' + (i + 1)] = val[i]
  456. }
  457. if (val.length == 0) {
  458. this.queryParam.productTypeSn1 = ''
  459. this.queryParam.productTypeSn2 = ''
  460. this.queryParam.productTypeSn3 = ''
  461. }
  462. },
  463. // 页面初始化
  464. pageInit () {
  465. const _this = this
  466. this.$nextTick(() => { // 页面渲染完成后的回调
  467. _this.setTableH()
  468. })
  469. // 是否默认包括禁用产品
  470. this.queryParam.enableFlag = localStorage.getItem('productEnabledFlag-' + this.$store.state.user.info.orgId) != 'false'
  471. },
  472. // 表格高度
  473. setTableH () {
  474. const tableSearchH = this.$refs.tableSearch.offsetHeight
  475. this.tableHeight = window.innerHeight - tableSearchH - 216
  476. }
  477. },
  478. watch: {
  479. advanced (newValue, oldValue) {
  480. const _this = this
  481. this.$nextTick(() => { // 页面渲染完成后的回调
  482. _this.setTableH()
  483. })
  484. },
  485. 'queryParam.enableFlag' (newValue, oldValue) {
  486. localStorage.setItem('productEnabledFlag-' + this.$store.state.user.info.orgId, newValue)
  487. },
  488. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  489. this.setTableH()
  490. }
  491. },
  492. mounted () {
  493. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  494. this.pageInit()
  495. this.resetSearchForm()
  496. }
  497. },
  498. activated () {
  499. // 如果是新页签打开,则重置当前页面
  500. if (this.$store.state.app.isNewTab) {
  501. this.pageInit()
  502. this.resetSearchForm()
  503. }
  504. // 仅刷新列表,不重置页面
  505. if (this.$store.state.app.updateList) {
  506. this.pageInit()
  507. this.$refs.table.refresh()
  508. }
  509. },
  510. beforeRouteEnter (to, from, next) {
  511. next(vm => {})
  512. }
  513. }
  514. </script>