salesReturnEdit.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. <template>
  2. <div class="salesReturnEdit-wrap">
  3. <a-spin :spinning="spinning" tip="Loading...">
  4. <a-page-header :ghost="false" :backIcon="false" class="salesReturnEdit-back" >
  5. <!-- 自定义的二级文字标题 -->
  6. <template slot="subTitle">
  7. <a id="salesReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
  8. <span style="margin: 0 10px;color: #666;font-weight: bold;">
  9. 单号:{{ ordeDetail&&ordeDetail.salesReturnBillNo }}
  10. </span>
  11. <span style="margin: 0 10px;color: #666;">客户名称:{{ ordeDetail&&ordeDetail.buyerName || '--' }}</span>
  12. <span style="margin: 0 10px;color: #666;">
  13. 退货仓库:{{ ordeDetail&&ordeDetail.warehouseName }}
  14. </span>
  15. <span style="margin: 0 10px;color: #666;">
  16. 退货类别:{{ ordeDetail&&ordeDetail.goodFlagDictValue }}
  17. </span>
  18. </template>
  19. <!-- 操作区,位于 title 行的行尾 -->
  20. <template slot="extra">
  21. <a-button
  22. key="3"
  23. type="default"
  24. class="button-info"
  25. id="salesReturnEdit-preview-btn"
  26. v-if="$hasPermissions('B_salesReturnPrint')"
  27. :disabled="chooseLoadData.length==0"
  28. @click="handlePrint('preview')">打印预览</a-button>
  29. <a-button
  30. key="2"
  31. type="primary"
  32. class="button-info"
  33. id="salesReturnEdit-print-btn"
  34. v-if="$hasPermissions('B_salesReturnPrint')"
  35. :disabled="chooseLoadData.length==0"
  36. @click="handlePrint('print')">快捷打印</a-button>
  37. <a-divider type="vertical" />
  38. <a-button
  39. key="1"
  40. type="default"
  41. class="button-warning"
  42. id="salesReturnEdit-export-btn"
  43. v-if="$hasPermissions('B_salesReturnExport')"
  44. :disabled="chooseLoadData.length==0"
  45. @click="handlePrint('export')">导出Excel</a-button>
  46. </template>
  47. </a-page-header>
  48. <a-card size="small" :bordered="false" class="salesReturnEdit-cont">
  49. <!-- 查询配件列表 -->
  50. <queryPart ref="partQuery" :newLoading="isInster" @add="saveProduct"></queryPart>
  51. </a-card>
  52. <a-card size="small" :bordered="false" class="salesReturnEdit-cont">
  53. <a-alert style="margin-bottom: 10px;" type="info">
  54. <div slot="message" class="total-bar">
  55. <div>
  56. <span>申请退货数量:{{ ordeDetail&&(ordeDetail.totalInitialQty || ordeDetail.totalInitialQty==0) ? ordeDetail.totalInitialQty : '--' }};</span>
  57. <span v-if="$hasPermissions('B_salesReturnEdit_salesPrice')">参考退货金额:{{ ordeDetail&&(ordeDetail.totalAmount || ordeDetail.totalAmount==0) ? toThousands(ordeDetail.totalAmount) : '--' }};</span>
  58. </div>
  59. </div>
  60. </a-alert>
  61. <div class="table-page-search-wrapper" style="display:flex;align-items: center;justify-content: space-between;">
  62. <div style="flex-grow:1;">
  63. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  64. <a-row :gutter="15">
  65. <a-col :md="6" :sm="24">
  66. <a-form-item label="产品编码">
  67. <a-input v-model.trim="productForm.productCode" allowClear placeholder="请输入产品编码"/>
  68. </a-form-item>
  69. </a-col>
  70. <a-col :md="6" :sm="24">
  71. <a-form-item label="产品名称">
  72. <a-input v-model.trim="productForm.productName" allowClear placeholder="请输入产品名称"/>
  73. </a-form-item>
  74. </a-col>
  75. <a-col :md="6" :sm="24">
  76. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled">查询</a-button>
  77. <a-button style="margin-left: 5px" @click="resetSearchForm(true)" :disabled="disabled">重置</a-button>
  78. </a-col>
  79. </a-row>
  80. </a-form>
  81. </div>
  82. <div>
  83. <span style="margin-right: 10px;" v-if="selNums">已选{{ selNums }}项</span>
  84. <a-button type="default" class="button-info" @click="openPlSetReason">批量设置退货原因</a-button>
  85. <a-button type="primary" class="button-info" id="salesReturnEdit-import-btn" @click="openGuideModal=true">导入产品</a-button>
  86. </div>
  87. </div>
  88. <!-- 已选配件列表 -->
  89. <s-table
  90. class="sTable"
  91. ref="table"
  92. size="small"
  93. :rowKey="(record) => record.id"
  94. :row-selection="{ columnWidth: 40 }"
  95. @rowSelection="rowSelectionFun"
  96. :columns="columns"
  97. :data="loadData"
  98. :defaultLoadData="false"
  99. :scroll="{ y: 300 }"
  100. bordered>
  101. <!-- 本次退货数量 -->
  102. <template slot="qty" slot-scope="text, record">
  103. <a-input-number
  104. id="salesReturn-qty"
  105. size="small"
  106. v-model="record.initialQty"
  107. :precision="0"
  108. :min="0"
  109. :max="99999999"
  110. placeholder="请输入"
  111. @blur="e => onCellBlur(e.target.value, record, 'qty')"
  112. style="width: 100%;" />
  113. </template>
  114. <!-- 退货原因 -->
  115. <template slot="returnReason" slot-scope="text, record">
  116. <returnReason :goodFlag="goodFlag" v-model="record.returnReasonCode" @change="e => updateReason(e, record, 0)"></returnReason>
  117. </template>
  118. <!-- 备注 -->
  119. <template slot="returnRemarks" slot-scope="text, record">
  120. <a-input size="small" placeholder="请输入备注" v-model="record.returnReasonRemarks" @blur="e => updateReason(e, record, 1)"></a-input>
  121. </template>
  122. <!-- 操作 -->
  123. <template slot="action" slot-scope="text, record">
  124. <a-button
  125. size="small"
  126. type="link"
  127. :loading="delLoading"
  128. class="button-error"
  129. @click="handleDel(record)"
  130. id="salesReturn-Del">删除</a-button>
  131. </template>
  132. </s-table>
  133. </a-card>
  134. </a-spin>
  135. <div class="affix-cont">
  136. <a-button
  137. size="large"
  138. style="padding: 0 60px;"
  139. :disabled="spinning"
  140. type="primary"
  141. class="button-primary"
  142. @click="beforeSubmit()"
  143. id="salesReturn-handleSubmit">提交</a-button>
  144. </div>
  145. <!-- 选择审核人员 -->
  146. <chooseDepartUserModal ref="chooseDepart" :showDefUser="true" :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSubmit"></chooseDepartUserModal>
  147. <!-- 导入产品 -->
  148. <importGuideModal :goodFlag="goodFlag == 'GOOD_PRODUCT_RETURN' ? 1 : 0" :openModal="openGuideModal" :params="{salesReturnBillSn: $route.params.sn}" @close="closeGuideModel" @ok="hanldeOk" />
  149. <!-- 批量设置退货原因 -->
  150. <commonModal modalTit="批量设置退货原因" :openModal="showPlModal" @cancel="showPlModal=false" @ok="setPlReturnReason">
  151. <div style="text-align: left;">
  152. <div style="line-height: 24px;">
  153. <div><span style="color:red;">*</span>退货原因</div>
  154. <div><returnReason size="large" :goodFlag="goodFlag" v-model="plReturnReason"></returnReason></div>
  155. </div>
  156. <div style="line-height: 24px;margin-top:10px;">
  157. <a-checkbox :checked="showEditRemarks" @change="e => showEditRemarks=!showEditRemarks">是否设置备注</a-checkbox>
  158. </div>
  159. <div style="line-height: 24px;margin-top:10px;" v-if="showEditRemarks">
  160. <div>备注</div>
  161. <div><a-input size="large" :maxLength="50" placeholder="请输入备注(最多50字符)" v-model="plReturnRemark"></a-input></div>
  162. </div>
  163. </div>
  164. </commonModal>
  165. </div>
  166. </template>
  167. <script>
  168. import { commonMixin } from '@/utils/mixin'
  169. import { STable, VSelect } from '@/components'
  170. import { printFun, exportExcel } from '@/libs/JGPrint.js'
  171. import ImportGuideModal from './importGuideModal.vue'
  172. import queryPart from './queryPart.vue'
  173. import commonModal from '@/views/common/commonModal.vue'
  174. import EditableCell from '@/views/common/editInput.js'
  175. import chooseDepartUserModal from './chooseDepartUserModal.vue'
  176. import warehouse from '@/views/common/chooseWarehouse.js'
  177. import returnReason from '@/views/common/returnReason'
  178. import {
  179. salesReturnDetail,
  180. salesReturnSubmit,
  181. salesReturnBatchInsert,
  182. salesReturnPrint,
  183. salesReturnExport,
  184. salesReturnModify,
  185. submitVerify
  186. } from '@/api/salesReturn'
  187. import {
  188. salesReturnDetailList,
  189. salesReturnDetailDel,
  190. salesReturnDetailInsert,
  191. salesReturnDetailUpdateQty,
  192. salesReturnDetailUpdateReason,
  193. salesReturnDetailSetReason
  194. } from '@/api/salesReturnDetail'
  195. export default {
  196. name: 'SalesReturnEdit',
  197. mixins: [commonMixin],
  198. components: {
  199. STable,
  200. VSelect,
  201. queryPart,
  202. EditableCell,
  203. ImportGuideModal,
  204. chooseDepartUserModal,
  205. returnReason,
  206. commonModal,
  207. warehouse
  208. },
  209. data () {
  210. return {
  211. spinning: false,
  212. orderId: null,
  213. orderSn: null,
  214. buyerSn: null,
  215. disabled: false,
  216. isInster: false, // 是否正在添加产品
  217. openDepartUserModal: false,
  218. ordeDetail: { discountAmount: 0 },
  219. delLoading: false,
  220. // 已选产品
  221. dataSource: [],
  222. productForm: {
  223. salesReturnBillSn: '',
  224. productName: '',
  225. productCode: ''
  226. },
  227. chooseLoadData: [],
  228. // 加载数据方法 必须为 Promise 对象
  229. loadData: parameter => {
  230. this.disabled = true
  231. // 查询总计
  232. this.productForm.salesReturnBillSn = this.orderSn
  233. return salesReturnDetailList(Object.assign(parameter, this.productForm)).then(res => {
  234. let data
  235. if (res.status == 200) {
  236. data = res.data
  237. const no = (data.pageNo - 1) * data.pageSize
  238. for (var i = 0; i < data.list.length; i++) {
  239. data.list[i].no = no + i + 1
  240. data.list[i].qtyBackups = data.list[i].initialQty
  241. data.list[i].returnReasonBackups = data.list[i].returnReasonCode
  242. data.list[i].bakReamrks = data.list[i].returnReasonRemarks
  243. }
  244. this.disabled = false
  245. this.chooseLoadData = data.list
  246. this.total = res.data.count
  247. }
  248. return data
  249. })
  250. },
  251. openGuideModal: false, // 导入产品引导
  252. total: 0,
  253. rowSelectionInfo: null,
  254. plReturnReason: undefined,
  255. plReturnRemark: undefined,
  256. showEditRemarks: false,
  257. showPlModal: false,
  258. returnReasonlist: []
  259. }
  260. },
  261. watch: {
  262. showPlModal (newValue, oldValue) {
  263. if (!newValue) {
  264. this.plReturnReason = undefined
  265. this.plReturnRemark = undefined
  266. this.showEditRemarks = false
  267. }
  268. }
  269. },
  270. computed: {
  271. goodFlag () {
  272. return this.ordeDetail && this.ordeDetail.goodFlag || ''
  273. },
  274. selNums () {
  275. return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
  276. },
  277. columns () {
  278. const arr = [
  279. { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
  280. { title: '产品编码', dataIndex: 'productEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
  281. { title: '产品名称', dataIndex: 'productEntity.name', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  282. { title: '单位', dataIndex: 'productEntity.unit', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
  283. { title: '申请退货数量', dataIndex: 'initialQty', align: 'center', width: '8%', scopedSlots: { customRender: 'qty' } },
  284. { title: '退货原因', dataIndex: 'returnReason', align: 'center', width: '13%', scopedSlots: { customRender: 'returnReason' } },
  285. { title: '备注', scopedSlots: { customRender: 'returnRemarks' }, width: '10%', align: 'center' },
  286. { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
  287. ]
  288. if (this.$hasPermissions('B_salesReturnEdit_salesPrice')) { // 售价权限
  289. arr.splice(4, 0, { title: '参考退货单价', dataIndex: 'price', align: 'right', width: '8%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
  290. arr.splice(7, 0, { title: '参考退货金额', align: 'right', dataIndex: 'totalAmount', width: '8%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
  291. }
  292. return arr
  293. }
  294. },
  295. methods: {
  296. // 返回
  297. handleBack () {
  298. this.$router.push({ name: 'salesReturnList', query: { closeLastOldTab: true } })
  299. },
  300. // 表格选中项
  301. rowSelectionFun (obj) {
  302. this.rowSelectionInfo = obj || null
  303. },
  304. // 已选产品 blur
  305. onCellBlur (val, record, type) {
  306. const valBackups = record.qtyBackups
  307. // 光标移出,值发生改变再调用编辑接口
  308. if (val && val != valBackups) {
  309. this.spinning = true
  310. salesReturnDetailUpdateQty({
  311. salesReturnDetailSn: record.salesReturnDetailSn,
  312. initialQty: record.initialQty,
  313. price: record.price
  314. }).then(res => {
  315. if (res.status == 200) {
  316. this.resetTable(false)
  317. this.$message.success(res.message)
  318. this.spinning = false
  319. record.qtyBackups = record.initialQty
  320. } else {
  321. this.spinning = false
  322. record.initialQty = valBackups
  323. }
  324. })
  325. } else {
  326. record.initialQty = valBackups
  327. }
  328. },
  329. // 修改仓库
  330. updateWarehouse (warehouseSn) {
  331. const _this = this
  332. _this.spinning = true
  333. const params = { id: this.ordeDetail.id, warehouseSn: warehouseSn }
  334. salesReturnModify(params).then(res => {
  335. if (res.status == 200) {
  336. _this.$message.success(res.message)
  337. _this.getOrderDetail()
  338. }
  339. _this.spinning = false
  340. })
  341. },
  342. // 修改退货原因
  343. updateReason (val, record, type) {
  344. console.log(val, record, type)
  345. const params = {
  346. salesReturnDetailSn: record.salesReturnDetailSn,
  347. goodFlag: this.goodFlag
  348. }
  349. // 退货原因
  350. if (type == 0) {
  351. const rows = this.returnReasonlist.find(item => item.code == val)
  352. params.returnReasonCode = val || ''
  353. params.returnReason = rows ? rows.dispName : ''
  354. } else {
  355. // 备注
  356. params.returnReasonRemarks = val.target.value
  357. if (params.returnReasonRemarks == record.bakReamrks) {
  358. return
  359. }
  360. }
  361. this.spinning = true
  362. salesReturnDetailUpdateReason(params).then(res => {
  363. if (res.status == 200) {
  364. this.resetTable(false)
  365. this.$message.success(res.message)
  366. } else {
  367. row.returnReasonCode = record.returnReasonBackups
  368. }
  369. this.spinning = false
  370. })
  371. },
  372. // 批量设置退货原因
  373. openPlSetReason () {
  374. if (this.selNums) {
  375. this.showPlModal = true
  376. } else {
  377. this.$message.warning('请先选择产品!')
  378. }
  379. },
  380. setPlReturnReason () {
  381. if (!this.plReturnReason) {
  382. this.$message.warning('请选择退货原因!')
  383. } else {
  384. this.spinning = true
  385. const snList = []
  386. const arr = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
  387. const rows = this.returnReasonlist.find(item => item.code == this.plReturnReason)
  388. arr.map(item => {
  389. snList.push(item.salesReturnDetailSn)
  390. })
  391. salesReturnDetailSetReason({
  392. salesReturnBillDetailSnList: snList,
  393. salesReturnBillSn: this.orderSn,
  394. returnReason: rows ? rows.dispName : '',
  395. returnReasonCode: this.plReturnReason,
  396. returnReasonRemarks: this.showEditRemarks ? this.plReturnRemark || '' : undefined
  397. }).then(res => {
  398. if (res.status == 200) {
  399. this.showPlModal = false
  400. this.$refs.table.clearSelected()
  401. this.resetTable(false)
  402. }
  403. this.spinning = false
  404. })
  405. }
  406. },
  407. // 获取单据详细
  408. getOrderDetail (flag) {
  409. salesReturnDetail({ sn: this.orderSn }).then(res => {
  410. this.ordeDetail = res.data || null
  411. if (res.data.goodFlag == 'DEFECTIVE_PRODUCT_RETURN') {
  412. this.returnReasonlist = this.$store.state.app.defectiveReturnReason
  413. }
  414. // 良品
  415. if (res.data.goodFlag == 'GOOD_PRODUCT_RETURN') {
  416. this.returnReasonlist = this.$store.state.app.goodReturnReason
  417. }
  418. this.$refs.table.refresh(!flag)
  419. if (!flag) {
  420. this.$refs.partQuery.pageInit(this.buyerSn, this.ordeDetail.warehouseSn, this.goodFlag)
  421. }
  422. })
  423. },
  424. // 删除产品
  425. handleDel (row) {
  426. const _this = this
  427. this.$confirm({
  428. title: '提示',
  429. content: '确认要删除吗?',
  430. centered: true,
  431. closable: true,
  432. onOk () {
  433. _this.delLoading = true
  434. _this.spinning = true
  435. salesReturnDetailDel({ salesReturnDetailSn: row.salesReturnDetailSn }).then(res => {
  436. if (res.status == 200) {
  437. _this.resetTable(false)
  438. }
  439. _this.$message.info(res.message)
  440. _this.delLoading = false
  441. _this.spinning = false
  442. })
  443. }
  444. })
  445. },
  446. resetTable (flag) {
  447. this.$refs.table.refresh(flag)
  448. this.getOrderDetail(true)
  449. },
  450. // 重置
  451. resetSearchForm (flag) {
  452. this.productForm.productName = ''
  453. this.productForm.productCode = ''
  454. this.getOrderDetail(flag)
  455. },
  456. // 添加或修改产品
  457. saveProduct (row) {
  458. // 防止多次添加产品
  459. if (this.isInster) {
  460. return
  461. }
  462. // 退货原因
  463. const rows = this.returnReasonlist.find(item => item.code == row.returnReasonCode)
  464. this.isInster = true
  465. const params = {
  466. 'salesReturnBillSn': this.orderSn,
  467. 'salesReturnBillNo': this.ordeDetail.salesReturnBillNo,
  468. 'price': row.productPrice,
  469. 'returnReasonCode': row.returnReasonCode,
  470. 'returnReason': rows ? rows.dispName : '',
  471. 'goodFlag': this.goodFlag,
  472. 'productSn': row.productSn,
  473. 'initialQty': row.qty
  474. }
  475. this.spinning = true
  476. salesReturnDetailInsert(params).then(res => {
  477. if (res.status == 200) {
  478. this.resetSearchForm(true)
  479. this.$message.success(res.message)
  480. }
  481. this.isInster = false
  482. this.spinning = false
  483. })
  484. },
  485. beforeSubmit () {
  486. if (this.total) {
  487. const hasKong = this.chooseLoadData.find(item => !item.returnReason)
  488. if (hasKong) {
  489. this.$message.warning('请输入退货原因!')
  490. } else {
  491. // 判断价格
  492. submitVerify({ salesReturnBillSn: this.orderSn }).then(res => {
  493. if (res.status == 200) {
  494. if (!res.data) {
  495. this.openDepartUserModal = true
  496. if (this.ordeDetail.billStatus == 'AUDIT_REJECT') {
  497. this.$refs.chooseDepart.getDetail(this.ordeDetail)
  498. }
  499. } else {
  500. const arr = res.data.split('\n')
  501. this.$notification.open({
  502. message: '提示',
  503. description:
  504. <div>
  505. {arr.map(item =>
  506. (<p>{item}</p>)
  507. )}
  508. </div>
  509. })
  510. }
  511. }
  512. })
  513. }
  514. } else {
  515. this.$message.warning('请添加产品!')
  516. }
  517. },
  518. // 提交销售退货
  519. handleSubmit (data) {
  520. this.spinning = true
  521. salesReturnSubmit({ salesReturnBillSn: this.orderSn, ...data }).then(res => {
  522. if (res.status == 200) {
  523. this.handleBack()
  524. this.$message.success(res.message)
  525. }
  526. this.spinning = false
  527. })
  528. },
  529. closeGuideModel () {
  530. this.openGuideModal = false
  531. },
  532. // 导入产品
  533. hanldeOk (obj) {
  534. salesReturnBatchInsert(obj).then(res => {
  535. if (res.status == 200) {
  536. this.resetTable(true)
  537. }
  538. })
  539. },
  540. // 打印预览/快捷打印
  541. handlePrint (type) {
  542. const _this = this
  543. const a = ['WAIT_CUSTOMER_SERVICE_CONFIRM', 'WAIT_FINANCIAL_AUDIT', 'FINANCIAL_REJECT', 'FINISH'].find(item => item == this.ordeDetail.billStatus)
  544. const status = a ? 'SALES_RETURN_AMOUNT' : 'SALES_RETURN_REASON'
  545. const params = { salesReturnBillSn: this.$route.params.sn, priceType: status }
  546. _this.spinning = true
  547. // 导出
  548. if (type == 'export') {
  549. exportExcel(salesReturnExport, params, '销售退货', function () {
  550. _this.spinning = false
  551. _this.$store.state.app.curActionPermission = ''
  552. })
  553. } else {
  554. // 打印或预览
  555. printFun(salesReturnPrint, params, type, '销售退货', () => {
  556. _this.spinning = false
  557. _this.$store.state.app.curActionPermission = ''
  558. })
  559. }
  560. },
  561. pageInit () {
  562. this.orderSn = this.$route.params.sn
  563. this.buyerSn = this.$route.params.buyerSn
  564. this.resetSearchForm()
  565. }
  566. },
  567. mounted () {
  568. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  569. this.pageInit()
  570. }
  571. },
  572. activated () {
  573. // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
  574. if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
  575. this.pageInit()
  576. }
  577. },
  578. beforeRouteEnter (to, from, next) {
  579. next(vm => {})
  580. }
  581. }
  582. </script>
  583. <style lang="less">
  584. .salesReturnEdit-wrap{
  585. position: relative;
  586. height: 100%;
  587. padding-bottom: 51px;
  588. box-sizing: border-box;
  589. >.ant-spin-nested-loading{
  590. overflow-y: scroll;
  591. height: 100%;
  592. }
  593. .salesReturnEdit-cont{
  594. margin-top: 6px;
  595. .total-bar{
  596. display: flex;
  597. align-items: center;
  598. justify-content: space-between;
  599. > div{
  600. &:last-child{
  601. display: flex;
  602. align-items: center;
  603. justify-content: space-between;
  604. > div{
  605. padding: 0 10px;
  606. }
  607. }
  608. }
  609. }
  610. }
  611. }
  612. </style>