edit.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. <template>
  2. <div class="salesNewEdit-wrap">
  3. <a-spin :spinning="spinning" tip="Loading...">
  4. <a-page-header :ghost="false" :backIcon="false" @back="handleBack" >
  5. <!-- 自定义的二级文字标题 -->
  6. <template slot="subTitle">
  7. <a id="salesEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
  8. <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ detailData&&detailData.salesBillNo }}</span>
  9. <span v-if="detailData&&detailData.salesBillNoSource">(原:{{ detailData&&detailData.salesBillNoSource || '--' }})</span>
  10. <span style="margin: 0 10px;color: #666;">客户名称:{{ detailData&&detailData.buyerName }}</span>
  11. <a-button type="link" size="small" class="button-default" @click="showDetail=!showDetail">
  12. <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
  13. </a-button>
  14. </template>
  15. </a-page-header>
  16. <!-- 单据详情 -->
  17. <a-card size="small" :bordered="false" class="salesEdit-cont" v-show="showDetail">
  18. <div style="padding: 10px;">
  19. <a-descriptions size="small" :column="3">
  20. <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
  21. <a-descriptions-item label="收货地址" :span="2">{{ shippingAddress||'--' }}</a-descriptions-item>
  22. <a-descriptions-item label="收货人">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
  23. <a-descriptions-item label="收货电话">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
  24. <a-descriptions-item label="收款方式">{{ detailData&&detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
  25. <a-descriptions-item label="审核时间">{{ detailData&&detailData.auditDate || '--' }}</a-descriptions-item>
  26. <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
  27. <a-descriptions-item label="财务状态">{{ detailData&&detailData.financialStatusDictValue || '--' }}</a-descriptions-item>
  28. <a-descriptions-item label="改单时间" v-if="detailData&&detailData.salesBillSource=='PURCHASE'&&detailData.submitDate">{{ detailData.submitDate }}</a-descriptions-item>
  29. <a-descriptions-item label="最新提交时间" v-if="detailData&&detailData.salesBillSource=='SALES'&&detailData.submitDate">{{ detailData.submitDate }}</a-descriptions-item>
  30. <a-descriptions-item label="备注" :span="3">{{ detailData&&detailData.remarks || '--' }}</a-descriptions-item>
  31. </a-descriptions>
  32. </div>
  33. </a-card>
  34. <!-- 正常产品 -->
  35. <a-card size="small" :bordered="false" class="salesEdit-cont" v-if="salesBillSn">
  36. <div style="padding: 10px 10px 0;">
  37. <productNormalList
  38. ref="productNormalList"
  39. @refash="refashTableData"
  40. @spinning="e=>spinning=e"
  41. @openCpModal="openProductModal"
  42. @allThreeStock="searchAllThreeStock"
  43. @addActive="upActive"
  44. @error="tableErrorData"
  45. :showTotal="showTotal"
  46. :hasActive="activeList.length>0"
  47. :detailData="detailData"
  48. :warehouseSn="warehouseSn"
  49. :salesBillSn="salesBillSn">
  50. </productNormalList>
  51. </div>
  52. </a-card>
  53. <!-- 活动统计列表 -->
  54. <a-card
  55. size="small"
  56. :bordered="false"
  57. class="salesEdit-cont"
  58. v-if="activeList.length"
  59. >
  60. <div slot="title">
  61. <div style="display: flex;justify-content: space-between;align-items: center;">
  62. <span>活动产品</span>
  63. <a-button size="small" @click="getActiveList(false)" type="link" class="button-info"><a-icon type="reload"/> 刷新</a-button>
  64. </div>
  65. </div>
  66. <activeStatisticsList
  67. ref="activeTjList"
  68. @openCpModal="openProductModal"
  69. @refash="refashTableData"
  70. @selected="active => salesPromoSnSet = active"
  71. :activeList="activeList"
  72. :warehouseSn="warehouseSn"
  73. :salesBillSn="salesBillSn"
  74. ></activeStatisticsList>
  75. <div style="padding:10px;">
  76. <productActiveList
  77. ref="productActiveList"
  78. :activeList="activeList"
  79. :detailData="detailData"
  80. :salesBillSn="salesBillSn"
  81. :salesPromoSnSet="salesPromoSnSet"
  82. @showRuleDetail="showRuleDetail"
  83. @refash="refashTableData"
  84. @error="tableErrorData"
  85. @upActive="upActive">
  86. </productActiveList>
  87. </div>
  88. </a-card>
  89. </a-spin>
  90. <!-- 底部栏 -->
  91. <div class="affix-cont">
  92. <div class="footer-price">
  93. <div></div>
  94. <div v-if="detailData">
  95. <div class="totalPrice">总售价:¥<span>{{ toThousands(detailData.totalAmount) }}</span></div>
  96. <div>
  97. 产品总款数:<strong style="margin-right: 10px;"> {{ detailData.totalCategory }} </strong>
  98. 总数量:<strong style="margin-right: 10px;"> {{ detailData.totalQty }} </strong>
  99. <!-- 总售价:¥<strong> {{ toThousands(detailData.totalOrigAmount) }}</strong> -->
  100. <span style="margin:0 10px;" v-if="detailData.totalDiscountAmount">优惠金额:¥-<strong>{{ Number(detailData.totalDiscountAmount).toFixed(2) }}</strong></span>
  101. <a-popover title="优惠明细" @visibleChange="(visible)=>{visible&&getPromYhDetail()}">
  102. <a-button shape="round" size="small" v-if="detailData.totalDiscountAmount">优惠明细</a-button>
  103. <div slot="content">
  104. <div v-if="yhDetail">
  105. <div
  106. class="yhdetail"
  107. style="min-width:300px;margin-bottom: 5px;"
  108. v-for="(item,index) in yhDetail.promoMapList"
  109. :key="index">
  110. <div class="yhdetail-h" style="font-weight: bold;font-size:14px;">{{ item.description }}</div>
  111. <div
  112. style="padding-left:10px;"
  113. v-for="(sitem,sindex) in item.promoRuleMapList"
  114. :key="sindex"
  115. v-if="sitem.lossAmount"
  116. >
  117. <div style="display: flex;justify-content: space-between;">
  118. <span>{{ sitem.promotionRuleTypeDictValue }}:</span>
  119. <strong>¥{{ toThousands(sitem.lossAmount) }}</strong>
  120. </div>
  121. <div class="yhdetail-d" style="color:#999;">{{ sitem.description }}</div>
  122. </div>
  123. </div>
  124. <div class="yhdetail" style="display: flex;justify-content: space-between;">
  125. <span style="font-weight: bold;font-size:14px;">优惠金额:</span>
  126. <span style="font-weight: bold;font-size:18px;">¥{{ Number(yhDetail.totalLossAmount).toFixed(2) }}</span>
  127. </div>
  128. </div>
  129. <div style="text-align: center;padding: 20px;" v-else>
  130. 正在加载...
  131. </div>
  132. </div>
  133. </a-popover>
  134. </div>
  135. </div>
  136. </div>
  137. <div>
  138. <a-button
  139. size="large"
  140. style="padding: 0 40px;"
  141. :disabled="spinning"
  142. type="primary"
  143. class="button-primary"
  144. @click="submitResult()"
  145. id="productInfoList-handleSubmit">提交</a-button>
  146. </div>
  147. </div>
  148. <!-- 添加产品 -->
  149. <chooseProduct
  150. ref="chooseProduct"
  151. :openModal="showCpModal"
  152. @close="closeProductModal"
  153. @addProduct="insterProduct">
  154. </chooseProduct>
  155. <!-- 新活动窗口 -->
  156. <newPromoModal
  157. :show="showNewActiveModal"
  158. :salesBillSn="salesBillSn"
  159. :newActiveList="newActiveList"
  160. @ok="showNewActiveOk"
  161. ></newPromoModal>
  162. <!-- 特价活动排序弹框 -->
  163. <discountSortModal
  164. :show="showDiscountSortModal"
  165. :salesBillSn="salesBillSn"
  166. :activeList="discountActiveList"
  167. @ok="showDiscountSortOk">
  168. </discountSortModal>
  169. <!-- 提交时校验销售价低于成本价提示 -->
  170. <vaildPriceModal
  171. ref="vaildPriceModal"
  172. :openModal="openVaildPriceModal"
  173. :dataObj="tempData"
  174. @close="closeVaildPrice"
  175. @ok="vaildPriceOk"></vaildPriceModal>
  176. </div>
  177. </template>
  178. <script>
  179. import { commonMixin } from '@/utils/mixin'
  180. import productActiveList from './comps/productActiveList.vue'
  181. import productNormalList from './comps/productNormalList.vue'
  182. import activeStatisticsList from './comps/activeStatisticsList.vue'
  183. import chooseProduct from './comps/chooseProduct.vue'
  184. import newPromoModal from './newPromoModal.vue'
  185. import discountSortModal from './discountSortModal.vue'
  186. import vaildPriceModal from './vaildPriceModal.vue'
  187. import { salesChangePromo } from '@/api/salesDetailNew'
  188. import {
  189. salesDetailBySn,
  190. salesPromoQueryCount,
  191. salesWriteSubmit,
  192. salesPromoQueryList,
  193. salesPromoDiscountSort,
  194. salesQueryUnPartPromo,
  195. salesPromoValidaSubmit } from '@/api/salesNew'
  196. export default {
  197. name: 'SalesNewEdit',
  198. mixins: [commonMixin],
  199. components: {
  200. productActiveList,
  201. chooseProduct,
  202. productNormalList,
  203. newPromoModal,
  204. activeStatisticsList,
  205. discountSortModal,
  206. vaildPriceModal
  207. },
  208. data () {
  209. return {
  210. spinning: false,
  211. activeList: [], // 活动列表
  212. newActiveList: [], // 新活动列表
  213. salesBillSn: null, // 销售单sn
  214. detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
  215. warehouseSn: undefined, // 仓库sn
  216. // 有价格变更前后总金额
  217. updataData: {
  218. totalRealAmount: '',
  219. totalAmount: ''
  220. },
  221. showDetail: false, // 显示详细基本信息
  222. showCpModal: false, // 添加产品弹框
  223. cpCurRefId: 'productList-active-list', // 活动产品列表ref
  224. disabledActiveOption: null, // 禁用活动选项
  225. yhDetail: null, // 优惠明细
  226. showNewActiveModal: false, // 新活动弹框
  227. salesPromoSnSet: [], // 当前勾选的活动sn
  228. showDiscountSortModal: false, // 特价活动排序弹框
  229. discountActiveList: [], // 可叠加的特价活动列表
  230. openVaildPriceModal: false, // 销售价低于成本价提示弹窗
  231. tempData: null// 销售价低于成本价 弹窗列表数据
  232. }
  233. },
  234. computed: {
  235. // 是否显示统计信息
  236. showTotal () {
  237. return this.activeList.length > 0
  238. },
  239. // 详细地址
  240. shippingAddress () {
  241. const shippingAddrProvinceName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrProvinceName ? this.detailData.salesBillExtEntity.shippingAddrProvinceName : ''
  242. const shippingAddrCityName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrCityName ? this.detailData.salesBillExtEntity.shippingAddrCityName : ''
  243. const shippingAddrCountyName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrCountyName ? this.detailData.salesBillExtEntity.shippingAddrCountyName : ''
  244. const shippingAddr = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddr ? this.detailData.salesBillExtEntity.shippingAddr : ''
  245. if (!shippingAddrProvinceName && !shippingAddrCityName && !shippingAddrCountyName && !shippingAddr) {
  246. return '--'
  247. } else {
  248. return shippingAddrProvinceName + shippingAddrCityName + shippingAddrCountyName + shippingAddr
  249. }
  250. }
  251. },
  252. methods: {
  253. // 返回
  254. handleBack () {
  255. this.$router.push({ name: 'salesQueryNewList', query: { closeLastOldTab: true } })
  256. },
  257. // 查看参与规则明细
  258. showRuleDetail (sn) {
  259. this.$refs.activeTjList.showDesc({ promoRuleSn: sn })
  260. },
  261. // 优惠明细查看
  262. getPromYhDetail () {
  263. salesPromoQueryCount({ salesBillSn: this.$route.params.sn }).then(res => {
  264. if (res.status == 200) {
  265. this.yhDetail = res.data
  266. }
  267. })
  268. },
  269. // 刷新所有第三方库存
  270. searchAllThreeStock () {
  271. // 刷新正常活动产品列表
  272. this.$refs.productNormalList.searchThreeStockOk()
  273. // 刷新所有活动产品列表
  274. if (this.activeList.length) this.$refs.productActiveList.searchThreeStockOk()
  275. },
  276. // 打开选择产品弹框,type:0 正常产品,1活动产品,2累计产品
  277. openProductModal (type, promo) {
  278. this.$refs.chooseProduct.pageInit(this.detailData, promo, type)
  279. this.showCpModal = true
  280. },
  281. // 添加产品后,关闭弹框
  282. closeProductModal (hasRefash, type) {
  283. this.showCpModal = false
  284. // 刷新产品列表和活动统计列表
  285. if (hasRefash) {
  286. this.getActiveList(false)
  287. if (type == 0) {
  288. // 刷新活动产品列表
  289. if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
  290. } else {
  291. // 刷新正常产品列表
  292. this.$refs.productNormalList.resetSearchForm()
  293. }
  294. }
  295. },
  296. // 确定新增产品到列表,
  297. // row 产品信息,promo 活动规则信息,promoProductClz 规则类型,cptype 1 添加活动产品,2 累计产品
  298. insterProduct (row, promo, promoProductClz, cptype) {
  299. this.spinning = true
  300. // 正常产品
  301. if (promoProductClz == 0) {
  302. this.$refs.productNormalList.saveNewProduct(row, promo)
  303. } else {
  304. // 活动产品对象
  305. if (cptype == 1) {
  306. if (this.activeList.length) this.$refs.productActiveList.saveNewProduct(row, promo, promoProductClz)
  307. }
  308. // 累计产品
  309. if (cptype == 2) {
  310. if (this.activeList.length) this.$refs.productActiveList.accumulateProduct(row, promo, promoProductClz)
  311. }
  312. }
  313. },
  314. // type 1 更换活动,0 参与活动
  315. upActive (params, type) {
  316. this.spinning = true
  317. salesChangePromo(params).then(res => {
  318. if (res.status == 200) {
  319. // 刷新活动统计
  320. this.getActiveList(false)
  321. if (type == 1) {
  322. // 刷新正常产品列表
  323. this.$refs.productNormalList.resetSearchForm()
  324. // 关闭活动产品页面弹窗加载状态等
  325. this.$refs.productActiveList.upAcitveSuccess()
  326. } else {
  327. this.$refs.productNormalList.addAcitveSuccess()
  328. // 刷新活动产品列表
  329. if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
  330. }
  331. }
  332. this.spinning = false
  333. })
  334. },
  335. // 提交销售单
  336. async submitResult () {
  337. const _this = this
  338. _this.spinning = true
  339. // 校验活动规则
  340. const vaildActive = await salesPromoValidaSubmit({ salesBillSn: this.salesBillSn }).then(res => res.data)
  341. const a = vaildActive.filter(item => item.type == 1) // 不可提交
  342. const d = vaildActive.filter(item => item.type == 'price_less_0') // 不可提交
  343. const b = vaildActive.filter(item => item.type == 0) // 文字提示,可跳过继续提交
  344. const c = vaildActive.filter(item => item.type == 'price_less_cost' || item.type == 'wait_up_audit_price_less_cost') // 价格校验表格提示,可跳过继续提交
  345. if (vaildActive && vaildActive.length == 0) {
  346. this.submitOrder()
  347. }
  348. // 不可提交
  349. // 弹出不符合规则弹框
  350. if (a.length > 0) {
  351. this.$info({
  352. title: '提示',
  353. centered: true,
  354. class: 'confirm-center',
  355. okText: '关闭',
  356. width: 600,
  357. content: <div style="padding-top:15px;">
  358. <ol>
  359. {a.map(item => (
  360. <li style="padding:3px 0;">{item.message}</li>
  361. ))}
  362. </ol>
  363. <div style="padding:10px 0;text-align:center"><strong>请按照以上提示修改后再提交</strong></div>
  364. </div>
  365. })
  366. _this.spinning = false
  367. return
  368. }
  369. if (d.length > 0) { // 价格校验弹框提示
  370. _this.openVaildPrice(d[0])
  371. return
  372. }
  373. // 弹出确认提示信息,可跳过继续提交
  374. if (b.length > 0) {
  375. this.$confirm({
  376. title: '提示',
  377. centered: true,
  378. class: 'confirm-center',
  379. okText: '提交',
  380. width: 600,
  381. content: <div style="padding-top:15px;">
  382. <ol>
  383. {b.map(item => (
  384. <li style="padding:3px 0;">{item.message}</li>
  385. ))}
  386. </ol>
  387. </div>,
  388. onOk () {
  389. _this.submitOrder()
  390. },
  391. onCancel () {
  392. _this.spinning = false
  393. }
  394. })
  395. return
  396. }
  397. // 价格校验弹框
  398. if (c.length > 0) {
  399. _this.openVaildPrice(c[0])
  400. } else {
  401. _this.submitOrder()
  402. }
  403. },
  404. // 校验销售价低于成本价提示
  405. openVaildPrice (data) {
  406. this.tempData = data
  407. this.openVaildPriceModal = true
  408. },
  409. // 关闭校验销售价低于成本价提示
  410. closeVaildPrice () {
  411. this.spinning = false
  412. this.tempData = null
  413. this.openVaildPriceModal = false
  414. },
  415. // 校验销售价低于成本价提示成功,关闭弹窗
  416. vaildPriceOk (type) {
  417. if (type == 'confirm') {
  418. this.submitOrder()
  419. }
  420. },
  421. // 提交销售单
  422. async submitOrder () {
  423. this.spinning = true
  424. const res = await salesWriteSubmit({ salesBillSn: this.salesBillSn })
  425. if (res.status == 200) {
  426. this.closeVaildPrice()
  427. this.handleBack()
  428. this.$message.success(res.message)
  429. }
  430. this.spinning = false
  431. },
  432. // 刷新查询列表数据
  433. getTableListData () {
  434. this.showCpModal = false
  435. // 刷新正常产品列表
  436. this.$refs.productNormalList.resetSearchForm()
  437. // 刷新活动产品列表
  438. if (this.activeList.length) {
  439. this.$refs.productActiveList.resetSearchForm()
  440. }
  441. },
  442. // 添加产品出错时
  443. tableErrorData (type, action) {
  444. this.$refs.chooseProduct.spinning = false
  445. },
  446. // 添加活动产品成功的回调,刷新产品列表
  447. // type:normal 正常列表 ,promo 活动列表
  448. // action:add 添加,del 删除,batchDel 批量删除,update 更新数据, enable 启用禁用,sort 排序
  449. // 如果添加操作,不实时刷新列表,关闭后再刷新
  450. refashTableData (type, action) {
  451. this.$refs.chooseProduct.spinning = false
  452. // 重新获取详情信息
  453. this.getOrderDetail(false)
  454. // 如果是活动产品,刷新正常产品列表
  455. if (type == 'promo') {
  456. this.$refs.productNormalList.resetSearchForm()
  457. } else if (type == 'normal') { // 如果是正常产品
  458. // 刷新活动产品列表
  459. if (this.activeList.length) {
  460. this.$refs.productActiveList.resetSearchForm()
  461. }
  462. } else {
  463. // 正常和活动列表都刷新
  464. this.getTableListData()
  465. }
  466. // 重新获取参与活动列表
  467. this.getActiveList(false)
  468. },
  469. // 获取销售单参与的活动列表,flag: true 查询产品明细列表,false 不查
  470. async getActiveList (flag) {
  471. this.spinning = true
  472. // 触发活动统计查询变量
  473. if (this.$refs.activeTjList) this.$refs.activeTjList.hasInit = false
  474. // 已参与活动列表
  475. const list = await salesPromoQueryList({ salesBillSn: this.$route.params.sn }).then(res => res.data || [])
  476. this.activeList = list.filter(item => item.promotion && item.promotionRule)
  477. this.spinning = false
  478. if (flag) {
  479. setTimeout(() => {
  480. this.getTableListData()
  481. }, 200)
  482. }
  483. },
  484. // 销售单详情 flag: true 查询活动列表,false 不查
  485. async getOrderDetail (flag) {
  486. this.spinning = true
  487. const detail = await salesDetailBySn({ salesBillSn: this.$route.params.sn }).then(res => res.data)
  488. if (detail) {
  489. this.detailData = detail
  490. this.detailData.totalDiscountAmount = Number(this.detailData.totalOrigAmount || 0) - Number(this.detailData.totalAmount || 0)
  491. }
  492. this.spinning = false
  493. if (flag) {
  494. // 获取活动列表
  495. this.getActiveList(true)
  496. }
  497. },
  498. // 获取是否有新活动,
  499. async getNewActive () {
  500. const hasNewActive = await salesQueryUnPartPromo({ salesBillSn: this.$route.params.sn, enabledFlag: '1' }).then(res => res.data)
  501. if (hasNewActive.length) {
  502. this.newActiveList = hasNewActive
  503. // 有则弹出参与新活动弹框
  504. this.showNewActiveModal = true
  505. } else {
  506. // 获取销售单详情
  507. this.getOrderDetail(true)
  508. }
  509. },
  510. // 新活动弹框确认后
  511. showNewActiveOk (type) {
  512. this.showNewActiveModal = false
  513. // 特价规则排序
  514. if (type == 1) {
  515. this.getSalesPromoDiscountSort()
  516. } else {
  517. // 取消加入新活动
  518. this.getOrderDetail(true)
  519. }
  520. },
  521. // 特价规则排序列表
  522. getSalesPromoDiscountSort () {
  523. this.spinning = true
  524. salesPromoDiscountSort({ salesBillSn: this.$route.params.sn }).then(res => {
  525. if (res.status == 200) {
  526. this.discountActiveList = res.data
  527. this.showDiscountSortModal = res.data && res.data.length > 1
  528. if (res.data && res.data.length <= 1) {
  529. this.getOrderDetail(true)
  530. }
  531. }
  532. this.spinning = false
  533. })
  534. },
  535. // 特价规则排序完成或取消排序
  536. showDiscountSortOk () {
  537. this.showDiscountSortModal = false
  538. this.getOrderDetail(true)
  539. },
  540. // 页面初始化
  541. pageInit () {
  542. this.salesBillSn = this.$route.params.sn
  543. this.warehouseSn = this.$route.params.sn ? this.$route.params.wSn : ''
  544. // 是否有新活动
  545. this.getNewActive()
  546. }
  547. },
  548. mounted () {
  549. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  550. this.pageInit()
  551. }
  552. },
  553. activated () {
  554. // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
  555. if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
  556. this.pageInit()
  557. }
  558. },
  559. beforeRouteEnter (to, from, next) {
  560. next(vm => {})
  561. }
  562. }
  563. </script>
  564. <style lang="less">
  565. .salesNewEdit-wrap{
  566. position: relative;
  567. height: 100%;
  568. padding-bottom: 65px;
  569. box-sizing: border-box;
  570. >.ant-spin-nested-loading{
  571. overflow-y: auto;
  572. height: 100%;
  573. }
  574. .salesEdit-cont{
  575. margin: 6px 0;
  576. }
  577. .redStyle{
  578. font-weight: bold;
  579. color: red;
  580. }
  581. .ellipsisCon{
  582. display: flex;
  583. justify-content: space-between;
  584. align-items: center;
  585. .ellipsisText{
  586. width: 100%;
  587. overflow: hidden;
  588. text-overflow: ellipsis;
  589. display: box;
  590. display: -webkit-box;
  591. -webkit-line-clamp: 1;
  592. -webkit-box-orient: vertical;
  593. }
  594. }
  595. .ant-card-small > .ant-card-body {
  596. padding: 0!important;
  597. }
  598. .affix-cont{
  599. padding: 6px 12px;
  600. text-align: right;
  601. display: flex;
  602. justify-content: space-between;
  603. align-items: center;
  604. .footer-price{
  605. flex-grow:1;
  606. display: flex;
  607. justify-content: flex-end;
  608. align-items: center;
  609. > div{
  610. padding: 0 15px;
  611. }
  612. .totalPrice{
  613. span{
  614. font-weight: bold;
  615. color: red;
  616. font-size: 20px;
  617. }
  618. }
  619. }
  620. }
  621. }
  622. </style>