detail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. <template>
  2. <view class="app-content">
  3. <!-- <stepStatus-->
  4. <!-- v-if="!$util.isEmpty(detailInfo)"-->
  5. <!-- :stepOptions="detailInfo.progress"-->
  6. <!-- ></stepStatus>-->
  7. <view v-if="!$util.isEmpty(detailInfo)" class="info-content_box">
  8. <view class="title">
  9. 客户
  10. </view>
  11. <view class="address-des_bx content-box">
  12. <view>
  13. <view> {{ detailInfo.customName }} {{ detailInfo.customMobile }} </view>
  14. <view class="">
  15. {{ detailInfo.customAddress}}
  16. </view>
  17. </view>
  18. <view>
  19. <i
  20. @click="callUp(detailInfo.customMobile)"
  21. class="iconfont icondianhua1"
  22. ></i>
  23. </view>
  24. </view>
  25. <view class="title">
  26. 单据信息
  27. </view>
  28. <view class="bills-info_box content-box">
  29. <view class="order-info_box">
  30. <view>日期:</view>
  31. <view>{{ detailInfo.addTime }}</view>
  32. </view>
  33. <view class="order-info_box">
  34. <view>单号编码:</view>
  35. <view>{{ detailInfo.orderSn }}</view>
  36. <view class="price">
  37. <button
  38. @click="copy(detailInfo.orderSn)"
  39. class="admin-button-com default"
  40. >
  41. 复制
  42. </button>
  43. </view>
  44. </view>
  45. <view class="order-info_box">
  46. <view>销售人员:</view>
  47. <view>{{ detailInfo.adminName }}</view>
  48. </view>
  49. <!-- <view class="order-info_box">
  50. <view>销售部门:</view>
  51. <view>2020 11-22</view>
  52. </view> -->
  53. <view class="order-info_box">
  54. <view>出货日期:</view>
  55. <view>{{ detailInfo.outTime }}</view>
  56. </view>
  57. <view class="order-info_box">
  58. <view>欠款:</view>
  59. <view>{{ detailInfo.debt==1?'是':'-' }}</view>
  60. </view>
  61. <view class="order-info_box">
  62. <view>订单状态:</view>
  63. <view>{{ detailInfo.status==1?'待付款':detailInfo.status==2?'待发货':detailInfo.status==3?'待收货':detailInfo.status==4?'已完成':detailInfo.status==5?'已取消':'已退款' }}</view>
  64. </view>
  65. <!-- <view class="order-info_box">
  66. <view>销售门店:</view>
  67. <view>2020 11-22</view>
  68. </view> -->
  69. </view>
  70. <view class="content-box shipping-address" v-if="detailInfo.expressProgress!=''">
  71. <view> 配送进展:<text>{{ detailInfo.expressProgress.progressName }}</text> </view>
  72. <i class="iconfont iconqishouyinying"></i>
  73. </view>
  74. <view class="title">
  75. 商品信息
  76. </view>
  77. <view class="module-com content-box">
  78. <view class="commodity-view">
  79. <view class="commodity-list">
  80. <view
  81. v-for="(s, idx) in detailInfo.product"
  82. :key="idx"
  83. class="commodity-item"
  84. >
  85. <image class="item-icon" :src="s.cover" alt="商品图片" />
  86. <view class="item-info">
  87. <view class="info-line">
  88. <text class="item-name">{{ s.name }}</text>
  89. <text class="item-price">
  90. <text class="unit">¥</text>
  91. <text class="price">{{ s.price }}</text>
  92. </text>
  93. </view>
  94. <view class="info-line">
  95. <text class="item-type">{{ s.property }}</text>
  96. <text class="item-count">{{ `${s.bigNum}/${s.smallNum}` }}</text>
  97. </view>
  98. </view>
  99. </view>
  100. </view>
  101. <view class="summary-bar">
  102. <view class="operate-view" ></view>
  103. <view class="describe-view">
  104. 共{{ detailInfo.productStat.kind || 0 }}种, 共{{ detailInfo.productStat.bigNum }}扎{{
  105. detailInfo.productStat.smallNun}}支,合计 ¥<text class="price">{{ detailInfo.productStat.totalPrice }}</text>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. <view class="content-box price-detail">
  111. <div class="module-com input-line-wrap">
  112. <tui-list-cell class="line-cell" :hover="false">
  113. <div class="tui-title">运费</div>
  114. <div class="detail-price_box">¥{{ detailInfo.sendCost }}</div>
  115. </tui-list-cell>
  116. <tui-list-cell class="line-cell" :hover="false">
  117. <div class="tui-title">总金额</div>
  118. <div class="detail-price_box red">¥{{ detailInfo.totalPrice || 0 }}</div>
  119. </tui-list-cell>
  120. </div>
  121. </view>
  122. <view class="content-box price-detail">
  123. <div class="module-com input-line-wrap">
  124. <tui-list-cell class="line-cell" :hover="false">
  125. <div class="tui-title">备注</div>
  126. <input
  127. :disabled="true"
  128. v-model="detailInfo.remark"
  129. placeholder-class="phcolor"
  130. class="tui-input"
  131. name="name"
  132. maxlength="50"
  133. type="text"
  134. />
  135. </tui-list-cell>
  136. </div>
  137. </view>
  138. </view>
  139. <div class="app-footer">
  140. <template v-for="s in detailInfo.buttonList">
  141. <button
  142. :key="s.type"
  143. @click="openBt(s, detailInfo)"
  144. v-if="s.show == 1"
  145. :disabled="s.disable === 1"
  146. class="admin-button-com default" :class="s.disable === 1?'active':''">
  147. {{ s.type === "item" ? "改花材" : s.type === "selfGet" ? "自取" :s.type === "print" ? "打印" :s.type === "debtPay" ? "延期收款" :s.type === "hasPay" ? "已收款" : "发货" }}
  148. </button>
  149. </template>
  150. <!-- <button-->
  151. <!-- @click="pageTo({-->
  152. <!-- url:'/pagesOrder/print'-->
  153. <!-- })"-->
  154. <!-- class="admin-button-com default">-->
  155. <!-- 打印-->
  156. <!-- </button>-->
  157. </div>
  158. <!-- 免发货弹窗 -->
  159. <modal-module
  160. :show="freeShipModal"
  161. @cancel="modalCancel"
  162. @click="freeShipModalClick"
  163. content="确认已自取?"
  164. color="#333"
  165. :size="32"
  166. padding="30rpx 30rpx"
  167. ></modal-module>
  168. </view>
  169. </template>
  170. <script>
  171. import stepStatus from "./components/stepStatus";
  172. import TuiListCell from "@/components/plugin/list-cell";
  173. import { getDetail,debtPay,hasPay, freeShipping } from "@/api/order/index";
  174. import productMins from "@/mixins/product";
  175. import { ORDER_STATUS } from "@/utils/declare";
  176. export default {
  177. name: "orderDetail",
  178. components: {
  179. stepStatus,
  180. TuiListCell
  181. },
  182. mixins: [productMins],
  183. data() {
  184. return {
  185. ORDER_STATUS,
  186. pageType: "order_change",
  187. autoLoad: false,
  188. stepActive: 0,
  189. form: {
  190. name: ""
  191. },
  192. detailInfo: {},
  193. freeShipModal: false,
  194. loading: false
  195. };
  196. },
  197. onShow() {
  198. this.init();
  199. },
  200. methods: {
  201. freeShipModalClick(e) {
  202. if (e.index === 0) {
  203. this.modalCancel();
  204. } else {
  205. freeShipping({ id: this.detailInfo.id }).then(res => {
  206. this.init();
  207. this.$msg("操作成功!");
  208. this.modalCancel();
  209. });
  210. }
  211. },
  212. modalCancel() {
  213. this.freeShipModal = false;
  214. },
  215. openBt(s, item) {
  216. // 花材
  217. if (s.type === "item") {
  218. this.gotoSelect();
  219. // 自取
  220. } else if (s.type === "selfGet") {
  221. this.freeShipModal = true;
  222. // this.operateData = item;
  223. //打印
  224. } else if (s.type === "print") {
  225. this.pageTo({url: "/pagesOrder/print",query: {id: item.id}});
  226. //发货
  227. } else if (s.type === "send") {
  228. this.pageTo({url: "/pagesOrder/ship",query: {id: item.id}});
  229. }else if (s.type === "debtPay") {
  230. let self = this;
  231. //延期收款
  232. uni.showModal({
  233. content: '您确认要延期收款',
  234. success: function (res) {
  235. if (res.confirm) {
  236. return debtPay({ id: self.option.id }).then(res => {
  237. console.log(res)
  238. uni.showToast({title:'操作成功!',icon:'none'})
  239. self.init();
  240. })
  241. }
  242. }
  243. });
  244. // this.pageTo({url: "/pagesOrder/ship",query: {id: item.id}});
  245. }else if (s.type === "hasPay") {
  246. let self = this;
  247. //已收款
  248. uni.showModal({
  249. content: '您确认已收款',
  250. success: function (res) {
  251. if (res.confirm) {
  252. return hasPay({ id: self.option.id }).then(res => {
  253. uni.showToast({title:'操作成功!',icon:'none'})
  254. self.init();
  255. })
  256. }
  257. }
  258. });
  259. // this.pageTo({url: "/pagesOrder/ship",query: {id: item.id}});
  260. }
  261. },
  262. copy(val) {
  263. const self = this;
  264. uni.setClipboardData({
  265. data: val,
  266. success: function() {
  267. self.$msg("复制成功");
  268. }
  269. });
  270. },
  271. callUp(mobile) {
  272. uni.makePhoneCall({
  273. phoneNumber: mobile
  274. });
  275. },
  276. async init() {
  277. try {
  278. if (this.loading) {
  279. return new Promise.reject();
  280. }
  281. this.loading = true;
  282. const res = await getDetail({
  283. id: this.option.id
  284. });
  285. this.detailInfo = res.data;
  286. const { product } = this.detailInfo;
  287. if (product) {
  288. this.setSelectInfoByType({
  289. type: this.pageType,
  290. info: product.map(ele => {
  291. return {
  292. ...ele,
  293. bigCount: Number(ele.bigNum),
  294. smallCount: Number(ele.smallNum)
  295. };
  296. })
  297. });
  298. }
  299. } catch {
  300. } finally {
  301. this.loading = false;
  302. }
  303. },
  304. gotoSelect() {
  305. uni.navigateTo({url: `/pagesOrder/select?id=${this.detailInfo.id}`});
  306. }
  307. }
  308. };
  309. </script>
  310. <style lang="scss" scoped>
  311. .info-content_box {
  312. padding: 0 20upx 100upx;
  313. & > .title {
  314. color: #666666;
  315. font-size: 28upx;
  316. font-weight: 600;
  317. padding: 30upx 3upx;
  318. }
  319. & .address-des_bx {
  320. display: flex;
  321. padding: 20upx 10upx 30upx 20upx;
  322. & > view:nth-child(1) {
  323. flex: 1;
  324. margin-top: 10upx;
  325. & > view:nth-child(1) {
  326. color: #333333;
  327. font-size: 32upx;
  328. font-weight: bold;
  329. }
  330. & > view:nth-child(2) {
  331. color: #666666;
  332. font-size: 28upx;
  333. font-weight: 400;
  334. margin-top: 20upx;
  335. }
  336. }
  337. & > view:nth-child(2) {
  338. display: flex;
  339. & .icondianhua1 {
  340. font-size: 44upx;
  341. color: #3385ff;
  342. margin-left: 10upx;
  343. }
  344. }
  345. }
  346. .bills-info_box {
  347. padding: 30upx 20upx 30upx;
  348. // border-bottom: 1px solid #EEEEEE;
  349. & > .order-info_box {
  350. display: flex;
  351. align-items: center;
  352. font-size: 26upx;
  353. font-weight: 400;
  354. margin-bottom: 5upx;
  355. & > view:nth-child(1) {
  356. color: #999999;
  357. width: 135upx;
  358. text-align: right;
  359. }
  360. & > view:nth-child(2) {
  361. color: #333333;
  362. }
  363. & > .price {
  364. flex: 1;
  365. font-size: 30upx;
  366. color: #333333;
  367. display: flex;
  368. align-items: center;
  369. justify-content: flex-end;
  370. & .iconxiangyou {
  371. color: #999999;
  372. font-size: 25upx;
  373. margin-left: 12upx;
  374. }
  375. }
  376. }
  377. }
  378. .content-box {
  379. background-color: #ffffff;
  380. border-radius: 10upx;
  381. }
  382. .commodity-view {
  383. display: flex;
  384. flex-direction: column;
  385. .commodity-list {
  386. padding: 20upx;
  387. .commodity-item {
  388. display: flex;
  389. margin-bottom: 20upx;
  390. .item-icon {
  391. flex-shrink: 0;
  392. width: 140upx;
  393. height: 140upx;
  394. }
  395. .item-info {
  396. display: flex;
  397. flex-direction: column;
  398. justify-content: center;
  399. flex: 1;
  400. margin-left: 20upx;
  401. .info-line {
  402. margin-bottom: 20upx;
  403. display: flex;
  404. justify-content: space-between;
  405. align-items: flex-end;
  406. .item-name {
  407. color: #666;
  408. font-size: 28upx;
  409. }
  410. .item-price {
  411. color: #333;
  412. font-size: 22upx;
  413. .price {
  414. font-size: 32upx;
  415. font-weight: bold;
  416. }
  417. }
  418. .item-type {
  419. color: #999;
  420. font-size: 24upx;
  421. }
  422. .item-count {
  423. color: #666;
  424. font-size: 24upx;
  425. }
  426. }
  427. }
  428. }
  429. }
  430. .summary-bar {
  431. padding: 0 20upx;
  432. height: 90upx;
  433. display: flex;
  434. align-items: center;
  435. justify-content: space-between;
  436. border-top: 1px solid #eeeeee;
  437. .operate-view {
  438. display: flex;
  439. align-items: center;
  440. color: #3385ff;
  441. font-size: 26upx;
  442. .iconfont {
  443. margin-right: 20upx;
  444. font-size: 40upx;
  445. }
  446. }
  447. .describe-view {
  448. display: flex;
  449. align-items: center;
  450. color: #333;
  451. font-size: 24upx;
  452. .price {
  453. font-weight: bold;
  454. font-size: 36upx;
  455. }
  456. }
  457. }
  458. }
  459. .shipping-address {
  460. display: flex;
  461. align-items: center;
  462. margin-top: 20upx;
  463. & > view:nth-child(1) {
  464. color: #999999;
  465. font-size: 28upx;
  466. font-weight: 400;
  467. display: inline-block;
  468. padding: 30upx 0 30upx 20upx;
  469. flex: 1;
  470. & > text {
  471. color: #333333;
  472. font-weight: 600;
  473. }
  474. }
  475. & > view:nth-child(2) {
  476. font-size: 60upx;
  477. color: #d6e7ff;
  478. margin-right: 10upx;
  479. }
  480. }
  481. .price-detail {
  482. margin-top: 20upx;
  483. margin-bottom: 20upx;
  484. }
  485. .detail-price_box {
  486. color: #333333;
  487. font-size: 22upx;
  488. text-align: right;
  489. flex: 1;
  490. font-weight: 600;
  491. &.red {
  492. color: #ff2842;
  493. }
  494. }
  495. }
  496. .app-footer {
  497. display: flex;
  498. align-items: center;
  499. justify-content: flex-end;
  500. & .admin-button-com {
  501. padding: 0;
  502. margin-right: 15upx;
  503. width: 140upx;
  504. height: 70upx;
  505. line-height: 70upx;
  506. text-align: center;
  507. color: #3385ff;
  508. border: 1px solid #3385ff;
  509. &.active{
  510. color: #666666;
  511. border: 1px solid #ccc;
  512. }
  513. }
  514. }
  515. </style>