edit.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. <template>
  2. <div class="allocateBillEdit-wrap">
  3. <!-- <a-spin :spinning="spinning" tip="Loading..."> -->
  4. <div class="ant-spin-nested-loading">
  5. <a-page-header :ghost="false" :backIcon="false" class="allocateBillEdit-back" >
  6. <!-- 自定义的二级文字标题 -->
  7. <template slot="subTitle">
  8. <a id="allocateBillEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
  9. <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ basicInfoData&&basicInfoData.allocateReturnNo }}</span>
  10. <a-button type="link" class="button-default" @click="showDetail=!showDetail">
  11. <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
  12. </a-button>
  13. </template>
  14. <!-- 操作区,位于 title 行的行尾 -->
  15. <template slot="extra">
  16. <print :params="{allocateReturnSn: $route.params.sn || outBizSn}" :basicInfoData="basicInfoData" :disabled="localDataSource.length==0" @loading="spinning=true" @unloading="spinning=false"></print>
  17. </template>
  18. </a-page-header>
  19. <a-card size="small" :bordered="false" v-if="basicInfoData" class="allocateBillEdit-cont" v-show="showDetail">
  20. <a-descriptions :column="3">
  21. <a-descriptions-item label="调拨退货单号">{{ (basicInfoData&&basicInfoData.allocateReturnNo) || '--' }}</a-descriptions-item>
  22. <a-descriptions-item label="调拨退货对象">{{ (basicInfoData&&basicInfoData.targetTypeDictValue) || '--' }}</a-descriptions-item>
  23. <a-descriptions-item label="调拨退货对象名称">{{ (basicInfoData&&basicInfoData.targetName) || '--' }}</a-descriptions-item>
  24. <a-descriptions-item label="调入仓库">
  25. <!-- <warehouse
  26. style="width:200px;"
  27. :allowClear="false"
  28. v-model="basicInfoData.warehouseSn"
  29. @change="updateWarehouse"
  30. id="basicInfo-warehouseSn"
  31. placeholder="请选择调入仓库"
  32. /> -->
  33. {{ (basicInfoData&&basicInfoData.warehouseName) || '--' }}
  34. </a-descriptions-item>
  35. <a-descriptions-item label="费用/调拨退货类型">
  36. <AllocateType
  37. id="allocateEdit-allocateReturnTypeSn"
  38. style="width: 220px;"
  39. v-model="allocateTypeVal"
  40. :allowClear="false"
  41. placeholder="请选择费用/调拨退货类型"
  42. @change="changeAllocateType"></AllocateType>
  43. </a-descriptions-item>
  44. <a-descriptions-item label="是否抓单">{{ (basicInfoData&&basicInfoData.grabFlagDictValue) || '--' }}</a-descriptions-item>
  45. <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
  46. <a-descriptions-item label="备注">
  47. {{ (basicInfoData&&basicInfoData.remarks) }}
  48. <a-icon type="form" title="编辑备注" @click="editRemark = true" style="color: dodgerblue;font-size: 14px;" />
  49. </a-descriptions-item>
  50. </a-descriptions>
  51. </a-card>
  52. <!-- 选择产品 -->
  53. <a-card size="small" title="选择产品" :bordered="false" class="allocateBillEdit-cont">
  54. <!-- 筛选条件 -->
  55. <div class="table-page-search-wrapper">
  56. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  57. <a-row :gutter="15">
  58. <a-col :md="6" :sm="24">
  59. <a-form-item label="产品编码" prop="productCode">
  60. <a-input id="allocateBillEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
  61. </a-form-item>
  62. </a-col>
  63. <a-col :md="6" :sm="24">
  64. <a-form-item label="产品名称" prop="productName">
  65. <a-input id="allocateBillEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
  66. </a-form-item>
  67. </a-col>
  68. <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
  69. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
  70. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
  71. </a-col>
  72. </a-row>
  73. </a-form>
  74. </div>
  75. <!-- 列表 -->
  76. <s-table
  77. class="sTable"
  78. ref="table"
  79. size="small"
  80. index="0"
  81. tableId="table1"
  82. :rowKey="(record) => record.stockSn"
  83. :columns="columns"
  84. :customRow="handleClickRow"
  85. :data="loadData"
  86. :scroll="{ y: 300 }"
  87. :defaultLoadData="false"
  88. bordered>
  89. <!-- 退货单价 -->
  90. <template slot="returnPrice" slot-scope="text, record">
  91. <div @dblclick.stop>
  92. <a-input-number
  93. size="small"
  94. v-model="record.productPrice"
  95. :precision="2"
  96. :min="0"
  97. :max="999999"
  98. placeholder="请输入"
  99. style="width: 100%;" />
  100. </div>
  101. </template>
  102. <!-- 退货数量 -->
  103. <template slot="returnQty" slot-scope="text, record">
  104. <div @dblclick.stop>
  105. <a-input-number
  106. size="small"
  107. v-model="record.qty"
  108. :precision="0"
  109. :min="1"
  110. :max="999999"
  111. placeholder="请输入"
  112. style="width: 100%;" />
  113. </div>
  114. </template>
  115. <!-- 操作 -->
  116. <template slot="action" slot-scope="text, record">
  117. <a-button
  118. size="small"
  119. type="link"
  120. v-if="record.lastStockCost"
  121. class="button-primary"
  122. @click="handleAdd(record)"
  123. id="allocateBillEdit-add-btn">添加</a-button>
  124. <span v-else>--</span>
  125. </template>
  126. </s-table>
  127. </a-card>
  128. <!-- 已选产品 -->
  129. <a-card size="small" title="已选产品" :bordered="false" class="allocateBillEdit-cont">
  130. <!-- 总计 -->
  131. <a-alert type="info" style="margin-bottom:10px">
  132. <div slot="message">
  133. 退货总数量:<strong>{{ (basicInfoData&&(basicInfoData.totalQty || basicInfoData.totalQty==0)) ? basicInfoData.totalQty : '--' }}</strong> ;
  134. <span>退货总金额:<strong>{{ (basicInfoData&&(basicInfoData.totalPrice || basicInfoData.totalPrice==0)) ? toThousands(basicInfoData.totalPrice) : '--' }}</strong>;</span>
  135. </div>
  136. </a-alert>
  137. <!-- 筛选条件 -->
  138. <a-row :gutter="15">
  139. <a-col :span="17">
  140. <div class="table-page-search-wrapper">
  141. <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
  142. <a-row :gutter="15">
  143. <a-col :md="9" :sm="24">
  144. <a-form-item label="产品编码" prop="productCode">
  145. <a-input id="editGrap-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
  146. </a-form-item>
  147. </a-col>
  148. <a-col :md="9" :sm="24">
  149. <a-form-item label="产品名称" prop="productName">
  150. <a-input id="editGrap-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
  151. </a-form-item>
  152. </a-col>
  153. <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
  154. <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
  155. <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
  156. </a-col>
  157. </a-row>
  158. </a-form>
  159. </div>
  160. </a-col>
  161. <a-col :span="7" style="text-align: right;">
  162. <!-- <a-button size="small" id="editGrap-import-btn" @click="openGuideModal=true">导入产品</a-button> -->
  163. <!-- <a-button size="small" type="danger" style="margin-left: 5px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button> -->
  164. </a-col>
  165. </a-row>
  166. <!-- 列表 -->
  167. <s-table
  168. class="sTable"
  169. ref="chooseTable"
  170. size="small"
  171. index="1"
  172. tableId="table2"
  173. :rowKey="(record) => record.id"
  174. :columns="chooseColumns"
  175. :data="chooseLoadData"
  176. :scroll="{ y: 300 }"
  177. :defaultLoadData="false"
  178. bordered>
  179. <!-- 退货单价 -->
  180. <template slot="returnPrice" slot-scope="text, record">
  181. <a-input-number
  182. size="small"
  183. v-model="record.price"
  184. :precision="2"
  185. :min="0"
  186. :max="999999"
  187. @blur="e => priceChange(e.target.value, record)"
  188. placeholder="请输入"
  189. style="width: 100%;" />
  190. </template>
  191. <!-- 退货数量 -->
  192. <template slot="returnQty" slot-scope="text, record">
  193. <a-input-number
  194. size="small"
  195. v-model="record.returnQty"
  196. :precision="0"
  197. :min="1"
  198. :max="999999"
  199. @blur="e => qtyBlur(e.target.value, record)"
  200. placeholder="请输入"
  201. style="width: 100%;" />
  202. </template>
  203. <!-- 操作 -->
  204. <template slot="action" slot-scope="text, record">
  205. <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="allocateBillEdit-del-btn">删除</a-button>
  206. </template>
  207. </s-table>
  208. </a-card>
  209. <!-- </a-spin> -->
  210. </div>
  211. <div class="affix-cont">
  212. <a-button
  213. type="primary"
  214. id="allocateBillEdit-submit"
  215. size="large"
  216. :disabled="spinning"
  217. class="button-primary"
  218. @click="handleSubmit"
  219. style="padding: 0 60px;">提交</a-button>
  220. </div>
  221. <!-- 导入产品 -->
  222. <!-- <importGuideModal :openModal="openGuideModal" :params="{allocateReturnSn: $route.params.sn}" @close="openGuideModal=false" @ok="handleGuideOk" /> -->
  223. <!-- 修改基础信息 -->
  224. <a-modal
  225. centered
  226. wrapClassName="allocateBill-editRemark-modal"
  227. v-if="basicInfoData"
  228. :footer="null"
  229. :maskClosable="false"
  230. title="修改备注"
  231. v-model="editRemark"
  232. @cancel="editRemark = false"
  233. :width="600">
  234. <a-textarea
  235. v-model="basicInfoData.remarks"
  236. placeholder="请输入备注(最多120个字符)"
  237. :maxLength="120"
  238. :auto-size="{ minRows: 3, maxRows: 5 }"
  239. />
  240. <div class="btn-cont">
  241. <a-button type="primary" id="allocateBill-basicInfo-modal-save" @click="handleEditRemark">保存</a-button>
  242. <a-button id="allocateBill-basicInfo-modal-back" @click="editRemark = false" style="margin-left: 15px;">取消</a-button>
  243. </div>
  244. </a-modal>
  245. </div>
  246. </template>
  247. <script>
  248. import { commonMixin } from '@/utils/mixin'
  249. import { STable, VSelect } from '@/components'
  250. // import ImportGuideModal from './importGuideModal.vue'
  251. import print from './print.vue'
  252. import warehouse from '@/views/common/chooseWarehouse.js'
  253. import { queryStockProductPage } from '@/api/stock'
  254. import AllocateType from '@/views/common/allocateType.js'
  255. import {
  256. allocateReturnSave,
  257. allocReturnDetailQueryPage,
  258. allocateReturnQueryBySn,
  259. allocReturnDetailInsert,
  260. allocReturnDetailUpdate,
  261. allocateReturnSubmit,
  262. allocReturnDetailDelete
  263. // allocateBillBatchInsert
  264. } from '@/api/allocateReturn'
  265. export default {
  266. name: 'TransferReturnEdit',
  267. mixins: [commonMixin],
  268. components: { STable, VSelect, print, AllocateType, warehouse },
  269. data () {
  270. const _this = this
  271. return {
  272. spinning: false,
  273. queryParam: {
  274. productCode: '',
  275. productName: '',
  276. productOrigCode: ''
  277. },
  278. chooseQueryParam: {
  279. productCode: '',
  280. productName: ''
  281. },
  282. editRemark: false,
  283. disabled: false, // 查询、重置按钮是否可操作
  284. loading: false,
  285. chooseDisabled: false, // 查询、重置按钮是否可操作
  286. advanced: false, // 高级搜索 展开/关闭
  287. // 加载数据方法 必须为 Promise 对象
  288. loadData: parameter => {
  289. this.disabled = true
  290. const dealerLevel = this.$route.params.dealerLevel == 'OTHER' ? undefined : this.$route.params.dealerLevel
  291. const warehouseSn = this.basicInfoData.warehouseSn
  292. return queryStockProductPage(Object.assign(parameter, this.queryParam, { dealerLevel: dealerLevel == 0 ? '' : dealerLevel, warehouseSn: warehouseSn })).then(res => {
  293. const data = res.data
  294. const no = (data.pageNo - 1) * data.pageSize
  295. for (var i = 0; i < data.list.length; i++) {
  296. data.list[i].no = no + i + 1
  297. data.list[i].qty = 1
  298. }
  299. this.loadDataSource = data.list || []
  300. this.disabled = false
  301. return data
  302. })
  303. },
  304. loadDataSource: [],
  305. localDataSource: [],
  306. // 加载数据方法 必须为 Promise 对象
  307. chooseLoadData: parameter => {
  308. this.chooseDisabled = true
  309. const params = Object.assign(parameter, { product: { name: this.chooseQueryParam.productName, code: this.chooseQueryParam.productCode }, allocateReturnSn: this.$route.params.sn })
  310. return allocReturnDetailQueryPage(params).then(res => {
  311. const data = res.data
  312. const no = (data.pageNo - 1) * data.pageSize
  313. for (var i = 0; i < data.list.length; i++) {
  314. data.list[i].no = no + i + 1
  315. data.list[i].qtyBackups = data.list[i].returnQty
  316. data.list[i].oldPrice = data.list[i].price
  317. }
  318. this.localDataSource = data.list || []
  319. this.chooseDisabled = false
  320. return data
  321. })
  322. },
  323. basicInfoData: null, // 基本信息
  324. openGuideModal: false, // 导入产品引导
  325. openModal: false,
  326. nowType: null,
  327. allocateTypeVal: [],
  328. showDetail: false
  329. }
  330. },
  331. computed: {
  332. columns () {
  333. const arr = [
  334. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  335. { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'left', customRender: function (text) { return text || '--' } },
  336. { title: '产品名称', dataIndex: 'productName', align: 'left', width: '29%', customRender: function (text) { return text || '--' }, ellipsis: true },
  337. { title: '单位', dataIndex: 'productUnit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  338. { title: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '10%', align: 'right' },
  339. { title: '退货数量', scopedSlots: { customRender: 'returnQty' }, width: '10%', align: 'center' },
  340. { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
  341. ]
  342. return arr
  343. },
  344. chooseColumns () {
  345. const _this = this
  346. const arr = [
  347. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  348. { title: '产品编码', dataIndex: 'product.code', width: '10%', align: 'left', customRender: function (text) { return text || '--' } },
  349. { title: '产品名称', dataIndex: 'product.name', align: 'left', width: '29%', customRender: function (text) { return text || '--' }, ellipsis: true },
  350. { title: '单位', dataIndex: 'product.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  351. { title: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '10%', align: 'right' },
  352. { title: '退货数量', scopedSlots: { customRender: 'returnQty' }, width: '10%', align: 'center' },
  353. { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
  354. ]
  355. arr.splice(6, 0, { title: '退货金额', dataIndex: 'totalReturnPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  356. return arr
  357. }
  358. },
  359. methods: {
  360. // 修改备注
  361. handleEditRemark (flag) {
  362. const _this = this
  363. const params = _this.basicInfoData
  364. allocateReturnSave(params).then(res => {
  365. if (res.status == 200) {
  366. _this.$message.success(res.message)
  367. _this.getDetail(flag)
  368. } else {
  369. _this.spinning = false
  370. }
  371. })
  372. _this.editRemark = false
  373. },
  374. // 修改仓库
  375. updateWarehouse (warehouseSn) {
  376. this.basicInfoData.warehouseSn = warehouseSn
  377. this.handleEditRemark(true)
  378. },
  379. // 修改调拨类型
  380. changeAllocateType (val, opt) {
  381. console.log(val, opt, '------------')
  382. const _this = this
  383. this.allocateTypeVal = val
  384. this.basicInfoData.costTypeSn = val[0] ? val[0] : ''
  385. this.basicInfoData.allocateSortSn = val[1] ? val[1] : ''
  386. this.basicInfoData.allocateReturnTypeSn = val[2] ? val[2] : ''
  387. // 名称
  388. this.basicInfoData.costTypeName = opt[0] ? opt[0].name : ''
  389. this.basicInfoData.allocateSortName = opt[1] ? opt[1].name : ''
  390. this.basicInfoData.allocateReturnTypeName = opt[2] ? opt[2].name : ''
  391. this.$confirm({
  392. title: '提示',
  393. content: '确定要更改调拨退货类型吗?',
  394. centered: true,
  395. onOk () {
  396. _this.handleEditRemark()
  397. },
  398. onCancel () {
  399. _this.getDetail(false)
  400. }
  401. })
  402. },
  403. // 重置
  404. resetSearchForm () {
  405. this.queryParam.productCode = ''
  406. this.queryParam.productName = ''
  407. this.queryParam.productOrigCode = ''
  408. this.$refs.table.refresh(true)
  409. },
  410. // 双击快速添加
  411. handleClickRow (record) {
  412. return {
  413. on: {
  414. dblclick: (event) => {
  415. this.handleAdd(record)
  416. }
  417. }
  418. }
  419. },
  420. // 导入产品
  421. // handleGuideOk (obj) {
  422. // allocateBillBatchInsert(obj).then(res => {
  423. // if (res.status == 200) {
  424. // this.$refs.chooseTable.refresh(true)
  425. // }
  426. // })
  427. // },
  428. // 已选产品 重置
  429. chooseResetSearchForm () {
  430. this.chooseQueryParam.productCode = ''
  431. this.chooseQueryParam.productName = ''
  432. this.$refs.chooseTable.refresh(true)
  433. },
  434. // 添加/编辑
  435. handleAdd (row, isEdit, isRefresh) {
  436. const params = {
  437. allocateReturnSn: this.$route.params.sn,
  438. productSn: row.productSn,
  439. price: isEdit ? row.price : row.productPrice,
  440. returnQty: isEdit ? row.returnQty : row.qty,
  441. cost: isEdit ? row.cost : row.lastStockCost
  442. }
  443. const fun = isEdit ? allocReturnDetailUpdate : allocReturnDetailInsert
  444. if (isEdit) { // 编辑
  445. // 清空数量时,值应保持未清空前的值,因数量不可为空
  446. if (!row.returnQty) {
  447. row.returnQty = row.qtyBackups
  448. return
  449. }
  450. if (!row.price) {
  451. row.price = row.oldPrice
  452. return
  453. }
  454. params.oldPrice = row.oldPrice
  455. params.allocateReturnDetailSn = row.allocateReturnDetailSn
  456. }
  457. this.spinning = true
  458. fun(params).then(res => {
  459. if (res.status == 200) {
  460. this.getDetail(false)
  461. this.$message.success(res.message)
  462. if (isRefresh != 'noRefresh') {
  463. this.$refs.table.refresh()
  464. }
  465. this.$refs.chooseTable.refresh()
  466. this.spinning = false
  467. } else {
  468. this.spinning = false
  469. }
  470. })
  471. },
  472. // 删除
  473. handleDel (row, isAll) {
  474. const _this = this
  475. const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
  476. this.$confirm({
  477. title: '提示',
  478. content: content,
  479. centered: true,
  480. onOk () {
  481. if (isAll) { // 整单删除
  482. // allocateBillDetailDelAll({ sn: _this.$route.params.sn }).then(res => {
  483. // if (res.status == 200) {
  484. // _this.$message.success(res.message)
  485. // _this.refashPage()
  486. // }
  487. // })
  488. } else { // 单个删除
  489. allocReturnDetailDelete({
  490. allocateReturnSn: _this.$route.params.sn,
  491. allocateDetailSn: row.allocateDetailSn,
  492. price: row.price,
  493. productSn: row.productSn
  494. }).then(res => {
  495. if (res.status == 200) {
  496. _this.$message.success(res.message)
  497. _this.refashPage()
  498. }
  499. })
  500. }
  501. }
  502. })
  503. },
  504. // 提交
  505. handleSubmit () {
  506. const _this = this
  507. if (this.localDataSource.length == 0) {
  508. _this.$message.error('请先选择产品!')
  509. return
  510. }
  511. _this.spinning = true
  512. allocateReturnSubmit({ allocateReturnSn: this.$route.params.sn }).then(res => {
  513. if (res.status == 200) {
  514. this.$message.success(res.message)
  515. setTimeout(() => {
  516. _this.handleBack()
  517. _this.spinning = false
  518. }, 1000)
  519. } else {
  520. _this.spinning = false
  521. }
  522. })
  523. },
  524. // 基本信息
  525. getDetail (flag) {
  526. this.spinning = true
  527. allocateReturnQueryBySn({ allocateReturnSn: this.$route.params.sn }).then(res => {
  528. if (res.status == 200) {
  529. this.basicInfoData = res.data
  530. if (this.basicInfoData.costTypeSn) {
  531. this.allocateTypeVal = [this.basicInfoData.costTypeSn, this.basicInfoData.allocateSortSn, this.basicInfoData.allocateReturnTypeSn]
  532. }
  533. if (flag) {
  534. this.$refs.table.refresh()
  535. }
  536. } else {
  537. this.basicInfoData = null
  538. }
  539. this.spinning = false
  540. })
  541. },
  542. // 返回列表
  543. handleBack () {
  544. this.$router.push({ name: 'transferReturnList', query: { closeLastOldTab: true } })
  545. },
  546. // 已选产品 退货数量 blur
  547. qtyBlur (val, record) {
  548. // 光标移出,值发生改变再调用编辑接口
  549. if (val != record.qtyBackups) {
  550. this.handleAdd(record, 'edit')
  551. }
  552. },
  553. // 已选产品 退货单价 change
  554. priceChange (val, record) {
  555. // 光标移出,值发生改变再调用编辑接口
  556. if (val != record.oldPrice) {
  557. this.handleAdd(record, 'edit', 'noRefresh')
  558. }
  559. },
  560. // 刷新当前页面
  561. refashPage () {
  562. this.getDetail(true)
  563. this.$refs.chooseTable.refresh()
  564. },
  565. pageInit () {
  566. this.refashPage()
  567. }
  568. },
  569. mounted () {
  570. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  571. this.pageInit()
  572. }
  573. },
  574. activated () {
  575. // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
  576. if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
  577. this.pageInit()
  578. }
  579. },
  580. beforeRouteEnter (to, from, next) {
  581. next(vm => {})
  582. }
  583. }
  584. </script>
  585. <style lang="less">
  586. .allocateBillEdit-wrap{
  587. position: relative;
  588. height: 100%;
  589. box-sizing: border-box;
  590. >.ant-spin-nested-loading{
  591. overflow-y: scroll;
  592. height: 100%;
  593. padding-bottom: 51px;
  594. }
  595. .allocateBillEdit-back{
  596. margin-bottom: 6px;
  597. .ant-page-header-heading-sub-title{
  598. margin:0;
  599. }
  600. }
  601. .allocateBillEdit-cont{
  602. margin-bottom: 6px;
  603. .sub-title{
  604. font-size: 12px;
  605. color: #808695;
  606. margin-left: 10px;
  607. }
  608. .tag-txt{
  609. font-size: 12px;
  610. color: #ed1c24;
  611. }
  612. .edit-circle-btn{
  613. margin-left: 15px;
  614. i{
  615. vertical-align: text-bottom;
  616. }
  617. }
  618. .import-btn{
  619. margin-left: 15px;
  620. }
  621. }
  622. }
  623. .allocateBill-editRemark-modal{
  624. .btn-cont{
  625. text-align: center;
  626. padding-top: 20px;
  627. }
  628. }
  629. </style>