com-order-cashier.php 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346
  1. <?php
  2. Yii::$app->loadComponentView('cashier_order/com-search','@app/plugins/o2o_store/views/components/mall');
  3. Yii::$app->loadComponentView('order/com-edit-address');
  4. Yii::$app->loadComponentView('order/com-edit-seller-remark');
  5. Yii::$app->loadComponentView('order/com-clerk');
  6. Yii::$app->loadComponentView('order/com-send');
  7. Yii::$app->loadComponentView('order/com-cancel');
  8. Yii::$app->loadComponentView('order/com-edit-price');
  9. Yii::$app->loadComponentView('order/com-city');
  10. ?>
  11. <style>
  12. .com-order-list .table-body {
  13. padding: 20px;
  14. background-color: #fff;
  15. }
  16. .com-order-list .header-box {
  17. padding: 20px;
  18. background-color: #fff;
  19. margin-bottom: 10px;
  20. border-top-left-radius: 4px;
  21. border-top-right-radius: 4px;
  22. }
  23. .com-order-list .header-box .title {
  24. display: inline-block;
  25. }
  26. .com-order-list .addPrice {
  27. color: #5CB85C;
  28. }
  29. .com-order-list .com-order-item .el-button {
  30. padding: 0;
  31. }
  32. .com-order-list .change .el-input__inner {
  33. height: 22px !important;
  34. line-height: 22px !important;
  35. }
  36. .com-order-list .price-item {
  37. color: #888888;
  38. }
  39. .com-order-list .price-item .el-form-item {
  40. margin-bottom: 0 !important;
  41. }
  42. .com-order-list .important {
  43. color: #ff4544;
  44. }
  45. .com-order-list .com-order-list .goods-info {
  46. padding: 5px;
  47. font-size: 12px;
  48. color: #353535;
  49. text-align: left;
  50. }
  51. .com-order-list .com-order-list .goods-name {
  52. white-space: nowrap;
  53. overflow: hidden;
  54. text-overflow: ellipsis;
  55. font-size: 16px;
  56. margin-bottom: 10px;
  57. }
  58. .com-order-list .el-date-editor .el-range-separator {
  59. width: auto;
  60. }
  61. .com-order-list .goods-image {
  62. height: 90px;
  63. width: 90px;
  64. margin-right: 15px;
  65. float: left;
  66. }
  67. .com-order-list .com-order-item {
  68. margin-top: 20px;
  69. min-width: 750px;
  70. }
  71. .com-order-list .com-order-item:hover {
  72. border: 1px solid #3399FF;
  73. }
  74. .com-order-list .com-order-item:hover .com-order-del {
  75. display: block;
  76. }
  77. .com-order-del {
  78. position: absolute;
  79. top: 20px;
  80. right: 25px;
  81. color: #7C868D;
  82. font-size: 18px;
  83. padding: 0;
  84. display: none;
  85. }
  86. .com-order-list .com-order-item .el-card__header {
  87. padding: 0;
  88. }
  89. .com-order-list .com-order-head {
  90. padding: 20px;
  91. background-color: #F3F5F6;
  92. color: #303133;
  93. min-width: 750px;
  94. display: flex;
  95. position: relative;
  96. }
  97. .com-order-list .com-order-time {
  98. color: #909399;
  99. }
  100. .com-order-user {
  101. margin-left: 30px;
  102. }
  103. .com-order-user img {
  104. height: 20px;
  105. width: 20px;
  106. display: block;
  107. float: left;
  108. border-radius: 50%;
  109. margin-right: 10px;
  110. }
  111. .com-order-offline {
  112. margin-left: 30px;
  113. margin-top: -2px;
  114. }
  115. .com-order-offline .el-tag {
  116. margin-right: 5px;
  117. }
  118. .com-order-refund-status {
  119. position: absolute;
  120. bottom: 19px;
  121. left: 20px;
  122. height: 20px;
  123. width: 90px;
  124. z-index: 5;
  125. background-color: #FF7171;
  126. color: #fff;
  127. text-align: center;
  128. }
  129. .cancel {
  130. margin-left: 10px;
  131. }
  132. .com-order-list .com-order-item .cancel .el-button {
  133. padding: 5px;
  134. }
  135. .com-order-list .el-card__body {
  136. padding: 0;
  137. }
  138. .com-order-body {
  139. display: flex;
  140. flex-wrap: nowrap;
  141. }
  142. .com-order-list .goods-item {
  143. border-right: 1px solid #EBEEF5;
  144. }
  145. .com-order-list .goods-item .goods {
  146. position: relative;
  147. padding: 20px;
  148. min-height: 130px;
  149. border-top: 1px solid #EBEEF5;
  150. }
  151. .com-order-list .goods-item .goods:first-of-type {
  152. border-top: 0;
  153. }
  154. .com-order-list .goods-item .goods-info {
  155. width: 50%;
  156. margin-top: 5px;
  157. }
  158. .com-order-list .goods-item .goods-info .goods-name {
  159. margin-bottom: 5px;
  160. word-break: break-all;
  161. text-overflow: ellipsis;
  162. display: -webkit-box;
  163. -webkit-box-orient: vertical;
  164. -webkit-line-clamp: 2;
  165. overflow: hidden;
  166. }
  167. .com-order-list .goods-item .goods .com-order-goods-price {
  168. height: 24px;
  169. margin-top: 10px;
  170. position: absolute;
  171. bottom: 20px;
  172. left: 125px;
  173. }
  174. .com-order-list .com-order-info {
  175. display: flex;
  176. align-items: center;
  177. width: 15%;
  178. text-align: center;
  179. border-right: 1px solid #EBEEF5;
  180. }
  181. .com-order-list .com-order-info > div {
  182. width: 100%;
  183. }
  184. .com-order-list .express-price {
  185. height: 30px;
  186. line-height: 30px;
  187. }
  188. .com-order-title {
  189. background-color: #F3F5F6;
  190. height: 40px;
  191. line-height: 40px;
  192. display: flex;
  193. min-width: 750px;
  194. }
  195. .com-order-title div {
  196. text-align: center;
  197. }
  198. .com-order-icon {
  199. margin-right: 5%;
  200. margin-bottom: 10px;
  201. cursor: pointer;
  202. }
  203. .com-order-icon:last-of-type {
  204. margin-right: 0;
  205. }
  206. .com-order-list .remark-box {
  207. padding-top: 3px;
  208. margin-left: 7px;
  209. }
  210. /*表格底部样式 start*/
  211. .com-order-list .card-footer {
  212. background: #F3F5F6;
  213. padding: 10px 20px;
  214. }
  215. .com-order-list .card-footer .address-box {
  216. margin-right: 10px;
  217. }
  218. .com-order-list .card-footer .seller-remark {
  219. margin-top: 10px;
  220. color: #E6A23C;
  221. }
  222. /*表格底部样式 end*/
  223. .com-order-list .express-send-box {
  224. position: relative;
  225. overflow: hidden;
  226. border-radius: 4px;
  227. height: 24px;
  228. }
  229. .com-order-list .express-send-box .triangle {
  230. width: 0;
  231. height: 0;
  232. border-right: 23px solid rgba(0, 0, 0, 0);
  233. border-top: 23px solid red;
  234. position: relative;
  235. top: -24px;
  236. }
  237. .com-order-list .express-send-box .triangle .text {
  238. font-size: 10px;
  239. color: #ffffff;
  240. position: absolute;
  241. top: -25px;
  242. }
  243. .express-single-box {
  244. margin-bottom: 10px;
  245. }
  246. .express-single-box .goods-pic {
  247. width: 35px;
  248. height: 35px;
  249. margin: 0 4px;
  250. }
  251. .express-single-box .label {
  252. margin-right: 10px;
  253. }
  254. </style>
  255. <template id="com-order-list" ref="appOrder">
  256. <div class="com-order-list" style="margin-bottom: 20px;">
  257. <div class="header-box">
  258. <div class="title">
  259. <slot name="orderTitle">订单列表</slot>
  260. </div>
  261. <com-export-dialog
  262. style="float: right;margin-top: -5px"
  263. :field_list='export_list'
  264. :action_url="'<?= Yii::$app->request->baseUrl . '/index.php?r=' ?>' + orderUrl"
  265. :params="search">
  266. </com-export-dialog>
  267. <el-button
  268. v-if="isShowRecycle"
  269. style="float: right; margin: -5px 20px"
  270. :loading="submitLoading"
  271. type="primary"
  272. size="small"
  273. @click="toRecycleAll">清空回收站
  274. </el-button>
  275. </div>
  276. <div class="table-body">
  277. <com-search
  278. @search="toSearch"
  279. :plugins="plugins"
  280. :tabs="tabs"
  281. :active-name="activeName"
  282. :is-show-order-type="isShowOrderType"
  283. :is-show-order-plugin="isShowOrderPlugin"
  284. :new-search="newSearch"
  285. :select-list="selectList">
  286. </com-search>
  287. <com-edit-address
  288. @close="dialogClose"
  289. @submit="dialogSubmit"
  290. :is-show="addressVisible"
  291. :order="newOrder">
  292. </com-edit-address>
  293. <com-edit-seller-remark
  294. :url="editRemarkUrl"
  295. @close="dialogClose"
  296. @submit="dialogSubmit"
  297. :is-show="sellerRemarkVisible"
  298. :order="newOrder">
  299. </com-edit-seller-remark>
  300. <com-clerk
  301. @close="dialogClose"
  302. @submit="dialogSubmit"
  303. :is-show="clerkVisible"
  304. :order="newOrder">
  305. </com-clerk>
  306. <com-send
  307. @close="dialogClose"
  308. @submit="dialogSubmit"
  309. :is-show="sendVisible"
  310. :express-id="expressId"
  311. :send-type="sendType"
  312. :order="newOrder">
  313. </com-send>
  314. <com-cancel
  315. @close="dialogClose"
  316. @submit="dialogSubmit"
  317. :is-show="cancelVisible"
  318. :cancel-type="cancelType"
  319. :order="newOrder">
  320. </com-cancel>
  321. <com-edit-price
  322. @close="dialogClose"
  323. @submit="dialogSubmit"
  324. :is-show="changePriceVisible"
  325. :order="newOrder">
  326. </com-edit-price>
  327. <com-city
  328. @close="dialogClose"
  329. @submit="dialogSubmit"
  330. :is-show="citySendVisible"
  331. :send-type="sendType"
  332. :order="newOrder">
  333. </com-city>
  334. <div class="com-order-title">
  335. <div v-for="(item,index) in orderTitle" :key="index" :style="{width: item.width}">{{item.name}}</div>
  336. </div>
  337. <div v-loading="loading" v-if="list && list.length > 0">
  338. <el-card
  339. v-for="item in list"
  340. class="com-order-item"
  341. :key="item.id"
  342. shadow="never">
  343. <div slot="header" class="com-order-head" flex="cross:center">
  344. <div class="com-order-time">{{ item.created_at }}</div>
  345. <div class="com-order-user">
  346. <span class="com-order-time">订单号:</span>{{ item.order_no }}
  347. </div>
  348. <div class="com-order-user" flex="cross:center">
  349. <img src="statics/img/mall/ali.png" v-if="item.platform == 'aliapp'" alt="">
  350. <img src="statics/img/mall/wx.png" v-else-if="item.platform == 'wxapp'" alt="">
  351. <img src="statics/img/mall/toutiao.png" v-else-if="item.platform == 'ttapp'" alt="">
  352. <img src="statics/img/mall/baidu.png" v-else-if="item.platform == 'bdapp'" alt="">
  353. <span>{{ item.nickname }}({{ item.user_id }})</span>
  354. </div>
  355. <div flex="cross:center" class="remark-box" v-if="item.remark != '' || item.words != ''">
  356. <el-tooltip effect="dark" placement="bottom">
  357. <div slot="content">
  358. <span v-if="item.remark">买家下单留言:{{item.remark}}</span>
  359. <br v-if="item.remark"/>
  360. <span v-if="item.words">商家订单留言:{{item.words}}</span>
  361. <br v-if="item.words"/>
  362. <span v-for="(deItem, deIndex) in item.detailExpress" :key="deItem.id">
  363. <span v-if="deItem.merchant_remark">
  364. 卖家物流留言: {{deItem.merchant_remark}}
  365. </span>
  366. <br v-if="deItem.merchant_remark"/>
  367. </span>
  368. </div>
  369. <div v-if="item.remark || item.is_show_merchant_remark">
  370. <img src="statics/img/mall/order/remark.png" alt="">
  371. </div>
  372. </el-tooltip>
  373. </div>
  374. <div class="com-order-offline" flex="dir:left wrap:wrap">
  375. <template v-if="item.cancel_status == 2 && item.status == 1 && isShowCancel">
  376. <!-- 用户申请取消 -->
  377. <div class="cancel" flex="wrap:wrap">
  378. <span style="margin-right: 5px;">用户正在申请取消该订单</span>
  379. <el-button type="success" size="mini" @click="agreeCancel(item,1)">同意</el-button>
  380. <el-button type="danger" size="mini" @click="agreeCancel(item,0)">拒绝</el-button>
  381. </div>
  382. </template>
  383. <template v-else-if="isShowOrderStatus">
  384. <div v-if="item.send_type == 0" class="express-send-box">
  385. <el-tag size="small">快递发送</el-tag>
  386. <div v-if="item.store_id > 0" class="triangle">
  387. <el-tooltip class="item" effect="dark" content="该订单由门店自提改成快递发送" placement="top">
  388. <span class="text">改</span>
  389. </el-tooltip>
  390. </div>
  391. </div>
  392. <el-tag size="small" v-if="item.send_type == 1">到店自提</el-tag>
  393. <el-tag size="small" v-if="item.send_type == 2">同城配送</el-tag>
  394. <el-tag size="small" type="warning" v-if="item.is_pay == 0">未付款</el-tag>
  395. <el-tag size="small" type="warning" v-if="item.is_pay == 1 && item.is_send == 0">已付款
  396. </el-tag>
  397. <el-tag size="small" type="success"
  398. v-if="item.is_send == 0 && item.is_pay == 1 && item.detailExpress && item.detailExpress.length > 0">
  399. 部分发货
  400. </el-tag>
  401. <el-tag size="small" type="success"
  402. v-if="item.is_send == 0 && item.is_pay == 1 && item.detailExpress && item.detailExpress.length == 0">
  403. 未发货
  404. </el-tag>
  405. <el-tag size="small" type="success" v-if="item.is_send == 1 && item.is_confirm == 0">
  406. 已发货
  407. </el-tag>
  408. <el-tag size="small" type="success" v-if="item.is_confirm == 0 && item.is_send == 1">
  409. 未收货
  410. </el-tag>
  411. <el-tag size="small" type="success" v-if="item.is_sale == 1">已完成</el-tag>
  412. <el-tag size="small" type="danger" v-if="item.cancel_status == 1">已取消</el-tag>
  413. <el-tag size="small" type="danger" v-else-if="item.cancel_status == 2">申请取消</el-tag>
  414. <slot name="orderTag" :order="item"></slot>
  415. </template>
  416. </div>
  417. <el-button
  418. v-if="isShowCancel && item.is_send == 0 && item.cancel_status == 0 && item.is_cancel_show == 1 && item.status == 1"
  419. style="right: 60px"
  420. class="com-order-del"
  421. @click="agreeCancel(item,2)"
  422. type="text">
  423. <el-tooltip class="item" effect="dark" content="强制取消" placement="top">
  424. <img src="statics/img/mall/order/force.png" alt="">
  425. </el-tooltip>
  426. </el-button>
  427. <el-button v-if="isShowRecycle && item.is_recycle == 0"
  428. class="com-order-del"
  429. @click="toRecycle(item)"
  430. type="text">
  431. <el-tooltip class="item" effect="dark" content="放入回收站" placement="top">
  432. <img src="statics/img/mall/order/del.png" alt="">
  433. </el-tooltip>
  434. </el-button>
  435. </div>
  436. <div class="com-order-body">
  437. <!-- 订单信息 -->
  438. <div class="goods-item" :style="{width: orderTitle[0].width}">
  439. <div class="goods" v-for="goods in item.detail">
  440. <img :src="item.store.logo_img"
  441. class="goods-image">
  442. <span v-if="goods.refund_status == '11' || goods.refund_status == '10' || goods.refund_status == '12'" class="com-order-refund-status">售后中</span>
  443. <span v-else-if="goods.refund_status == '20'" class="com-order-refund-status">已退款</span>
  444. <span v-else-if="goods.refund_status == '21'" class="com-order-refund-status">已拒绝</span>
  445. <div flex="dir:left">
  446. <div class="goods-info">
  447. <div class="goods-name">
  448. {{item.store.name}}
  449. </div>
  450. </div>
  451. <div style="width: 250px" flex="dir:left box:mean">
  452. <div flex="cross:center main:center">
  453. <span>小计:¥{{goods.total_original_price}}</span>
  454. <el-button type="text"
  455. style="margin-left: 3px;"
  456. v-if="isShowEditSinglePrice && item.is_pay == 0 && item.is_send == 0 && search.status != 5"
  457. circle
  458. @click="changeGoods(goods)">
  459. <img src="statics/img/mall/order/edit.png" alt="">
  460. </el-button>
  461. </div>
  462. </div>
  463. </div>
  464. </div>
  465. </div>
  466. <div flex="cross:center" class="com-order-info" :style="{width:orderTitle[1].width}">
  467. <div flex="dir:top">
  468. <div>
  469. <span style="font-size: 16px">¥{{item.total_pay_price}}</span>
  470. <el-popover
  471. placement="bottom"
  472. width="250"
  473. trigger="hover">
  474. <el-form class="price-item" label-width="100px" :model="item">
  475. <el-form-item label="商品小计">
  476. <span>{{ item.total_goods_original_price }}元</span>
  477. </el-form-item>
  478. <el-form-item label="会员优惠" v-if="item.member_discount_price != 0.00">
  479. <span class="important" v-if="item.member_discount_price > 0">
  480. -{{ item.member_discount_price }}元
  481. </span>
  482. <span class="addPrice" v-if="item.member_discount_price < 0">
  483. +{{ -item.member_discount_price }}元
  484. </span>
  485. </el-form-item>
  486. <el-form-item label="积分抵扣" v-if="item.score_deduction_price != 0.00">
  487. <span class="important">-{{ item.score_deduction_price }}元</span>
  488. </el-form-item>
  489. <el-form-item label="优惠券抵扣" v-if="item.coupon_discount_price != 0.00">
  490. <span class="important">-{{ item.coupon_discount_price }}元</span>
  491. </el-form-item>
  492. <el-form-item label="后台改价" v-if="item.back_price != 0.00">
  493. <span class="important" v-if="item.back_price > 0">-{{ item.back_price }}元</span>
  494. <span class="addPrice" v-else>+{{ -item.back_price }}元</span>
  495. </el-form-item>
  496. <el-form-item label="运费改价" v-if="item.express_price != 0">
  497. <span class="important"
  498. v-if="item.express_price > item.express_original_price">
  499. +{{item.express_price - item.express_original_price}}元
  500. </span>
  501. <span class="addPrice" v-else>
  502. -{{item.express_price - item.express_original_price }}元
  503. </span>
  504. </el-form-item>
  505. <el-form-item v-if="item.plugin_data" v-for="pluginData in item.plugin_data"
  506. :label="pluginData.label" :key="pluginData.label">
  507. <span class="important">{{pluginData.value}}元</span>
  508. </el-form-item>
  509. </el-form>
  510. <img src="statics/img/mall/order/price.png" slot="reference" alt="">
  511. </el-popover>
  512. <slot name="other" :item="item"></slot>
  513. </div>
  514. <div>
  515. <el-tag size="mini" color="#E6A23C" style="color:#fff;border:0"
  516. v-if="item.pay_type == 1">在线支付
  517. </el-tag>
  518. <el-tag size="mini" color="#E6A23C" style="color:#fff;border:0"
  519. v-if="item.pay_type == 3">余额支付
  520. </el-tag>
  521. <el-tag size="mini" color="#E6A23C" style="color:#fff;border:0"
  522. v-if="item.pay_type == 2">货到付款
  523. </el-tag>
  524. </div>
  525. </div>
  526. </div>
  527. <div v-if="isShowAction" class="com-order-info" :style="{width:orderTitle[2].width}"
  528. style="padding: 10px;border-right: 0;">
  529. <div flex="wrap:wrap cross:center">
  530. <!-- 结束 -->
  531. <el-tooltip class="item" effect="dark" content="结束订单" placement="top">
  532. <img class="com-order-icon" @click="saleOrder(item.id)"
  533. v-if="item.is_recycle == 0 && item.is_confirm == 1 && item.is_sale == 0 && isShowFinish && item.status != 0"
  534. src="statics/img/mall/order/sale.png" alt="">
  535. </el-tooltip>
  536. <!-- 确认收货 -->
  537. <el-tooltip class="item" effect="dark" content="确认收货" placement="top">
  538. <img class="com-order-icon" src="statics/img/mall/order/confirm.png" alt=""
  539. v-if="item.is_recycle == 0 && item.is_send == 1 && item.is_confirm == 0 && isShowConfirm && item.status != 0 && item.is_confirm_show"
  540. @click="confirm(item.id)">
  541. </el-tooltip>
  542. <el-tooltip class="item" effect="dark" content="电子面单" placement="top">
  543. <img class="com-order-icon" src="statics/img/mall/order/express_single.png" alt=""
  544. v-if="item.new_express_single && item.new_express_single.length > 0"
  545. @click="expressSingle(item.new_express_single)">
  546. </el-tooltip>
  547. <!-- 核销 -->
  548. <el-tooltip class="item" effect="dark" content="核销订单" placement="top">
  549. <img class="com-order-icon" @click="openDialog(item, clerkVisible = true)"
  550. v-if="item.send_type == 1 && (item.is_pay == 1 || item.pay_type == 2) && item.clerk == null && item.is_send == 0 && item.is_clerk_show && item.is_recycle == 0 && isShowClerk && item.is_recycle == 0 && item.status != 0 && item.cancel_status != 1"
  551. src="statics/img/mall/order/clerk.png" alt="">
  552. </el-tooltip>
  553. <template v-if="">
  554. <slot name="orderSend" :order="item"></slot>
  555. <!-- 发货 -->
  556. <el-tooltip class="item" effect="dark" content="发货" placement="top">
  557. <img class="com-order-icon" @click="openExpress(item,'send')"
  558. v-if="item.is_send_show"
  559. src="statics/img/mall/order/send.png" alt="">
  560. </el-tooltip>
  561. </template>
  562. <!-- 恢复订单 -->
  563. <el-tooltip class="item" effect="dark" content="恢复订单" placement="top">
  564. <img class="com-order-icon" v-if="item.is_recycle == 1"
  565. @click="toRecycle(item)"
  566. src="statics/img/mall/order/renew.png" alt="">
  567. </el-tooltip>
  568. <!-- 删除订单 -->
  569. <el-tooltip class="item" effect="dark" content="删除订单" placement="top">
  570. <img class="com-order-icon" v-if="item.is_recycle == 1"
  571. @click="toDelete(item)"
  572. src="statics/img/mall/del.png" alt="">
  573. </el-tooltip>
  574. <!-- 修改快递单号 -->
  575. <template v-if="item.send_type != 2">
  576. <template
  577. v-if="item.detailExpress && item.detailExpress.length == 1 && item.is_send == 1 && item.cancel_status != 1 && item.is_confirm == 0 && item.is_recycle == 0 && isShowSend && item.status != 0">
  578. <el-tooltip class="item" effect="dark" content="修改快递单号" placement="top">
  579. <img class="com-order-icon"
  580. @click="openExpress(item,'change', item.detailExpress[0].id)"
  581. src="statics/img/mall/order/change.png" alt="">
  582. </el-tooltip>
  583. </template>
  584. <!--多个物流信息订单 需到订单详情修改 -->
  585. <template
  586. v-else-if="item.detailExpress && item.detailExpress.length >= 1 && item.cancel_status != 1 && item.is_confirm == 0 && item.is_recycle == 0 && isShowSend && item.status != 0">
  587. <el-tooltip class="item" effect="dark" content="修改快递单号" placement="top">
  588. <img class="com-order-icon"
  589. @click="openExpressHint" src="statics/img/mall/order/change.png"
  590. alt="">
  591. </el-tooltip>
  592. </template>
  593. </template>
  594. <el-tooltip class="item" effect="dark" content="修改配送员" placement="top">
  595. <img class="com-order-icon"
  596. v-if="item.send_type == 2 && item.cancel_status != 1 && item.is_confirm == 0 && item.city_info && item.is_recycle == 0 && isShowSend && item.status != 0"
  597. @click="openCity(item,'change')" src="statics/img/mall/order/change.png"
  598. alt="">
  599. </el-tooltip>
  600. <!-- 订单详情 -->
  601. <el-tooltip class="item" effect="dark" content="查看订单详情" placement="top">
  602. <img v-if="isShowDetail" class="com-order-icon" @click="toDetail(item.id)"
  603. src="statics/img/mall/order/detail.png"
  604. alt="">
  605. </el-tooltip>
  606. </div>
  607. </div>
  608. <!--目前用于分销-->
  609. <slot name="orderAction" :order="item"></slot>
  610. </div>
  611. <div class="card-footer">
  612. <template v-if="item.send_type == 1">
  613. <div style="margin: 10px 0;">会员昵称: {{item.user.nickname}} 电话:{{item.user.mobile}}</div>
  614. </template>
  615. <slot name="footerFirst" :item="item"></slot>
  616. <div class="seller-remark" v-if="item.seller_remark">商家备注:{{item.seller_remark}}</div>
  617. <slot name="footer" :item="item"></slot>
  618. </div>
  619. </el-card>
  620. </div>
  621. <el-card v-loading="loading" shadow="never" class="com-order-item"
  622. style="height: 100px;line-height: 100px;text-align: center;"
  623. v-if="list && list.length == 0">
  624. 暂无订单信息
  625. </el-card>
  626. <div style="margin-top: 15px">
  627. <el-pagination
  628. v-if="pagination"
  629. style="display: inline-block;float: right;"
  630. background
  631. :page-count="pagination.page_count"
  632. :current-page="pagination.current_page"
  633. @current-change="pageChange"
  634. layout="prev, pager, next">
  635. </el-pagination>
  636. </div>
  637. </div>
  638. <el-dialog
  639. title="电子面单"
  640. :visible.sync="singleDialogVisible"
  641. width="30%">
  642. <div v-for="(expressSingle, index) in newExpressSingle"
  643. :key="index"
  644. class="express-single-box" flex="dir:left">
  645. <div>
  646. <div class="label" style="background: #fffaef;color: #e6a23c;padding: 3px 0;">
  647. 收货信息:{{index + 1}}
  648. </div>
  649. </div>
  650. <div flex="dir:top">
  651. <div flex="cross:center">
  652. <template v-if="expressSingle.send_type == 1">
  653. <el-tag style="margin-right: 5px;" type="info" hit size="small">{{
  654. expressSingle.express }}
  655. </el-tag>
  656. <a :href="'https://www.baidu.com/s?wd='+ expressSingle.express + expressSingle.express_no"
  657. target="_blank" title='点击搜索运单号'>{{ expressSingle.express_no }}</a>
  658. </template>
  659. <template v-else>
  660. <span>{{expressSingle.express_content}}</span>
  661. </template>
  662. <el-button @click="printTeplate(expressSingle.print_teplate)" v-if="expressSingle.print_teplate"
  663. style="margin-left: 10px;" size="mini" type="default">打印此面单
  664. </el-button>
  665. </div>
  666. <div flex="dir:left" style="margin-top: 10px;">
  667. <span class="label">配送商品:</span>
  668. <img v-for="(goods, index) in expressSingle.goods_list"
  669. :key="index"
  670. class="goods-pic"
  671. :src="goods.cover_pic">
  672. </div>
  673. </div>
  674. </div>
  675. </el-dialog>
  676. <el-dialog width="25%" title="修改商品价格" :visible.sync="editGoodsPriceVisible">
  677. <el-form :model="editGoodsForm" ref="goodsValidateForm" label-width="80px" size="small">
  678. <el-form-item
  679. label="商品价格"
  680. prop="total_price"
  681. :rules="[{ required: true, message: '价格不能为空'}]">
  682. <el-input type="number" v-model="editGoodsForm.total_price" auto-complete="off"></el-input>
  683. </el-form-item>
  684. </el-form>
  685. <div slot="footer" class="dialog-footer">
  686. <el-button size="small" @click="editGoodsPriceVisible = false">取 消</el-button>
  687. <el-button size="small" :loading="submitLoading" type="primary"
  688. @click="changePrice('goodsValidateForm')">确 定
  689. </el-button>
  690. </div>
  691. </el-dialog>
  692. </div>
  693. </template>
  694. <script>
  695. Vue.component('com-order', {
  696. template: '#com-order-list',
  697. props: {
  698. orderTitle: {
  699. type: Array,
  700. default: function () {
  701. return [
  702. {width: '60%', name: '订单信息'},
  703. {width: '20%', name: '实付金额'},
  704. {width: '20%', name: '操作'}
  705. ]
  706. }
  707. },
  708. selectList: {
  709. type: Array,
  710. default: function () {
  711. return [
  712. {value: '1', name: '订单号'},
  713. {value: '9', name: '商户单号'},
  714. {value: '2', name: '用户名'},
  715. {value: '4', name: '用户ID'},
  716. {value: '5', name: '商品名称'},
  717. {value: '3', name: '收货人'},
  718. {value: '6', name: '收货人电话'},
  719. {value: '7', name: '门店名称'},
  720. {value: 'goods_no', name: '商品货号'},
  721. ]
  722. }
  723. },
  724. tabs: {
  725. type: Array,
  726. default: function () {
  727. return [
  728. {value: '-1', name: '全部'},
  729. {value: '1', name: '待付款'},
  730. {value: '3', name: '已完成'},
  731. {value: '7', name: '回收站'},
  732. ]
  733. }
  734. },
  735. activeName: {
  736. type: String,
  737. default: '-1',
  738. },
  739. // 订单列表请求URL
  740. orderUrl: {
  741. type: String,
  742. default: 'plugin/o2o_store/mall/order/cashier',
  743. },
  744. // 删除回收站请求URl
  745. recycleUrl: {
  746. type: String,
  747. default: 'mall/order/destroy-all',
  748. },
  749. // 订单详情URL
  750. orderDetailUrl: {
  751. type: String,
  752. default: 'plugin/o2o_store/mall/order/cashier-detail'
  753. },
  754. // 修改备注请求URL
  755. editRemarkUrl: {
  756. type: String,
  757. default: 'mall/order/seller-remark'
  758. },
  759. // 订单详情URL
  760. batchSendUrl: {
  761. type: String,
  762. default: 'mall/order/batch-send'
  763. },
  764. // 控制按钮是否显示
  765. // 编辑收货地址
  766. isShowEditAddress: {
  767. type: Boolean,
  768. default: true
  769. },
  770. // 订单取消操作
  771. isShowCancel: {
  772. type: Boolean,
  773. default: true
  774. },
  775. // 编辑订单备注
  776. isShowRemark: {
  777. type: Boolean,
  778. default: true
  779. },
  780. // 结束订单
  781. isShowFinish: {
  782. type: Boolean,
  783. default: true
  784. },
  785. // 确认收货
  786. isShowConfirm: {
  787. type: Boolean,
  788. default: true
  789. },
  790. // 小票打印
  791. isShowPrint: {
  792. type: Boolean,
  793. default: true
  794. },
  795. // 订单核销
  796. isShowClerk: {
  797. type: Boolean,
  798. default: true
  799. },
  800. // 订单发货
  801. isShowSend: {
  802. type: Boolean,
  803. default: true
  804. },
  805. // 清空回收站
  806. isShowRecycle: {
  807. type: Boolean,
  808. default: true
  809. },
  810. // 订单配送方式
  811. isShowOrderType: {
  812. type: Boolean,
  813. default: true
  814. },
  815. // 订单配送方式
  816. isShowOrderStatus: {
  817. type: Boolean,
  818. default: true
  819. },
  820. // 订单详情
  821. isShowDetail: {
  822. type: Boolean,
  823. default: true
  824. },
  825. // 操作按钮
  826. isShowAction: {
  827. type: Boolean,
  828. default: true
  829. },
  830. // 修改运费
  831. isShowEditExpressPrice: {
  832. type: Boolean,
  833. default: true
  834. },
  835. // 修改商品小计
  836. isShowEditSinglePrice: {
  837. type: Boolean,
  838. default: true
  839. },
  840. // 插件筛选
  841. isShowOrderPlugin: {
  842. type: Boolean,
  843. default: false
  844. },
  845. newSearch: {
  846. type: Object,
  847. default: function () {
  848. return {
  849. time: null,
  850. keyword: '',
  851. keyword_1: '1',
  852. date_start: '',
  853. date_end: '',
  854. platform: '',
  855. status: '',
  856. plugin: 'all',
  857. send_type: -1,
  858. }
  859. }
  860. },
  861. },
  862. data() {
  863. return {
  864. search: {},
  865. submitLoading: false,
  866. // 新的
  867. loading: false,
  868. list: [],
  869. pagination: null,
  870. newOrder: {},// 传给各子组件的订单信息
  871. addressVisible: false,// 修改收货地址
  872. sellerRemarkVisible: false,// 添加商户备注
  873. clerkVisible: false,// 订单核销
  874. sendVisible: false,// 发货
  875. sendType: '',// 发货类型
  876. cancelVisible: false,// 订单取消
  877. cancelType: -1,// 订单取消状态 同意|拒绝
  878. changePriceVisible: false,// 修改订单价格
  879. plugins: [
  880. {
  881. name: '全部订单',
  882. sign: 'all',
  883. }
  884. ],// 插件筛选
  885. export_list: [],//导出字段数据,
  886. // 修改商品单价 start
  887. editGoodsPriceVisible: false,//修改商品单价
  888. editGoodsForm: {
  889. total_price: '',
  890. id: 0,
  891. },//价格
  892. // 修改商品单价 end
  893. expressId: 0,// 修改物流
  894. citySendVisible: false, //同城配送发货
  895. singleDialogVisible: false,// 电子面单弹框
  896. newExpressSingle: [],
  897. };
  898. },
  899. mounted() {
  900. this.search = this.newSearch;
  901. // 用户列表 用户订单数
  902. if (getQuery('user_id') > 0) {
  903. this.search.keyword_1 = '4';
  904. this.search.keyword = getQuery('user_id')
  905. }
  906. if (getQuery('clerk_id') > 0) {
  907. this.search.clerk_id = getQuery('clerk_id');
  908. }
  909. this.getList();
  910. },
  911. methods: {
  912. // 关闭弹出框
  913. closeDialog() {
  914. this.submitLoading = false;
  915. this.id = null;
  916. },
  917. // 进入商品详情
  918. toDetail(id) {
  919. this.$navigate({
  920. r: this.orderDetailUrl,
  921. order_id: id
  922. })
  923. },
  924. // 确认收货
  925. confirm(id) {
  926. this.$confirm('是否确认收货?', '提示', {
  927. confirmButtonText: '确定',
  928. cancelButtonText: '取消',
  929. }).then(() => {
  930. request({
  931. params: {
  932. r: 'mall/order/confirm',
  933. },
  934. data: {
  935. order_id: id
  936. },
  937. method: 'post',
  938. }).then(e => {
  939. if (e.data.code == 0) {
  940. this.$message({
  941. message: e.data.msg,
  942. type: 'success'
  943. });
  944. this.getList();
  945. } else {
  946. this.$message({
  947. message: e.data.msg,
  948. type: 'error'
  949. });
  950. }
  951. }).catch(e => {
  952. this.$message({
  953. message: e.data.msg,
  954. type: 'error'
  955. });
  956. });
  957. }).catch(e => {
  958. });
  959. },
  960. // 结束订单
  961. saleOrder(id) {
  962. this.$confirm('是否结束该订单?', '提示', {
  963. confirmButtonText: '确定',
  964. cancelButtonText: '取消',
  965. }).then(() => {
  966. request({
  967. params: {
  968. r: 'mall/order/order-sales',
  969. },
  970. data: {
  971. order_id: id
  972. },
  973. method: 'post',
  974. }).then(e => {
  975. if (e.data.code == 0) {
  976. this.$message({
  977. message: e.data.msg,
  978. type: 'success'
  979. });
  980. this.getList();
  981. } else {
  982. this.$message({
  983. message: e.data.msg,
  984. type: 'error'
  985. });
  986. }
  987. }).catch(e => {
  988. });
  989. }).catch(() => {
  990. });
  991. },
  992. // 打印小票
  993. print(id) {
  994. this.$confirm('是否打印小票?', '提示', {
  995. confirmButtonText: '确定',
  996. cancelButtonText: '取消',
  997. }).then(() => {
  998. this.loading = true;
  999. request({
  1000. params: {
  1001. r: 'mall/order/order-print',
  1002. order_id: id
  1003. },
  1004. method: 'get',
  1005. }).then(e => {
  1006. this.loading = false;
  1007. if (e.data.code == 0) {
  1008. this.$message({
  1009. message: e.data.msg,
  1010. type: 'success'
  1011. });
  1012. this.getList();
  1013. }
  1014. this.$message({
  1015. message: e.data.msg,
  1016. type: 'warning'
  1017. });
  1018. }).catch(e => {
  1019. });
  1020. }).catch(() => {
  1021. });
  1022. },
  1023. changeGoods(e) {
  1024. this.editGoodsPriceVisible = true;
  1025. this.editGoodsForm.total_price = e.total_original_price;
  1026. this.editGoodsForm.id = e.id;
  1027. },
  1028. // 修改商品金额
  1029. changePrice(formName) {
  1030. this.$refs[formName].validate((valid) => {
  1031. if (valid) {
  1032. this.submitLoading = true;
  1033. request({
  1034. params: {
  1035. r: 'mall/order/update-price',
  1036. },
  1037. data: {
  1038. order_detail_id: this.editGoodsForm.id,
  1039. total_price: this.editGoodsForm.total_price
  1040. },
  1041. method: 'post',
  1042. }).then(e => {
  1043. this.submitLoading = false;
  1044. if (e.data.code === 0) {
  1045. this.editGoodsPriceVisible = false
  1046. this.$message({
  1047. message: '修改成功',
  1048. type: 'success'
  1049. });
  1050. this.getList();
  1051. } else {
  1052. this.$message({
  1053. message: e.data.msg,
  1054. type: 'warning'
  1055. });
  1056. }
  1057. }).catch(e => {
  1058. });
  1059. } else {
  1060. console.log('error submit!!');
  1061. return false;
  1062. }
  1063. });
  1064. },
  1065. // 回收站
  1066. toRecycle(e) {
  1067. let that = this;
  1068. let text = "是否放入回收站(可在回收站中恢复)?"
  1069. let para = {
  1070. order_id: e.id,
  1071. is_recycle: 1
  1072. }
  1073. if (e.is_recycle == 1) {
  1074. para.is_recycle = 0;
  1075. text = "是否移出回收站?"
  1076. }
  1077. this.$confirm(text, '提示', {
  1078. confirmButtonText: '确定',
  1079. cancelButtonText: '取消',
  1080. type: 'warning',
  1081. center: true
  1082. }).then(() => {
  1083. request({
  1084. params: {
  1085. r: 'mall/order/recycle',
  1086. },
  1087. data: para,
  1088. method: 'post'
  1089. }).then(e => {
  1090. e.visible = false;
  1091. this.submitLoading = false;
  1092. if (e.data.code === 0) {
  1093. this.$message({
  1094. message: e.data.msg,
  1095. type: 'success'
  1096. });
  1097. this.getList();
  1098. }
  1099. }).catch(e => {
  1100. });
  1101. }).catch(() => {
  1102. });
  1103. },
  1104. expressSingle(newExpressSingle) {
  1105. this.singleDialogVisible = true
  1106. this.newExpressSingle = newExpressSingle;
  1107. },
  1108. printTeplate(htmlData) {
  1109. myWindow = window.open('', '_blank');
  1110. myWindow.document.write(htmlData);
  1111. myWindow.focus();
  1112. },
  1113. // 删除订单
  1114. toDelete(e) {
  1115. this.$confirm('是否删除订单?', '提示', {
  1116. confirmButtonText: '确定',
  1117. cancelButtonText: '取消',
  1118. type: 'warning'
  1119. }).then(() => {
  1120. request({
  1121. params: {
  1122. r: 'mall/order/destroy',
  1123. },
  1124. data: {
  1125. order_id: e.id,
  1126. },
  1127. method: 'post'
  1128. }).then(e => {
  1129. this.loading = false;
  1130. if (e.data.code == 0) {
  1131. this.$message({
  1132. message: e.data.msg,
  1133. type: 'success'
  1134. });
  1135. this.getList();
  1136. }
  1137. }).catch(e => {
  1138. });
  1139. }).catch(() => {
  1140. });
  1141. },
  1142. // 获取订单列表
  1143. getList() {
  1144. this.loading = true;
  1145. let params = {
  1146. r: this.orderUrl
  1147. };
  1148. Object.keys(this.search).map((key) => {
  1149. params[key] = this.search[key]
  1150. });
  1151. request({
  1152. params: params,
  1153. }).then(e => {
  1154. this.loading = false;
  1155. if (e.data.code === 0) {
  1156. this.list = e.data.data.list;
  1157. this.export_list = e.data.data.export_list;
  1158. this.pagination = e.data.data.pagination;
  1159. //this.plugins = e.data.data.plugins;
  1160. let arr = e.data.data.plugins
  1161. let searchObj = {
  1162. "sign":"cloud_stock",
  1163. "name":"云库存订单"
  1164. }
  1165. arr.push(searchObj);
  1166. this.plugins = arr;
  1167. }
  1168. }).catch(e => {
  1169. });
  1170. },
  1171. // com-search组件 搜索事件
  1172. toSearch(searchParams) {
  1173. this.search = searchParams;
  1174. this.search.page = 1;
  1175. this.getList();
  1176. },
  1177. // 分页
  1178. pageChange(page) {
  1179. this.search.page = page;
  1180. this.getList();
  1181. },
  1182. openDialog(order) {
  1183. this.newOrder = order;
  1184. },
  1185. dialogClose() {
  1186. this.addressVisible = false;
  1187. this.sellerRemarkVisible = false;
  1188. this.clerkVisible = false;
  1189. this.sendVisible = false;
  1190. this.changePriceVisible = false;
  1191. this.cancelVisible = false;
  1192. this.citySendVisible = false;
  1193. },
  1194. dialogSubmit() {
  1195. this.expressId = 0;
  1196. this.getList();
  1197. },
  1198. // 发货
  1199. openExpress(order, type, expressId) {
  1200. this.newOrder = order;
  1201. this.sendType = type;
  1202. this.sendVisible = true;
  1203. this.expressId = parseInt(expressId);
  1204. },
  1205. // 申请取消订单
  1206. agreeCancel(row, status) {
  1207. this.newOrder = row;
  1208. this.cancelType = status;
  1209. this.cancelVisible = true;
  1210. },
  1211. // 清空回收站
  1212. toRecycleAll(e) {
  1213. this.$confirm('此操作将清空回收站, 是否继续?', '提示', {
  1214. confirmButtonText: '确定',
  1215. cancelButtonText: '取消',
  1216. type: 'warning',
  1217. center: true
  1218. }).then(() => {
  1219. this.submitLoading = true;
  1220. request({
  1221. params: {
  1222. r: this.recycleUrl,
  1223. },
  1224. data: {},
  1225. method: 'post',
  1226. }).then(e => {
  1227. e.visible = false;
  1228. this.submitLoading = false;
  1229. if (e.data.code === 0) {
  1230. this.$message({
  1231. message: e.data.msg,
  1232. type: 'success'
  1233. });
  1234. this.getList();
  1235. } else {
  1236. this.$message({
  1237. message: e.data.msg,
  1238. type: 'warning'
  1239. });
  1240. }
  1241. }).catch(e => {
  1242. this.submitLoading = false;
  1243. });
  1244. }).catch(() => {
  1245. });
  1246. },
  1247. // 清空回收站
  1248. toBatchSend(e) {
  1249. this.$navigate({
  1250. r: this.batchSendUrl
  1251. })
  1252. },
  1253. openExpressHint() {
  1254. this.$alert('该订单有多个物流,请到订单详情修改物流信息', '提示', {
  1255. confirmButtonText: '确定',
  1256. callback: action => {
  1257. }
  1258. });
  1259. },
  1260. openCity(order, sendType) {
  1261. this.newOrder = order;
  1262. this.sendType = sendType
  1263. this.citySendVisible = true;
  1264. },
  1265. storeOrderSend(order) {
  1266. this.$alert('是否将配送方式改为快递配送?', '提示', {
  1267. confirmButtonText: '确定',
  1268. showCancelButton: true,
  1269. type: 'warning',
  1270. callback: action => {
  1271. if (action == 'confirm') {
  1272. this.openDialog(order)
  1273. this.addressVisible = true;
  1274. }
  1275. }
  1276. });
  1277. }
  1278. },
  1279. });
  1280. </script>