detail.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. <template>
  2. <div class="salesDetail-wrap">
  3. <a-spin :spinning="spinning" tip="Loading...">
  4. <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
  5. <template slot="subTitle">
  6. <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
  7. </template>
  8. <template slot="extra">
  9. <a-button
  10. key="4"
  11. type="primary"
  12. class="button-info"
  13. id="salesDetail-xs-print-btn"
  14. v-if="$hasPermissions('B_salesPrint')"
  15. :disabled="localDataSource.length==0"
  16. @click="handlePrint('SALES_BILL')">销售打印</a-button>
  17. <a-button
  18. key="3"
  19. type="primary"
  20. class="button-info"
  21. id="salesDetail-xsfl-print-btn"
  22. v-if="$hasPermissions('B_salesPrint')"
  23. :disabled="localDataSource.length==0"
  24. @click="handlePrint('SALES_BILL_TYPE')">销售分类打印</a-button>
  25. <a-button
  26. key="2"
  27. type="primary"
  28. class="button-info"
  29. id="salesDetail-export-btn"
  30. v-if="$hasPermissions('B_salesExport')"
  31. :disabled="localDataSource.length==0"
  32. @click="handlePrint('export')">导出Excel</a-button>
  33. <a-button
  34. key="1"
  35. type="primary"
  36. class="button-info"
  37. id="salesDetail-export-btn"
  38. v-if="$hasPermissions('B_salesExport')"
  39. :disabled="localDataSource.length==0"
  40. @click="handlePrint('typeExport')">分类导出</a-button>
  41. </template>
  42. </a-page-header>
  43. <!-- 基础信息 -->
  44. <a-card size="small" :bordered="false" class="salesDetail-cont">
  45. <a-collapse :activeKey="['1']">
  46. <a-collapse-panel key="1" header="基础信息">
  47. <a-descriptions size="small" :column="3">
  48. <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
  49. <a-descriptions-item label="收货地址" :span="2">{{ shippingAddress }}</a-descriptions-item>
  50. <a-descriptions-item label="收款方式">{{ detailData&&detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
  51. <a-descriptions-item label="收货人">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
  52. <a-descriptions-item label="收货电话">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
  53. <a-descriptions-item label="审核时间">{{ detailData&&detailData.auditDate || '--' }}</a-descriptions-item>
  54. <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
  55. <a-descriptions-item label="财务状态">{{ detailData&&detailData.financialStatusDictValue || '--' }}</a-descriptions-item>
  56. <a-descriptions-item label="备注" :span="3">
  57. <!-- 可审核时需显示具体缺货产品的信息 -->
  58. <p v-if="detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')">
  59. <span v-if="outStockStr || detailData&&detailData.remarks">{{ outStockStr }}{{ detailData&&detailData.remarks }}</span>
  60. <span v-else>--</span>
  61. </p>
  62. <p v-else>{{ detailData&&detailData.remarks || '--' }}</p>
  63. </a-descriptions-item>
  64. </a-descriptions>
  65. </a-collapse-panel>
  66. </a-collapse>
  67. </a-card>
  68. <a-card size="small" :bordered="false" class="pages-wrap">
  69. <!-- alert -->
  70. <a-alert type="info" style="margin-bottom: 10px;">
  71. <div slot="message">
  72. <div style="display: flex;justify-content: space-between;align-items: center;">
  73. <div>
  74. 总销售数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
  75. 已取消数量:<strong>{{ detailData&&(detailData.totalCancelQty || detailData.totalCancelQty==0) ? detailData.totalCancelQty : '--' }}</strong>;
  76. 已下推数量:<strong>{{ detailData&&(detailData.totalPushedQty || detailData.totalPushedQty==0) ? detailData.totalPushedQty : '--' }}</strong>;
  77. 待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;
  78. 已发货数量:<strong>{{ detailData&&(detailData.totalDispatchQty || detailData.totalDispatchQty==0) ? detailData.totalDispatchQty : '--' }}</strong>;
  79. 待发货数量:<strong>{{ detailData&&(detailData.totalUndispatchQty || detailData.totalUndispatchQty==0) ? detailData.totalUndispatchQty : '--' }}</strong>;<br/>
  80. 总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</strong>;
  81. <span v-if="$hasPermissions('B_isShowCost')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? detailData.totalCost : '--' }}</strong>;</span>
  82. 总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? detailData.grossProfit : '--' }}</strong>;
  83. 已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? detailData.totalCancelAmount : '--' }}</strong>;
  84. 已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? detailData.totalPushedAmount : '--' }}</strong>;
  85. 待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? detailData.totalUnpushedAmount : '--' }}</strong>;
  86. 已发货金额:<strong>{{ detailData&&(detailData.totalDispatchAmount || detailData.totalDispatchAmount==0) ? detailData.totalDispatchAmount : '--' }}</strong>;
  87. 待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? detailData.totalUndispatchAmount : '--' }}</strong>;
  88. </div>
  89. <a-checkbox v-model="isCityPrice"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
  90. </div>
  91. </div>
  92. </a-alert>
  93. <!-- 列表 -->
  94. <s-table
  95. class="sTable"
  96. ref="table"
  97. size="small"
  98. :rowKey="(record) => record.id"
  99. :columns="columns"
  100. :data="loadData"
  101. :defaultLoadData="false"
  102. :showPagination="false"
  103. bordered>
  104. <!-- 产品编码 -->
  105. <template slot="productCode" slot-scope="text, record">
  106. <div v-if="(record.promotionFlag == 1) || (Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit'))" class="flexBox">
  107. <div>{{ text }}</div>
  108. <a-badge count="促" :number-style="{ backgroundColor: '#f90' }" v-if="record.promotionFlag == 1">
  109. </a-badge>
  110. <!-- 可审核时才可显示“缺”货产品 -->
  111. <a-badge count="缺" v-if="(Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit'))">
  112. </a-badge>
  113. </div>
  114. <span v-if="!(record.promotionFlag == 1 || ((Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit'))))">{{ text }}</span>
  115. </template>
  116. <!-- 当前库存 -->
  117. <template slot="stockQty" slot-scope="text, record">
  118. <div v-if="record.stockQty || record.stockQty==0">
  119. <p style="margin: 0;" v-if="Number(record.stockQty) < Number(record.unpushedQty)">{{ record.stockQty }}(<span class="redStyle">缺{{ Number(record.unpushedQty) - Number(record.stockQty) }}</span>)</p>
  120. <p style="margin: 0;" v-else>{{ record.stockQty }}</p>
  121. </div>
  122. <span v-else>--</span>
  123. </template>
  124. </s-table>
  125. </a-card>
  126. </a-spin>
  127. <div class="affix-cont">
  128. <a-button
  129. size="large"
  130. style="width: 100px;"
  131. :disabled="spinning"
  132. type="primary"
  133. class="button-info"
  134. id="salesDetail-audit-btn"
  135. v-if="detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
  136. @click="handleAudit()"
  137. >
  138. 审核
  139. </a-button>
  140. <a-button
  141. type="primary"
  142. :disabled="spinning"
  143. class="button-info"
  144. size="large"
  145. style="width: 100px;"
  146. id="salesDetail-edit-btn"
  147. v-if="detailData&&detailData.salesBillSource != 'PURCHASE' && (detailData.billStatus == 'WAIT_SUBMIT' || detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'AUDIT_REJECT')&&$hasPermissions('B_salesEdit')"
  148. @click="handleEdit()"
  149. >
  150. 编辑
  151. </a-button>
  152. <a-button
  153. size="large"
  154. style="width: 100px;"
  155. :disabled="spinning"
  156. type="primary"
  157. class="button-info"
  158. id="salesDetail-edit-btn"
  159. v-if="detailData&&detailData.salesBillSource == 'PURCHASE' && (detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesEdit')"
  160. @click="handleEdit()"
  161. >
  162. 改单
  163. </a-button>
  164. <a-button
  165. size="large"
  166. style="width: 150px;font-size: 12px;margin-left: 50px;"
  167. :disabled="spinning"
  168. type="primary"
  169. class="button-info"
  170. id="salesDetail-batchAudit-btn"
  171. v-if="detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
  172. @click="handleAudit('batch')"
  173. >
  174. 一键审核
  175. </a-button>
  176. </div>
  177. <!-- 打印导出 -->
  178. <print-modal :openModal="openModal" :itemData="detailData" :nowType="nowType" @ok="handleOk" @close="openModal=false" />
  179. <!-- 审核 -->
  180. <auditModal
  181. :openModal="visibleAudit"
  182. :content="auditText"
  183. :spinning="spinningAudit"
  184. @close="visibleAudit=false"
  185. @ok="auditOrder('AUDIT_PASS')"
  186. @fail="auditOrder('AUDIT_REJECT')" />
  187. <!-- 打印 -->
  188. <div id="print"></div>
  189. </div>
  190. </template>
  191. <script>
  192. import moment from 'moment'
  193. import { STable, VSelect } from '@/components'
  194. import printModal from './printModal.vue'
  195. import auditModal from '@/views/common/auditModal.vue'
  196. import { findBySalesBillSn } from '@/api/dispatch'
  197. import { salesDetailBySn, salesDetailPrint, salesDetailExcel, salesDetailTypeExcel, salesWriteAudit, salesWriteAuditPush } from '@/api/sales'
  198. import { salesDetailAllList, salesDetailAllStockList } from '@/api/salesDetail'
  199. export default {
  200. name: 'SalesDetail',
  201. components: { STable, VSelect, printModal, auditModal },
  202. data () {
  203. return {
  204. spinning: false,
  205. disabled: false,
  206. // 加载数据方法 必须为 Promise 对象
  207. loadData: parameter => {
  208. this.disabled = true
  209. const params = Object.assign(parameter, { salesBillSn: this.$route.params.sn })
  210. let url = salesDetailAllList
  211. if (this.detailData && this.detailData.billStatus == 'WAIT_AUDIT' && this.$hasPermissions('B_salesAudit')) { // 审核,需用到库存
  212. url = salesDetailAllStockList
  213. } else { // 非审核
  214. url = salesDetailAllList
  215. }
  216. return url(params).then(res => {
  217. const data = res.data
  218. const no = 0
  219. this.outStockStr = ''
  220. let str = ''
  221. for (var i = 0; i < data.length; i++) {
  222. data[i].no = no + i + 1
  223. const productCode = (data[i].productEntity && data[i].productEntity.code) || (data[i].dealerProductEntity && data[i].dealerProductEntity.code)
  224. const productName = (data[i].productEntity && data[i].productEntity.name) || (data[i].dealerProductEntity && data[i].dealerProductEntity.name)
  225. const productOrigCode = (data[i].productEntity && data[i].productEntity.origCode) || (data[i].dealerProductEntity && data[i].dealerProductEntity.origCode)
  226. const productOrigUnit = (data[i].productEntity && data[i].productEntity.unit) || (data[i].dealerProductEntity && data[i].dealerProductEntity.unit)
  227. data[i].productCode = productCode || '--'
  228. data[i].productName = productName || '--'
  229. data[i].productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
  230. data[i].productOrigUnit = productOrigUnit || '--'
  231. if (data[i].unpushedQty && (Number(data[i].stockQty) < Number(data[i].unpushedQty))) {
  232. str += data[i].productCode + '、'
  233. }
  234. }
  235. if (str.length > 0) {
  236. str = str.substr(0, str.length - 1)
  237. this.outStockStr = '产品编号为:' + str + '的产品库存不足;'
  238. }
  239. this.localDataSource = data
  240. this.disabled = false
  241. return data
  242. })
  243. },
  244. localDataSource: [],
  245. openModal: false,
  246. detailData: null, // 详情数据
  247. nowType: null,
  248. isCityPrice: false, // 是否显示市级价
  249. visibleAudit: false,
  250. auditInfo: null,
  251. spinningAudit: false,
  252. outStockStr: '', // 缺货产品信息说明
  253. auditText: null
  254. }
  255. },
  256. computed: {
  257. shippingAddress () {
  258. const shippingAddrProvinceName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrProvinceName ? this.detailData.salesBillExtEntity.shippingAddrProvinceName : ''
  259. const shippingAddrCityName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrCityName ? this.detailData.salesBillExtEntity.shippingAddrCityName : ''
  260. const shippingAddrCountyName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrCountyName ? this.detailData.salesBillExtEntity.shippingAddrCountyName : ''
  261. const shippingAddr = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddr ? this.detailData.salesBillExtEntity.shippingAddr : ''
  262. if (!shippingAddrProvinceName && !shippingAddrCityName && !shippingAddrCountyName && !shippingAddr) {
  263. return '--'
  264. } else {
  265. return shippingAddrProvinceName + shippingAddrCityName + shippingAddrCountyName + shippingAddr
  266. }
  267. },
  268. columns () {
  269. const arr = [
  270. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  271. { title: '产品编码', dataIndex: 'productCode', width: '13%', scopedSlots: { customRender: 'productCode' }, align: 'left' },
  272. { title: '产品名称', dataIndex: 'productName', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  273. { title: '原厂编码', dataIndex: 'productOrigCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
  274. { title: '省级价', dataIndex: 'provincePrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  275. { title: '销售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  276. { title: '单位', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
  277. { title: '销售数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  278. { title: '待下推数', dataIndex: 'unpushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  279. { title: '已下推数', dataIndex: 'pushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  280. { title: '已取消数', dataIndex: 'cancelQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
  281. ]
  282. if (this.$hasPermissions('B_isShowCost')) {
  283. arr.splice(4, 0, { title: '成本价', dataIndex: 'showCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
  284. }
  285. if (this.isCityPrice) {
  286. const ind = this.$hasPermissions('B_isShowCost') ? 6 : 5
  287. arr.splice(ind, 0, { title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
  288. }
  289. if (this.detailData && this.detailData.billStatus == 'WAIT_AUDIT' && this.$hasPermissions('B_salesAudit')) { // 审核,需用到库存
  290. arr.splice(arr.length - 3, 0, { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' })
  291. }
  292. return arr
  293. }
  294. },
  295. methods: {
  296. // 返回
  297. handleBack () {
  298. this.$router.push({ path: '/salesManagement/salesQuery/list', query: { closeLastOldTab: true } }) // 为解决,销售列表=>销售详情=>其他页=>销售详情 时,点击返回列表,此时返回的是其他页的问题
  299. // this.$router.go(-1)
  300. },
  301. // 编辑
  302. handleEdit () {
  303. const row = this.detailData
  304. this.$router.push({ name: 'salesEdit', params: { sn: row.salesBillSn } })
  305. },
  306. // 详情
  307. getDetail () {
  308. salesDetailBySn({ salesBillSn: this.$route.params.sn }).then(res => {
  309. if (res.status == 200) {
  310. this.detailData = res.data || null
  311. this.$refs.table.refresh(true)
  312. } else {
  313. this.detailData = null
  314. }
  315. })
  316. },
  317. // 审核/批量审核
  318. handleAudit (isBatch) {
  319. if (isBatch) {
  320. this.auditText = this.outStockStr + '是否审核通过?'
  321. } else {
  322. this.auditText = null
  323. }
  324. this.visibleAudit = true
  325. },
  326. // 审核
  327. auditOrder (billStatus) {
  328. this.spinningAudit = true
  329. let url = salesWriteAudit
  330. if (this.auditText) { // 批量
  331. url = salesWriteAuditPush
  332. }
  333. url({
  334. salesBillSn: this.$route.params.sn,
  335. billStatus: billStatus
  336. }).then(res => {
  337. if (res.status == 200) {
  338. this.visibleAudit = false
  339. this.$message.success(res.message)
  340. this.spinningAudit = false
  341. if (billStatus == 'AUDIT_PASS' && !this.auditText) {
  342. this.handleDispatch({ salesBillSn: this.$route.params.sn })
  343. } else {
  344. // 关闭详情跳列表
  345. this.handleBack()
  346. }
  347. } else {
  348. this.visibleAudit = false
  349. this.spinningAudit = false
  350. }
  351. })
  352. },
  353. // 下推
  354. handleDispatch (row) {
  355. this.spinning = true
  356. findBySalesBillSn({ salesBillSn: row.salesBillSn }).then(res => {
  357. this.spinning = false
  358. if (res.status == 200) {
  359. this.$router.push({ name: 'waitDispatch', params: { salesBillSn: row.salesBillSn, dispatchBillSn: res.data.dispatchBillSn } })
  360. }
  361. })
  362. },
  363. // 打印导出
  364. handlePrint (type) {
  365. if (type == 'typeExport') {
  366. this.nowType = type
  367. this.handleOk()
  368. } else {
  369. this.nowType = type
  370. this.openModal = true
  371. }
  372. },
  373. handleOk (objs) {
  374. const _this = this
  375. let params
  376. let url = salesDetailPrint // 打印
  377. if (this.nowType == 'export') { // 导出
  378. url = salesDetailExcel
  379. params = JSON.parse(JSON.stringify(objs))
  380. delete params.type
  381. } else if (this.nowType == 'typeExport') { // 分类导出
  382. url = salesDetailTypeExcel
  383. params = {
  384. salesBillSn: this.$route.params.sn,
  385. showCostFlag: this.$hasPermissions('B_isShowCost')
  386. }
  387. } else { // 打印
  388. params = JSON.parse(JSON.stringify(objs))
  389. delete params.type
  390. }
  391. _this.spinning = true
  392. url(params).then(res => {
  393. _this.spinning = false
  394. if (res.type == 'application/json') {
  395. var reader = new FileReader()
  396. reader.addEventListener('loadend', function () {
  397. const obj = JSON.parse(reader.result)
  398. _this.$notification.error({
  399. message: '提示',
  400. description: obj.message
  401. })
  402. })
  403. reader.readAsText(res)
  404. } else {
  405. if (this.nowType == 'export' || this.nowType == 'typeExport') {
  406. this.download(res)
  407. } else {
  408. this.print(res, objs.type)
  409. }
  410. }
  411. })
  412. },
  413. print (data, type) {
  414. if (!data) {
  415. return
  416. }
  417. const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
  418. document.getElementById('print').innerHTML = '<iframe id="printfsqd" name="printfsqd" src="' + url + '" hidden></iframe>'
  419. if (type == 'preview') { // 预览
  420. window.open(url)
  421. } else if (type == 'print') { // 打印
  422. window.frames['printfsqd'].focus()
  423. window.frames['printfsqd'].print()
  424. }
  425. },
  426. download (data) {
  427. if (!data) { return }
  428. const url = window.URL.createObjectURL(new Blob([data]))
  429. const link = document.createElement('a')
  430. link.style.display = 'none'
  431. link.href = url
  432. const a = moment().format('YYYYMMDDHHmmss')
  433. let fname = ''
  434. if (this.nowType == 'typeExport') {
  435. fname = '销售分类' + a
  436. } else {
  437. fname = '销售' + a
  438. }
  439. link.setAttribute('download', fname + '.xlsx')
  440. document.body.appendChild(link)
  441. link.click()
  442. }
  443. },
  444. mounted () {
  445. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  446. this.getDetail()
  447. }
  448. },
  449. activated () {
  450. // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
  451. if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
  452. this.getDetail()
  453. }
  454. },
  455. beforeRouteEnter (to, from, next) {
  456. next(vm => {})
  457. }
  458. }
  459. </script>
  460. <style lang="less">
  461. .salesDetail-wrap{
  462. position: relative;
  463. height: 100%;
  464. padding-bottom: 51px;
  465. box-sizing: border-box;
  466. >.ant-spin-nested-loading{
  467. overflow-y: scroll;
  468. height: 100%;
  469. }
  470. .salesDetail-cont{
  471. margin-bottom: 10px;
  472. }
  473. .flexBox{
  474. display: flex;
  475. justify-content: space-between;
  476. align-items: center;
  477. }
  478. .footer-cont{
  479. margin-top: 5px;
  480. text-align: center;
  481. }
  482. .redStyle{
  483. font-weight: bold;
  484. color: red;
  485. }
  486. }
  487. </style>