list.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. <template>
  2. <a-spin :spinning="spinning" tip="Loading...">
  3. <a-alert :show-icon="false" type="error" message="注:销售单报表包含急件销售数量、售价,销售明细报表不包含急件销售数量、成本、售价" banner style="margin-bottom: 10px;" />
  4. <!-- 搜索条件 -->
  5. <div class="table-page-search-wrapper">
  6. <a-form-model
  7. id="salesDetailReportList-form"
  8. ref="ruleForm"
  9. class="form-model-con"
  10. layout="inline"
  11. :model="queryParam"
  12. :rules="rules"
  13. :labelCol="labelCol"
  14. :wrapperCol="wrapperCol"
  15. @keyup.enter.native="handleSearch" >
  16. <a-row :gutter="15">
  17. <a-col :md="6" :sm="24">
  18. <a-form-model-item label="创建时间">
  19. <rangeDate ref="creatDate" v-model="creatTime" @change="creatDateChange" />
  20. </a-form-model-item>
  21. </a-col>
  22. <a-col :md="6" :sm="24">
  23. <a-form-model-item label="审核时间">
  24. <rangeDate ref="rangeDate" v-model="time" @change="dateChange" />
  25. </a-form-model-item>
  26. </a-col>
  27. <a-col :md="6" :sm="24">
  28. <a-form-item label="出库时间">
  29. <rangeDate ref="outWareRangeDate" v-model="outWareTime" @change="outWareDateChange" />
  30. </a-form-item>
  31. </a-col>
  32. <template v-if="advanced">
  33. <a-col :md="4" :sm="24">
  34. <a-form-model-item label="客户名称">
  35. <custList id="salesDetailReportList-salesTargetName" ref="custSatelliteList" @change="custSatelliteChange"></custList>
  36. </a-form-model-item>
  37. </a-col>
  38. <a-col :md="4" :sm="24">
  39. <a-form-model-item label="客户类型">
  40. <a-select id="salesDetailReportList-customerType" v-model="queryParam.salesTargetType" allowClear placeholder="请选择客户类型">
  41. <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
  42. </a-select>
  43. </a-form-model-item>
  44. </a-col>
  45. <a-col :md="4" :sm="24">
  46. <a-form-model-item label="收款方式">
  47. <v-select
  48. code="SETTLE_STYLE"
  49. id="salesDetailReportList-settleStyleSn"
  50. v-model="queryParam.settleStyleSn"
  51. allowClear
  52. placeholder="请选择收款方式"
  53. ></v-select>
  54. </a-form-model-item>
  55. </a-col>
  56. <a-col :md="4" :sm="24">
  57. <a-form-item label="产品品牌">
  58. <ProductBrand id="salesDetailReportList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productEntity.productBrandSn"></ProductBrand>
  59. </a-form-item>
  60. </a-col>
  61. <a-col :md="4" :sm="24">
  62. <a-form-model-item label="产品分类">
  63. <ProductType id="salesDetailReportList-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
  64. </a-form-model-item>
  65. </a-col>
  66. <a-col :md="4" :sm="24">
  67. <a-form-model-item label="产品编码">
  68. <a-input id="salesDetailReportList-code" v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
  69. </a-form-model-item>
  70. </a-col>
  71. <a-col :md="4" :sm="24">
  72. <a-form-model-item label="产品名称">
  73. <a-input id="salesDetailReportList-name" v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
  74. </a-form-model-item>
  75. </a-col>
  76. <a-col :md="4" :sm="24">
  77. <a-form-model-item label="仓库仓位">
  78. <a-cascader
  79. v-model="queryParam.warehouseCascade"
  80. expand-trigger="hover"
  81. :options="warehouseCascadeData"
  82. :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
  83. id="salesDetailReportList-warehouseCascade"
  84. placeholder="请选择仓库仓位"
  85. @change="warehouseCascadeChange"
  86. allowClear
  87. style="width: 100%;" />
  88. </a-form-model-item>
  89. </a-col>
  90. <a-col :md="4" :sm="24">
  91. <a-form-model-item label="单号">
  92. <a-input id="salesDetailReportList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入单号"/>
  93. </a-form-model-item>
  94. </a-col>
  95. <a-col :md="4" :sm="24">
  96. <a-form-model-item label="业务员">
  97. <a-input id="salesDetailReportList-salesManName" v-model.trim="queryParam.salesManName" allowClear placeholder="请输入业务员"/>
  98. </a-form-model-item>
  99. </a-col>
  100. <a-col :md="12" :sm="24">
  101. <a-row>
  102. <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }" style="margin-bottom: 0!important;">
  103. <a-col span="7">
  104. <a-form-model-item prop="provinceSn" style="margin: 0;">
  105. <a-select v-model="queryParam.provinceSn" @change="getCityList" placeholder="请选择省" allowClear>
  106. <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
  107. </a-select>
  108. </a-form-model-item>
  109. </a-col>
  110. <a-col span="7" offset="1">
  111. <a-form-model-item prop="citySn" style="margin: 0;">
  112. <a-select v-model="queryParam.citySn" @change="getAreaList" placeholder="请选择市" allowClear>
  113. <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
  114. </a-select>
  115. </a-form-model-item>
  116. </a-col>
  117. <a-col span="7" offset="1">
  118. <a-form-model-item prop="countySn" style="margin: 0;">
  119. <a-select v-model="queryParam.countySn" placeholder="请选择区/县" allowClear>
  120. <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
  121. </a-select>
  122. </a-form-model-item>
  123. </a-col>
  124. </a-form-model-item>
  125. </a-row>
  126. </a-col>
  127. </template>
  128. <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
  129. <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesDetailReportList-refresh">查询</a-button>
  130. <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesDetailReportList-reset">重置</a-button>
  131. <a-button
  132. type="primary"
  133. style="margin-left: 5px"
  134. @click="handleExport"
  135. :disabled="disabled"
  136. :loading="exportLoading"
  137. v-if="$hasPermissions('B_salesDetailExport')"
  138. class="button-warning"
  139. id="salesDetailReportList-export-btn">导出</a-button>
  140. <a @click="advanced=!advanced" style="margin-left: 5px">
  141. {{ advanced ? '收起' : '展开' }}
  142. <a-icon :type="advanced ? 'up' : 'down'"/>
  143. </a>
  144. </a-col>
  145. </a-row>
  146. </a-form-model>
  147. </div>
  148. <!-- 合计 -->
  149. <a-alert type="info" style="margin-bottom:10px">
  150. <div class="ftext" slot="message">
  151. 产品总数量:<strong>{{ (totalData && (totalData.productQty || totalData.productQty==0)) ? totalData.productQty : '--' }}</strong>;
  152. <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
  153. 总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? toThousands(totalData.totalCost) : '--' }}</strong>;
  154. </div>
  155. 总售价:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</strong>;
  156. 折后总售价:<strong>{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? toThousands(totalData.discountedAmount) : '--' }}</strong>;
  157. <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
  158. 总毛利:<strong>{{ (totalData && (totalData.grossProfit || totalData.grossProfit==0)) ? toThousands(totalData.grossProfit) : '--' }}</strong>。
  159. </div>
  160. </div>
  161. </a-alert>
  162. <!-- 列表 -->
  163. <s-table
  164. class="sTable"
  165. ref="table"
  166. size="small"
  167. :rowKey="(record) => record.no"
  168. rowKeyName="no"
  169. :columns="columns"
  170. :data="loadData"
  171. :defaultLoadData="false"
  172. bordered>
  173. </s-table>
  174. </a-spin>
  175. </template>
  176. <script>
  177. import { commonMixin } from '@/utils/mixin'
  178. import { STable, VSelect } from '@/components'
  179. import rangeDate from '@/views/common/rangeDate.vue'
  180. import { downloadExcel } from '@/libs/JGPrint.js'
  181. import { getArea } from '@/api/data'
  182. import { custTypeFindAllList } from '@/api/custType'
  183. import { warehouseCascadeList } from '@/api/warehouse'
  184. import ProductType from '../../common/productType.js'
  185. import ProductBrand from '../../common/productBrand.js'
  186. import custList from '@/views/common/custList.vue'
  187. import { reportSalesBillDetailList, reportSalesBillDetailCount, reportSalesBillDetailExport } from '@/api/reportData'
  188. export default {
  189. components: { STable, VSelect, rangeDate, ProductType, ProductBrand, custList },
  190. mixins: [commonMixin],
  191. data () {
  192. return {
  193. spinning: false,
  194. labelCol: { span: 8 },
  195. wrapperCol: { span: 16 },
  196. advanced: false, // 高级搜索 展开/关闭
  197. tableHeight: 0,
  198. outWareTime: [],
  199. time: [],
  200. creatTime: [],
  201. queryParam: { // 查询条件
  202. createBeginDate: '',
  203. createEndDate: '',
  204. beginDate: '',
  205. endDate: '',
  206. buyerNameCurrent: undefined, // 客户名称
  207. buyerSnCurrent: undefined, // 客户sn
  208. salesTargetType: undefined,
  209. provinceSn: undefined, // 省
  210. citySn: undefined, // 市
  211. countySn: undefined, // 区
  212. settleStyleSn: undefined,
  213. productEntity: {
  214. productBrandSn: undefined, // 产品品牌
  215. productTypeSn1: '', // 产品一级分类
  216. productTypeSn2: '', // 产品二级分类
  217. productTypeSn3: '', // 产品三级分类
  218. code: '', // 产品编码
  219. name: '' // 产品名称
  220. },
  221. warehouseCascade: [],
  222. warehouseSn: undefined,
  223. warehouseLocationSn: undefined,
  224. salesBillNo: '',
  225. salesManName: ''
  226. },
  227. rules: {
  228. 'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
  229. },
  230. disabled: false, // 查询、重置按钮是否可操作
  231. exportLoading: false,
  232. // 加载数据方法 必须为 Promise 对象
  233. loadData: parameter => {
  234. this.disabled = true
  235. const params = Object.assign(parameter, this.queryParam)
  236. this.spinning = true
  237. delete params.time
  238. delete params.warehouseCascade
  239. return reportSalesBillDetailList(params).then(res => {
  240. let data
  241. if (res.status == 200) {
  242. data = res.data
  243. // 总计
  244. this.getCount(params)
  245. const no = (data.pageNo - 1) * data.pageSize
  246. for (var i = 0; i < data.list.length; i++) {
  247. data.list[i].no = no + i + 1
  248. }
  249. this.disabled = false
  250. }
  251. this.spinning = false
  252. return data
  253. })
  254. },
  255. totalData: null, // 合计
  256. addrProvinceList: [], // 省下拉
  257. addrCityList: [], // 市下拉
  258. addrDistrictList: [], // 区下拉
  259. linkageGroupData: [],
  260. allocateTypeList: [], // 调拨类型
  261. custTypeList: [], // 客户类型 下拉数据
  262. productType: [],
  263. warehouseCascadeData: [] // 仓库仓位
  264. }
  265. },
  266. computed: {
  267. columns () {
  268. const _this = this
  269. const arr = [
  270. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  271. { title: '销售单号', dataIndex: 'salesBillNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  272. { title: '客户名称', dataIndex: 'salesTargetName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  273. { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
  274. { title: '产品编码', dataIndex: 'productEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
  275. { title: '产品名称', dataIndex: 'productEntity.name', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  276. { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
  277. { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
  278. { title: '数量', dataIndex: 'productQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  279. // { title: '成本', dataIndex: 'productCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  280. { title: '总售价', dataIndex: 'totalAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  281. { title: '折扣金额', dataIndex: 'discountAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  282. { title: '折后总售价', dataIndex: 'discountedAmount', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  283. // { title: '毛利', dataIndex: 'productProfit', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  284. { title: '审核时间', dataIndex: 'salesAuditDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
  285. ]
  286. if (this.$hasPermissions('M_ShowAllCost')) {
  287. arr.splice(8, 0, { title: '成本', dataIndex: 'totalCost', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  288. arr.splice(12, 0, { title: '毛利', dataIndex: 'grossProfit', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  289. }
  290. return arr
  291. }
  292. },
  293. methods: {
  294. // 合计
  295. getCount (params) {
  296. reportSalesBillDetailCount(params).then(res => {
  297. if (res.status == 200) {
  298. this.totalData = res.data
  299. } else {
  300. this.totalData = null
  301. }
  302. })
  303. },
  304. creatDateChange (date) {
  305. this.creatTime = date
  306. this.queryParam.createBeginDate = date[0] || ''
  307. this.queryParam.createEndDate = date[1] || ''
  308. },
  309. // 创建时间 change
  310. dateChange (date) {
  311. this.time = date
  312. this.queryParam.beginDate = date[0] || ''
  313. this.queryParam.endDate = date[1] || ''
  314. },
  315. outWareDateChange (date) {
  316. this.outWareTime = date
  317. this.queryParam.outWarehouseBeginDate = date[0]
  318. this.queryParam.outWarehouseEndDate = date[1]
  319. },
  320. // 查询
  321. handleSearch () {
  322. const str = JSON.stringify(this.queryParam)
  323. const ret = str.replace(/\[|\]/g, '"').replace(/"},"/g, '","').replace(/"}/g, '","').match(/"\:".*?","/g)
  324. const ret1 = ret.filter(item => item != '":"","')
  325. console.log(ret1)
  326. if (ret1.length) {
  327. this.$refs.table.refresh(true)
  328. } else {
  329. this.$message.info('请至少输入一个查询条件')
  330. }
  331. },
  332. custSatelliteChange (v, row) {
  333. if (row && row.customerSn) {
  334. this.queryParam.buyerSnCurrent = row.customerSn
  335. this.queryParam.buyerNameCurrent = undefined
  336. } else {
  337. this.queryParam.buyerNameCurrent = v
  338. this.queryParam.buyerSnCurrent = undefined
  339. }
  340. },
  341. // 重置
  342. resetSearchForm () {
  343. this.$refs.rangeDate.resetDate()
  344. this.queryParam.time = []
  345. this.queryParam.beginDate = ''
  346. this.queryParam.endDate = ''
  347. this.$refs.outWareRangeDate.resetDate('')
  348. this.outWareTime = []
  349. this.queryParam.outWarehouseBeginDate = ''
  350. this.queryParam.outWarehouseEndDate = ''
  351. this.$refs.creatDate.resetDate()
  352. this.creatTime = []
  353. this.queryParam.createBeginDate = ''
  354. this.queryParam.createEndDate = ''
  355. this.queryParam.buyerNameCurrent = undefined
  356. this.queryParam.buyerSnCurrent = undefined
  357. this.queryParam.salesTargetType = undefined
  358. this.queryParam.provinceSn = undefined
  359. this.queryParam.citySn = undefined
  360. this.queryParam.countySn = undefined
  361. this.queryParam.settleStyleSn = undefined
  362. this.queryParam.productEntity.productBrandSn = undefined
  363. this.queryParam.productEntity.productTypeSn1 = ''
  364. this.queryParam.productEntity.productTypeSn2 = ''
  365. this.queryParam.productEntity.productTypeSn3 = ''
  366. this.queryParam.productEntity.code = ''
  367. this.queryParam.productEntity.name = ''
  368. this.queryParam.warehouseSn = undefined
  369. this.queryParam.warehouseLocationSn = undefined
  370. this.queryParam.showCost = undefined
  371. this.queryParam.warehouseCascade = []
  372. this.queryParam.salesBillNo = ''
  373. this.queryParam.salesManName = ''
  374. this.productType = []
  375. this.$refs.ruleForm.resetFields()
  376. this.totalData = null
  377. this.$refs.table.clearTable()
  378. if (this.advanced) {
  379. this.$refs.custSatelliteList.resetForm()
  380. }
  381. },
  382. // 导出
  383. handleExport () {
  384. const _this = this
  385. const str = JSON.stringify(this.queryParam)
  386. const ret = str.replace(/\[|\]/g, '"').replace(/"},"/g, '","').replace(/"}/g, '","').match(/"\:".*?","/g)
  387. const ret1 = ret.filter(item => item != '":"","')
  388. console.log(ret1)
  389. if (ret1.length) {
  390. const params = _this.queryParam
  391. params.showCost = this.$hasPermissions('M_ShowAllCost') ? '1' : '0'
  392. _this.exportLoading = true
  393. _this.spinning = true
  394. reportSalesBillDetailExport(params).then(res => {
  395. downloadExcel(res, '销售明细报表')
  396. _this.exportLoading = false
  397. _this.spinning = false
  398. _this.queryParam.showCost = undefined
  399. })
  400. } else {
  401. this.$message.info('请至少输入一个查询条件')
  402. }
  403. },
  404. filterOption (input, option) {
  405. return (
  406. option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  407. )
  408. },
  409. // 获取客户类型列表
  410. getCustTypeList () {
  411. const _this = this
  412. custTypeFindAllList().then(res => {
  413. if (res.status == 200) {
  414. _this.custTypeList = res.data || []
  415. } else {
  416. _this.custTypeList = []
  417. }
  418. })
  419. },
  420. // 产品分类 change
  421. changeProductType (val, opt) {
  422. this.queryParam.productEntity.productTypeSn1 = val[0] ? val[0] : ''
  423. this.queryParam.productEntity.productTypeSn2 = val[1] ? val[1] : ''
  424. this.queryParam.productEntity.productTypeSn3 = val[2] ? val[2] : ''
  425. },
  426. // 仓库仓位 级联 列表
  427. getWarehouseCascade () {
  428. warehouseCascadeList({}).then(res => {
  429. if (res.status == 200) {
  430. res.data.map(item => {
  431. item.sn = item.warehouseSn
  432. if (item.warehouseLocationList) {
  433. item.warehouseLocationList.map(subItem => {
  434. subItem.sn = subItem.warehouseLocationSn
  435. })
  436. }
  437. })
  438. this.warehouseCascadeData = res.data
  439. } else {
  440. this.warehouseCascadeData = []
  441. }
  442. })
  443. },
  444. // 仓库仓位change
  445. warehouseCascadeChange (val) {
  446. if (val && val.length > 0) {
  447. this.queryParam.warehouseSn = val[0] || ''
  448. this.queryParam.warehouseLocationSn = val[1] || ''
  449. } else {
  450. this.queryParam.warehouseSn = ''
  451. this.queryParam.warehouseLocationSn = ''
  452. }
  453. },
  454. // 获取城市列表
  455. getCityList (val) {
  456. this.addrCityList = []
  457. this.addrDistrictList = []
  458. this.queryParam.citySn = undefined
  459. this.queryParam.countySn = undefined
  460. if (val) {
  461. this.getArea('city', val)
  462. }
  463. },
  464. // 获取区县列表
  465. getAreaList (val) {
  466. this.addrDistrictList = []
  467. this.queryParam.countySn = undefined
  468. if (val) {
  469. this.getArea('district', val)
  470. }
  471. },
  472. // 省/市/区
  473. getArea (leve, sn) {
  474. let params
  475. if (leve == 'province') {
  476. params = { type: '2' }
  477. } else {
  478. params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
  479. }
  480. getArea(params).then(res => {
  481. if (res.status == 200) {
  482. if (leve == 'province') {
  483. this.addrProvinceList = res.data || []
  484. } else if (leve == 'city') {
  485. this.addrCityList = res.data || []
  486. } else if (leve == 'district') {
  487. this.addrDistrictList = res.data || []
  488. }
  489. } else {
  490. if (leve == 'province') {
  491. this.addrProvinceList = []
  492. } else if (leve == 'city') {
  493. this.addrCityList = []
  494. } else if (leve == 'district') {
  495. this.addrDistrictList = []
  496. }
  497. }
  498. })
  499. },
  500. pageInit () {
  501. this.disabled = false
  502. this.spinning = false
  503. this.getArea('province')
  504. this.getCustTypeList()
  505. this.getWarehouseCascade()
  506. }
  507. },
  508. mounted () {
  509. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  510. this.pageInit()
  511. this.resetSearchForm()
  512. }
  513. },
  514. activated () {
  515. // 如果是新页签打开,则重置当前页面
  516. if (this.$store.state.app.isNewTab) {
  517. this.pageInit()
  518. this.resetSearchForm()
  519. }
  520. },
  521. beforeRouteEnter (to, from, next) {
  522. next(vm => {})
  523. }
  524. }
  525. </script>