reserve-detail.php 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803
  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 && orderDetail.reserve ? reserve_status[orderDetail.reserve.reserve_status].title : '--' }}</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>
  159. <span>
  160. 预约订单
  161. </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">
  167. <span>卖家备注</span>
  168. <span>{{ orderDetail.seller_remark || '--' }}</span>
  169. <span><el-button type="text" size="mini" @click="handle('remark')">备注</el-button></span>
  170. </div>
  171. <div class="text-item" v-if="orderDetail.is_user_handle_finish == 1">
  172. <span>订单标识</span>
  173. <span>放弃退换货</span>
  174. </div>
  175. <div class="text-item">
  176. <span>创建方式</span><span>{{ orderDetail.create_type_text }}</span>
  177. </div>
  178. </el-card>
  179. </el-col>
  180. <el-col :span="8">
  181. <el-card class="card-box " shadow="never">
  182. <div slot="header" class="clearfix row-card-header">
  183. <span>买家及预约信息</span>
  184. </div>
  185. <div class="text-item">
  186. <span>买家</span><span>{{ orderDetail.base_user.nickname }}</span>
  187. </div>
  188. <div class="text-item">
  189. <span>买家备注</span><span>{{ orderDetail.remark || '--' }}</span>
  190. </div>
  191. <div class="text-item">
  192. <span>预约时间</span><span>{{ orderDetail.reserve.reserve_date_time || '--' }}</span>
  193. </div>
  194. <div class="text-item">
  195. <span>预约方式</span><span>{{ shipping_type_list[orderDetail.reserve.service_type] }}</span>
  196. </div>
  197. <div class="text-item">
  198. <span>预约人</span><span>{{ orderDetail.receiver_name || '--' }}</span>
  199. </div>
  200. <div class="text-item">
  201. <span>服务地址</span><span>{{ orderDetail.region_name }} {{ orderDetail.address }}</span>
  202. </div>
  203. <div class="text-item">
  204. <span>手机号码</span><span>{{ orderDetail.mobile }}</span>
  205. </div>
  206. </el-card>
  207. </el-col>
  208. <el-col :span="8">
  209. <el-card class="card-box" shadow="never">
  210. <div slot="header" class="clearfix row-card-header">
  211. <span>结算信息</span>
  212. </div>
  213. <div class="text-item">
  214. <span>商品小计</span>
  215. <span>¥{{orderDetail.goods_price}}</span>
  216. </div>
  217. <div class="text-item" v-if="orderDetail.score_money > 0">
  218. <template v-if="orderDetail.marketing_type=='DigitalMall'">
  219. <span>抵扣</span>
  220. <span>{{orderDetail.extra_info}}</span>
  221. </template>
  222. <template v-else>
  223. <span>积分抵扣</span>
  224. <span>- ¥{{orderDetail.score_money}}</span>
  225. </template>
  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" v-if="orderDetail.rand_fee">
  232. <span>随机减</span>
  233. <span>¥{{orderDetail.rand_fee}}</span>
  234. </div>
  235. <div class="text-item">
  236. <span>实付款</span>
  237. <span>¥{{orderDetail.pay_money}}</span>
  238. </div>
  239. </el-card>
  240. </el-col>
  241. </el-row>
  242. <el-card class="card-box marign-b-20" shadow="never" v-if="orderDetail.reserve && orderDetail.reserve.reserve_code">
  243. <div slot="header" class="clearfix row-card-header">
  244. <span>预约码</span>
  245. </div>
  246. <el-table :data="[{code: orderDetail.reserve.reserve_code, status: orderDetail.reserve.reserve_status}]"
  247. style="width: 100%;" :header-cell-style="{background:'#F7F7F7','border-bottom': 0}">
  248. <el-table-column label="预约码" prop="code"></el-table-column>
  249. <el-table-column label="状态">
  250. <template slot-scope="scope">
  251. <el-tag size="mini" :type="reserve_status[scope.row.status].type">{{reserve_status[scope.row.status].title}}</el-tag>
  252. </template>
  253. </el-table-column>
  254. <el-table-column label="操作">
  255. <template slot-scope="scope">
  256. <template v-if="orderDetail.reserve.reserve_type == 0">
  257. <!-- 执行放在这里 -->
  258. --
  259. <!-- <el-button type="primary" v-if="status == 0" size="small"-->
  260. <!-- @click="handle('take-delivery', orderDetail)">使用服务-->
  261. <!-- </el-button>-->
  262. <!-- <el-button type="primary" v-if="orderDetail.order_status == 1" size="small"-->
  263. <!-- @click="handle('sales', orderDetail)">服务验收-->
  264. <!-- </el-button>-->
  265. <!-- <span v-else size="small">--</span>-->
  266. </template>
  267. <template v-else>--</template>
  268. </template>
  269. </el-table-column>
  270. </el-table>
  271. </el-card>
  272. <el-card class="card-box marign-b-20" shadow="never">
  273. <div slot="header" class="clearfix row-card-header">
  274. <span>商品信息</span>
  275. </div>
  276. <div v-if="orderDetail.detail" class="order-goods">
  277. <el-table :data="orderDetail.detail" style="width: 100%;"
  278. :header-cell-style="{background:'#F7F7F7','border-bottom': 0}">
  279. <el-table-column label="明细id" width="100">
  280. <template slot-scope="scope">
  281. <div>{{ scope.row.id }}
  282. </div>
  283. </template>
  284. </el-table-column>
  285. <el-table-column label="商品id" width="100">
  286. <template slot-scope="scope">
  287. <div>{{ scope.row.goods_id }}
  288. </div>
  289. </template>
  290. </el-table-column>
  291. <el-table-column label="商品" width="260">
  292. <template slot-scope="scope">
  293. <div style="position: relative;display: flex;align-items: center;">
  294. <el-image style="width: 66px; height: 50px;border-radius: 5px;"
  295. :src="scope.row.pic_url"></el-image>
  296. <span v-if="repeal_list[scope.row.is_feedback]" class="com-order-refund-status">{{ repeal_list[scope.row.is_feedback] }}</span>
  297. <com-ellipsis :line="2" style="margin-left: 10px;">
  298. {{ scope.row.goods_name }}
  299. </com-ellipsis>
  300. </div>
  301. </template>
  302. </el-table-column>
  303. <el-table-column label="规格" width="210">
  304. <template slot-scope="scope">
  305. <el-tag size="small">
  306. {{ scope.row.goods_attr_name || '无规格' }}
  307. </el-tag>
  308. </template>
  309. </el-table-column>
  310. <el-table-column label="单价" width="210">
  311. <template slot-scope="scope">
  312. <div>{{ scope.row.price }}
  313. <span v-if="scope.row.adjust_money != 0">(调价:¥{{ scope.row.adjust_money }})</span>
  314. </div>
  315. </template>
  316. </el-table-column>
  317. <el-table-column label="购买数量" width="210">
  318. <template slot-scope="scope">
  319. <div>{{ scope.row.num }}</div>
  320. </template>
  321. </el-table-column>
  322. <el-table-column label="优惠" width="210">
  323. <template slot-scope="scope">
  324. <div>¥{{(scope.row.original_goods_price - scope.row.goods_price - orderDetail.score_money).toFixed(2)}}</div>
  325. </template>
  326. </el-table-column>
  327. <el-table-column label="小计" width="210">
  328. <template slot-scope="scope">
  329. <div>{{ getOrderPrice(scope.row) }}</div>
  330. </template>
  331. </el-table-column>
  332. <el-table-column label="状态">
  333. <template slot-scope="scope">
  334. <div>{{ order_status_list[scope.row.order_status] }}</div>
  335. </template>
  336. </el-table-column>
  337. </el-table>
  338. </div>
  339. </el-card>
  340. <el-card v-if="orderAction.length > 0" class="card-box marign-b-20" shadow="never">
  341. <div slot="header" class="clearfix row-card-header">
  342. <span>订单操作日志</span>
  343. </div>
  344. <el-table :data="orderAction" v-loading="logLoading" style="width: 100%;" size="small" stripe>
  345. <el-table-column prop="member_name" label="用户" width="90">
  346. <template slot-scope="scope">
  347. <div>{{ scope.row.member_name }}</div>
  348. </template>
  349. </el-table-column>
  350. <el-table-column prop="created_at" label="操作时间" width="160">
  351. <template slot-scope="scope">
  352. <div>{{ scope.row.created_at|dateTimeFormat('Y-m-d H:i:s') }}</div>
  353. </template>
  354. </el-table-column>
  355. <el-table-column prop="action" label="详情">
  356. <template slot-scope="scope">
  357. <div>{{ scope.row.action }}</div>
  358. </template>
  359. </el-table-column>
  360. </el-table>
  361. </el-card>
  362. <!-- <el-card v-if="orderDetail">-->
  363. <!-- <el-button type="primary" v-if="orderDetail.order_status == 1" size="small"-->
  364. <!-- @click="handle('shipping', orderDetail)">发货-->
  365. <!-- </el-button>-->
  366. <!-- <el-button type="primary" v-if="orderDetail.order_status == 2" size="small"-->
  367. <!-- @click="handle('take-delivery', orderDetail)">确认收货-->
  368. <!-- </el-button>-->
  369. <!-- <el-button type="primary" v-if="orderDetail.order_status == 3" size="small"-->
  370. <!-- @click="handle('sales', orderDetail)">订单完成-->
  371. <!-- </el-button>-->
  372. <!-- </el-card>-->
  373. </el-card>
  374. <!-- 修改物流发货 -->
  375. <order-shipping :is_show="isShowChangeShipping" :change-shipping-loading="changeShippingLoading"
  376. :order_info="orderDetail" :shipping_form="shipping_form" @submit="handleShipping"
  377. @close="isShowChangeShipping = false"></order-shipping>
  378. <!-- 商家备注 -->
  379. <el-dialog title="商家备注" width="600px" :visible.sync="isShowRemark">
  380. <el-form :model="remark_form" label-width="80px" size="small">
  381. <el-form-item label="备注" prop="seller_remark">
  382. <el-input type="textarea" v-model="remark_form.seller_remark"></el-input>
  383. </el-form-item>
  384. </el-form>
  385. <div slot="footer" class="dialog-footer">
  386. <el-button @click="isShowRemark = false">取 消</el-button>
  387. <el-button type="primary" @click="handle('remark',remark_form,true)" :loading="remarkLoading">确 定</el-button>
  388. </div>
  389. </el-dialog>
  390. </div>
  391. <script>
  392. const app = new Vue({
  393. el: '#app',
  394. data() {
  395. return {
  396. id: 0,
  397. count: 6,
  398. detail: {},
  399. isShowChangeShipping: false,
  400. changeShippingLoading: false,
  401. remarkLoading: false,
  402. isShowRemark: false,
  403. shipping_form: {},
  404. remark_form: {
  405. seller_remark: null,
  406. },
  407. supply_express: ['JuheShop'],// 供应链订单禁止任何物流操作
  408. activePackage: '0',
  409. cardLoading: false,
  410. logLoading: false,
  411. goodDetails: [],
  412. orderAction: [],
  413. repeal_list: {
  414. '1': '售后中',
  415. '2': '售后完成',
  416. },
  417. marketing_type_map:{},
  418. stepArr: [
  419. {
  420. title: '买家下单',
  421. created_at: '0',
  422. is_step: 0,
  423. },
  424. {
  425. title: '买家付款',
  426. created_at: '0',
  427. is_step: 0,
  428. },
  429. {
  430. title: '服务核销',
  431. created_at: '0',
  432. is_step: 0,
  433. },
  434. {
  435. title: '交易完成',
  436. created_at: '0',
  437. is_step: 0,
  438. }
  439. ],
  440. reserve_status: [
  441. {
  442. title: '待预约',
  443. type: 'info'
  444. },
  445. {
  446. title: '待使用',
  447. type: 'primary'
  448. },
  449. {
  450. title: '已使用',
  451. type: 'success'
  452. }
  453. ],
  454. stepArrActive: 0,
  455. orderDetail: {
  456. base_user: {},
  457. express: [],
  458. reserve: {}
  459. },
  460. orderExpress: [],
  461. order_status_list: {
  462. '0': "待付款",
  463. '1': "待发货",
  464. '2': "已发货",
  465. '3': "已收货",
  466. '4': "已完成",
  467. '-1': "售后申请",
  468. '-2': "退款中",
  469. '-3': "售后完成",
  470. '-4': "已关闭",
  471. '-5': "撤销申请",
  472. },
  473. payment_type_list: {
  474. '0': "在线支付",
  475. '1': "微信",
  476. '2': "支付宝",
  477. '3': "银联卡",
  478. '5': "余额支付",
  479. '7': "汇聚支付",
  480. '8': "汇聚快捷支付",
  481. '100': "线下支付"
  482. },
  483. shipping_type_list: {
  484. '1': "上门服务",
  485. '2': "到店服务",
  486. },
  487. send_type: {
  488. '0': "无需物流",
  489. '1': "快递",
  490. },
  491. activities: [{
  492. content: '支持使用图标',
  493. timestamp: '2018-04-12 20:46',
  494. size: 'normal',
  495. color: '#409eff'
  496. }, {
  497. content: '支持自定义颜色',
  498. timestamp: '2018-04-03 20:46',
  499. }, {
  500. content: '支持自定义尺寸',
  501. timestamp: '2018-04-03 20:46',
  502. size: 'large'
  503. }, {
  504. content: '默认样式的节点',
  505. timestamp: '2018-04-03 20:46'
  506. }, {
  507. content: '默认样式的节点',
  508. timestamp: '2018-04-03 20:46'
  509. }, {
  510. content: '默认样式的节点',
  511. timestamp: '2018-04-03 20:46'
  512. }, {
  513. content: '默认样式的节点',
  514. timestamp: '2018-04-03 20:46'
  515. }, {
  516. content: '默认样式的节点',
  517. timestamp: '2018-04-03 20:46'
  518. }]
  519. };
  520. },
  521. created() {
  522. this.id = getQuery('id');
  523. },
  524. mounted() {
  525. this.getDetail();
  526. },
  527. methods: {
  528. load() {
  529. // this.count += 2
  530. },
  531. handleShipping(data) {
  532. this.handle('shipping', data, true);
  533. },
  534. getDetail() {
  535. let self = this;
  536. self.cardLoading = true;
  537. request({
  538. params: {
  539. r: 'store/client/order/detail',
  540. id: self.id
  541. },
  542. method: 'get',
  543. }).then(e => {
  544. self.cardLoading = false;
  545. if (e.data.code == 0) {
  546. var data = e.data.data;
  547. self.orderDetail = data.order;
  548. self.orderAction = data.order_action;
  549. Object.keys(self.orderDetail.detail).forEach(function (item) {
  550. self.goodDetails[self.orderDetail.detail[item].id] = self.orderDetail.detail[item];
  551. });
  552. self.order_status_list = data.order_status_list;
  553. self.marketing_type_map = data.marketing_type_map;
  554. self.payment_type_list = data.payment_type_list;
  555. // self.shipping_type_list = data.shipping_type_list;
  556. self.remark_form.seller_remark = self.orderDetail.seller_remark;
  557. if (!isEmpty(data.step_arr)) {
  558. self.getStepArr(data.step_arr, data.order);
  559. }
  560. } else {
  561. self.$message.error(e.data.msg);
  562. }
  563. }).catch(e => {
  564. console.log(e);
  565. });
  566. },
  567. getStepArr(stepArr, order) {
  568. var newStepArr = [];
  569. var index = 0;
  570. stepArr.forEach(function (item) {
  571. if (typeof(order[item.field]) != "undefined" && order[item.field] >= 0) {
  572. let step = {};
  573. var field_key = item.field;
  574. step['title'] = item.title === '商家发货' ? '服务核销' : item.title;
  575. step['created_at'] = order[field_key];
  576. step['is_step'] = (order[field_key] == 0 || order[field_key] == null) ? 0 : 1;
  577. newStepArr.push(step);
  578. if (step['is_step'] == 1) index++;
  579. }
  580. });
  581. this.stepArrActive = index;
  582. this.stepArr = newStepArr;
  583. },
  584. handle(type, data = null, submit = false) {
  585. let id = data ? parseInt(data.id) : '';
  586. let url = 'store/client/order/operate'
  587. switch (type) {
  588. // 订单详情
  589. case 'detail':
  590. let params = {
  591. r: 'store/client/order/detail'
  592. };
  593. if (id) params = Object.assign(params, {
  594. id: id
  595. });
  596. navigateTo(params);
  597. break;
  598. // 删除订单
  599. case 'destroy':
  600. param = {
  601. id: data.id,
  602. type
  603. };
  604. this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {
  605. type: 'warning'
  606. }).then(() => {
  607. this.send(param)
  608. }).catch((err) => {
  609. })
  610. break;
  611. // 取消订单
  612. case 'cancel':
  613. param = {
  614. id: id
  615. };
  616. this.$confirm('确定关闭订单吗?', '警告', {
  617. type: 'warning'
  618. }).then(() => {
  619. this.send('store/client/order/close', param)
  620. }).catch((err) => {
  621. })
  622. break;
  623. // 修改订单价格
  624. case 'change_price':
  625. if (submit) {
  626. this.changePriceLoading = true;
  627. this.send('store/client/order/change-price', this.change_price_form, (resp) => {
  628. if (resp.code == 0) this.isShowChangePrice = false;
  629. });
  630. setTimeout(() => {
  631. this.changePriceLoading = false;
  632. }, 100);
  633. } else {
  634. this.isShowChangePrice = true
  635. var objString = JSON.stringify(data);
  636. this.change_price_form = JSON.parse(objString);
  637. }
  638. break;
  639. // 修改收货地址
  640. case 'change_address':
  641. if (submit) {
  642. this.changeAddressLoading = true;
  643. this.send('store/client/order/change-address', data, (resp) => {
  644. if (resp.code == 0) this.isShowChangeAddress = false;
  645. });
  646. setTimeout(() => {
  647. this.changeAddressLoading = false;
  648. }, 100);
  649. } else {
  650. this.isShowChangeAddress = true
  651. var objString = JSON.stringify(data);
  652. this.change_address_form = JSON.parse(objString);
  653. }
  654. break;
  655. // 订单备注
  656. case 'remark':
  657. if (submit) {
  658. this.remarkLoading = true;
  659. this.remark_form.id = this.id;
  660. this.send('store/client/order/remark', this.remark_form, (resp) => {
  661. if (resp.code == 0) this.isShowRemark = false;
  662. });
  663. setTimeout(() => {
  664. this.remarkLoading = false;
  665. }, 100);
  666. } else {
  667. this.isShowRemark = true
  668. }
  669. break;
  670. // 物流发货
  671. case 'shipping':
  672. if (submit) {
  673. this.changeShippingLoading = true;
  674. this.send('store/client/order/shipping', data, (resp) => {
  675. if (resp.code == 0) this.isShowChangeShipping = false;
  676. });
  677. setTimeout(() => {
  678. this.changeShippingLoading = false;
  679. }, 100);
  680. } else {
  681. this.isShowChangeShipping = true
  682. var objString = JSON.stringify(data);
  683. this.shipping_form = JSON.parse(objString);
  684. }
  685. break;
  686. // 收货
  687. case 'take-delivery':
  688. param = {
  689. id: id
  690. };
  691. this.$confirm('确定收货吗?', '警告', {
  692. type: 'warning'
  693. }).then(() => {
  694. this.send('store/client/order/take-delivery', param)
  695. }).catch((err) => {
  696. })
  697. break;
  698. // 取消发货
  699. case 'cancel_shipment':
  700. param = {
  701. id: id,
  702. order_id: data.order_id
  703. };
  704. this.$confirm('确定取消发货吗?', '警告', {
  705. type: 'warning'
  706. }).then(() => {
  707. this.send('store/client/order/cancel-shipment', param)
  708. }).catch((err) => {
  709. })
  710. break;
  711. // 订单完成
  712. case 'sales':
  713. param = {
  714. id: id
  715. };
  716. this.$confirm('确定完成订单吗?', '警告', {
  717. type: 'warning'
  718. }).then(() => {
  719. this.send('store/client/order/sales-order', param)
  720. }).catch((err) => {
  721. })
  722. break;
  723. }
  724. },
  725. send(url, params, callback) {
  726. let self = this;
  727. request({
  728. params: {
  729. r: url,
  730. },
  731. method: 'post',
  732. data: params
  733. }).then(e => {
  734. if (e.data.code == 0) {
  735. self.$message.success(e.data.msg);
  736. self.getDetail();
  737. } else {
  738. self.$message.error(e.data.msg);
  739. }
  740. if (callback) callback(e.data);
  741. }).catch(e => {
  742. console.log(e);
  743. });
  744. },
  745. format(num){
  746. return num.toFixed(2);
  747. },
  748. getOrderPrice(data){
  749. let text = '';
  750. switch (data.marketing_type) {
  751. case 'ScoreMall' :
  752. text = '¥'+data.goods_price;
  753. if (data.score > 0 ) text += '+' + data.score + '积分';
  754. break;
  755. default :
  756. text = '¥'+data.goods_price;
  757. }
  758. return text;
  759. },
  760. }
  761. });
  762. </script>