edit.vue 23 KB

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