detail.php 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('component/order-shipping', __DIR__);
  4. ?>
  5. <style>
  6. .card-box {
  7. border: none;
  8. }
  9. .marign-b-20 {
  10. margin-bottom: 20px;
  11. }
  12. .step-box {
  13. margin-top: 10px;
  14. padding-top: 10px;
  15. }
  16. .step-inactive {
  17. position: absolute;
  18. top: 50%;
  19. left: 50%;
  20. width: 34px;
  21. height: 34px;
  22. border-radius: 50%;
  23. background-color: #e8e8e8;
  24. transform: translate(-50%, -50%);
  25. }
  26. .step-inside {
  27. position: absolute;
  28. top: 50%;
  29. left: 50%;
  30. width: 25px;
  31. height: 25px;
  32. border-radius: 50%;
  33. background-color: #cccbcb;
  34. transform: translate(-50%, -50%);
  35. text-align: center;
  36. line-height: 24px;
  37. z-index: 9;
  38. color: #fff;
  39. font-size: 12px;
  40. }
  41. .step-active {
  42. background-color: var(--primary, #fb6638);
  43. }
  44. .step-outside {
  45. background-color: transparent;
  46. }
  47. .step-box .el-step__title {
  48. font-size: 14px;
  49. }
  50. .text-item {
  51. padding: 10px 0;
  52. font-size: 12px;
  53. }
  54. .row-card-header {
  55. font-weight: 700;
  56. font-size: 14px;
  57. }
  58. .text-item > span:nth-child(1) {
  59. display: inline-block;
  60. width: 105px;
  61. padding-right: 20px;
  62. text-align: right;
  63. }
  64. .el-row-flex {
  65. display: flex;
  66. flex-flow: row wrap;
  67. }
  68. .el-row-flex .card-box {
  69. height: 100%;
  70. }
  71. .order-goods .el-table th > .cell,
  72. .order-goods .el-table {
  73. font-size: 13px;
  74. }
  75. .package-item {
  76. padding: 10px 0;
  77. font-size: 12px;
  78. }
  79. .package-item > span:nth-child(1) {
  80. display: inline-block;
  81. width: 105px;
  82. padding: 0 20px;
  83. text-align: left;
  84. }
  85. .package-item img {
  86. width: 55px;
  87. height: 55px;
  88. border-radius: 5px;
  89. margin-right: 10px;
  90. }
  91. .range-right {
  92. margin-right: 20px;
  93. }
  94. .com-order-refund-status {
  95. position: absolute;
  96. bottom: 0px;
  97. left: 0px;
  98. height: 20px;
  99. width: 50px;
  100. background-color: #FF7171;
  101. color: #fff;
  102. text-align: center;
  103. border-radius: 0 0 5px 5px;
  104. font-size: 12px;
  105. }
  106. .package .el-tab-pane {
  107. display: flex;
  108. }
  109. .package-item ::-webkit-scrollbar {
  110. width: 5px;
  111. }
  112. .el-timeline {
  113. font-size: 12px;
  114. }
  115. .com-order-count-price{
  116. float: right;
  117. margin-right: 100px;
  118. }
  119. .com-order-count-price .el-form-item{
  120. margin-bottom:0px;
  121. }
  122. </style>
  123. <div id="app" v-cloak>
  124. <el-card shadow="never" style="border: none;" body-style="background-color: #f3f3f3;padding: 10px 0 0;"
  125. v-loading="cardLoading">
  126. <div slot="header">
  127. <span>订单详情</span>
  128. </div>
  129. <el-card class="card-box step-box marign-b-20" shadow="never">
  130. <el-steps :active="stepArrActive">
  131. <el-step v-for="(item,index) in stepArr" :key="index" :title="item.title"
  132. :description="item.created_at|dateTimeFormat('Y-m-d H:i:s')">
  133. <template slot="icon">
  134. <div class="step-inactive" :class="item.is_step == 1 ? 'step-outside' : ''">
  135. <div class="step-inside" :class="item.is_step == 1 ? 'step-active' : ''">{{ index + 1 }}
  136. </div>
  137. </div>
  138. </template>
  139. </el-step>
  140. </el-steps>
  141. </el-card>
  142. <el-row :gutter="20" class="el-row-flex marign-b-20">
  143. <el-col :span="8">
  144. <el-card class="card-box" shadow="never">
  145. <div slot="header" class="clearfix row-card-header">
  146. <span>订单信息</span>
  147. </div>
  148. <div class="text-item">
  149. <span>订单状态</span><span>{{ orderDetail ? order_status_list[orderDetail.order_status] : '--' }}</span>
  150. </div>
  151. <div class="text-item">
  152. <span>订单编号</span><span>{{ orderDetail.order_no }}</span>
  153. </div>
  154. <div class="text-item">
  155. <span>交易单号</span><span>{{ orderDetail.out_trade_no || '--' }}</span>
  156. </div>
  157. <div class="text-item">
  158. <span>订单类型</span><span>普通订单</span>
  159. </div>
  160. <div class="text-item">
  161. <span>订单来源</span><span>{{marketing_type_map[orderDetail.marketing_type]? marketing_type_map[orderDetail.marketing_type] : '--' }}</span>
  162. </div>
  163. <div class="text-item">
  164. <span>支付方式</span><span>{{ payment_type_list[orderDetail.payment_type] }}</span>
  165. </div>
  166. <div class="text-item" v-if="orderDetail.shipping_type==2">
  167. <span>自提门店</span>
  168. <span>{{ store.store_name || '--' }}</span>
  169. </div>
  170. <div class="text-item">
  171. <span>卖家备注</span>
  172. <span>{{ orderDetail.seller_remark || '--' }}</span>
  173. <span><el-button type="text" size="mini" @click="handle('remark')">备注</el-button></span>
  174. </div>
  175. </el-card>
  176. </el-col>
  177. <el-col :span="8">
  178. <el-card class="card-box " shadow="never">
  179. <div slot="header" class="clearfix row-card-header">
  180. <span>买家及收货信息</span>
  181. </div>
  182. <div class="text-item">
  183. <span>买家</span><span>{{ orderDetail.base_user.nickname }}</span>
  184. </div>
  185. <div class="text-item">
  186. <span>买家备注</span><span>{{ orderDetail.remark || '--' }}</span>
  187. </div>
  188. <div class="text-item">
  189. <span>配送方式</span><span>{{ shipping_type_list[orderDetail.shipping_type] }}</span>
  190. </div>
  191. <template v-if="orderDetail.shipping_type!=2">
  192. <div class="text-item">
  193. <span>收货人</span><span>{{ orderDetail.receiver_name || '--' }}</span>
  194. </div>
  195. <div class="text-item">
  196. <span>收货地址</span><span>{{ orderDetail.region_name }} {{ orderDetail.address }}</span>
  197. </div>
  198. <div class="text-item">
  199. <span>手机号码</span><span>{{ orderDetail.mobile }}</span>
  200. </div>
  201. </template>
  202. </el-card>
  203. </el-col>
  204. <el-col :span="8">
  205. <el-card class="card-box" shadow="never">
  206. <div slot="header" class="clearfix row-card-header">
  207. <span>结算信息</span>
  208. </div>
  209. <div class="text-item">
  210. <span>商品小计</span>
  211. <span>¥{{orderDetail.goods_price}}</span>
  212. </div>
  213. <div class="text-item">
  214. <template v-if="orderDetail.shipping_type==1">
  215. <span>快递费¥</span>
  216. <span>¥{{orderDetail.shipping_money}}</span>
  217. </template>
  218. <template v-if="orderDetail.shipping_type==3">
  219. <span>配送费¥</span>
  220. <span>¥{{orderDetail.shipping_money}}</span>
  221. </template>
  222. </div>
  223. <div class="text-item" v-if="orderDetail.score_money > 0">
  224. <span>积分抵扣</span>
  225. <span>- ¥{{orderDetail.score_money}}</span>
  226. </div>
  227. <div class="text-item" v-if="orderDetail.coupon_money > 0">
  228. <span>优惠券抵扣</span>
  229. <span>¥{{orderDetail.coupon_money}}</span>
  230. </div>
  231. <div class="text-item">
  232. <span>实付款</span>
  233. <span>¥{{orderDetail.pay_money}}</span>
  234. </div>
  235. </el-card>
  236. </el-col>
  237. </el-row>
  238. <el-card class="card-box marign-b-20" shadow="never">
  239. <div slot="header" class="clearfix row-card-header">
  240. <span>商品信息</span>
  241. </div>
  242. <div v-if="orderDetail.detail" class="order-goods">
  243. <el-table :data="orderDetail.detail" style="width: 100%;"
  244. :header-cell-style="{background:'#F7F7F7','border-bottom': 0}">
  245. <el-table-column label="明细id" width="100">
  246. <template slot-scope="scope">
  247. <div>{{ scope.row.id }}
  248. </div>
  249. </template>
  250. </el-table-column>
  251. <el-table-column label="商品id" width="100">
  252. <template slot-scope="scope">
  253. <div>{{ scope.row.goods_id }}
  254. </div>
  255. </template>
  256. </el-table-column>
  257. <el-table-column label="商品" width="260">
  258. <template slot-scope="scope">
  259. <div style="position: relative;display: flex;align-items: center;">
  260. <el-image style="width: 66px; height: 50px;border-radius: 5px;"
  261. :src="scope.row.pic_url"></el-image>
  262. <span v-if="repeal_list[scope.row.is_feedback]" class="com-order-refund-status">{{ repeal_list[scope.row.is_feedback] }}</span>
  263. <com-ellipsis :line="2" style="margin-left: 10px;">
  264. {{ scope.row.goods_name }}
  265. </com-ellipsis>
  266. </div>
  267. </template>
  268. </el-table-column>
  269. <el-table-column label="单价" width="210">
  270. <template slot-scope="scope">
  271. <div>{{ getOrderPrice(scope.row) }}
  272. <span v-if="scope.row.adjust_money != 0">(调价:¥{{ scope.row.adjust_money }})</span>
  273. </div>
  274. </template>
  275. </el-table-column>
  276. <el-table-column label="购买数量" width="210">
  277. <template slot-scope="scope">
  278. <div>{{ scope.row.num }}</div>
  279. </template>
  280. </el-table-column>
  281. <el-table-column label="优惠" width="210">
  282. <template slot-scope="scope">
  283. <div>¥{{(scope.row.original_goods_price - scope.row.goods_price - orderDetail.score_money).toFixed(2)}}</div>
  284. </template>
  285. </el-table-column>
  286. <el-table-column label="小计" width="210">
  287. <template slot-scope="scope">
  288. <div>{{ getOrderPrice(orderDetail) }}</div>
  289. </template>
  290. </el-table-column>
  291. <el-table-column label="状态">
  292. <template slot-scope="scope">
  293. <div>{{ order_status_list[scope.row.order_status] }}</div>
  294. </template>
  295. </el-table-column>
  296. </el-table>
  297. </div>
  298. </el-card>
  299. <el-card v-if="orderDetail.express.length > 0" class="card-box marign-b-20" shadow="never">
  300. <div slot="header" class="clearfix row-card-header">
  301. <span>物流包裹</span>
  302. </div>
  303. <template>
  304. <el-tabs class="package" v-model="activePackage" type="card">
  305. <template v-for="(item,index) in orderDetail.express">
  306. <el-tab-pane :label="'包裹'+(index+1)" :key="index">
  307. <el-row style="width: 100%;">
  308. <el-col :span="24">
  309. <div class="package-item">
  310. <span>发货方式:</span><span
  311. class="text-color-primary">{{send_type[item.shipping_type]}}</span>
  312. </div>
  313. <div class="package-item">
  314. <span>发货人:</span><span>{{item.operator_username}}</span>
  315. </div>
  316. <div class="package-item">
  317. <span>发货时间:</span><span>{{ item.created_at|dateTimeFormat('Y-m-d H:i:s')}}</span>
  318. </div>
  319. <div class="package-item">
  320. <span>运单编号:</span><span v-if="item.express_no" class="range-right">{{item.express_no}}</span>
  321. <el-button
  322. v-if="orderDetail && orderDetail.order_status == 2 && item.created_at == item.updated_at"
  323. type="text" @click="handle('shipping', item)" style="padding: 0px;">修改物流
  324. </el-button>
  325. </div>
  326. <div class="package-item" flex="dir:left">
  327. <span style="line-height: 50px;">包裹商品:</span>
  328. <ul flex="dir:left cross:center" style="with=100%;overflow-y:auto;">
  329. <template v-for="val in (JSON.parse(item.order_detail_ids))">
  330. <li><el-image :src="goodDetails[val].pic_url"></el-image></li>
  331. <li class="range-right" style="width: 150px;padding-bottom:5px">
  332. <com-ellipsis :line="1" :text="goodDetails[val].goods_name"></com-ellipsis>
  333. 数量:<span style="color: red">{{goodDetails[val].num}}</span>
  334. <com-ellipsis :line="1">
  335. <template v-if="goodDetails[val].attr_list && goodDetails[val].attr_list.length > 0">
  336. <template v-for="(attrItem, attrIndex) in goodDetails[val].attr_list" size="small">
  337. {{ attrItem }}
  338. </template>
  339. </template>
  340. </com-ellipsis>
  341. </li>
  342. </template>
  343. </ul>
  344. </div>
  345. <div class="package-item">
  346. <span>商家备注:</span><span class="range-right">{{item.memo}}</span>
  347. </div>
  348. <div class="package-item" style="width:100%;">
  349. <span>物流状态:</span>
  350. <span class="text-color-success">{{item.now_state?item.now_state:'暂无物流信息'}}</span>
  351. <div v-if="item.express_log && item.express_log.length > 0" style="padding: 20px;font-size: 12px">
  352. <div style="padding: 2px;height:200px;overflow-y:auto;">
  353. <div>
  354. <el-timeline>
  355. <el-timeline-item
  356. v-for="(express_log, val) in item.express_log"
  357. :key="val"
  358. :size="normal"
  359. :color="val==0?'#409eff':''"
  360. :timestamp="express_log.AcceptTime">
  361. {{express_log.AcceptStation}}
  362. </el-timeline-item>
  363. </el-timeline>
  364. </div>
  365. </div>
  366. </div>
  367. </div>
  368. </el-col>
  369. </el-row>
  370. </el-tab-pane>
  371. </template>
  372. </el-tabs>
  373. </template>
  374. </el-card>
  375. <el-card v-if="orderAction.length > 0" class="card-box marign-b-20" shadow="never">
  376. <div slot="header" class="clearfix row-card-header">
  377. <span>订单操作日志</span>
  378. </div>
  379. <el-table :data="orderAction" v-loading="logLoading" style="width: 100%;" size="small" stripe>
  380. <el-table-column prop="member_name" label="用户" width="90">
  381. <template slot-scope="scope">
  382. <div>{{ scope.row.member_name }}</div>
  383. </template>
  384. </el-table-column>
  385. <el-table-column prop="created_at" label="操作时间" width="160">
  386. <template slot-scope="scope">
  387. <div>{{ scope.row.created_at|dateTimeFormat('Y-m-d H:i:s') }}</div>
  388. </template>
  389. </el-table-column>
  390. <el-table-column prop="action" label="详情">
  391. <template slot-scope="scope">
  392. <div>{{ scope.row.action }}</div>
  393. </template>
  394. </el-table-column>
  395. </el-table>
  396. </el-card>
  397. <el-card v-if="orderDetail">
  398. <el-button type="primary" v-if="orderDetail.order_status == 1" size="small"
  399. @click="handle('shipping', orderDetail)">发货
  400. </el-button>
  401. <el-button type="primary" v-if="orderDetail.order_status == 2" size="small"
  402. @click="handle('take-delivery', orderDetail)">确认收货
  403. </el-button>
  404. <el-button type="primary" v-if="orderDetail.order_status == 3" size="small"
  405. @click="handle('sales', orderDetail)">订单完成
  406. </el-button>
  407. </el-card>
  408. </el-card>
  409. <!-- 修改物流发货 -->
  410. <order-shipping :is_show="isShowChangeShipping" :change-shipping-loading="changeShippingLoading"
  411. :order_info="orderDetail" :shipping_form="shipping_form" @submit="handleShipping"
  412. @close="isShowChangeShipping = false"></order-shipping>
  413. <!-- 商家备注 -->
  414. <el-dialog title="商家备注" width="600px" :visible.sync="isShowRemark">
  415. <el-form :model="remark_form" label-width="80px" size="small">
  416. <el-form-item label="备注" prop="seller_remark">
  417. <el-input type="textarea" v-model="remark_form.seller_remark"></el-input>
  418. </el-form-item>
  419. </el-form>
  420. <div slot="footer" class="dialog-footer">
  421. <el-button @click="isShowRemark = false">取 消</el-button>
  422. <el-button type="primary" @click="handle('remark',remark_form,true)" :loading="remarkLoading">确 定</el-button>
  423. </div>
  424. </el-dialog>
  425. </div>
  426. <script>
  427. const app = new Vue({
  428. el: '#app',
  429. data() {
  430. return {
  431. id: 0,
  432. count: 6,
  433. detail: {},
  434. store: {},
  435. isShowChangeShipping: false,
  436. changeShippingLoading: false,
  437. remarkLoading: false,
  438. isShowRemark: false,
  439. shipping_form: {},
  440. remark_form: {
  441. seller_remark: null,
  442. },
  443. activePackage: '0',
  444. cardLoading: false,
  445. logLoading: false,
  446. goodDetails: [],
  447. orderAction: [],
  448. repeal_list: {
  449. '1': '售后中',
  450. '2': '售后完成',
  451. },
  452. marketing_type_map:{},
  453. stepArr: [],
  454. stepArrActive: 0,
  455. orderDetail: {
  456. base_user: {},
  457. express: []
  458. },
  459. orderExpress: [],
  460. order_status_list: {
  461. '0': "待付款",
  462. '1': "待发货",
  463. '2': "已发货",
  464. '3': "已收货",
  465. '4': "已完成",
  466. '-1': "售后申请",
  467. '-2': "退款中",
  468. '-3': "售后完成",
  469. '-4': "已关闭",
  470. '-5': "撤销申请",
  471. },
  472. payment_type_list: {
  473. '0': "在线支付",
  474. '1': "微信",
  475. '2': "支付宝",
  476. '3': "银联卡",
  477. '5': "余额支付",
  478. '7': "汇聚支付",
  479. '8': "汇聚快捷支付",
  480. '100': "线下支付"
  481. },
  482. shipping_type_list: {
  483. '1': "物流配送",
  484. '2': "买家自提",
  485. '3': "货到付款",
  486. '4': "本地配送"
  487. },
  488. send_type: {
  489. '0': "无需物流",
  490. '1': "快递",
  491. },
  492. activities: [{
  493. content: '支持使用图标',
  494. timestamp: '2018-04-12 20:46',
  495. size: 'normal',
  496. color: '#409eff'
  497. }, {
  498. content: '支持自定义颜色',
  499. timestamp: '2018-04-03 20:46',
  500. }, {
  501. content: '支持自定义尺寸',
  502. timestamp: '2018-04-03 20:46',
  503. size: 'large'
  504. }, {
  505. content: '默认样式的节点',
  506. timestamp: '2018-04-03 20:46'
  507. }, {
  508. content: '默认样式的节点',
  509. timestamp: '2018-04-03 20:46'
  510. }, {
  511. content: '默认样式的节点',
  512. timestamp: '2018-04-03 20:46'
  513. }, {
  514. content: '默认样式的节点',
  515. timestamp: '2018-04-03 20:46'
  516. }, {
  517. content: '默认样式的节点',
  518. timestamp: '2018-04-03 20:46'
  519. }],
  520. };
  521. },
  522. created() {
  523. this.id = getQuery('id');
  524. },
  525. mounted() {
  526. this.getDetail();
  527. },
  528. methods: {
  529. load() {
  530. // this.count += 2
  531. },
  532. handleShipping(data) {
  533. this.handle('shipping', data, true);
  534. },
  535. getDetail() {
  536. let self = this;
  537. self.cardLoading = true;
  538. request({
  539. params: {
  540. r: 'mch/client/order/detail',
  541. id: self.id
  542. },
  543. method: 'get',
  544. }).then(e => {
  545. self.cardLoading = false;
  546. if (e.data.code == 0) {
  547. var data = e.data.data;
  548. self.orderDetail = data.order;
  549. self.store = data.store;
  550. self.orderAction = data.order_action;
  551. Object.keys(self.orderDetail.detail).forEach(function (item) {
  552. self.goodDetails[self.orderDetail.detail[item].id] = self.orderDetail.detail[item];
  553. });
  554. self.order_status_list = data.order_status_list;
  555. self.stepArr = data.stepArr;
  556. self.marketing_type_map = data.marketing_type_map;
  557. self.payment_type_list = data.payment_type_list;
  558. self.shipping_type_list = data.shipping_type_list;
  559. self.remark_form.seller_remark = self.orderDetail.seller_remark;
  560. if (!isEmpty(data.step_arr)) self.getStepArr(data.step_arr, data.order);
  561. } else {
  562. self.$message.error(e.data.msg);
  563. }
  564. }).catch(e => {
  565. console.log(e);
  566. });
  567. },
  568. getStepArr(stepArr, order) {
  569. var newStepArr = [];
  570. var index = 0;
  571. stepArr.forEach(function (item) {
  572. let step = {};
  573. var field_key = item.field;
  574. step['title'] = item.title;
  575. step['created_at'] = order[field_key];
  576. step['is_step'] = order[field_key] ? 1 : 0;
  577. newStepArr.push(step);
  578. if (step['is_step'] == 1) index++;
  579. });
  580. this.stepArrActive = index;
  581. this.stepArr = newStepArr;
  582. },
  583. handle(type, data = null, submit = false) {
  584. let id = data ? parseInt(data.id) : '';
  585. let url = 'mch/client/order/operate'
  586. switch (type) {
  587. // 订单详情
  588. case 'detail':
  589. let params = {
  590. r: 'mch/client/order/detail'
  591. };
  592. if (id) params = Object.assign(params, {
  593. id: id
  594. });
  595. navigateTo(params);
  596. break;
  597. // 删除订单
  598. case 'destroy':
  599. param = {
  600. id: data.id,
  601. type
  602. };
  603. this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {
  604. type: 'warning'
  605. }).then(() => {
  606. this.send(param)
  607. }).catch((err) => {
  608. })
  609. break;
  610. // 取消订单
  611. case 'cancel':
  612. param = {
  613. id: id
  614. };
  615. this.$confirm('确定关闭订单吗?', '警告', {
  616. type: 'warning'
  617. }).then(() => {
  618. this.send('mch/client/order/close', param)
  619. }).catch((err) => {
  620. })
  621. break;
  622. // 修改订单价格
  623. case 'change_price':
  624. if (submit) {
  625. this.changePriceLoading = true;
  626. this.send('mch/client/order/change-price', this.change_price_form, (resp) => {
  627. if (resp.code == 0) this.isShowChangePrice = false;
  628. });
  629. setTimeout(() => {
  630. this.changePriceLoading = false;
  631. }, 100);
  632. } else {
  633. this.isShowChangePrice = true
  634. var objString = JSON.stringify(data);
  635. this.change_price_form = JSON.parse(objString);
  636. }
  637. break;
  638. // 修改收货地址
  639. case 'change_address':
  640. if (submit) {
  641. this.changeAddressLoading = true;
  642. this.send('mch/client/order/change-address', data, (resp) => {
  643. if (resp.code == 0) this.isShowChangeAddress = false;
  644. });
  645. setTimeout(() => {
  646. this.changeAddressLoading = false;
  647. }, 100);
  648. } else {
  649. this.isShowChangeAddress = true
  650. var objString = JSON.stringify(data);
  651. this.change_address_form = JSON.parse(objString);
  652. }
  653. break;
  654. // 订单备注
  655. case 'remark':
  656. if (submit) {
  657. this.remarkLoading = true;
  658. this.remark_form.id = this.id;
  659. this.send('mch/client/order/remark', this.remark_form, (resp) => {
  660. if (resp.code == 0) this.isShowRemark = false;
  661. });
  662. setTimeout(() => {
  663. this.remarkLoading = false;
  664. }, 100);
  665. } else {
  666. this.isShowRemark = true
  667. }
  668. break;
  669. // 物流发货
  670. case 'shipping':
  671. if (submit) {
  672. this.changeShippingLoading = true;
  673. this.send('mch/client/order/shipping', data, (resp) => {
  674. if (resp.code == 0) this.isShowChangeShipping = false;
  675. });
  676. setTimeout(() => {
  677. this.changeShippingLoading = false;
  678. }, 100);
  679. } else {
  680. this.isShowChangeShipping = true
  681. var objString = JSON.stringify(data);
  682. this.shipping_form = JSON.parse(objString);
  683. }
  684. break;
  685. // 收货
  686. case 'take-delivery':
  687. param = {
  688. id: id
  689. };
  690. this.$confirm('确定收货吗?', '警告', {
  691. type: 'warning'
  692. }).then(() => {
  693. this.send('mch/client/order/take-delivery', param)
  694. }).catch((err) => {
  695. })
  696. break;
  697. // 订单完成
  698. case 'sales':
  699. param = {
  700. id: id
  701. };
  702. this.$confirm('确定完成订单吗?', '警告', {
  703. type: 'warning'
  704. }).then(() => {
  705. this.send('mch/client/order/sales-order', param)
  706. }).catch((err) => {
  707. })
  708. break;
  709. }
  710. },
  711. send(url, params, callback) {
  712. let self = this;
  713. request({
  714. params: {
  715. r: url,
  716. },
  717. method: 'post',
  718. data: params
  719. }).then(e => {
  720. if (e.data.code == 0) {
  721. self.$message.success(e.data.msg);
  722. self.getDetail();
  723. } else {
  724. self.$message.error(e.data.msg);
  725. }
  726. if (callback) callback(e.data);
  727. }).catch(e => {
  728. console.log(e);
  729. });
  730. },
  731. format(num){
  732. return num.toFixed(2);
  733. },
  734. getOrderPrice(data){
  735. let text = '';
  736. switch (data.marketing_type) {
  737. case 'ScoreMall' :
  738. text = data.extra_info;
  739. break;
  740. default :
  741. text = '¥'+data.goods_price;
  742. }
  743. return text;
  744. },
  745. }
  746. });
  747. </script>