edit.vue 24 KB

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