detail.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  1. <template>
  2. <div class="salesDetail-wrap" :style="{paddingBottom:hideFooter?'0px':'45px'}">
  3. <a-spin :spinning="spinning" tip="Loading...">
  4. <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
  5. <template slot="subTitle" v-if="!bizSn">
  6. <a id="salesEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
  7. <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ detailData&&detailData.salesBillNo }}</span>
  8. <span v-if="detailData&&detailData.salesBillNoSource">(原:{{ detailData&&detailData.salesBillNoSource || '--' }})</span>
  9. <span style="margin: 0 10px;color: #666;">客户名称:{{ detailData&&detailData.buyerName }}</span>
  10. <a-button size="small" type="link" class="button-default" @click="showDetail=!showDetail">
  11. <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
  12. </a-button>
  13. </template>
  14. <template slot="extra">
  15. <a-button
  16. key="1"
  17. type="primary"
  18. class="button-info"
  19. id="salesDetail-xs-print-btn"
  20. v-if="$hasPermissions('B_salesPrint')"
  21. :disabled="hasData"
  22. @click="handlePrint('SALES_BILL','B_salesPrint')">销售打印</a-button>
  23. <a-button
  24. key="2"
  25. type="primary"
  26. class="button-info"
  27. id="salesDetail-xsfl-print-btn"
  28. v-if="$hasPermissions('B_salesTypePrint')"
  29. :disabled="hasData"
  30. @click="handlePrint('SALES_BILL_TYPE','B_salesTypePrint')">销售分类打印</a-button>
  31. <a-divider type="vertical" />
  32. <a-button
  33. key="3"
  34. type="default"
  35. class="button-info"
  36. id="salesDetail-export-btn"
  37. v-if="$hasPermissions('B_salesDetailExport')"
  38. :disabled="hasData"
  39. @click="handlePrint('export','B_salesDetailExport')">导出Excel</a-button>
  40. <a-button
  41. key="4"
  42. type="default"
  43. class="button-info"
  44. id="salesDetail-export-btn"
  45. v-if="$hasPermissions('B_salesTypeExport')"
  46. :disabled="hasData"
  47. @click="handlePrint('typeExport','B_salesTypeExport')">销售分类导出</a-button>
  48. </template>
  49. </a-page-header>
  50. <!-- 基础信息 -->
  51. <a-card size="small" :bordered="false" class="pages-wrap" style="margin-bottom: 6px;" v-show="showDetail">
  52. <div style="padding: 0;">
  53. <a-descriptions size="small" :column="3">
  54. <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
  55. <a-descriptions-item label="收货地址" :span="2">{{ shippingAddress||'--' }}</a-descriptions-item>
  56. <a-descriptions-item label="收货人">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
  57. <a-descriptions-item label="收货电话">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
  58. <a-descriptions-item label="收款方式">{{ detailData&&detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
  59. <a-descriptions-item label="审核时间">{{ detailData&&detailData.auditDate || '--' }}</a-descriptions-item>
  60. <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
  61. <a-descriptions-item label="财务状态">{{ detailData&&detailData.financialStatusDictValue || '--' }}</a-descriptions-item>
  62. <a-descriptions-item label="改单时间" v-if="detailData&&detailData.salesBillSource=='PURCHASE'&&detailData.submitDate">{{ detailData.submitDate }}</a-descriptions-item>
  63. <a-descriptions-item label="最新提交时间" v-if="detailData&&detailData.salesBillSource=='SALES'&&detailData.submitDate">{{ detailData.submitDate }}</a-descriptions-item>
  64. <a-descriptions-item label="备注" :span="3">{{ detailData&&detailData.remarks || '--' }}</a-descriptions-item>
  65. </a-descriptions>
  66. </div>
  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>
  73. 总销售数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
  74. 已取消数量:<strong>{{ detailData&&(detailData.totalCancelQty || detailData.totalCancelQty==0) ? detailData.totalCancelQty : '--' }}</strong>;
  75. 已下推数量:<strong>{{ detailData&&(detailData.totalPushedQty || detailData.totalPushedQty==0) ? detailData.totalPushedQty : '--' }}</strong>;
  76. 待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;
  77. 已发货数量:<strong>{{ detailData&&(detailData.totalDispatchQty || detailData.totalDispatchQty==0) ? detailData.totalDispatchQty : '--' }}</strong>;
  78. 待发货数量:<strong>{{ detailData&&(detailData.totalUndispatchQty || detailData.totalUndispatchQty==0) ? detailData.totalUndispatchQty : '--' }}</strong>;<br/>
  79. <span v-if="$hasPermissions(authCode + '_salesPrice')">总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;</span>
  80. <span v-if="$hasPermissions(authCode + '_costPrice')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;</span>
  81. <span v-if="$hasPermissions(authCode + '_costPrice')">总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;</span>
  82. <span v-if="$hasPermissions(authCode + '_salesPrice')">已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? toThousands(detailData.totalCancelAmount) : '--' }}</strong>;</span>
  83. <span v-if="$hasPermissions(authCode + '_salesPrice')">已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? toThousands(detailData.totalPushedAmount) : '--' }}</strong>;</span>
  84. <span v-if="$hasPermissions(authCode + '_salesPrice')">待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? toThousands(detailData.totalUnpushedAmount) : '--' }}</strong>;</span>
  85. <span v-if="$hasPermissions(authCode + '_salesPrice')">已发货金额:<strong>{{ detailData&&(detailData.totalDispatchAmount || detailData.totalDispatchAmount==0) ? toThousands(detailData.totalDispatchAmount) : '--' }}</strong>;</span>
  86. <span v-if="$hasPermissions(authCode + '_salesPrice')">待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? toThousands(detailData.totalUndispatchAmount) : '--' }}</strong>;</span>
  87. <span v-if="isCityPrice">市级总售价:<strong>{{ detailData&&(detailData.totalCityAmount || detailData.totalCityAmount==0) ? toThousands(detailData.totalCityAmount) : '--' }}</strong>;</span>
  88. <span v-if="$hasPermissions(authCode + '_salesPrice')&&detailData&&detailData.totalDiscountAmount" style="color: red;">优惠金额:<strong>{{ Number(detailData.totalDiscountAmount).toFixed(2) }}</strong>;</span>
  89. <span v-if="$hasPermissions(authCode + '_salesPrice')&&detailData&&detailData.totalConvertPromoGiftsAmount" style="color: red;">促销产品转采购额金额:<strong>{{ Number(detailData.totalConvertPromoGiftsAmount).toFixed(2) }}</strong>;</span>
  90. </div>
  91. </div>
  92. </a-alert>
  93. <!-- 查询 -->
  94. <div class="table-page-search-wrapper">
  95. <div style="display: flex;justify-content: space-between;align-items: center;">
  96. <div style="flex-grow: 1;width: 60%;">
  97. <a-form layout="inline" @keyup.enter.native="searchTable">
  98. <a-row :gutter="15" type="flex">
  99. <a-col flex="300px">
  100. <a-form-item label="出库仓库">
  101. <chooseWarehouse ref="warehouse" v-model="warehouseSn"></chooseWarehouse>
  102. </a-form-item>
  103. </a-col>
  104. <a-col flex="300px" v-if="hasPrompActive">
  105. <a-form-item label="产品类型">
  106. <a-select v-model.trim="promoFlag" allowClear :dropdownMatchSelectWidth="false" placeholder="请选择产品类型">
  107. <a-select-option value="0">
  108. 正常产品
  109. </a-select-option>
  110. <a-select-option value="REGULAR">
  111. 正价产品(活动)
  112. </a-select-option>
  113. <a-select-option value="DISCOUNT">
  114. 特价产品
  115. </a-select-option>
  116. <a-select-option value="GIFT">
  117. 促销产品
  118. </a-select-option>
  119. <a-select-option value="GATE">
  120. 门槛产品
  121. </a-select-option>
  122. </a-select>
  123. </a-form-item>
  124. </a-col>
  125. <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
  126. <a-button type="primary" @click="searchTable" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
  127. <a-button style="margin-left: 5px" @click="resetSearchForm" id="productInfoList-reset">重置</a-button>
  128. </a-col>
  129. </a-row>
  130. </a-form>
  131. </div>
  132. <div>
  133. <a-button v-if="detailData && (detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'HQ_CHANGE')" type="link" @click="openStockOut">缺货明细</a-button>
  134. <a-checkbox v-model="isCityPrice" v-if="$hasPermissions(authCode + '_cityPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
  135. </div>
  136. </div>
  137. </div>
  138. <!-- 产品列表 -->
  139. <div>
  140. <detailProductList
  141. ref="productList"
  142. :detailData="detailData"
  143. :warehouseSn="warehouseSn"
  144. :promoFlag="promoFlag"
  145. :salesBillSn="$route.params.sn || bizSn"
  146. :authCode="authCode"
  147. :maxHeight="pageHeight"
  148. :showCityPrice="isCityPrice">
  149. </detailProductList>
  150. </div>
  151. </a-card>
  152. </a-spin>
  153. <div class="affix-cont" :style="{padding:hideFooter?0:'7px 0 4px'}">
  154. <a-button
  155. style="width: 100px;"
  156. :disabled="spinning"
  157. type="primary"
  158. class="button-info"
  159. id="salesDetail-audit-btn"
  160. v-if="detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
  161. @click="handleAudit()"
  162. >
  163. 审核
  164. </a-button>
  165. <a-button
  166. type="primary"
  167. :disabled="spinning"
  168. style="width: 100px;margin: 0 20px;"
  169. id="salesDetail-edit-btn"
  170. v-if="detailData&&detailData.salesBillSource == 'SALES' && (detailData.billStatus == 'WAIT_SUBMIT' || detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'AUDIT_REJECT' || detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesEdit')"
  171. @click="handleEdit()"
  172. >
  173. 编辑
  174. </a-button>
  175. <a-button
  176. style="width: 100px;margin: 0 20px;"
  177. :disabled="spinning"
  178. type="primary"
  179. id="salesDetail-edit-btn"
  180. v-if="detailData&&detailData.salesBillSource == 'PURCHASE' && (detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesEdit')"
  181. @click="handleEdit()"
  182. >
  183. 改单
  184. </a-button>
  185. <a-button
  186. style="width: 100px;"
  187. :disabled="spinning"
  188. type="primary"
  189. class="button-success"
  190. id="salesDetail-batchAudit-btn"
  191. v-if="detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
  192. @click="handleAudit('batch')"
  193. >
  194. 一键审核
  195. </a-button>
  196. <a-button
  197. style="width: 100px;"
  198. type="primary"
  199. class="button-warning"
  200. v-if="detailData&&detailData.billStatus == 'WAIT_PUSH'&&$hasPermissions('B_salesDispatch')"
  201. @click="handleDispatch(detailData)"
  202. >下推</a-button>
  203. </div>
  204. <!-- 打印导出 -->
  205. <print-modal :openModal="openModal" :itemData="detailData" :nowType="nowType" @ok="handleOk" @close="closePrint" />
  206. <!-- 审核 -->
  207. <auditModal
  208. :openModal="visibleAudit"
  209. :content="auditText"
  210. :spinning="spinningAudit"
  211. @close="visibleAudit=false"
  212. @ok="auditOrder('AUDIT_PASS')"
  213. @fail="auditOrder('AUDIT_REJECT')" />
  214. <!-- 审核加下推 -->
  215. <dsModal ref="dsModal" title="销售单一键审核" :openModal="showDsModal" @close="showDsModal=false" @ok="handleOnceAudit" />
  216. <!-- 缺货明细 -->
  217. <stockOutDetail :openModal="showStockOut" :detailData="detailData" :salesBillSn="$route.params.sn || bizSn" @close="showStockOut=false"></stockOutDetail>
  218. </div>
  219. </template>
  220. <script>
  221. import { printFun, exportExcel } from '@/libs/JGPrint.js'
  222. import { commonMixin } from '@/utils/mixin'
  223. import moment from 'moment'
  224. import { VSelect } from '@/components'
  225. import printModal from './printModal.vue'
  226. import auditModal from '@/views/common/auditModal.vue'
  227. import dsModal from '@/views/salesManagement/waitDispatchNew/dsModal.vue'
  228. import stockOutDetail from './stockOutDetailModal.vue'
  229. import chooseWarehouse from '@/views/common/chooseWarehouse'
  230. import detailProductList from './comps/detailProductList.vue'
  231. // 接口
  232. import {
  233. salesDetailBySn,
  234. salesDetailPrint,
  235. salesDetailExcel,
  236. salesDetailTypeExcel,
  237. salesWriteAuditPass,
  238. salesWriteAuditReject,
  239. salesWriteAuditPush
  240. } from '@/api/salesNew'
  241. export default {
  242. name: 'SalesDetailNew',
  243. mixins: [commonMixin],
  244. components: { VSelect, printModal, auditModal, dsModal, stockOutDetail, chooseWarehouse, detailProductList },
  245. props: {
  246. bizSn: { // 有值则为弹框,无值则为页面
  247. type: [Number, String],
  248. default: ''
  249. }
  250. },
  251. data () {
  252. return {
  253. spinning: false,
  254. disabled: false,
  255. showDsModal: false,
  256. showStockOut: false,
  257. authCode: '', // 权限码
  258. hasData: false, // 是否有数据
  259. showDetail: false,
  260. openModal: false,
  261. detailData: null, // 详情数据
  262. nowType: null,
  263. isCityPrice: false, // 是否显示市级价
  264. visibleAudit: false,
  265. auditInfo: null,
  266. spinningAudit: false,
  267. auditText: null,
  268. fromRouter: null,
  269. warehouseSn: undefined,
  270. promoFlag: undefined
  271. }
  272. },
  273. computed: {
  274. // 地址
  275. shippingAddress () {
  276. const shippingAddrProvinceName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrProvinceName ? this.detailData.salesBillExtEntity.shippingAddrProvinceName : ''
  277. const shippingAddrCityName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrCityName ? this.detailData.salesBillExtEntity.shippingAddrCityName : ''
  278. const shippingAddrCountyName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrCountyName ? this.detailData.salesBillExtEntity.shippingAddrCountyName : ''
  279. const shippingAddr = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddr ? this.detailData.salesBillExtEntity.shippingAddr : ''
  280. if (!shippingAddrProvinceName && !shippingAddrCityName && !shippingAddrCountyName && !shippingAddr) {
  281. return '--'
  282. } else {
  283. return shippingAddrProvinceName + shippingAddrCityName + shippingAddrCountyName + shippingAddr
  284. }
  285. },
  286. hideFooter (){
  287. const detailData = this.detailData
  288. return detailData&&(detailData.billStatus == 'HQ_CHANGE'|| (detailData.salesBillSource != 'SALES'&&detailData.billStatus == 'AUDIT_REJECT') ||detailData.billStatus == 'FINISH'||detailData.billStatus == 'OUTING_WAREHOUSE')
  289. },
  290. hasPrompActive(){
  291. return this.detailData&&this.detailData.promoFlag==1
  292. },
  293. pageHeight () {
  294. return window.innerHeight - 305 + (this.hideFooter ? 45 : 0)
  295. }
  296. },
  297. methods: {
  298. // 返回
  299. handleBack () {
  300. this.$router.push({ name: 'salesQueryNewList' })
  301. },
  302. // 编辑
  303. handleEdit () {
  304. const row = this.detailData
  305. this.$router.push({ name: 'salesNewEdit', params: { sn: row.salesBillSn, wSn: row.warehouseSn } })
  306. },
  307. // 重置
  308. resetSearchForm () {
  309. this.warehouseSn = undefined
  310. this.promoFlag = undefined
  311. setTimeout(() => {
  312. this.searchTable()
  313. }, 100)
  314. },
  315. // 查询数据
  316. searchTable () {
  317. this.$refs.productList.searchTable()
  318. },
  319. // 详情
  320. getDetail () {
  321. salesDetailBySn({ salesBillSn: this.bizSn || this.$route.params.sn }).then(res => {
  322. if (res.status == 200) {
  323. this.detailData = res.data || null
  324. this.detailData.totalDiscountAmount = Number(this.detailData.totalOrigAmount || 0) - Number(this.detailData.totalAmount || 0)
  325. }
  326. this.$refs.productList.pageInit()
  327. })
  328. },
  329. // 打开缺货明细
  330. openStockOut () {
  331. if (this.$refs.productList.outStockStr != '') {
  332. this.showStockOut = true
  333. } else {
  334. this.$info({
  335. title: '提示',
  336. content: '此销售单暂无缺货产品!',
  337. centered: true
  338. })
  339. }
  340. },
  341. // 下推
  342. handleDispatch (row) {
  343. this.$router.push({ name: 'waitDispatchNew', params: { salesBillSn: row.salesBillSn } })
  344. },
  345. // 打开审核/一键审核弹框
  346. handleAudit (isBatch) {
  347. if (isBatch) { // 一键审核
  348. if (this.$refs.productList.hasOutStockOfActive) {
  349. this.$info({
  350. title: '提示',
  351. content: '参加促销活动的产品存在缺货,不可一键审核!',
  352. centered: true
  353. })
  354. return
  355. }
  356. if (this.detailData && this.detailData.totalConvertPromoGiftsQty) {
  357. this.$info({
  358. title: '提示',
  359. content: '该活动规则中,促销产品可转费用报销单,不可一键审核!',
  360. centered: true
  361. })
  362. return
  363. }
  364. this.showDsModal = true
  365. this.$refs.dsModal.setDetail(this.detailData)
  366. } else {
  367. this.auditText = null
  368. this.visibleAudit = true
  369. }
  370. },
  371. // 一键审核
  372. handleOnceAudit (data) {
  373. const params = {
  374. salesBillSn: this.bizSn || this.$route.params.sn,
  375. billStatus: 'AUDIT_PASS',
  376. dispatchBill: data
  377. }
  378. this.spinningAudit = true
  379. this.spinning = true
  380. salesWriteAuditPush(params).then(res => {
  381. if (res.status == 200) {
  382. this.$message.success(res.message)
  383. // 关闭详情跳列表
  384. this.handleBack()
  385. }
  386. this.spinningAudit = false
  387. this.spinning = false
  388. })
  389. },
  390. // 审核
  391. auditOrder (billStatus) {
  392. this.spinningAudit = true
  393. const auditFun = billStatus == 'AUDIT_PASS' ? salesWriteAuditPass : salesWriteAuditReject
  394. auditFun({
  395. salesBillSn: this.bizSn || this.$route.params.sn,
  396. billStatus: billStatus
  397. }).then(res => {
  398. if (res.status == 200) {
  399. this.visibleAudit = false
  400. this.$message.success(res.message)
  401. this.spinningAudit = false
  402. const _this = this
  403. this.$nextTick(() => {
  404. if (billStatus == 'AUDIT_PASS' && !_this.auditText) {
  405. _this.$router.push({ name: 'waitDispatchNew', params: { salesBillSn: _this.bizSn || _this.$route.params.sn } })
  406. } else {
  407. // 关闭详情跳列表
  408. _this.handleBack()
  409. }
  410. })
  411. } else {
  412. this.visibleAudit = false
  413. this.spinningAudit = false
  414. }
  415. })
  416. },
  417. // 打印导出
  418. handlePrint (type, authCode) {
  419. const _this = this
  420. _this.$store.state.app.curActionPermission = authCode
  421. // 销售分类导出
  422. if (type == 'typeExport') {
  423. const params = {
  424. salesBillSn: this.bizSn || this.$route.params.sn
  425. }
  426. _this.spinning = true
  427. exportExcel(salesDetailTypeExcel, params, '销售分类' + moment().format('YYYYMMDDHHmmss'), () => {
  428. _this.spinning = false
  429. _this.$store.state.app.curActionPermission = ''
  430. })
  431. } else {
  432. this.detailData.authCode = authCode
  433. this.nowType = type
  434. this.openModal = true
  435. }
  436. },
  437. closePrint () {
  438. console.log(9)
  439. this.$store.state.app.curActionPermission = ''
  440. this.openModal = false
  441. },
  442. // 确定打印或预览,导出
  443. handleOk (objs) {
  444. const _this = this
  445. const params = JSON.parse(JSON.stringify(objs))
  446. _this.$store.state.app.curActionPermission = this.detailData.authCode
  447. delete params.type
  448. _this.spinning = true
  449. if (this.nowType == 'export') { // 导出
  450. exportExcel(salesDetailExcel, params, '销售' + moment().format('YYYYMMDDHHmmss'), () => {
  451. _this.spinning = false
  452. _this.$store.state.app.curActionPermission = ''
  453. })
  454. } else { // 打印
  455. const taskName = this.nowType == 'SALES_BILL' ? '销售单' : '销售分类'
  456. printFun(salesDetailPrint, params, objs.type, taskName, () => {
  457. _this.spinning = false
  458. _this.$store.state.app.curActionPermission = ''
  459. })
  460. }
  461. }
  462. },
  463. mounted () {
  464. if (!this.$store.state.app.isNewTab || this.bizSn) { // 页签刷新时调用
  465. this.getDetail()
  466. }
  467. },
  468. activated () {
  469. // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
  470. if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
  471. this.getDetail()
  472. }
  473. },
  474. beforeRouteEnter (to, from, next) {
  475. next(vm => {
  476. vm.fromRouter = from
  477. vm.authCode = to.meta.permission
  478. })
  479. }
  480. }
  481. </script>
  482. <style lang="less">
  483. .salesDetail-wrap{
  484. position: relative;
  485. height: 100%;
  486. padding-bottom: 45px;
  487. box-sizing: border-box;
  488. >.ant-spin-nested-loading{
  489. overflow-y: auto;
  490. height: 100%;
  491. }
  492. .salesDetail-cont{
  493. margin-bottom: 6px;
  494. }
  495. .active-title{
  496. display: flex;
  497. align-items: center;
  498. justify-content: space-between;
  499. padding: 10px;
  500. background: #f3f8fa;
  501. }
  502. .flexBox{
  503. display: flex;
  504. justify-content: space-between;
  505. align-items: center;
  506. }
  507. .footer-cont{
  508. margin-top: 5px;
  509. text-align: center;
  510. }
  511. .redStyle{
  512. font-weight: bold;
  513. color: red;
  514. }
  515. }
  516. </style>