vue-list.blade.php 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331
  1. @extends('layouts.base')
  2. @section('title', "订单列表")
  3. @section('content')
  4. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
  5. <style>
  6. .el-select {position: relative;}
  7. .el-select__tags { position: inherit;transform: translateY(0);padding: 3px 0;min-height: 40px;}
  8. .el-select__tags ~ .el-input {height: 100%;position: absolute;top: 50%;left: 0;transform: translateY(-50%);}
  9. .el-select__tags ~ .el-input .el-input__inner {min-height: 20px; height: 100% !important;}
  10. .el-select__input.is-mini { min-height: 20px;}
  11. .edit-i{display:none;}
  12. .el-table_1_column_2:hover .edit-i{font-weight:900;padding:0;margin:0;display:inline-block;}
  13. .el-tabs__item,.is-top{font-size:16px}
  14. .el-tabs__active-bar { height: 3px;}
  15. .list-title{display:flex;width:100%;background:#f9f9f9;padding:15px 10px;font-weight:900;border:1px solid #e9e9e9;}
  16. .list-title .list-title-1{display:flex;align-items:center;justify-content: center;}
  17. .list-info{display:flex ;padding: 10px;justify-content: left;background:#f9f9f9;}
  18. .list-con{display:flex;width:100%;font-size:12px;font-weight:500;align-items: stretch;border-bottom: 1px solid rgb(233, 233, 233);}
  19. .list-con-goods{display:flex;align-items:center;justify-content: center;box-sizing:border-box;padding-left:10px;border-top:1px solid #e9e9e9;min-height:90px}
  20. .list-con-goods-text{min-height:70px;overflow:hidden;flex:1;display: flex;flex-direction: column;justify-content: space-between;}
  21. .list-con-goods-price{border-right:1px solid #e9e9e9;border-left:1px solid #e9e9e9;min-width:150px;min-height:90px;text-align: left;padding:20px;display: flex;flex-direction: column;}
  22. .list-con-goods-title{font-size:14px;line-height:20px;text-overflow: -o-ellipsis-lastline;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;line-clamp: 2;-webkit-box-orient: vertical;}
  23. .list-con-goods-option{font-size:12px;color:#999}
  24. .list-con-goods-after-sales{font-size:12px;color:red}
  25. .list-con-member-info{display:flex;padding:0 2px;flex-direction: column;flex:1;min-width: 120px;line-height:28px;justify-content: center;text-align:left;font-size:14px;border-top:1px solid #e9e9e9;border-right:1px solid #e9e9e9;}
  26. .list-member{padding: 10px;font-size: 12px;font-weight: 500;display:flex}
  27. .list-num{flex:3;display:flex;align-items:center;border-right:1px solid #e9e9e9;justify-content: center;}
  28. .list-gen{display:flex;align-items:center;justify-content: center;line-height:28px;}
  29. .list-gen-txt{flex:1;border-right:1px solid #e9e9e9;border-bottom:1px solid #e9e9e9;align-items:center;justify-content: center;display:flex;}
  30. .list-opt{flex:1;display:flex;align-items:center;border-left:1px solid #e9e9e9;justify-content: center;}
  31. /* 导航 */
  32. .el-radio-button .el-radio-button__inner,.el-radio-button:first-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;border-left: 0px;}
  33. .el-radio-button__inner{border:0;}
  34. .el-radio-button:last-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;}
  35. .el-checkbox__inner{margin:0 15px;width:18px;height:18px;}
  36. .el-checkbox__input.is-checked .el-checkbox__inner::after {transform: rotate(45deg) scaleY(1);padding-top: 3px;padding-left:3px;}
  37. .a-btn {
  38. border-radius: 2px;
  39. padding: 8px 12px;
  40. box-sizing: border-box;
  41. color: #666;
  42. font-weight: 500;
  43. text-align: center;
  44. margin-left: 1%;
  45. background-color: #fff;
  46. }
  47. .a-btn:hover{
  48. background-color: #29BA9C;
  49. color: #FFF;
  50. }
  51. .a-colour1 {
  52. background-color: #fff;
  53. color: #666;
  54. }
  55. .a-colour2 {
  56. background-color: #29BA9C;
  57. color: #FFF;
  58. }
  59. .el-form-item {
  60. margin-bottom: 5px;
  61. }
  62. .el-popover{
  63. width: 90px;
  64. min-width: 90px;
  65. }
  66. .vue-search .el-form-item {
  67. height: 40px;
  68. }
  69. .row-bottom-class {
  70. margin-left: 15px;
  71. }
  72. </style>
  73. <div class="all" id="card">
  74. <div id="app" v-cloak>
  75. {{--订单类型选项卡--}}
  76. @include('order.typeTabs')
  77. <div class="vue-head">
  78. <div class="vue-main-title" style="margin-bottom:20px">
  79. <div class="vue-main-title-left"></div>
  80. <div class="vue-main-title-content">订单筛选</div>
  81. <div class="vue-main-title-button">
  82. </div>
  83. </div>
  84. <div class="vue-search">
  85. <template>
  86. <{!! (new \app\backend\modules\order\services\OrderViewService())->searchImport('name') !!}
  87. :view-return="responseResults"
  88. :search-form="search_form"
  89. :other-data="otherData"
  90. @sync-form="syncSearchForm"
  91. @search="searchMutual"
  92. @export="agentExport"
  93. >
  94. </{!! (new \app\backend\modules\order\services\OrderViewService())->searchImport('name') !!}>
  95. </template>
  96. </div>
  97. </div>
  98. <div class="vue-main">
  99. <div class="vue-main-form">
  100. <div class="vue-main-title" style="margin-bottom:20px">
  101. <div class="vue-main-title-left"></div>
  102. {{--<div class="vue-main-title-content" style="flex:0 0 140px">商品订单列表</div>--}}
  103. <div class="" style="text-align:left;font-size:14px;color:#999">
  104. <span>订单数:[[count.total]]</span>&nbsp;&nbsp;&nbsp;
  105. <span>订单金额:[[count.total_price]]</span>&nbsp;&nbsp;&nbsp;
  106. <span>运费:[[count.dispatch_price]]</span>&nbsp;&nbsp;&nbsp;
  107. <el-button @click="confirm_batch_send_show = true" v-if="code == 'waitSend'" size="mini" type="primary">
  108. 一键发货
  109. </el-button>
  110. </div>
  111. <div class="vue-main-title-button">
  112. </div>
  113. </div>
  114. <div v-for="(item,index) in list" style="border:1px solid #e9e9e9;border-radius:10px;margin-bottom:10px">
  115. <div class="list-info">
  116. <div style="display:flex;flex-wrap:wrap">
  117. <div class="vue-ellipsis" style="max-width:250px">
  118. <strong>[[item.store_name]]</strong>&nbsp;&nbsp;&nbsp;
  119. </div>
  120. <div class="vue-ellipsis" style="color:#999;max-width:150px">
  121. <strong>订单ID:</strong>[[item.id]]&nbsp;&nbsp;&nbsp;
  122. </div>
  123. <div v-if="item.order_sn" class="vue-ellipsis" style="color:#999;max-width:240px">
  124. <strong>订单编号:</strong>[[item.order_sn]]&nbsp;&nbsp;&nbsp;
  125. </div>
  126. <div v-if="item.has_one_order_pay" class="vue-ellipsis" style="color:#999;max-width:240px">
  127. <strong>支付单号:</strong>[[item.has_one_order_pay.pay_sn]]&nbsp;&nbsp;&nbsp;
  128. </div>
  129. <div class="vue-ellipsis" style="color:#999;max-width:230px">
  130. <strong>下单时间:</strong>[[item.create_time]]&nbsp;&nbsp;&nbsp;
  131. </div>
  132. <div v-if="item.has_many_first_order != null && item.has_many_first_order.length > 0" class="vue-ellipsis" style="color:#999;max-width:100px">
  133. <strong>首单</strong>&nbsp;&nbsp;&nbsp;
  134. </div>
  135. <div v-if="item.has_one_refund_apply" class="vue-ellipsis" style="color:red;max-width:230px">
  136. <strong>[[item.has_one_refund_apply.refund_type_name]]:[[item.has_one_refund_apply.status_name]]</strong>&nbsp;&nbsp;&nbsp;
  137. </div>
  138. <div v-if="!item.refund_id && item.part_refund" style="color:red;max-width:230px">
  139. <strong>部分退款</strong>&nbsp;&nbsp;
  140. </div>
  141. <div v-if="item.no_refund" class="vue-ellipsis" style="color:red;max-width:200px">
  142. <strong>不可退款</strong>&nbsp;&nbsp;&nbsp;
  143. </div>
  144. <div v-if="item.manual_refund_log != null || (item.has_one_refund_apply && item.has_one_refund_apply.part_refund == 4)" class="vue-ellipsis" style="color:red;max-width:200px">
  145. <strong>退款并关闭</strong>&nbsp;&nbsp;&nbsp;
  146. </div>
  147. <div v-if="item.leshua_refund_error_msg != null" class="vue-ellipsis" style="color:red;max-width:500px">
  148. <strong>(乐刷: [[ item.leshua_refund_error_msg ]])</strong>
  149. </div>
  150. <div v-for="(topContent,topKey1) in item.top_row" :key="topKey1" class="vue-ellipsis" style="color:#29BA9C;max-width:230px" >
  151. <strong>[[topContent]]</strong>&nbsp;&nbsp;&nbsp;
  152. </div>
  153. </div>
  154. <div style="flex:1;text-align:right;min-width:150px;">
  155. <span style="margin-left: 10px;" v-if="item.fixed_button.partRefund.is_show">
  156. <a @click="partRefund(item.id,item)" style="color:#29BA9C;font-size:13px;font-weight:600">部分退款</a>
  157. </span>
  158. <span style="margin-left: 10px;" v-if="item.fixed_button.close.is_show">
  159. <a @click="closeOrder(item.id,item)" style="color:#29BA9C;font-size:13px;font-weight:600">关闭订单</a>
  160. </span>
  161. <span style="margin-left: 10px;" v-if="item.fixed_button.manualRefund.is_show">
  162. <a @click="closeOrder1(item.id,item)" style="color:#29BA9C;font-size:13px;font-weight:600">退款并关闭</a>
  163. </span>
  164. </div>
  165. </div>
  166. <div class="list-con">
  167. <div style="flex:3;min-width:400px">
  168. <div v-for="(item1,index1) in item.has_many_order_goods" class="list-con-goods">
  169. <div class="list-con-goods-img" style="width:80px">
  170. <el-image :src="item1.thumb" style="width:70px;height:70px"></el-image>
  171. </div>
  172. <div class="list-con-goods-text" :style="{justifyContent:(item1.goods_option_title?'':'center')}">
  173. <div class="list-con-goods-title" style="color:#29BA9C;cursor: pointer;" @click="gotoGoods(item1.goods_id,item)">[[item1.title]]</div>
  174. <div class="list-con-goods-option" v-if="item1.goods_option_title">规格:[[item1.goods_option_title]]</div>
  175. <div v-if="item1.after_sales">
  176. <div v-if="item1.refund_id" class="list-con-goods-after-sales">
  177. [[item1.after_sales.refund_type_name]]:[[item1.after_sales.refund_status_name]] * [[item1.after_sales.refunded_total]]
  178. </div>
  179. <div v-if="(!item1.refund_id) && item1.after_sales.refunded_total" class="list-con-goods-after-sales" >
  180. 已售后:[[item1.after_sales.refunded_total]]
  181. </div>
  182. </div>
  183. </div>
  184. <div class="list-con-goods-price">
  185. <div>原价:[[item1.goods_price]]</div>
  186. @if(\Setting::get('shop.member')['vip_price'] == 1)
  187. <div>会员价:[[item1.vip_price]]</div>
  188. @endif
  189. <div>实付:[[item1.payment_amount]]</div>
  190. <div>数量:[[item1.total]]</div>
  191. </div>
  192. </div>
  193. </div>
  194. <div class="list-con-member-info vue-ellipsis">
  195. <div v-if="item.belongs_to_member" style="min-width:70%;margin:0 auto">
  196. <div @click="gotoMember(item.uid)" style="line-height:32px;color:#29BA9C;cursor: pointer;" class="vue-ellipsis">
  197. <strong>[[item.belongs_to_member.nickname]] </strong>
  198. </div>
  199. <div>[[item.has_many_member_certified?item.has_many_member_certified.realname:item.belongs_to_member.realname]]</div>
  200. <div>[[item.belongs_to_member.mobile]]</div>
  201. </div>
  202. <div v-else style="min-width:70%;margin:0 auto">
  203. <div v-if="item.member_cancel&&item.member_cancel.status==2">该会员已注销</div>
  204. <div v-else-if="item.uid==0"></div>
  205. <div v-else>会员([[item.uid]])已被删除</div>
  206. </div>
  207. </div>
  208. <div class="list-con-member-info vue-ellipsis" style="text-align:center;min-width: 90px;">
  209. <div><strong>[[item.pay_type_name]]</strong></div>
  210. <div><strong v-if="item.has_one_dispatch_type">[[item.has_one_dispatch_type.name]]</strong></div>
  211. </div>
  212. <div class="list-con-member-info vue-ellipsis" style="min-width: 120px;">
  213. <div style="min-width:75%;margin:0 auto">
  214. <div>商品小计:¥[[item.goods_price]]</div>
  215. <div>运费:¥[[item.dispatch_price]]</div>
  216. <div v-if="item.change_price!='0.00'">卖家改价:¥[[item.change_price]]</div>
  217. <div v-if="item.change_dispatch_price!='0.00'">卖家改运费:¥[[item.change_dispatch_price]]</div>
  218. <div>应付款:¥[[item.price]]</div>
  219. <div>商品总数量:[[item.goods_total]]</div>
  220. </div>
  221. </div>
  222. <div class="list-con-member-info vue-ellipsis" style="text-align:center">
  223. <div style="min-width:70%;margin:0 auto">
  224. <div style="color:#29BA9C">[[item.status_name]]</div>
  225. </div>
  226. </div>
  227. <div class="list-con-member-info vue-ellipsis" style="text-align:center;min-width: 80px;border-right:0">
  228. <div v-for="(item1,index1) in item.backend_button_models" :key="index1">
  229. <el-button @click="orderConfirm(item1.value,item)" size="mini" :type="item1.type" style="width:80%;margin:0 auto;margin-bottom:5px;">
  230. [[item1.name]]
  231. </el-button>
  232. </div>
  233. </div>
  234. </div>
  235. <div class="list-member">
  236. <div style="display:flex;flex-wrap:wrap;justify-content: flex-start">
  237. <template v-if="item.row_bottom">
  238. <template v-for="(bottom_item,bottom_key1) in item.row_bottom">
  239. <span :class="bottom_key1 ? 'row-bottom-class' : '' " :style="bottom_item.style">
  240. [[bottom_item.text]]
  241. </span>
  242. </template>
  243. </template>
  244. &nbsp;&nbsp;&nbsp;
  245. <span v-if="item.has_one_order_remark" style="
  246. width: 300px;
  247. overflow: hidden;
  248. text-overflow: ellipsis;
  249. white-space: nowrap;
  250. ">商家备注:[[item.has_one_order_remark.remark]]</span>
  251. </div>
  252. <div style="justify-content: flex-end;flex:1;display:flex">
  253. <div v-if="extra_param.printer" style="margin-right:15px">
  254. <el-tooltip class="item" effect="dark" content="打印小票" placement="bottom">
  255. <a style="color:#29BA9C;" @click="orderPrinter(item.id,item)">
  256. {{-- <i class="el-icon-printer"></i>--}}
  257. <img src="{!! \app\common\helpers\Url::shopUrl('static/images/printer.png') !!}" style="width: 20px;">
  258. </a>
  259. </el-tooltip>
  260. </div>
  261. <div v-if="item.has_many_city_delivery_another&&item.has_many_city_delivery_another.length!=0">
  262. <city-delivery :item="item"></city-delivery>
  263. </div>
  264. <div style="margin-right:15px" v-if="item.fixed_button.invoice.is_show">
  265. <el-popover placement="top-start" trigger="hover" style="min-width:80px;">
  266. <div style="width:60px;" @click="oneClickInvoicing(item.id,item.price)">
  267. <el-button type="text">一键开票</el-button>
  268. </div>
  269. <div style="width:60px;">
  270. <a @click="oneClickInvoicing(item.id,item.price,`{!! yzWebFullUrl('plugin.invoice.admin.invoicing-order.set-invoice') !!}&order_id=${item.id}`)">
  271. <el-button type="text">手动开票</el-button>
  272. </a>
  273. </div>
  274. <a style="color:#29BA9C" slot="reference">[[item.fixed_button.invoice.name]]</a>
  275. </el-popover>
  276. </div>
  277. @if(app('plugins')->isEnabled('electronics-bill'))
  278. <electronics-bill :item="item"></electronics-bill>
  279. @endif
  280. <div v-if="item.status==0" style="margin-right:15px">
  281. <a style="color:#29BA9C" @click="changePrice(item.id,item)">修改价格</a>
  282. </div>
  283. <div v-if="item.fixed_button.detail.is_show">
  284. <a @click="gotoDetail(item)" style="color:#29BA9C">查看详情</a>
  285. </div>
  286. </div>
  287. </div>
  288. </div>
  289. </div>
  290. </div>
  291. {{--订单类型-动态引入主键--}}
  292. @foreach((new \app\backend\modules\order\services\OrderViewService())->importVue() as $routeKey => $vueRoute)
  293. <template>
  294. <{{$vueRoute['primary']}}
  295. :operation-type="operationType"
  296. :operation-order="operationOrder"
  297. :express-companies="expressCompanies"
  298. :dialog_show="dialog_show"
  299. @search="reloadList"
  300. >
  301. </{{$vueRoute['primary']}}>
  302. </template>
  303. @endforeach
  304. {{--<template>--}}
  305. {{--<order-operation--}}
  306. {{--:operation-type="operationType"--}}
  307. {{--:operation-order="operationOrder"--}}
  308. {{--:synchro="synchro"--}}
  309. {{--:express-companies="expressCompanies"--}}
  310. {{--:dialog_show="dialog_show"--}}
  311. {{--@search="reloadList"--}}
  312. {{-->--}}
  313. {{--</order-operation>--}}
  314. {{--</template>--}}
  315. <!-- 退款 -->
  316. <el-dialog :visible.sync="close_order_show" width="750px" title="关闭订单">
  317. <div style="height:300px;overflow:auto" id="close-order">
  318. <div style="color:#000;font-weight:500">关闭订单原因</div>
  319. <el-input v-model="close_order_con" :rows="10" type="textarea"></el-input>
  320. </div>
  321. <span slot="footer" class="dialog-footer">
  322. <el-button @click="close_order_show = false">取 消</el-button>
  323. <el-button type="primary" @click="sureCloseOrder">确 定 </el-button>
  324. </span>
  325. </el-dialog>
  326. <!-- 手动退款 -->
  327. <el-dialog :visible.sync="close_order1_show" width="750px" title="退款并关闭订单">
  328. <div style="height:300px;overflow:auto">
  329. <div style="color:#000;font-weight:500">退款原因</div>
  330. <el-input v-model="close_order1_con" :rows="10" type="textarea"></el-input>
  331. </div>
  332. <span slot="footer" class="dialog-footer">
  333. <el-button @click="close_order1_show = false">取 消</el-button>
  334. <el-button type="primary" @click="sureCloseOrder1">退 款 </el-button>
  335. </span>
  336. </el-dialog>
  337. <!-- 部分退款 -->
  338. <el-dialog :visible.sync="part_refund_show" width="750px" title="部分退款" @close="default_check=false">
  339. <div style="overflow:auto">
  340. <div style="color:#000;font-weight:500">退款金额:¥[[part_refund_price]]</div>
  341. </div>
  342. <div style="height:300px;overflow:auto">
  343. <div style="color:#000;font-weight:500">申请说明</div>
  344. <el-input v-model="part_refund_con" :rows="10" type="textarea"></el-input>
  345. </div>
  346. <el-divider></el-divider>
  347. <div v-for="(item_part,index_part) in part_refund_goods" style="display: flex;justify-content: space-between;align-items: center;padding-bottom: 10px">
  348. <el-checkbox :label="item_part.id" :key="index_part" style="width: 100%;" @change="changeCheck($event,item_part.id)" v-model="item_part.checked"><br/></el-checkbox>
  349. <div style="min-width: 600px;display: flex;align-items: center;justify-content: space-between;">
  350. <div>
  351. <img :src="item_part.thumb" style="width:60px;height:60px;">
  352. <span>[[item_part.title]]</span>
  353. <span class="help-block" v-if="item_part.option">规格:[[item_part.option]]</span>
  354. </div>
  355. <div style="float: right">
  356. <el-input-number v-model="item_part.total" controls-position="right" :min="1" :max="item_part.remark" @change="changeCheck"></el-input-number>
  357. <div>最大数量:[[item_part.remark]]</div>
  358. </div>
  359. </div>
  360. </div>
  361. <div slot="footer" class="dialog-footer" style="display: flex;justify-content: space-between;align-items: center;">
  362. <el-checkbox label="全选" @change="allCheck($event)" v-model="default_check" style="margin-bottom: 0"></el-checkbox>
  363. <div>
  364. <el-button @click="part_refund_show = false">取 消</el-button>
  365. <el-button type="primary" @click="surePartRefund">确 定 </el-button>
  366. </div>
  367. </div>
  368. </el-dialog>
  369. <!-- 取消发货 -->
  370. <!-- <el-dialog :visible.sync="cancel_send_show" width="750px" title="取消发货">
  371. <div style="height:300px;overflow:auto" id="cancel-send">
  372. <div style="color:#000;font-weight:500">取消发货原因</div>
  373. <el-input v-model="cancel_send_con" :rows="10" type="textarea"></el-input>
  374. </div>
  375. <span slot="footer" class="dialog-footer">
  376. <el-button @click="cancel_send_show = false">取 消</el-button>
  377. <el-button type="primary" @click="sureCancelSend">取消发货 </el-button>
  378. </span>
  379. </el-dialog> -->
  380. <!-- 批量发货发货 -->
  381. <el-dialog :visible.sync="confirm_batch_send_show" width="750px" title="一键发货(退款订单不能发货)">
  382. <div style="height:200px;overflow:auto" id="confirm-send">
  383. <el-form ref="send" :model="batch_send" :rules="send_rules" label-width="15%">
  384. <el-form-item label="配送方式" prop="">
  385. <el-radio v-model="batch_send.dispatch_type_id" :label="1">快递</el-radio>
  386. </el-form-item>
  387. <el-form-item label="快递公司">
  388. <el-select v-model="batch_send.express_code" clearable filterable placeholder="快递公司" :disabled='readonly' style="width:70%;">
  389. <el-option label="其他快递" value=""></el-option>
  390. <el-option v-for="(item,index) in expressCompanies" :key="index" :label="item.name" :value="item.value"></el-option>
  391. </el-select>
  392. </el-form-item>
  393. <el-form-item label="快递单号" prop="">
  394. <el-input v-model="batch_send.express_sn" :disabled='readonly' style="width:70%;"></el-input>
  395. </el-form-item>
  396. </el-form>
  397. </div>
  398. <span slot="footer" class="dialog-footer">
  399. <el-button @click="confirm_batch_send_show = false">取 消</el-button>
  400. <el-button type="primary" @click="sureconfirmBatchSend">确认发货 </el-button>
  401. </span>
  402. </el-dialog>
  403. <!-- 多包裹确认发货 -->
  404. <!-- <el-dialog :visible.sync="more_send_show" width="750px" title="分批发货">
  405. <div style="" id="separate-send">
  406. <el-form ref="send" :model="send" label-width="15%">
  407. <el-form-item label="收件人信息" prop="aggregation">
  408. <div>收 件 人: [[address_info.realname]] / [[address_info.mobile]]</div>
  409. <div>收货地址: [[address_info.address]]</div>
  410. </el-form-item>
  411. <el-form-item label="快递公司">
  412. <el-select v-model="send.express_code" clearable filterable placeholder="快递公司" style="width:70%;">
  413. <el-option label="其他快递" value=""></el-option>
  414. <el-option v-for="(v1,k1) in expressCompanies" :key="k1" :label="v1.name" :value="v1.value"></el-option>
  415. </el-select>
  416. </el-form-item>
  417. <el-form-item label="快递单号" prop="">
  418. <el-input v-model="send.express_sn" style="width:70%;"></el-input>
  419. </el-form-item>
  420. </el-form>
  421. <el-table ref="multipleTable" :data="order_goods_send_list" tooltip-effect="dark" height="250" style="width: 100%" @selection-change="moreSendChange">
  422. <el-table-column type="selection" width="55"></el-table-column>
  423. <el-table-column width="550">
  424. <template slot-scope="scope">
  425. <div style="display:flex;width: 88%;">
  426. <div style="width:50px;height:50px">
  427. <img :src="scope.row.thumb" alt="" style="width:50px;height:50px">
  428. </div>
  429. <div style="margin-left:20px;display: flex;flex-direction: column;justify-content: space-between;">
  430. <div style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">[[scope.row.title]]</div>
  431. <div style="color:#999">[[scope.row.goods_id]]</div>
  432. </div>
  433. </div>
  434. </template>
  435. </el-table-column>
  436. <el-table-column>
  437. <template slot-scope="scope">
  438. <div style="color:#999">[[scope.row.goods_option_title]]</div>
  439. </template>
  440. </el-table-column>
  441. </el-table>
  442. </div>
  443. <span slot="footer" class="dialog-footer">
  444. <el-button @click="more_send_show = false">取 消</el-button>
  445. <el-button type="primary" @click="confirmMoreSend()">确认发货 </el-button>
  446. </span>
  447. </el-dialog> -->
  448. <!-- 修改价格 -->
  449. <el-dialog :visible.sync="change_price_show" width="65%" title="修改价格">
  450. <div style="height:500px;overflow:auto" id="change-price">
  451. <el-table :data="order_goods_model" style="width: 100%">
  452. <el-table-column label="商品名称" prop="has_one_goods.title"></el-table-column>
  453. <el-table-column label="单价" align="center" prop="goods_price" width="120">
  454. <template slot-scope="scope">
  455. <div>
  456. [[parseFloat(scope.row.price)/parseFloat(scope.row.total)]]
  457. </div>
  458. </template>
  459. </el-table-column>
  460. <el-table-column label="数量" align="center" prop="total" width="100"></el-table-column>
  461. <el-table-column label="支付金额" align="center" prop="payment_amount" width="150">
  462. <template slot-scope="scope">
  463. <div>
  464. [[scope.row.price]]
  465. <el-tag v-if="scope.row.change_price&&scope.row.change_price!=0&&scope.row.change_price!='0.00'" type="danger">改价</el-tag>
  466. </div>
  467. </template>
  468. </el-table-column>
  469. <el-table-column label="加价或减价" align="center" prop="display_order">
  470. <template slot-scope="scope">
  471. <div>
  472. <el-input @input="inputPrice(scope.$index,scope.row.new_price)" v-model="scope.row.new_price" size="small" style="width:95%"></el-input>
  473. </div>
  474. </template>
  475. </el-table-column>
  476. <el-table-column label="运费" align="center" prop="dispatch_price">
  477. <template slot-scope="scope" v-if="scope.$index==0">
  478. <div>
  479. <el-input @input="inputPrice('dispatch_pricec',dispatch_price)" v-model="dispatch_price" size="small" style="width:95%"></el-input>
  480. </div>
  481. </template>
  482. </el-table-column>
  483. <el-table-column label="" align="center" prop="display_order">
  484. <template slot-scope="scope" v-if="scope.$index==0">
  485. <div>
  486. <el-link :underline="false" @click="clearDispatch">直接免运费</el-link>
  487. </div>
  488. </template>
  489. </el-table-column>
  490. </el-table>
  491. <div class="tip" style="color:#f00;margin:10px 0;">提示:改价后价格不能小于0元</div>
  492. <div style="background:#eff3f6;border-radius:8px;padding:20px 10px;color:#000;font-weight:500;line-height:36px;">
  493. <div style="font-size:16px;font-weight:600;color:#000">购买者信息</div>
  494. <div>
  495. <div style="display:inline-block;width:150px;text-align:right;margin-right:30px">姓名</div>
  496. <div style="display:inline-block;">[[order_model.address?order_model.address.realname:""]]</div>
  497. </div>
  498. <div>
  499. <div style="display:inline-block;width:150px;text-align:right;margin-right:30px">联系方式</div>
  500. <div style="display:inline-block;">[[order_model.address?order_model.address.mobile:""]]</div>
  501. </div>
  502. <div>
  503. <div style="display:inline-block;width:150px;text-align:right;margin-right:30px">联系地址</div>
  504. <div style="display:inline-block;">[[order_model.address?order_model.address.address:""]]</div>
  505. </div>
  506. </div>
  507. </div>
  508. <span slot="footer" class="dialog-footer" style="display:flex;justify-content: flex-end;">
  509. <div style="display:inline-block;color:#000;margin-right:20px;font-weight:500;">
  510. <div style="display:flex;text-align:center;line-height:28px;align-items: center;">
  511. <div style="margin-right:15px">
  512. 原价<br>
  513. ¥[[parseFloat(order_model.price)-(parseFloat(order_model.dispatch_price))]]
  514. </div>
  515. <div style="margin-right:15px">+</div>
  516. <div style="margin-right:15px">
  517. 运费<br>
  518. ¥[[parseFloat(dispatch_price)]]
  519. </div>
  520. <div style="margin-right:15px">+</div>
  521. <div style="margin-right:15px">
  522. 价格修改<br>
  523. ¥[[(parseFloat(change_all_money).toFixed(2))]]
  524. </div>
  525. <div style="margin-right:15px">=</div>
  526. <div style="margin-right:15px">
  527. 买家实付<br>
  528. <strong style="color:#f00">¥[[(parseFloat(all_money).toFixed(2))]]</strong>
  529. </div>
  530. </div>
  531. </div>
  532. <div style="line-height:56px">
  533. <el-button @click="change_price_show = false">取 消</el-button>
  534. <el-button type="primary" @click="sureChangePrice">确认改价</el-button>
  535. </div>
  536. </span>
  537. </el-dialog>
  538. <!-- 分页 -->
  539. <div class="vue-page" v-if="total>0">
  540. <el-row>
  541. <el-col align="right">
  542. <el-pagination layout="prev, pager, next,jumper" @current-change="search" :total="total"
  543. :page-size="per_page" :current-page="current_page" background
  544. ></el-pagination>
  545. </el-col>
  546. </el-row>
  547. </div>
  548. <invoice v-model="OneclickInvoicing" :show="OneclickInvoicing" ref="invoice" :order_id="order_id" url="{!! yzWebFullUrl('order.order-list.index') !!}"></invoice>
  549. </div>
  550. </div>
  551. {{--订单类型-动态加载js文件--}}
  552. @foreach((new \app\backend\modules\order\services\OrderViewService())->importVue() as $routeKey => $vueRoute)
  553. @include($vueRoute['path'])
  554. @endforeach
  555. @include((new \app\backend\modules\order\services\OrderViewService())->searchImport('path'))
  556. {{--@include('public.admin.orderOperation')--}}
  557. {{--@include('public.admin.orderOperationV')--}}
  558. @include('public.admin.invoice')
  559. <script>
  560. var app = new Vue({
  561. el: "#app",
  562. delimiters: ['[[', ']]'],
  563. name: 'test',
  564. data() {
  565. return {
  566. OneclickInvoicing:false,//一键开票预览
  567. order_id:"",
  568. commonPartUrl: '{!! yzWebFullUrl('order.order-list.common-part') !!}', //获取公共参数链接
  569. listUrl: '{!! yzWebFullUrl('order.order-list.get-list') !!}',//获取订单数据链接
  570. exportUrl: '{!! yzWebFullUrl('order.order-list.export') !!}',//订单数据导出链接
  571. detailUrl: '{!! yzWebFullUrl('order.detail.vue-index') !!}',
  572. url_open : "{!! yzWebUrl('order.waybill.waybill') !!}",
  573. list:[],
  574. count:{},
  575. has_many_level:[],
  576. change_sort:'',
  577. times:[], //搜索时间
  578. responseResults:{}, //页面返回全部参数
  579. otherData:{}, //传给搜索组件的额外参数
  580. extra_param:{}, //插件判断条件
  581. //订单条件
  582. code:'all',
  583. expressCompanies:[],//快递公司
  584. //搜索条件参数
  585. search_form:{
  586. member_id:"",
  587. order_sn:'',
  588. },
  589. close_order_show:false,//关闭订单弹窗
  590. close_order_con:"",//关闭订单原因
  591. close_order_id:"",
  592. close_order_api:"",
  593. close_order1_show:false,//手动关闭订单弹窗
  594. close_order1_con:"",//手动关闭订单原因
  595. close_order1_id:"",
  596. close_order1_api:"",
  597. cancel_send_show:false,// 取消发货弹窗
  598. cancel_send_con:"",//取消发货原因
  599. cancel_send_id:'',
  600. confirm_send_show:false,// 确认发货弹窗
  601. confirm_send_id:"",
  602. confirm_batch_send_show:false,// 确认发货弹窗
  603. change_price_show:false,//修改价格弹窗
  604. change_price_id:"",
  605. part_refund_show:false,//部分退款弹窗
  606. part_refund_id:"",
  607. part_refund_con:"",//部分退款原因
  608. part_refund_price:0,
  609. part_refund_api:"",
  610. part_refund_goods:[],
  611. part_refund_arr:[],
  612. change_all_money:0.00,//价格修改
  613. all_money:0.00,//买家实付
  614. order_model:{},
  615. dispatch_price:0,//运费
  616. order_goods_model:[],
  617. address_info:{},
  618. //发货提交信息
  619. send:{
  620. dispatch_type_id:1,
  621. express_code:"",
  622. express_sn:"",
  623. },
  624. //发货提交信息
  625. batch_send:{
  626. dispatch_type_id:1,
  627. express_code:"",
  628. express_sn:"",
  629. },
  630. send_rules:{
  631. },
  632. // 多包裹发货
  633. more_send_show:false,
  634. order_goods_send_list:[],
  635. send_order_goods_ids:[],
  636. street:0,
  637. province_list:[],
  638. city_list : [],
  639. district_list : [],
  640. street_list : [],
  641. areaLoading:false,
  642. rules: {},
  643. current_page:1,
  644. total:1,
  645. per_page:1,
  646. synchro:0,
  647. readonly:false,
  648. operationType:'',
  649. operationOrder:{},
  650. dialog_show:0,
  651. default_check:false,
  652. is_source_open: 0,
  653. source_list: [],
  654. }
  655. },
  656. created() {
  657. let result = this.viewReturn();
  658. this.__initial(result);
  659. },
  660. mounted() {
  661. // console.log(this.search_form);
  662. this.getData(1);
  663. },
  664. methods: {
  665. //搜索子组件传过来数据
  666. syncSearchForm(form,other) {
  667. this.search_form = form;
  668. console.log(form,other);
  669. },
  670. //搜索组件提交搜索
  671. searchMutual() {
  672. console.log(this.search_form);
  673. this.search(1);
  674. },
  675. //搜索组件提交导出
  676. agentExport(export_type,template,exportUrl) {
  677. this.export1(export_type,template,exportUrl);
  678. },
  679. oneClickInvoicing(id,price,url){
  680. if (price<=0) {
  681. this.$message.error("0元或0元以下商品不支持开票");
  682. return false;
  683. }
  684. if (url) {
  685. window.location.href = url;
  686. return false;
  687. }
  688. //一键开票
  689. this.order_id = id;
  690. this.OneclickInvoicing = true;
  691. },
  692. //视图返回数据
  693. viewReturn() {
  694. return {!! $data?:'{}' !!};
  695. },
  696. //初始化页面数据,请求链接
  697. __initial(data) {
  698. if (data.code) {
  699. this.code = data.code;
  700. }
  701. if (data.listUrl) {
  702. this.listUrl = data.listUrl;
  703. }
  704. if (data.commonPartUrl) {
  705. this.commonPartUrl = data.commonPartUrl;
  706. }
  707. if (data.exportUrl) {
  708. this.exportUrl = data.exportUrl;
  709. }
  710. if (data.extraParam) {
  711. this.extra_param = data.extraParam;
  712. }
  713. this.expressCompanies = data.expressCompanies;
  714. this.responseResults = data;
  715. this.is_source_open = data.is_source_open;
  716. this.source_list = data.source_list;
  717. // console.log(data);
  718. },
  719. getData(page) {
  720. let requestData = {
  721. page:page,
  722. code: this.code,
  723. search: JSON.parse(JSON.stringify(this.search_form)),
  724. };
  725. // console.log(requestData);
  726. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  727. this.$http.post(this.listUrl,requestData).then(function(response) {
  728. if (response.data.result) {
  729. // this.list = response.data.data.list;
  730. //this.expressCompanies = response.data.data.expressCompanies;
  731. this.count = response.data.data.count;
  732. this.list = response.data.data.list.data;
  733. this.current_page = response.data.data.list.current_page;
  734. this.total = response.data.data.list.total;
  735. this.per_page = response.data.data.list.per_page;
  736. this.synchro = response.data.data.synchro;
  737. loading.close();
  738. } else {
  739. this.$message({
  740. message: response.data.msg,
  741. type: 'error'
  742. });
  743. }
  744. loading.close();
  745. }, function(response) {
  746. this.$message({
  747. message: response.data.msg,
  748. type: 'error'
  749. });
  750. loading.close();
  751. });
  752. },
  753. search(val) {
  754. this.getData(val);
  755. },
  756. initProvince(val) {
  757. // console.log(val);
  758. this.areaLoading = true;
  759. this.$http.get("{!! yzWebUrl('area.list.init', ['area_ids'=>'']) !!}"+val).then(response => {
  760. this.province_list = response.data.data;
  761. this.areaLoading = false;
  762. }, response => {
  763. this.areaLoading = false;
  764. });
  765. },
  766. changeProvince(val) {
  767. this.city_list = [];
  768. this.district_list = [];
  769. this.street_list = [];
  770. // this.search_form.province_id = "";
  771. this.search_form.city_id = "";
  772. this.search_form.district_id = "";
  773. this.search_form.street_id = "";
  774. this.areaLoading = true;
  775. let url = "<?php echo yzWebUrl('area.list', ['parent_id'=> '']); ?>" + val;
  776. this.$http.get(url).then(response => {
  777. if (response.data.data.length) {
  778. this.city_list = response.data.data;
  779. } else {
  780. this.city_list = null;
  781. }
  782. this.areaLoading = false;
  783. }, response => {
  784. this.areaLoading = false;
  785. });
  786. },
  787. // 市改变
  788. changeCity(val) {
  789. this.district_list = [];
  790. this.street_list = [];
  791. this.search_form.district_id = "";
  792. this.search_form.street_id = "";
  793. this.areaLoading = true;
  794. let url = "<?php echo yzWebUrl('area.list', ['parent_id'=> '']); ?>" + val;
  795. this.$http.get(url).then(response => {
  796. if (response.data.data.length) {
  797. this.district_list = response.data.data;
  798. } else {
  799. this.district_list = null;
  800. }
  801. this.areaLoading = false;
  802. }, response => {
  803. this.areaLoading = false;
  804. });
  805. },
  806. // 区改变
  807. changeDistrict(val) {
  808. // console.log(val)
  809. this.street_list = [];
  810. this.search_form.street_id = "";
  811. this.areaLoading = true;
  812. let url = "<?php echo yzWebUrl('area.list', ['parent_id'=> '']); ?>" + val;
  813. this.$http.get(url).then(response => {
  814. if (response.data.data.length) {
  815. this.street_list = response.data.data;
  816. } else {
  817. this.street_list = null;
  818. }
  819. this.areaLoading = false;
  820. }, response => {
  821. this.areaLoading = false;
  822. });
  823. },
  824. gotoDetail(item) {
  825. // let link = this.detailUrl +'&id='+item.id;
  826. let link = item.fixed_button.detail.api +'&id='+item.id+'&order_id='+item.id;
  827. // window.location.href = link;
  828. window.open(link);
  829. },
  830. // 关闭订单
  831. closeOrder(id,item) {
  832. this.close_order_show = true;
  833. this.close_order_con = "";
  834. this.close_order_id = id;
  835. this.close_order_api = item.fixed_button.close.api;
  836. // console.log(this.close_order_api)
  837. },
  838. // 确认关闭订单
  839. sureCloseOrder() {
  840. let json = {
  841. // route:'order.vue-operation.close',
  842. order_id:this.close_order_id,
  843. reson:this.close_order_con,
  844. };
  845. // console.log(json);
  846. let loading = this.$loading({target:document.querySelector("#close-order"),background: 'rgba(0, 0, 0, 0)'});
  847. this.$http.post(this.close_order_api,json).then(function (response) {
  848. if (response.data.result) {
  849. this.$message({type: 'success',message: '关闭订单成功!'});
  850. }
  851. else{
  852. this.$message({type: 'error',message: response.data.msg});
  853. }
  854. loading.close();
  855. this.close_order_show = false;
  856. this.search(this.current_page);
  857. },function (response) {
  858. this.$message({type: 'error',message: response.data.msg});
  859. loading.close();
  860. this.close_order_show = false;
  861. })
  862. },
  863. // 手动退款并关闭订单
  864. closeOrder1(id,item) {
  865. this.close_order1_show = true;
  866. this.close_order1_con = "";
  867. this.close_order1_id = id;
  868. this.close_order1_api = item.fixed_button.manualRefund.api;
  869. },
  870. // 手动确认关闭订单
  871. sureCloseOrder1() {
  872. let json = {
  873. route:'order.vue-operation.manualRefund',
  874. order_id:this.close_order1_id,
  875. reson:this.close_order1_con,
  876. }
  877. // console.log(json);
  878. let loading = this.$loading({target:document.querySelector("#close-order"),background: 'rgba(0, 0, 0, 0)'});
  879. this.$http.post(this.close_order1_api,json).then(function (response) {
  880. if (response.data.result) {
  881. this.$message({type: 'success',message: '关闭订单成功!'});
  882. }
  883. else{
  884. this.$message({type: 'error',message: response.data.msg});
  885. }
  886. loading.close();
  887. this.close_order1_show = false;
  888. this.search(this.current_page);
  889. },function (response) {
  890. this.$message({type: 'error',message: response.data.msg});
  891. loading.close();
  892. this.close_order1_show = false;
  893. })
  894. },
  895. // 部分退款
  896. partRefund(id,item) {
  897. this.$http.post("{!! yzWebFullUrl('order.detail.order-goods-part-refund') !!}",{
  898. order_id:id,
  899. }).then(function (response) {
  900. if (response.data.result) {
  901. let list = [];
  902. let orderGoods = response.data.data;
  903. orderGoods.forEach((item,index) => {
  904. if(item.refundable_total > 0){
  905. let new_title = item.title;
  906. if (item.title.length > 15) {
  907. new_title = item.title.substring(0, 15) + '...';
  908. }
  909. list.push({id:item.id,thumb:item.thumb,title:new_title,total:item.refundable_total,remark:item.refundable_total,unit_price:item.unit_price,checked:false,option:item.goods_option_title});
  910. }
  911. });
  912. this.part_refund_goods = list;
  913. } else{
  914. this.$message({type: 'error',message: response.data.msg});
  915. }
  916. },function (response) {
  917. this.$message({type: 'error',message: response.data.msg});
  918. });
  919. // var list = [];
  920. // item.has_many_order_goods.forEach((item,index) => {
  921. // if(item.title.length > 15){
  922. // var new_title = item.title.substring(0,15)+'...';
  923. // }else{
  924. // var new_title = item.title;
  925. // }
  926. // if(item.is_refund != 1){
  927. // list.push({id:item.id,thumb:item.thumb,title:new_title,total:item.total,remark:item.total,price:item.payment_amount,checked:false,option:item.goods_option_title});
  928. // }
  929. // });
  930. // this.part_refund_goods = list;
  931. this.part_refund_id = id;
  932. this.part_refund_api = item.fixed_button.partRefund.api;
  933. this.part_refund_con = "";//部分退款原因
  934. this.part_refund_price = 0;
  935. this.part_refund_show = true;
  936. },
  937. changeCheck(ev,row) {
  938. let newArr = this.part_refund_goods.filter(item => item.checked).map(citem => {
  939. return {'id': citem.id, 'total': citem.total, 'unit_price': citem.unit_price, 'remark': citem.remark};
  940. });
  941. var sum = 0;
  942. newArr.forEach((item, index) => {
  943. sum = sum + item.unit_price * item.total;
  944. });
  945. this.part_refund_arr = newArr;
  946. this.part_refund_price = Math.floor(sum * 100) / 100;
  947. },
  948. allCheck(e) {
  949. if (e) {
  950. this.part_refund_goods.map(item => {
  951. return item.checked = true;
  952. });
  953. let newArr = this.part_refund_goods.filter(item => item.checked).map(citem => {
  954. return {'id': citem.id, 'total': citem.total, 'unit_price': citem.unit_price, 'remark': citem.remark};
  955. });
  956. var sum = 0;
  957. newArr.forEach((item, index) => {
  958. sum = sum + item.unit_price * item.total;
  959. });
  960. this.part_refund_price = Math.floor(sum * 100) / 100;
  961. } else {
  962. this.part_refund_goods.map(item => {
  963. return item.checked = false;
  964. });
  965. this.part_refund_price = 0;
  966. }
  967. },
  968. surePartRefund() {
  969. let newArr = this.part_refund_goods.filter(item => item.checked).map(citem => {
  970. return {'id':citem.id,'total':citem.total};
  971. });
  972. if(newArr.length <= 0){
  973. this.$message({type: 'error',message: '请选择退款商品'});
  974. return false;
  975. }
  976. let json = {
  977. content:this.part_refund_con,
  978. order_goods:newArr,
  979. freight_price:"0",
  980. order_id:this.part_refund_id,
  981. other_price:0,
  982. part_refund:1,
  983. reason:'后台退款',
  984. receive_status:0,
  985. refund_type:0,
  986. refund_way_type:0,
  987. };
  988. // console.log(json); return false;
  989. let loading = this.$loading({target:document.querySelector("#close-order"),background: 'rgba(0, 0, 0, 0)'});
  990. let newUrl = "{!! yzWebFullUrl('refund.pay') !!}";
  991. this.$http.post(this.part_refund_api,json).then(function (response) {
  992. if (response.data.result) {
  993. window.location.href = newUrl+'&refund_id='+response.data.data;
  994. } else{
  995. this.$message({type: 'error',message: response.data.msg});
  996. }
  997. loading.close();
  998. this.part_refund_show = false;
  999. this.search(this.current_page);
  1000. },function (response) {
  1001. this.$message({type: 'error',message: response.data.msg});
  1002. loading.close();
  1003. this.part_refund_show = false;
  1004. })
  1005. },
  1006. orderConfirm(operationType, order) {
  1007. // console.log(operationType, order);
  1008. this.dialog_show++;
  1009. this.operationOrder = order;
  1010. this.operationType = operationType;
  1011. },
  1012. // 修改价格
  1013. changePrice(id,item) {
  1014. this.change_price_show = true;
  1015. this.change_price_id = id;
  1016. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  1017. this.$http.post('{!! yzWebFullUrl('order.change-order-price.index-api') !!}',{order_id:this.change_price_id}).then(function (response) {
  1018. if (response.data.result) {
  1019. // this.$message({type: 'success',message: '操作成功'});
  1020. this.order_goods_model = response.data.data.order_goods_model;
  1021. this.order_goods_model.forEach((item,index) => {
  1022. this.order_goods_model[index].new_price = 0.00
  1023. })
  1024. this.order_model = response.data.data.order_model;
  1025. this.dispatch_price = this.order_model.dispatch_price;
  1026. this.getNewPrice();
  1027. }
  1028. else{
  1029. this.$message({type: 'error',message: response.data.msg});
  1030. }
  1031. loading.close();
  1032. },function (response) {
  1033. this.$message({type: 'error',message: response.data.msg});
  1034. loading.close();
  1035. }
  1036. );
  1037. },
  1038. // 打印小票
  1039. orderPrinter(id) {
  1040. this.change_price_id = id;
  1041. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  1042. this.$http.post('{!! yzWebFullUrl('order.order-list.orderPrinter') !!}',{order_id:this.change_price_id}).then(function (response) {
  1043. if (response.data.result) {
  1044. this.$message({type: 'success',message: '请求成功'});
  1045. }
  1046. else{
  1047. this.$message({type: 'error',message: response.data.msg});
  1048. }
  1049. loading.close();
  1050. },function (response) {
  1051. this.$message({type: 'error',message: response.data.msg});
  1052. loading.close();
  1053. }
  1054. );
  1055. },
  1056. // 输入改价
  1057. inputPrice(index,price) {
  1058. // 强制刷新
  1059. if(index != 'dispatch_price') {
  1060. this.order_goods_model.push({});
  1061. this.order_goods_model.splice(this.order_goods_model.length-1,1)
  1062. }
  1063. if (this.judgeSign(price) == -1) {
  1064. this.$message.error("请输入数字");
  1065. if(index == 'dispatch_price') {
  1066. this.dispatch_price = 0.00;
  1067. }
  1068. else {
  1069. this.order_goods_model[index].new_price = 0.00
  1070. }
  1071. return false;
  1072. }
  1073. this.getNewPrice();
  1074. },
  1075. getNewPrice() {
  1076. let new_price = 0;
  1077. this.order_goods_model.forEach((item,index) => {
  1078. new_price += parseFloat(item.new_price);
  1079. })
  1080. // console.log(new_price)
  1081. this.change_all_money = new_price;
  1082. this.all_money = (parseFloat(this.order_model.price)-(parseFloat(this.order_model.dispatch_price))) + parseFloat(new_price) + parseFloat(this.dispatch_price);
  1083. // this.
  1084. },
  1085. // 直接免运费
  1086. clearDispatch() {
  1087. this.dispatch_price = 0.00;
  1088. this.getNewPrice();
  1089. },
  1090. // 确认改价
  1091. sureChangePrice() {
  1092. let json = {
  1093. order_id:this.change_price_id,
  1094. dispatch_price:this.dispatch_price,
  1095. order_goods:[],
  1096. }
  1097. this.order_goods_model.forEach((item,index) => {
  1098. json.order_goods.push({order_goods_id:item.id,change_price:item.new_price});
  1099. })
  1100. // console.log(json);
  1101. let loading = this.$loading({target:document.querySelector("#change-price"),background: 'rgba(0, 0, 0, 0)'});
  1102. this.$http.post('{!! yzWebFullUrl('order.change-order-price.store-api') !!}',json).then(function (response) {
  1103. if (response.data.result) {
  1104. this.$message({type: 'success',message: '修改价格成功!'});
  1105. }
  1106. else{
  1107. this.$message({type: 'error',message: response.data.msg});
  1108. }
  1109. loading.close();
  1110. this.change_price_show = false;
  1111. this.search(this.current_page);
  1112. },function (response) {
  1113. this.$message({type: 'error',message: response.data.msg});
  1114. loading.close();
  1115. this.change_price_show = false;
  1116. })
  1117. },
  1118. // 判断是否是数字
  1119. judgeSign(num) {
  1120. var reg = new RegExp("^-?[0-9]*.?[0-9]*$");
  1121. if ( reg.test(num) ) {
  1122. var absVal = Math.abs(num);
  1123. return num==absVal?'是正数':'是负数';
  1124. }
  1125. else {
  1126. return -1;
  1127. }
  1128. },
  1129. //一键发货
  1130. sureconfirmBatchSend()
  1131. {
  1132. let requestData = {
  1133. code: this.code,
  1134. search: JSON.parse(JSON.stringify(this.search_form)),
  1135. batch_send: JSON.parse(JSON.stringify(this.batch_send)),
  1136. };
  1137. // console.log(requestData);
  1138. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  1139. this.$http.post(`{!! yzWebFullUrl('order.order-list.batchSend') !!}`,requestData).then(function(response) {
  1140. if (response.data.result) {
  1141. this.$message({
  1142. message: response.data.msg,
  1143. type: 'success'
  1144. });
  1145. setTimeout(function () {
  1146. location.reload();
  1147. }, 2000
  1148. );
  1149. } else {
  1150. this.$message({
  1151. message: response.data.msg,
  1152. type: 'error'
  1153. });
  1154. }
  1155. loading.close();
  1156. }, function(response) {
  1157. this.$message({
  1158. message: response.data.msg,
  1159. type: 'error'
  1160. });
  1161. loading.close();
  1162. });
  1163. },
  1164. export1(export_type,template,exportUrl = ''){
  1165. let that = this;
  1166. // console.log(that.search_form);
  1167. let json = that.search_form;
  1168. // if(this.times && this.times.length>0) {
  1169. // json.start_time = this.times[0];
  1170. // json.end_time = this.times[1];
  1171. // }
  1172. let url = exportUrl ? exportUrl : this.exportUrl;
  1173. url += "&export_type="+export_type+"&template="+template;
  1174. if (that.code) {
  1175. url+="&code="+that.code
  1176. }
  1177. for(let i in json){
  1178. if (json[i]) {
  1179. if(i==='goods_title'){
  1180. let replace = json[i].replace(/\+/g,'%2B');
  1181. url+="&search["+i+"]="+ replace
  1182. }else{
  1183. url+="&search["+i+"]="+ json[i]
  1184. }
  1185. }
  1186. }
  1187. // console.log(url);
  1188. window.location.href = url;
  1189. },
  1190. gotoGoods(id,item) {
  1191. // console.log(item)
  1192. if(!item.fixed_button.goods_detail.is_show) {
  1193. return
  1194. }
  1195. let link = item.fixed_button.goods_detail.api
  1196. // window.location.href = `{!! yzWebFullUrl('goods.goods.edit') !!}`+`&id=`+id;
  1197. window.location.href = link+`&id=`+id;
  1198. },
  1199. gotoMember(id) {
  1200. window.location.href = `{!! yzWebFullUrl('member.member.detail') !!}`+`&id=`+id;
  1201. },
  1202. // 字符转义
  1203. escapeHTML(a) {
  1204. a = "" + a;
  1205. return a.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&apos;/g, "'");;
  1206. },
  1207. getParam(name) {
  1208. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  1209. var r = window.location.search.substr(1).match(reg);
  1210. if (r != null) return unescape(r[2]);
  1211. return null;
  1212. },
  1213. // 将标准时间转为字符串
  1214. formatTime(date) {
  1215. let y = date.getFullYear()
  1216. let m = date.getMonth() + 1
  1217. m = m < 10 ? '0' + m : m
  1218. let d = date.getDate()
  1219. d = d < 10 ? '0' + d : d
  1220. let h = date.getHours()
  1221. h = h < 10 ? '0' + h : h
  1222. let minute = date.getMinutes()
  1223. minute = minute < 10 ? '0' + minute : minute
  1224. let second = date.getSeconds()
  1225. second = second < 10 ? '0' + second : second
  1226. return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second
  1227. },
  1228. reloadList() {
  1229. this.search(this.current_page)
  1230. }
  1231. },
  1232. })
  1233. </script>
  1234. @endsection