salesReturnGrabEdit.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. <template>
  2. <div class="salesReturnEdit-wrap">
  3. <a-spin :spinning="spinning" tip="Loading...">
  4. <a-page-header :ghost="false" :backIcon="false" class="salesReturnGrabEdit-back" >
  5. <!-- 自定义的二级文字标题 -->
  6. <template slot="subTitle">
  7. <a id="salesReturnGrabEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
  8. <span style="margin: 0 10px 0 20px;color: #666;font-size: 14px;font-weight: 600;">退货单号:{{ ordeDetail&&ordeDetail.salesReturnNo||'--' }}</span>
  9. <a-button type="link" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo">
  10. <a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/> {{ isShowBisiceInfo?'隐藏':'查看' }}信息
  11. </a-button>
  12. <a-button
  13. type="link"
  14. size="small"
  15. @click="handleEditCustom"
  16. class="button-info"
  17. key="0"> <a-icon type="edit"></a-icon> 编辑</a-button>
  18. </template>
  19. <!-- 操作区,位于 title 行的行尾 -->
  20. <template slot="extra" v-if="$hasPermissions('B_salesReturnPrint')">
  21. <Print :disabled="chooseLoadData.length==0" @handlePrint="handlePrint"></Print>
  22. </template>
  23. </a-page-header>
  24. <!-- 基础信息 -->
  25. <a-card size="small" :bordered="false" title="基础信息" v-show="isShowBisiceInfo" class="pages-wrap">
  26. <a-descriptions size="small" :column="3">
  27. <a-descriptions-item label="客户名称">{{ ordeDetail&&ordeDetail.buyerNameCurrent?ordeDetail.buyerName?ordeDetail.buyerName==ordeDetail.buyerNameCurrent?ordeDetail.buyerNameCurrent:ordeDetail.buyerNameCurrent+'('+ordeDetail.buyerName+')':ordeDetail.buyerNameCurrent:'--' }}</a-descriptions-item>
  28. <a-descriptions-item label="客户地址">
  29. <div v-if="ordeDetail&&(ordeDetail.provinceName || ordeDetail.cityName || ordeDetail.countyName || ordeDetail.customerAddr)">
  30. {{ ordeDetail&&ordeDetail.provinceName || '' }}
  31. {{ ordeDetail&&ordeDetail.cityName || '' }}
  32. {{ ordeDetail&&ordeDetail.countyName || '' }}
  33. {{ ordeDetail&&ordeDetail.customerAddr || '' }}
  34. </div>
  35. <span v-else>--</span>
  36. </a-descriptions-item>
  37. <a-descriptions-item label="联系电话">{{ ordeDetail&&ordeDetail.contactTel || '--' }}</a-descriptions-item>
  38. <a-descriptions-item label="退货单号">{{ ordeDetail&&ordeDetail.salesReturnNo || '--' }}</a-descriptions-item>
  39. <a-descriptions-item label="业务状态">{{ ordeDetail&&ordeDetail.stateDictValue || '--' }}</a-descriptions-item>
  40. <a-descriptions-item label="是否抓单">{{ ordeDetail&&ordeDetail.grabFlag==1?'抓单':'不抓单' }}</a-descriptions-item>
  41. <a-descriptions-item label="备注">{{ ordeDetail&&ordeDetail.remarks || '--' }}</a-descriptions-item>
  42. </a-descriptions>
  43. </a-card>
  44. <a-card size="small" :bordered="false" class="pages-wrap">
  45. <!-- 查询配件列表 -->
  46. <queryPart ref="queryPart" grabFlag="1" :newLoading="isInster" :warehouseCascadeData="warehouseCascadeData" @add="saveProduct"></queryPart>
  47. </a-card>
  48. <a-card size="small" :bordered="false" class="pages-wrap">
  49. <!-- alert -->
  50. <a-alert style="margin-bottom: 10px;" type="info">
  51. <div slot="message" class="total-bar">
  52. <div>
  53. <span>退货总金额:{{ countData&&(countData.totalAmount || countData.totalAmount==0) ? toThousands(countData.totalAmount) : '--' }};</span>
  54. <span>总款数:{{ countData&&(countData.totalCategory || countData.totalCategory==0) ? countData.totalCategory : '--' }};</span>
  55. <span>总数量:{{ countData&&(countData.totalQty || countData.totalQty==0) ? countData.totalQty : '--' }};</span>
  56. <span>废品总数量:{{ countData&&(countData.totalCelQty || countData.totalCelQty==0) ? countData.totalCelQty : '--' }};</span>
  57. </div>
  58. <div>
  59. <div>
  60. 折扣金额:
  61. <a-input-number
  62. size="small"
  63. id="discount"
  64. v-model="ordeDetail.discountAmount"
  65. :min="0"
  66. :precision="2"
  67. :max="999999"/>
  68. <a-button size="small" type="primary" @click="salesReturnDiscount" class="button-info">打折</a-button>
  69. </div>
  70. <div>
  71. 折扣:<strong>{{ ordeDetail&&(ordeDetail.discountRate || ordeDetail.discountRate==0) ? ordeDetail.discountRate+'%' : '--' }}</strong>;
  72. 折后总售价:<strong>{{ ordeDetail&&(ordeDetail.discountedAmount || ordeDetail.discountedAmount==0) ? toThousands(ordeDetail.discountedAmount) : '--' }}</strong>;
  73. </div>
  74. </div>
  75. </div>
  76. </a-alert>
  77. <!-- 搜索条件 -->
  78. <div class="table-page-search-wrapper">
  79. <a-row :gutter="15">
  80. <a-col :span="18">
  81. <a-form-model layout="inline" :model="productForm" @keyup.enter.native="$refs.table.refresh(true)">
  82. <a-row :gutter="15">
  83. <a-col :md="8" :sm="24">
  84. <a-form-model-item label="产品编码">
  85. <a-input v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
  86. </a-form-model-item>
  87. </a-col>
  88. <a-col :md="8" :sm="24">
  89. <a-form-model-item label="产品名称">
  90. <a-input v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
  91. </a-form-model-item>
  92. </a-col>
  93. <a-col :md="8" :sm="24">
  94. <a-form-model-item>
  95. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesReturn-refresh">查询</a-button>
  96. <a-button style="margin-left: 5px" @click="resetForm" id="salesReturn-reset">重置</a-button>
  97. </a-form-model-item>
  98. </a-col>
  99. </a-row>
  100. </a-form-model>
  101. </a-col>
  102. <a-col :span="6">
  103. <div style="float:right;overflow: hidden;">
  104. <!-- <a-button id="salesReturn-dru">导入明细</a-button> -->
  105. <a-button
  106. style="padding: 0 25px;"
  107. type="primary"
  108. :disabled="spinning"
  109. class="button-primary"
  110. @click="handleSubmit()"
  111. id="salesReturn-handleSubmit">提交</a-button>
  112. <a-button
  113. type="primary"
  114. ghost
  115. :disabled="chooseLoadData.length==0"
  116. @click="salesReturnDelAll"
  117. :loading="delLoading"
  118. style="margin-left: 10px"
  119. id="salesReturn-del-all">清空列表</a-button>
  120. </div>
  121. </a-col>
  122. </a-row>
  123. </div>
  124. <!-- 已选配件列表 -->
  125. <s-table
  126. class="sTable"
  127. ref="table"
  128. size="small"
  129. :rowKey="(record) => record.id"
  130. :columns="columns"
  131. :data="loadData"
  132. :defaultLoadData="false"
  133. :pageSize="10"
  134. :scroll="{ y: 300 }"
  135. bordered>
  136. <!-- 本次退货数量 -->
  137. <template slot="qty" slot-scope="text, record">
  138. <a-input-number
  139. id="salesReturns-qty"
  140. size="small"
  141. v-model="record.qty"
  142. :precision="0"
  143. :min="0"
  144. :max="999999"
  145. placeholder="请输入"
  146. @blur="e => onCellBlur(e.target.value, record, 'qty')"
  147. style="width: 100%;" />
  148. </template>
  149. <!-- 废品数量 -->
  150. <template slot="celQty" slot-scope="text, record">
  151. <a-input-number
  152. id="salesReturns-celQty"
  153. size="small"
  154. v-model="record.celQty"
  155. :precision="0"
  156. :min="0"
  157. :max="999999"
  158. placeholder="请输入"
  159. @blur="e => onCellBlur(e.target.value, record, 'celQty')"
  160. style="width: 100%;" />
  161. </template>
  162. <!-- 退货金额小计 -->
  163. <template slot="returnAmount" slot-scope="text, record">{{ toThousands(record.price * record.qty) }}</template>
  164. <!-- 仓库仓位 -->
  165. <template slot="warehouse" slot-scope="text, record, index">
  166. <a-cascader
  167. size="small"
  168. @change="e => changeWarehouseCascade(e, record, index)"
  169. v-model="record.warehouseCascade"
  170. expand-trigger="hover"
  171. :options="warehouseCascadeData"
  172. :allowClear="false"
  173. :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
  174. id="bulkWarehousingOrderEdit-warehouseCascade"
  175. placeholder="请选择仓库仓位"
  176. style="width: 100%;" />
  177. </template>
  178. <!-- 操作 -->
  179. <template slot="action" slot-scope="text, record">
  180. <a-button
  181. size="small"
  182. type="link"
  183. :loading="delLoading"
  184. class="button-error"
  185. @click="handleDel(record)"
  186. id="salesReturn-Del">删除</a-button>
  187. </template>
  188. </s-table>
  189. </a-card>
  190. </a-spin>
  191. <!-- <div class="affix-cont"></div> -->
  192. <!-- 选择客户弹框 -->
  193. <choose-custom-modal ref="editCustomModal" :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
  194. </div>
  195. </template>
  196. <script>
  197. import { commonMixin } from '@/utils/mixin'
  198. import { STable, VSelect } from '@/components'
  199. import queryPart from './queryPart.vue'
  200. import chooseCustomModal from './chooseCustomModal.vue'
  201. import { warehouseCascadeList } from '@/api/warehouse'
  202. import { salesReturnDetail, salesReturnQueryCount, salesReturnDetailList, salesReturnDiscount, salesReturnDelAll, salesReturnDetailDel, salesReturnSaveProduct, salesReturnSubmit, salesReturnDetailPrint, salesDetailExport } from '@/api/salesReturn'
  203. import Print from '@/views/common/print.vue'
  204. import { hdPrint } from '@/libs/JGPrint'
  205. export default {
  206. name: 'SalesReturnGrabEdit',
  207. components: {
  208. STable,
  209. VSelect,
  210. queryPart,
  211. chooseCustomModal,
  212. Print
  213. },
  214. mixins: [commonMixin],
  215. data () {
  216. const _this = this
  217. return {
  218. spinning: false,
  219. orderId: null,
  220. orderSn: null,
  221. buyerSn: null,
  222. disabled: false,
  223. openModal: false,
  224. isInster: false, // 是否正在添加产品
  225. ordeDetail: { discountAmount: 0 },
  226. delLoading: false,
  227. warehouseCascadeData: [], // 仓库仓位
  228. // 已选产品
  229. dataSource: [],
  230. productForm: {
  231. productCode: '',
  232. productName: '',
  233. orderBy: 'sales_return_bill_detail.CREATE_DATE desc'
  234. },
  235. countData: null,
  236. // 表头
  237. columns: [
  238. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  239. { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
  240. { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  241. { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
  242. { title: '销售单号', dataIndex: 'salesBillNo', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
  243. { title: '售价', dataIndex: 'price', align: 'right', width: '4%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  244. { title: '单位', dataIndex: 'dealerProductEntity.unit', align: 'center', width: '4%', customRender: function (text) { return text || '--' } },
  245. { title: '销售数量', dataIndex: 'salesQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  246. { title: '本次退货数量', dataIndex: 'qty', align: 'center', width: '7%', scopedSlots: { customRender: 'qty' } },
  247. { title: '废品数量', dataIndex: 'celQty', align: 'center', width: '6%', scopedSlots: { customRender: 'celQty' } },
  248. { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: '10%', align: 'center' },
  249. { title: '退货金额小计', align: 'right', scopedSlots: { customRender: 'returnAmount' }, width: '7%' },
  250. { title: '折后金额小计', dataIndex: 'discountedAmount', align: 'right', width: '7%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  251. { title: '操作', scopedSlots: { customRender: 'action' }, width: '5%', align: 'center' }
  252. ],
  253. chooseLoadData: [],
  254. // 加载数据方法 必须为 Promise 对象
  255. loadData: parameter => {
  256. this.disabled = true
  257. // 查询总计
  258. this.productForm.salesReturnBillSn = this.$route.params.sn
  259. this.getQueryCount(Object.assign(parameter, this.productForm))
  260. return salesReturnDetailList(Object.assign(parameter, this.productForm)).then(res => {
  261. let data
  262. if (res.status == 200) {
  263. data = res.data
  264. const no = (data.pageNo - 1) * data.pageSize
  265. for (var i = 0; i < data.list.length; i++) {
  266. data.list[i].no = no + i + 1
  267. data.list[i].qtyBackups = data.list[i].qty
  268. data.list[i].celQtyBackups = data.list[i].celQty
  269. const warehouseSn = data.list[i].warehouseSn || undefined
  270. const warehouseLocationSn = data.list[i].warehouseLocationSn || undefined
  271. if (warehouseSn || warehouseLocationSn) {
  272. data.list[i].warehouseSnBackups = warehouseSn
  273. data.list[i].warehouseLocationSnBackups = warehouseLocationSn
  274. data.list[i].warehouseCascade = [warehouseSn, warehouseLocationSn]
  275. } else {
  276. data.list[i].warehouseCascade = undefined
  277. }
  278. }
  279. this.disabled = false
  280. this.chooseLoadData = data.list
  281. }
  282. return data
  283. })
  284. },
  285. printerType: 'NEEDLE', // 打印机类型
  286. isShowBisiceInfo: false
  287. }
  288. },
  289. methods: {
  290. // 返回
  291. handleBack () {
  292. this.$router.push({ path: '/salesManagement/salesReturn/list' })
  293. },
  294. // 选择客户成功
  295. chooseCustomOk (data) {
  296. this.openModal = false
  297. this.getOrderDetail()
  298. },
  299. handleEditCustom () {
  300. this.openModal = true
  301. this.$refs.editCustomModal.editCust(this.ordeDetail)
  302. },
  303. // 已选产品 blur
  304. onCellBlur (val, record, type) {
  305. let valBackups
  306. if (type == 'qty') {
  307. valBackups = record.qtyBackups
  308. } else if (type == 'celQty') {
  309. valBackups = record.celQtyBackups
  310. }
  311. // 光标移出,值发生改变再调用编辑接口
  312. if (val && val != valBackups) {
  313. if (Number(record.celQty) > Number(record.qty)) {
  314. this.$message.info('废品数量不可大于本次退货数量')
  315. this.reductionVal(record, type, valBackups)
  316. } else {
  317. this.saveProduct(record, 'edit')
  318. }
  319. } else {
  320. this.reductionVal(record, type, valBackups)
  321. }
  322. },
  323. reductionVal (record, type, valBackups) {
  324. if (type == 'qty') {
  325. record.qty = valBackups
  326. } else if (type == 'celQty') {
  327. record.celQty = valBackups
  328. }
  329. },
  330. // 仓库仓位 级联 列表
  331. getWarehouseCascade () {
  332. warehouseCascadeList({}).then(res => {
  333. if (res.status == 200) {
  334. res.data.map(item => {
  335. item.sn = item.warehouseSn
  336. if (item.warehouseLocationList) {
  337. item.warehouseLocationList.map(subItem => {
  338. subItem.sn = subItem.warehouseLocationSn
  339. })
  340. }
  341. })
  342. this.warehouseCascadeData = res.data
  343. } else {
  344. this.warehouseCascadeData = []
  345. }
  346. })
  347. },
  348. // 修改仓库仓位
  349. changeWarehouseCascade (val, opt, ind) {
  350. console.log(val, opt, ind)
  351. let loadData = this.chooseLoadData[ind]
  352. if (val.length < 2) {
  353. this.$message.warning('当前仓库无仓位,请选择其他仓库')
  354. const warehouseSnBackups = loadData.warehouseSnBackups || undefined
  355. const warehouseLocationSnBackups = loadData.warehouseLocationSnBackups || undefined
  356. loadData.warehouseSn = warehouseSnBackups
  357. loadData.warehouseLocationSn = warehouseLocationSnBackups
  358. if (warehouseSnBackups || warehouseLocationSnBackups) {
  359. loadData.warehouseCascade = [warehouseSnBackups, warehouseLocationSnBackups]
  360. } else {
  361. loadData.warehouseCascade = undefined
  362. }
  363. } else {
  364. loadData.warehouseSn = val[0] ? val[0] : ''
  365. loadData.warehouseLocationSn = val[1] ? val[1] : ''
  366. loadData.warehouseSnBackups = val[0] ? val[0] : ''
  367. loadData.warehouseLocationSnBackups = val[1] ? val[1] : ''
  368. loadData = this.chooseLoadData[ind]
  369. console.log(loadData)
  370. this.saveProduct(loadData, 'edit')
  371. }
  372. },
  373. // 重置列表
  374. resetForm () {
  375. this.productForm = {
  376. productName: '',
  377. productCode: '',
  378. orderBy: 'sales_return_bill_detail.CREATE_DATE desc'
  379. }
  380. this.$refs.table.refresh(true)
  381. },
  382. // 明细统计
  383. getQueryCount (params) {
  384. salesReturnQueryCount(params).then(res => {
  385. this.countData = res.data || null
  386. })
  387. },
  388. // 获取单据详细
  389. getOrderDetail (flag) {
  390. salesReturnDetail({ sn: this.orderSn }).then(res => {
  391. this.ordeDetail = res.data || null
  392. if (!flag) {
  393. this.$refs.queryPart.pageInit(this.buyerSn, this.ordeDetail && this.ordeDetail.priceType || '')
  394. }
  395. })
  396. },
  397. // 打折
  398. salesReturnDiscount () {
  399. this.spinning = true
  400. salesReturnDiscount({
  401. discountAmount: this.ordeDetail.discountAmount || 0,
  402. salesReturnSn: this.ordeDetail.salesReturnSn,
  403. id: this.ordeDetail.id
  404. }).then(res => {
  405. if (res.status == 200) {
  406. this.getOrderDetail(true)
  407. this.$refs.table.refresh(true)
  408. this.spinning = false
  409. } else {
  410. this.spinning = false
  411. }
  412. })
  413. },
  414. // 清空列表
  415. salesReturnDelAll () {
  416. const _this = this
  417. this.$confirm({
  418. title: '提示',
  419. content: '确认要清空已选产品列表吗?',
  420. centered: true,
  421. closable: true,
  422. onOk () {
  423. _this.delLoading = true
  424. _this.spinning = true
  425. salesReturnDelAll({ sn: _this.ordeDetail.salesReturnSn }).then(res => {
  426. if (res.status == 200) {
  427. _this.resetSearchForm(true)
  428. _this.$refs.queryPart.resetSearchForm()
  429. }
  430. _this.$message.info(res.message)
  431. _this.delLoading = false
  432. _this.spinning = false
  433. })
  434. }
  435. })
  436. },
  437. // 删除产品
  438. handleDel (row) {
  439. const _this = this
  440. this.$confirm({
  441. title: '提示',
  442. content: '确认要删除吗?',
  443. centered: true,
  444. closable: true,
  445. onOk () {
  446. _this.delLoading = true
  447. _this.spinning = true
  448. salesReturnDetailDel({ id: row.id }).then(res => {
  449. if (res.status == 200) {
  450. _this.resetSearchForm(true)
  451. }
  452. _this.$message.info(res.message)
  453. _this.delLoading = false
  454. _this.spinning = false
  455. })
  456. }
  457. })
  458. },
  459. // 重置
  460. resetSearchForm (flag) {
  461. this.$refs.table.refresh(flag)
  462. if (flag) {
  463. this.getOrderDetail()
  464. }
  465. },
  466. // 添加或修改产品
  467. saveProduct (row, type) {
  468. console.log(row)
  469. // 防止多次添加产品
  470. if (this.isInster) {
  471. return
  472. }
  473. this.isInster = true
  474. const params = {
  475. 'salesReturnBillSn': this.orderSn,
  476. 'salesReturnBillNo': this.ordeDetail.salesReturnNo,
  477. 'salesBillSn': row.salesBillSn,
  478. 'salesBillNo': row.salesBillNo,
  479. 'salesBillDetailSn': row.salesBillDetailSn,
  480. 'price': row.price,
  481. 'cost': row.cost,
  482. 'productSn': row.productSn,
  483. 'celQty': row.celQty,
  484. 'qty': row.returnQty,
  485. 'hasReturnQty': row.hasReturnQty,
  486. 'warehouseLocationSn': row.warehouseLocationSn,
  487. 'warehouseSn': row.warehouseSn
  488. }
  489. // 编辑
  490. if (type == 'edit') {
  491. params.id = row.id
  492. params.qty = row.qty
  493. } else {
  494. params.salesQty = row.qty
  495. }
  496. this.spinning = true
  497. salesReturnSaveProduct(params).then(res => {
  498. this.resetSearchForm(type == 'edit')
  499. if (type == 'new') {
  500. this.getOrderDetail()
  501. }
  502. this.isInster = false
  503. this.spinning = false
  504. })
  505. },
  506. // 提交销售单
  507. handleSubmit () {
  508. this.spinning = true
  509. salesReturnSubmit({ sn: this.orderSn }).then(res => {
  510. if (res.status == 200) {
  511. this.handleBack()
  512. this.$message.success(res.message)
  513. this.spinning = false
  514. } else {
  515. this.spinning = false
  516. }
  517. })
  518. },
  519. // 打印预览/快捷打印
  520. handlePrint (type, printerType) {
  521. const _this = this
  522. _this.spinning = true
  523. let url = salesReturnDetailPrint
  524. const params = { sn: this.$route.params.sn }
  525. if (type == 'export') { // 导出
  526. url = salesDetailExport
  527. }
  528. // 打印或导出
  529. hdPrint(printerType, type, url, params, '销售退货', function () {
  530. _this.spinning = false
  531. })
  532. },
  533. pageInit () {
  534. this.orderId = this.$route.params.id
  535. this.orderSn = this.$route.params.sn
  536. this.buyerSn = this.$route.params.buyerSn
  537. this.getOrderDetail()
  538. this.getWarehouseCascade()
  539. this.resetForm()
  540. }
  541. },
  542. mounted () {
  543. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  544. this.pageInit()
  545. }
  546. },
  547. activated () {
  548. // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
  549. if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
  550. this.pageInit()
  551. }
  552. },
  553. beforeRouteEnter (to, from, next) {
  554. next(vm => {})
  555. }
  556. }
  557. </script>
  558. <style lang="less">
  559. .salesReturnEdit-wrap{
  560. position: relative;
  561. height: 100%;
  562. box-sizing: border-box;
  563. >.ant-spin-nested-loading{
  564. overflow-y: auto;
  565. height: 100%;
  566. }
  567. .pages-wrap{
  568. margin-top: 10px;
  569. .total-bar{
  570. display: flex;
  571. align-items: center;
  572. justify-content: space-between;
  573. > div{
  574. &:last-child{
  575. display: flex;
  576. align-items: center;
  577. justify-content: space-between;
  578. > div{
  579. padding: 0 10px;
  580. }
  581. }
  582. }
  583. }
  584. }
  585. }
  586. </style>