com-orders-list.php 65 KB

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