detail.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  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="GIFT1" v-if="showConvertPromoGifts">
  120. 促销产品(转采购额)
  121. </a-select-option>
  122. <a-select-option value="GATE">
  123. 门槛产品
  124. </a-select-option>
  125. </a-select>
  126. </a-form-item>
  127. </a-col>
  128. <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
  129. <a-button type="primary" @click="searchTable" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
  130. <a-button style="margin-left: 5px" @click="resetSearchForm" id="productInfoList-reset">重置</a-button>
  131. </a-col>
  132. </a-row>
  133. </a-form>
  134. </div>
  135. <div>
  136. <a-button v-if="detailData && (detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'HQ_CHANGE')" type="link" @click="openStockOut">缺货明细</a-button>
  137. <a-checkbox v-model="isCityPrice" v-if="$hasPermissions(authCode + '_cityPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
  138. </div>
  139. </div>
  140. </div>
  141. <!-- 产品列表 -->
  142. <div>
  143. <detailProductList
  144. ref="productList"
  145. :detailData="detailData"
  146. :warehouseSn="warehouseSn"
  147. :promoFlag="promoFlag"
  148. :salesBillSn="$route.params.sn || bizSn"
  149. :authCode="authCode"
  150. :maxHeight="pageHeight"
  151. :showCityPrice="isCityPrice">
  152. </detailProductList>
  153. </div>
  154. </a-card>
  155. </a-spin>
  156. <div class="affix-cont" :style="{padding:hideFooter?0:'7px 0 4px'}">
  157. <a-button
  158. style="width: 100px;"
  159. :disabled="spinning"
  160. type="primary"
  161. class="button-info"
  162. id="salesDetail-audit-btn"
  163. v-if="detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
  164. @click="handleAudit()"
  165. >
  166. 审核
  167. </a-button>
  168. <a-button
  169. type="primary"
  170. :disabled="spinning"
  171. style="width: 100px;margin: 0 20px;"
  172. id="salesDetail-edit-btn"
  173. 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')"
  174. @click="handleEdit()"
  175. >
  176. 编辑
  177. </a-button>
  178. <a-button
  179. style="width: 100px;margin: 0 20px;"
  180. :disabled="spinning"
  181. type="primary"
  182. id="salesDetail-edit-btn"
  183. v-if="detailData&&detailData.salesBillSource == 'PURCHASE' && (detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesEdit')"
  184. @click="handleEdit()"
  185. >
  186. 改单
  187. </a-button>
  188. <a-button
  189. style="width: 100px;"
  190. :disabled="spinning"
  191. type="primary"
  192. class="button-success"
  193. id="salesDetail-batchAudit-btn"
  194. v-if="detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
  195. @click="handleAudit('batch')"
  196. >
  197. 一键审核
  198. </a-button>
  199. <a-button
  200. style="width: 100px;"
  201. type="primary"
  202. class="button-warning"
  203. v-if="detailData&&detailData.billStatus == 'WAIT_PUSH'&&$hasPermissions('B_salesDispatch')"
  204. @click="handleDispatch(detailData)"
  205. >下推</a-button>
  206. </div>
  207. <!-- 打印导出 -->
  208. <print-modal :openModal="openModal" :itemData="detailData" :nowType="nowType" @ok="handleOk" @close="closePrint" />
  209. <!-- 审核 -->
  210. <auditModal
  211. :openModal="visibleAudit"
  212. :content="auditText"
  213. :spinning="spinningAudit"
  214. @close="visibleAudit=false"
  215. @ok="auditOrder('AUDIT_PASS')"
  216. @fail="auditOrder('AUDIT_REJECT')" />
  217. <!-- 审核加下推 -->
  218. <dsModal ref="dsModal" title="销售单一键审核" :openModal="showDsModal" @close="showDsModal=false" @ok="handleOnceAudit" />
  219. <!-- 缺货明细 -->
  220. <stockOutDetail :openModal="showStockOut" :detailData="detailData" :salesBillSn="$route.params.sn || bizSn" @close="showStockOut=false"></stockOutDetail>
  221. </div>
  222. </template>
  223. <script>
  224. import { printFun, exportExcel } from '@/libs/JGPrint.js'
  225. import { commonMixin } from '@/utils/mixin'
  226. import moment from 'moment'
  227. import { VSelect } from '@/components'
  228. import printModal from './printModal.vue'
  229. import auditModal from '@/views/common/auditModal.vue'
  230. import dsModal from '@/views/salesManagement/waitDispatchNew/dsModal.vue'
  231. import stockOutDetail from './stockOutDetailModal.vue'
  232. import chooseWarehouse from '@/views/common/chooseWarehouse'
  233. import detailProductList from './comps/detailProductList.vue'
  234. // 接口
  235. import {
  236. salesDetailBySn,
  237. salesDetailPrint,
  238. salesDetailExcel,
  239. salesDetailTypeExcel,
  240. salesWriteAuditPass,
  241. salesWriteAuditReject,
  242. salesWriteAuditPush
  243. } from '@/api/salesNew'
  244. export default {
  245. name: 'SalesDetailNew',
  246. mixins: [commonMixin],
  247. components: { VSelect, printModal, auditModal, dsModal, stockOutDetail, chooseWarehouse, detailProductList },
  248. props: {
  249. bizSn: { // 有值则为弹框,无值则为页面
  250. type: [Number, String],
  251. default: ''
  252. }
  253. },
  254. data () {
  255. return {
  256. spinning: false,
  257. disabled: false,
  258. showDsModal: false,
  259. showStockOut: false,
  260. authCode: '', // 权限码
  261. hasData: false, // 是否有数据
  262. showDetail: false,
  263. openModal: false,
  264. detailData: null, // 详情数据
  265. nowType: null,
  266. isCityPrice: false, // 是否显示市级价
  267. visibleAudit: false,
  268. auditInfo: null,
  269. spinningAudit: false,
  270. auditText: null,
  271. fromRouter: null,
  272. warehouseSn: undefined,
  273. promoFlag: undefined
  274. }
  275. },
  276. computed: {
  277. // 地址
  278. shippingAddress () {
  279. const shippingAddrProvinceName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrProvinceName ? this.detailData.salesBillExtEntity.shippingAddrProvinceName : ''
  280. const shippingAddrCityName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrCityName ? this.detailData.salesBillExtEntity.shippingAddrCityName : ''
  281. const shippingAddrCountyName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrCountyName ? this.detailData.salesBillExtEntity.shippingAddrCountyName : ''
  282. const shippingAddr = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddr ? this.detailData.salesBillExtEntity.shippingAddr : ''
  283. if (!shippingAddrProvinceName && !shippingAddrCityName && !shippingAddrCountyName && !shippingAddr) {
  284. return '--'
  285. } else {
  286. return shippingAddrProvinceName + shippingAddrCityName + shippingAddrCountyName + shippingAddr
  287. }
  288. },
  289. hideFooter () {
  290. const detailData = this.detailData
  291. return detailData && (detailData.billStatus == 'HQ_CHANGE' || (detailData.salesBillSource != 'SALES' && detailData.billStatus == 'AUDIT_REJECT') || detailData.billStatus == 'FINISH' || detailData.billStatus == 'OUTING_WAREHOUSE')
  292. },
  293. hasPrompActive () {
  294. return this.detailData && this.detailData.promoFlag == 1
  295. },
  296. showConvertPromoGifts () {
  297. console.log('11111111:', this.$refs.productList.showConvertPromoGifts)
  298. return this.$refs.productList && this.$refs.productList.showConvertPromoGifts
  299. },
  300. pageHeight () {
  301. return window.innerHeight - 305 + (this.hideFooter ? 45 : 0)
  302. }
  303. },
  304. methods: {
  305. // 返回
  306. handleBack () {
  307. this.$router.push({ name: 'salesQueryNewList' })
  308. },
  309. // 编辑
  310. handleEdit () {
  311. const row = this.detailData
  312. this.$router.push({ name: 'salesNewEdit', params: { sn: row.salesBillSn, wSn: row.warehouseSn } })
  313. },
  314. // 重置
  315. resetSearchForm () {
  316. this.warehouseSn = undefined
  317. this.promoFlag = undefined
  318. setTimeout(() => {
  319. this.searchTable()
  320. }, 100)
  321. },
  322. // 查询数据
  323. searchTable () {
  324. this.$refs.productList.searchTable()
  325. },
  326. // 详情
  327. getDetail () {
  328. salesDetailBySn({ salesBillSn: this.bizSn || this.$route.params.sn }).then(res => {
  329. if (res.status == 200) {
  330. this.detailData = res.data || null
  331. this.detailData.totalDiscountAmount = Number(this.detailData.totalOrigAmount || 0) - Number(this.detailData.totalAmount || 0)
  332. }
  333. this.$refs.productList.pageInit()
  334. })
  335. },
  336. // 打开缺货明细
  337. openStockOut () {
  338. if (this.$refs.productList.outStockStr != '') {
  339. this.showStockOut = true
  340. } else {
  341. this.$info({
  342. title: '提示',
  343. content: '此销售单暂无缺货产品!',
  344. centered: true
  345. })
  346. }
  347. },
  348. // 下推
  349. handleDispatch (row) {
  350. this.$router.push({ name: 'waitDispatchNew', params: { salesBillSn: row.salesBillSn } })
  351. },
  352. // 打开审核/一键审核弹框
  353. handleAudit (isBatch) {
  354. if (isBatch) { // 一键审核
  355. if (this.$refs.productList.hasOutStockOfActive) {
  356. this.$info({
  357. title: '提示',
  358. content: '参加促销活动的产品存在缺货,不可一键审核!',
  359. centered: true
  360. })
  361. return
  362. }
  363. if (this.$refs.productList.showConvertPromoGifts) {
  364. this.$info({
  365. title: '提示',
  366. content: '该活动规则中,促销产品可转费用报销单,不可一键审核!',
  367. centered: true
  368. })
  369. return
  370. }
  371. this.showDsModal = true
  372. this.$refs.dsModal.setDetail(this.detailData)
  373. } else {
  374. this.auditText = null
  375. this.visibleAudit = true
  376. }
  377. },
  378. // 一键审核
  379. handleOnceAudit (data) {
  380. const params = {
  381. salesBillSn: this.bizSn || this.$route.params.sn,
  382. billStatus: 'AUDIT_PASS',
  383. dispatchBill: data
  384. }
  385. this.spinningAudit = true
  386. this.spinning = true
  387. salesWriteAuditPush(params).then(res => {
  388. if (res.status == 200) {
  389. this.$message.success(res.message)
  390. // 关闭详情跳列表
  391. this.handleBack()
  392. }
  393. this.spinningAudit = false
  394. this.spinning = false
  395. })
  396. },
  397. // 审核
  398. auditOrder (billStatus) {
  399. this.spinningAudit = true
  400. const auditFun = billStatus == 'AUDIT_PASS' ? salesWriteAuditPass : salesWriteAuditReject
  401. auditFun({
  402. salesBillSn: this.bizSn || this.$route.params.sn,
  403. billStatus: billStatus
  404. }).then(res => {
  405. if (res.status == 200) {
  406. this.visibleAudit = false
  407. this.$message.success(res.message)
  408. this.spinningAudit = false
  409. const _this = this
  410. this.$nextTick(() => {
  411. if (billStatus == 'AUDIT_PASS' && !_this.auditText) {
  412. _this.$router.push({ name: 'waitDispatchNew', params: { salesBillSn: _this.bizSn || _this.$route.params.sn } })
  413. } else {
  414. // 关闭详情跳列表
  415. _this.handleBack()
  416. }
  417. })
  418. } else {
  419. this.visibleAudit = false
  420. this.spinningAudit = false
  421. }
  422. })
  423. },
  424. // 打印导出
  425. handlePrint (type, authCode) {
  426. const _this = this
  427. _this.$store.state.app.curActionPermission = authCode
  428. // 销售分类导出
  429. if (type == 'typeExport') {
  430. const params = {
  431. salesBillSn: this.bizSn || this.$route.params.sn
  432. }
  433. _this.spinning = true
  434. exportExcel(salesDetailTypeExcel, params, '销售分类' + moment().format('YYYYMMDDHHmmss'), () => {
  435. _this.spinning = false
  436. _this.$store.state.app.curActionPermission = ''
  437. })
  438. } else {
  439. this.detailData.authCode = authCode
  440. this.nowType = type
  441. this.openModal = true
  442. }
  443. },
  444. closePrint () {
  445. console.log(9)
  446. this.$store.state.app.curActionPermission = ''
  447. this.openModal = false
  448. },
  449. // 确定打印或预览,导出
  450. handleOk (objs) {
  451. const _this = this
  452. const params = JSON.parse(JSON.stringify(objs))
  453. _this.$store.state.app.curActionPermission = this.detailData.authCode
  454. delete params.type
  455. _this.spinning = true
  456. if (this.nowType == 'export') { // 导出
  457. exportExcel(salesDetailExcel, params, '销售' + moment().format('YYYYMMDDHHmmss'), () => {
  458. _this.spinning = false
  459. _this.$store.state.app.curActionPermission = ''
  460. })
  461. } else { // 打印
  462. const taskName = this.nowType == 'SALES_BILL' ? '销售单' : '销售分类'
  463. printFun(salesDetailPrint, params, objs.type, taskName, () => {
  464. _this.spinning = false
  465. _this.$store.state.app.curActionPermission = ''
  466. })
  467. }
  468. }
  469. },
  470. mounted () {
  471. if (!this.$store.state.app.isNewTab || this.bizSn) { // 页签刷新时调用
  472. this.getDetail()
  473. }
  474. },
  475. activated () {
  476. // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
  477. if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
  478. this.getDetail()
  479. }
  480. },
  481. beforeRouteEnter (to, from, next) {
  482. next(vm => {
  483. vm.fromRouter = from
  484. vm.authCode = to.meta.permission
  485. })
  486. }
  487. }
  488. </script>
  489. <style lang="less">
  490. .salesDetail-wrap{
  491. position: relative;
  492. height: 100%;
  493. padding-bottom: 45px;
  494. box-sizing: border-box;
  495. >.ant-spin-nested-loading{
  496. overflow-y: auto;
  497. height: 100%;
  498. }
  499. .salesDetail-cont{
  500. margin-bottom: 6px;
  501. }
  502. .active-title{
  503. display: flex;
  504. align-items: center;
  505. justify-content: space-between;
  506. padding: 10px;
  507. background: #f3f8fa;
  508. }
  509. .flexBox{
  510. display: flex;
  511. justify-content: space-between;
  512. align-items: center;
  513. }
  514. .footer-cont{
  515. margin-top: 5px;
  516. text-align: center;
  517. }
  518. .redStyle{
  519. font-weight: bold;
  520. color: red;
  521. }
  522. }
  523. </style>