restock_list.blade.php 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110
  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. .edit-i {
  7. display: none;
  8. }
  9. .el-table_1_column_2:hover .edit-i {
  10. font-weight: 900;
  11. padding: 0;
  12. margin: 0;
  13. display: inline-block;
  14. }
  15. .el-tabs__item, .is-top {
  16. font-size: 16px
  17. }
  18. .el-tabs__active-bar {
  19. height: 3px;
  20. }
  21. .list-title {
  22. display: flex;
  23. width: 100%;
  24. background: #f9f9f9;
  25. padding: 15px 10px;
  26. font-weight: 900;
  27. border: 1px solid #e9e9e9;
  28. }
  29. .list-title .list-title-1 {
  30. display: flex;
  31. align-items: center;
  32. justify-content: center;
  33. }
  34. .list-info {
  35. display: flex;
  36. padding: 10px;
  37. justify-content: left;
  38. background: #f9f9f9;
  39. }
  40. .list-con {
  41. display: flex;
  42. width: 100%;
  43. font-size: 12px;
  44. font-weight: 500;
  45. align-items: stretch;
  46. border-bottom: 1px solid rgb(233, 233, 233);
  47. }
  48. .list-con-goods {
  49. display: flex;
  50. align-items: center;
  51. justify-content: center;
  52. box-sizing: border-box;
  53. padding-left: 10px;
  54. border-top: 1px solid #e9e9e9;
  55. min-height: 90px
  56. }
  57. .list-con-goods-text {
  58. min-height: 70px;
  59. overflow: hidden;
  60. flex: 1;
  61. display: flex;
  62. flex-direction: column;
  63. justify-content: space-between;
  64. }
  65. .list-con-goods-price {
  66. border-right: 1px solid #e9e9e9;
  67. border-left: 1px solid #e9e9e9;
  68. min-width: 150px;
  69. min-height: 90px;
  70. text-align: left;
  71. padding: 20px;
  72. display: flex;
  73. flex-direction: column;
  74. }
  75. .list-con-goods-title {
  76. font-size: 14px;
  77. line-height: 20px;
  78. text-overflow: -o-ellipsis-lastline;
  79. overflow: hidden;
  80. text-overflow: ellipsis;
  81. display: -webkit-box;
  82. -webkit-line-clamp: 2;
  83. line-clamp: 2;
  84. -webkit-box-orient: vertical;
  85. }
  86. .list-con-goods-option {
  87. font-size: 12px;
  88. color: #999
  89. }
  90. .list-con-member-info {
  91. display: flex;
  92. padding: 0 2px;
  93. flex-direction: column;
  94. flex: 1;
  95. min-width: 120px;
  96. line-height: 28px;
  97. justify-content: center;
  98. text-align: left;
  99. font-size: 14px;
  100. border-top: 1px solid #e9e9e9;
  101. border-right: 1px solid #e9e9e9;
  102. }
  103. .list-member {
  104. padding: 10px;
  105. font-size: 12px;
  106. font-weight: 500;
  107. }
  108. .list-num {
  109. flex: 3;
  110. display: flex;
  111. align-items: center;
  112. border-right: 1px solid #e9e9e9;
  113. justify-content: center;
  114. }
  115. .list-gen {
  116. display: flex;
  117. align-items: center;
  118. justify-content: center;
  119. line-height: 28px;
  120. }
  121. .list-gen-txt {
  122. flex: 1;
  123. border-right: 1px solid #e9e9e9;
  124. border-bottom: 1px solid #e9e9e9;
  125. align-items: center;
  126. justify-content: center;
  127. display: flex;
  128. }
  129. .list-opt {
  130. flex: 1;
  131. display: flex;
  132. align-items: center;
  133. border-left: 1px solid #e9e9e9;
  134. justify-content: center;
  135. }
  136. /* 导航 */
  137. .el-radio-button .el-radio-button__inner, .el-radio-button:first-child .el-radio-button__inner {
  138. border-radius: 4px 4px 4px 4px;
  139. border-left: 0px;
  140. }
  141. .el-radio-button__inner {
  142. border: 0;
  143. }
  144. .el-radio-button:last-child .el-radio-button__inner {
  145. border-radius: 4px 4px 4px 4px;
  146. }
  147. .panel .active a {
  148. background-color: #29ba9c !important;
  149. border-radius: 18px !important;
  150. color: #fff;
  151. }
  152. .add-shopnav li a {
  153. display: inline-block;
  154. padding: 0 12px;
  155. line-height: 32px;
  156. color: #333;
  157. border: 1px solid #e5e5e5;
  158. background: #f8f8f8;
  159. min-width: 80px;
  160. text-align: center;
  161. }
  162. .panel a {
  163. border: none !important;
  164. background-color: #fff !important;
  165. }
  166. </style>
  167. <div class="all">
  168. <div id="app" v-cloak>
  169. <div class="vue-head">
  170. <div class="panel panel-info">
  171. <ul class="add-shopnav">
  172. <li @if(\YunShop::request()->route == 'plugin.agency.admin.restock.get-list' || \YunShop::request()->route == 'plugin.agency.admin.restock.index') class="active" @endif >
  173. <a
  174. href="{{ yzWebUrl('plugin.agency.admin.restock.index')}}">全部订单</a></li>
  175. <li @if(\YunShop::request()->route == 'plugin.agency.admin.restock.wait-pay') class="active" @endif >
  176. <a
  177. href="{{ yzWebUrl('plugin.agency.admin.restock.wait-pay')}}">待支付</a></li>
  178. <li @if(\YunShop::request()->route == 'plugin.agency.admin.restock.completed') class="active" @endif>
  179. <a
  180. href="{{ yzWebUrl('plugin.agency.admin.restock.completed')}}">已完成</a></li>
  181. <li @if(\YunShop::request()->route == 'plugin.agency.admin.restock.cancelled') class="active" @endif>
  182. <a
  183. href="{{ yzWebUrl('plugin.agency.admin.restock.cancelled')}}">已关闭</a></li>
  184. </ul>
  185. </div>
  186. </div>
  187. <div class="vue-head">
  188. <div class="vue-main-title" style="margin-bottom:20px">
  189. <div class="vue-main-title-button">
  190. </div>
  191. </div>
  192. <div class="vue-search">
  193. <el-form :inline="true" :model="search_form" class="demo-form-inline">
  194. <el-form-item label="">
  195. <el-input v-model="search_form.member_id" placeholder="购买会员ID"></el-input>
  196. </el-form-item>
  197. <el-form-item label="">
  198. <el-input v-model="search_form.member_info" placeholder="购买昵称/姓名/手机号"></el-input>
  199. </el-form-item>
  200. <el-form-item label="">
  201. <el-input v-model="search_form.goods_id" placeholder="商品ID"></el-input>
  202. </el-form-item>
  203. <el-form-item label="">
  204. <el-input v-model="search_form.goods_title" placeholder="商品名称"></el-input>
  205. </el-form-item>
  206. <el-form-item label="">
  207. <el-input v-model="search_form.order_sn" placeholder="订单编号"></el-input>
  208. </el-form-item>
  209. <el-form-item label="">
  210. <el-input v-model="search_form.pay_sn" placeholder="支付单号"></el-input>
  211. </el-form-item>
  212. <el-form-item label="">
  213. <el-select v-model="search_form.pay_type" clearable placeholder="支付方式" style="width:150px">
  214. @foreach(\app\backend\modules\order\services\OrderViewService::searchablePayType() as $pay_type)
  215. <el-option label="{{$pay_type['name']}}" value="{{$pay_type['value']}}"></el-option>
  216. @endforeach
  217. </el-select>
  218. </el-form-item>
  219. <el-form-item label="">
  220. <el-select v-model="search_form.time_field" clearable placeholder="操作时间"
  221. style="width:150px">
  222. <el-option label="下单时间" value="create_time"></el-option>
  223. <el-option label="支付时间" value="pay_time"></el-option>
  224. <el-option label="完成时间" value="finish_time"></el-option>
  225. <el-option label="关闭时间" value="cancel_time"></el-option>
  226. </el-select>
  227. </el-form-item>
  228. <el-form-item label="">
  229. <el-date-picker
  230. v-model="times"
  231. type="datetimerange"
  232. value-format="yyyy-MM-dd HH:mm:ss"
  233. range-separator="至"
  234. start-placeholder="开始日期"
  235. end-placeholder="结束日期"
  236. style="margin-left:5px;"
  237. align="right">
  238. </el-date-picker>
  239. </el-form-item>
  240. <el-form-item label="">
  241. <el-button type="primary" @click="search(1)">搜索</el-button>
  242. <el-button @click="export1(1,1)">导出</el-button>
  243. </el-form-item>
  244. </el-form>
  245. </div>
  246. </div>
  247. <div class="vue-main">
  248. <div class="vue-main-form">
  249. <div class="vue-main-title" style="margin-bottom:20px">
  250. <div class="vue-main-title-left"></div>
  251. <div class="vue-main-title-content" style="flex:0 0 140px">订单列表</div>
  252. <div class="" style="text-align:left;font-size:14px;color:#999">
  253. <span>订单数:[[count.total]]</span>&nbsp;&nbsp;&nbsp;
  254. <span>订单金额:[[count.total_price]]</span>&nbsp;&nbsp;&nbsp;
  255. </div>
  256. <div class="vue-main-title-button">
  257. </div>
  258. </div>
  259. <div v-for="(item,index) in list"
  260. style="border:1px solid #e9e9e9;border-radius:10px;margin-bottom:10px">
  261. <div class="list-info">
  262. <div style="display:flex;flex-wrap:wrap">
  263. <div class="vue-ellipsis" style="max-width:250px">
  264. <strong>[[item.store_name]]</strong>&nbsp;&nbsp;&nbsp;
  265. </div>
  266. <div class="vue-ellipsis" style="color:#999;max-width:150px">
  267. <strong>订单ID:</strong>[[item.id]]&nbsp;&nbsp;&nbsp;
  268. </div>
  269. <div v-if="item.order_sn" class="vue-ellipsis" style="color:#999;max-width:240px">
  270. <strong>订单编号:</strong>[[item.order_sn]]&nbsp;&nbsp;&nbsp;
  271. </div>
  272. <div v-if="item.has_one_order_pay" class="vue-ellipsis"
  273. style="color:#999;max-width:240px">
  274. <strong>支付单号:</strong>[[item.has_one_order_pay.pay_sn]]&nbsp;&nbsp;&nbsp;
  275. </div>
  276. <div class="vue-ellipsis" style="color:#999;max-width:230px">
  277. <strong>下单时间:</strong>[[item.create_time]]&nbsp;&nbsp;&nbsp;
  278. </div>
  279. <div v-if="item.has_many_first_order != null && item.has_many_first_order.length > 0"
  280. class="vue-ellipsis" style="color:#999;max-width:100px">
  281. <strong>首单</strong>&nbsp;&nbsp;&nbsp;
  282. </div>
  283. <div v-if="item.package_deliver" class="vue-ellipsis"
  284. style="color:#29BA9C;max-width:230px">
  285. <strong>[[item.package_deliver.package_deliver_name]]</strong>&nbsp;&nbsp;&nbsp;
  286. </div>
  287. <div v-if="item.package_deliver && item.package_deliver.deliver_clerk_name "
  288. class="vue-ellipsis" style="color:#999;max-width:230px">
  289. <strong>[[item.package_deliver.deliver_clerk_name]]</strong>&nbsp;&nbsp;&nbsp;
  290. </div>
  291. <div v-if="item.has_one_refund_apply" class="vue-ellipsis"
  292. style="color:red;max-width:230px">
  293. <strong>[[item.has_one_refund_apply.refund_type_name]]:[[item.has_one_refund_apply.status_name]]</strong>&nbsp;&nbsp;&nbsp;
  294. </div>
  295. <div v-if="item.no_refund" class="vue-ellipsis" style="color:red;max-width:200px">
  296. <strong>不可退款</strong>&nbsp;&nbsp;&nbsp;
  297. </div>
  298. </div>
  299. <div style="flex:1;text-align:right;min-width:150px;">
  300. <a @click="closeOrder(item.id)" style="color:#29BA9C;font-size:13px;font-weight:600"
  301. v-if="item.status == 0">关闭订单</a>
  302. </div>
  303. </div>
  304. <div class="list-con">
  305. <div style="flex:3;min-width:400px">
  306. <div v-for="(item1,index1) in item.has_many_order_goods" class="list-con-goods">
  307. <div class="list-con-goods-img" style="width:80px">
  308. <el-image :src="item1.thumb" style="width:70px;height:70px"></el-image>
  309. </div>
  310. <div class="list-con-goods-text"
  311. :style="{justifyContent:(item1.goods_option_title?'':'center')}">
  312. <div class="list-con-goods-title" style="color:#29BA9C;cursor: pointer;"
  313. @click="gotoGoods(item1.goods_id)">[[item1.title]]
  314. </div>
  315. <div class="list-con-goods-option" v-if="item1.goods_option_title">
  316. 规格:[[item1.goods_option_title]]
  317. </div>
  318. </div>
  319. <div class="list-con-goods-price">
  320. <div>原价:[[item1.goods_price]]</div>
  321. <div>应付:[[item1.price]]</div>
  322. <div>数量:[[item1.total]]</div>
  323. </div>
  324. </div>
  325. </div>
  326. <div class="list-con-member-info vue-ellipsis">
  327. <div v-if="item.belongs_to_member" style="min-width:70%;margin:0 auto">
  328. <div @click="gotoMember(item.uid)"
  329. style="line-height:32px;color:#29BA9C;cursor: pointer;" class="vue-ellipsis">
  330. <strong>[[item.belongs_to_member.nickname]] </strong>
  331. </div>
  332. <div>
  333. [[item.has_many_member_certified?item.has_many_member_certified.realname:item.belongs_to_member.realname]]
  334. </div>
  335. <div>[[item.belongs_to_member.mobile]]</div>
  336. </div>
  337. <div v-else style="min-width:70%;margin:0 auto">
  338. <div>会员([[item.uid]])已被删除</div>
  339. </div>
  340. </div>
  341. <div class="list-con-member-info vue-ellipsis" style="text-align:center;min-width: 90px;">
  342. <div><strong>[[item.pay_type_name]]</strong></div>
  343. <div><strong
  344. v-if="item.has_one_dispatch_type">[[item.has_one_dispatch_type.name]]</strong>
  345. </div>
  346. </div>
  347. <div class="list-con-member-info vue-ellipsis" style="min-width: 120px;">
  348. <div style="min-width:70%;margin:0 auto">
  349. <div>商品小计:¥[[item.goods_price]]</div>
  350. <div>运费:¥[[item.dispatch_price]]</div>
  351. <div v-if="item.change_price!='0.00'">卖家改价:¥[[item.change_price]]</div>
  352. <div v-if="item.change_dispatch_price!='0.00'">
  353. 卖家改运费:¥[[item.change_dispatch_price]]
  354. </div>
  355. <div>应付款:¥[[item.price]]</div>
  356. </div>
  357. </div>
  358. <div class="list-con-member-info vue-ellipsis" style="text-align:center">
  359. <div style="min-width:70%;margin:0 auto">
  360. <div style="color:#29BA9C">[[item.status_name]]</div>
  361. <div v-if="item.status==0">
  362. <a style="color:#29BA9C" @click="changePrice(item.id,item)">修改价格</a>
  363. </div>
  364. <div>
  365. <a @click="gotoDetail(item)" style="color:#29BA9C">查看详情</a>
  366. </div>
  367. </div>
  368. </div>
  369. </div>
  370. <div class="list-member">
  371. <div v-if="item.address">
  372. [[item.address.realname]]&nbsp;&nbsp;&nbsp;[[item.address.mobile]]&nbsp;&nbsp;&nbsp;[[item.address.address]]
  373. </div>
  374. </div>
  375. </div>
  376. </div>
  377. </div>
  378. <el-dialog :visible.sync="close_order_show" width="750px" title="关闭订单">
  379. <div style="height:300px;overflow:auto" id="close-order">
  380. <div style="color:#000;font-weight:500">关闭订单原因</div>
  381. <el-input v-model="close_order_con" :rows="10" type="textarea"></el-input>
  382. </div>
  383. <span slot="footer" class="dialog-footer">
  384. <el-button @click="close_order_show = false">取 消</el-button>
  385. <el-button type="primary" @click="sureCloseOrder">确 定 </el-button>
  386. </span>
  387. </el-dialog>
  388. <el-dialog :visible.sync="close_order1_show" width="750px" title="退款并关闭订单">
  389. <div style="height:300px;overflow:auto">
  390. <div style="color:#000;font-weight:500">退款原因</div>
  391. <el-input v-model="close_order1_con" :rows="10" type="textarea"></el-input>
  392. </div>
  393. <span slot="footer" class="dialog-footer">
  394. <el-button @click="close_order1_show = false">取 消</el-button>
  395. <el-button type="primary" @click="sureCloseOrder1">退 款 </el-button>
  396. </span>
  397. </el-dialog>
  398. <el-dialog :visible.sync="change_price_show" width="65%" title="修改价格">
  399. <div style="height:500px;overflow:auto" id="change-price">
  400. <el-table :data="order_goods_model" style="width: 100%">
  401. <el-table-column label="商品名称" prop="has_one_goods.title"></el-table-column>
  402. <el-table-column label="单价" align="center" prop="goods_price" width="120">
  403. <template slot-scope="scope">
  404. <div>
  405. [[parseFloat(scope.row.price)/parseFloat(scope.row.total)]]
  406. </div>
  407. </template>
  408. </el-table-column>
  409. <el-table-column label="数量" align="center" prop="total" width="100"></el-table-column>
  410. <el-table-column label="小计" align="center" prop="price" width="150">
  411. <template slot-scope="scope">
  412. <div>
  413. [[scope.row.price]]
  414. <el-tag v-if="scope.row.change_price&&scope.row.change_price!=0&&scope.row.change_price!='0.00'"
  415. type="danger">改价
  416. </el-tag>
  417. </div>
  418. </template>
  419. </el-table-column>
  420. <el-table-column label="加价或减价" align="center" prop="display_order">
  421. <template slot-scope="scope">
  422. <div>
  423. <el-input @input="inputPrice(scope.$index,scope.row.new_price)"
  424. v-model="scope.row.new_price" size="small" style="width:95%"></el-input>
  425. </div>
  426. </template>
  427. </el-table-column>
  428. <el-table-column label="运费" align="center" prop="dispatch_price">
  429. <template slot-scope="scope" v-if="scope.$index==0">
  430. <div>
  431. <el-input @input="inputPrice('dispatch_pricec',dispatch_price)"
  432. v-model="dispatch_price" size="small" style="width:95%"></el-input>
  433. </div>
  434. </template>
  435. </el-table-column>
  436. <el-table-column label="" align="center" prop="display_order">
  437. <template slot-scope="scope" v-if="scope.$index==0">
  438. <div>
  439. <el-link :underline="false" @click="clearDispatch">直接免运费</el-link>
  440. </div>
  441. </template>
  442. </el-table-column>
  443. </el-table>
  444. <div class="tip" style="color:#f00;margin:10px 0;">提示:改价后价格不能小于0元</div>
  445. <div style="background:#eff3f6;border-radius:8px;padding:20px 10px;color:#000;font-weight:500;line-height:36px;">
  446. <div style="font-size:16px;font-weight:600;color:#000">购买者信息</div>
  447. <div>
  448. <div style="display:inline-block;width:150px;text-align:right;margin-right:30px">姓名</div>
  449. <div style="display:inline-block;">[[order_model.address?order_model.address.realname:""]]
  450. </div>
  451. </div>
  452. <div>
  453. <div style="display:inline-block;width:150px;text-align:right;margin-right:30px">联系方式</div>
  454. <div style="display:inline-block;">[[order_model.address?order_model.address.mobile:""]]
  455. </div>
  456. </div>
  457. <div>
  458. <div style="display:inline-block;width:150px;text-align:right;margin-right:30px">联系地址</div>
  459. <div style="display:inline-block;">[[order_model.address?order_model.address.address:""]]
  460. </div>
  461. </div>
  462. </div>
  463. </div>
  464. <span slot="footer" class="dialog-footer" style="display:flex;justify-content: flex-end;">
  465. <div style="display:inline-block;color:#000;margin-right:20px;font-weight:500;">
  466. <div style="display:flex;text-align:center;line-height:28px;align-items: center;">
  467. <div style="margin-right:15px">
  468. 原价<br>
  469. ¥[[parseFloat(order_model.price)-(parseFloat(order_model.dispatch_price))]]
  470. </div>
  471. <div style="margin-right:15px">+</div>
  472. <div style="margin-right:15px">
  473. 运费<br>
  474. ¥[[parseFloat(dispatch_price)]]
  475. </div>
  476. <div style="margin-right:15px">+</div>
  477. <div style="margin-right:15px">
  478. 价格修改<br>
  479. ¥[[(parseFloat(change_all_money))]]
  480. </div>
  481. <div style="margin-right:15px">=</div>
  482. <div style="margin-right:15px">
  483. 买家实付<br>
  484. <strong style="color:#f00">¥[[(parseFloat(all_money))]]</strong>
  485. </div>
  486. </div>
  487. </div>
  488. <div style="line-height:56px">
  489. <el-button @click="change_price_show = false">取 消</el-button>
  490. <el-button type="primary" @click="sureChangePrice">确认改价</el-button>
  491. </div>
  492. </span>
  493. </el-dialog>
  494. <div class="vue-page" v-if="total>0">
  495. <el-row>
  496. <el-col align="right">
  497. <el-pagination layout="prev, pager, next,jumper" @current-change="search" :total="total"
  498. :page-size="per_page" :current-page="current_page" background
  499. ></el-pagination>
  500. </el-col>
  501. </el-row>
  502. </div>
  503. </div>
  504. </div>
  505. <script>
  506. var app = new Vue({
  507. el: "#app",
  508. delimiters: ['[[', ']]'],
  509. name: 'test',
  510. data() {
  511. return {
  512. commonPartUrl: '{!! yzWebFullUrl('order.order-list.common-part') !!}', //获取公共参数链接
  513. listUrl: '{!! yzWebUrl('plugin.agency.admin.restock.get-list') !!}',//获取订单数据链接
  514. exportUrl: '{!! yzWebUrl('plugin.agency.admin.restock.export') !!}',//订单数据导出链接
  515. detailUrl: '{!! yzWebUrl('plugin.agency.admin.restock.order-detail') !!}',
  516. url_open: "{!! yzWebUrl('order.waybill.waybill') !!}",
  517. list: [],
  518. count: {},
  519. has_many_level: [],
  520. change_sort: '',
  521. times: [],
  522. data: "",
  523. expressCompanies: [],//快递公司
  524. extra_param: {},
  525. code: 'all',
  526. search_form: {
  527. member_id: "",
  528. },
  529. order_type: '',
  530. close_order_show: false,//关闭订单弹窗
  531. close_order_con: "",//关闭订单原因
  532. close_order_id: "",
  533. close_order1_show: false,//手动关闭订单弹窗
  534. close_order1_con: "",//手动关闭订单原因
  535. close_order1_id: "",
  536. cancel_send_show: false,// 取消发货弹窗
  537. cancel_send_con: "",//取消发货原因
  538. cancel_send_id: '',
  539. confirm_send_show: false,// 确认发货弹窗
  540. confirm_send_id: "",
  541. change_price_show: false,//修改价格弹窗
  542. change_price_id: "",
  543. change_all_money: 0.00,//价格修改
  544. all_money: 0.00,//买家实付
  545. order_model: {},
  546. dispatch_price: 0,//运费
  547. order_goods_model: [],
  548. address_info: {},
  549. send: {
  550. dispatch_type_id: 1,
  551. express_code: "",
  552. express_sn: "",
  553. },
  554. send_rules: {},
  555. more_send_show: false,
  556. order_goods_send_list: [],
  557. send_order_goods_ids: [],
  558. street: 0,
  559. province_list: [],
  560. city_list: [],
  561. district_list: [],
  562. street_list: [],
  563. areaLoading: false,
  564. rules: {},
  565. current_page: 1,
  566. total: 1,
  567. per_page: 1,
  568. synchro: 0,
  569. readonly: false,
  570. }
  571. },
  572. created() {
  573. let result = this.viewReturn();
  574. this.__initial(result);
  575. this.search_form.member_id = this.getParam('member_id') ? this.getParam('member_id') : '';
  576. },
  577. mounted() {
  578. this.getData(1);
  579. },
  580. methods: {
  581. viewReturn() {
  582. return {!! $data?:'{}' !!};
  583. },
  584. __initial(data) {
  585. if (data.code) {
  586. this.code = data.code;
  587. }
  588. if (data.listUrl) {
  589. this.listUrl = data.listUrl;
  590. }
  591. if (data.commonPartUrl) {
  592. this.commonPartUrl = data.commonPartUrl;
  593. }
  594. if (data.exportUrl) {
  595. this.exportUrl = data.exportUrl;
  596. }
  597. if (data.extraParam) {
  598. this.extra_param = data.extraParam;
  599. }
  600. this.expressCompanies = data.expressCompanies;
  601. console.log(data);
  602. },
  603. commonPart() {
  604. this.$http.post(this.commonPartUrl).then(function (response) {
  605. if (response.data.result) {
  606. this.extra_param = response.data.data.extraParam;
  607. this.expressCompanies = response.data.data.expressCompanies;
  608. } else {
  609. this.$message({
  610. message: response.data.msg,
  611. type: 'error'
  612. });
  613. }
  614. }, function (response) {
  615. this.$message({
  616. message: response.data.msg,
  617. type: 'error'
  618. });
  619. });
  620. },
  621. getData(page) {
  622. let requestData = {
  623. page: page,
  624. code: this.code,
  625. search: JSON.parse(JSON.stringify(this.search_form)),
  626. };
  627. if (this.times && this.times.length > 0) {
  628. requestData.search.start_time = this.times[0];
  629. requestData.search.end_time = this.times[1];
  630. }
  631. console.log(requestData);
  632. let loading = this.$loading({
  633. target: document.querySelector(".content"),
  634. background: 'rgba(0, 0, 0, 0)'
  635. });
  636. this.$http.post(this.listUrl, requestData).then(function (response) {
  637. if (response.data.result) {
  638. this.count = response.data.data.count;
  639. this.list = response.data.data.list.data;
  640. this.current_page = response.data.data.list.current_page;
  641. this.total = response.data.data.list.total;
  642. this.per_page = response.data.data.list.per_page;
  643. this.synchro = response.data.data.synchro;
  644. loading.close();
  645. } else {
  646. this.$message({
  647. message: response.data.msg,
  648. type: 'error'
  649. });
  650. }
  651. loading.close();
  652. }, function (response) {
  653. this.$message({
  654. message: response.data.msg,
  655. type: 'error'
  656. });
  657. loading.close();
  658. });
  659. },
  660. gotoDetail(item) {
  661. let link = this.detailUrl + '&id=' + item.id;
  662. window.location = link;
  663. },
  664. search(val) {
  665. this.getData(val);
  666. },
  667. confirmPay(id) {
  668. this.$confirm('确认此订单已付款吗?', '提示', {
  669. confirmButtonText: '确定',
  670. cancelButtonText: '取消',
  671. type: 'warning'
  672. }).then(() => {
  673. let loading = this.$loading({
  674. target: document.querySelector(".content"),
  675. background: 'rgba(0, 0, 0, 0)'
  676. });
  677. this.$http.post('{!! yzWebFullUrl('order.vue-operation.pay') !!}', {order_id: id}).then(function (response) {
  678. if (response.data.result) {
  679. this.$message({type: 'success', message: '操作成功'});
  680. } else {
  681. this.$message({type: 'error', message: response.data.msg});
  682. }
  683. loading.close();
  684. this.search(this.current_page)
  685. }, function (response) {
  686. this.$message({type: 'error', message: response.data.msg});
  687. loading.close();
  688. }
  689. );
  690. }).catch(() => {
  691. this.$message({type: 'info', message: '已取消操作'});
  692. });
  693. },
  694. closeOrder(id) {
  695. this.close_order_show = true;
  696. this.close_order_con = "";
  697. this.close_order_id = id;
  698. },
  699. sureCloseOrder() {
  700. let json = {
  701. route: 'order.vue-operation.close',
  702. order_id: this.close_order_id,
  703. reson: this.close_order_con,
  704. };
  705. console.log(json);
  706. let loading = this.$loading({
  707. target: document.querySelector("#close-order"),
  708. background: 'rgba(0, 0, 0, 0)'
  709. });
  710. this.$http.post('{!! yzWebFullUrl('order.vue-operation.close') !!}', json).then(function (response) {
  711. if (response.data.result) {
  712. this.$message({type: 'success', message: '关闭订单成功!'});
  713. } else {
  714. this.$message({type: 'error', message: response.data.msg});
  715. }
  716. loading.close();
  717. this.close_order_show = false;
  718. this.search(this.current_page);
  719. }, function (response) {
  720. this.$message({type: 'error', message: response.data.msg});
  721. loading.close();
  722. this.close_order_show = false;
  723. })
  724. },
  725. closeOrder1(id) {
  726. this.close_order1_show = true;
  727. this.close_order1_con = "";
  728. this.close_order1_id = id;
  729. },
  730. sureCloseOrder1() {
  731. let json = {
  732. route: 'order.vue-operation.manualRefund',
  733. order_id: this.close_order1_id,
  734. reson: this.close_order1_con,
  735. }
  736. console.log(json);
  737. let loading = this.$loading({
  738. target: document.querySelector("#close-order"),
  739. background: 'rgba(0, 0, 0, 0)'
  740. });
  741. this.$http.post('{!! yzWebFullUrl('order.vue-operation.manualRefund') !!}', json).then(function (response) {
  742. if (response.data.result) {
  743. this.$message({type: 'success', message: '关闭订单成功!'});
  744. } else {
  745. this.$message({type: 'error', message: response.data.msg});
  746. }
  747. loading.close();
  748. this.close_order1_show = false;
  749. this.search(this.current_page);
  750. }, function (response) {
  751. this.$message({type: 'error', message: response.data.msg});
  752. loading.close();
  753. this.close_order1_show = false;
  754. })
  755. },
  756. cancelSend(id) {
  757. this.cancel_send_show = true;
  758. this.cancel_send_con = "";
  759. this.cancel_send_id = id;
  760. console.log(id)
  761. },
  762. sureCancelSend() {
  763. let json = {
  764. order_id: this.cancel_send_id,
  765. cancelreson: this.cancel_send_con,
  766. };
  767. console.log(json);
  768. let loading = this.$loading({
  769. target: document.querySelector("#cancel-send"),
  770. background: 'rgba(0, 0, 0, 0)'
  771. });
  772. this.$http.post('{!! yzWebFullUrl('order.vue-operation.cancel-send') !!}', json).then(function (response) {
  773. if (response.data.result) {
  774. this.$message({type: 'success', message: '取消发货成功!'});
  775. } else {
  776. this.$message({type: 'error', message: response.data.msg});
  777. }
  778. loading.close();
  779. this.cancel_send_show = false;
  780. this.search(this.current_page);
  781. }, function (response) {
  782. this.$message({type: 'error', message: response.data.msg});
  783. loading.close();
  784. this.close_order_show = false;
  785. })
  786. },
  787. confirmReceive(id) {
  788. this.$confirm('确认订单收货吗?', '提示', {
  789. confirmButtonText: '确定',
  790. cancelButtonText: '取消',
  791. type: 'warning'
  792. }).then(() => {
  793. let loading = this.$loading({
  794. target: document.querySelector(".content"),
  795. background: 'rgba(0, 0, 0, 0)'
  796. });
  797. this.$http.post('{!! yzWebFullUrl('order.vue-operation.receive') !!}', {order_id: id}).then(function (response) {
  798. if (response.data.result) {
  799. this.$message({type: 'success', message: '操作成功'});
  800. } else {
  801. this.$message({type: 'error', message: response.data.msg});
  802. }
  803. loading.close();
  804. this.search(this.current_page)
  805. }, function (response) {
  806. this.$message({type: 'error', message: response.data.msg});
  807. loading.close();
  808. }
  809. );
  810. }).catch(() => {
  811. this.$message({type: 'info', message: '已取消操作'});
  812. });
  813. },
  814. confirmSend(id, item) {
  815. let synchro = this.synchro;
  816. this.readonly = false;
  817. if (synchro) {
  818. this.$http.post(this.url_open, {id: id}).then(function (response) {
  819. if (response.data.result) {
  820. this.send.express_code = response.data.resp.shipper_code;
  821. this.send.express_sn = response.data.resp.logistic_code;
  822. this.readonly = true;
  823. console.log('66666', response.data.resp.logistic_code);
  824. }
  825. }, function (response) {
  826. this.$message({type: 'error', message: response.data.msg});
  827. }
  828. );
  829. }
  830. console.log('898998', synchro);
  831. this.confirm_send_show = true;
  832. this.confirm_send_con = "";
  833. this.send = {
  834. dispatch_type_id: 1,
  835. express_code: "",
  836. express_sn: ""
  837. }
  838. this.confirm_send_id = id;
  839. this.address_info = item.address || {};
  840. },
  841. sureconfirmSend() {
  842. let json = {
  843. dispatch_type_id: this.send.dispatch_type_id,
  844. express_code: this.send.express_code,
  845. express_sn: this.send.express_sn,
  846. order_id: this.confirm_send_id,
  847. };
  848. console.log(json);
  849. let loading = this.$loading({
  850. target: document.querySelector("#cancel-send"),
  851. background: 'rgba(0, 0, 0, 0)'
  852. });
  853. this.$http.post('{!! yzWebFullUrl('order.vue-operation.send') !!}', json).then(function (response) {
  854. if (response.data.result) {
  855. this.$message({type: 'success', message: '确认发货成功!'});
  856. } else {
  857. this.$message({type: 'error', message: response.data.msg});
  858. }
  859. loading.close();
  860. this.confirm_send_show = false;
  861. this.search(this.current_page);
  862. }, function (response) {
  863. this.$message({type: 'error', message: response.data.msg});
  864. loading.close();
  865. this.confirm_send_show = false;
  866. })
  867. },
  868. separateSend(id, item) {
  869. this.more_send_show = true;
  870. this.confirm_send_id = id;
  871. this.send = {
  872. dispatch_type_id: 1,
  873. express_code: "",
  874. express_sn: "",
  875. };
  876. this.address_info = item.address || {};
  877. this.getSeparateSendOrderGoods(id);
  878. },
  879. moreSendChange(selection) {
  880. let arr = [];
  881. for (let j = 0, len = selection.length; j < len; j++) {
  882. console.log(selection[j].id);
  883. arr.push(selection[j].id);
  884. }
  885. this.send_order_goods_ids = arr;
  886. },
  887. getSeparateSendOrderGoods(id) {
  888. this.$http.post('{!! yzWebFullUrl('order.multiple-packages-order-goods.get-order-goods') !!}', {order_id: id}).then(function (response) {
  889. if (response.data.result) {
  890. this.order_goods_send_list = response.data.data;
  891. } else {
  892. this.$message({type: 'error', message: response.data.msg});
  893. }
  894. }, function (response) {
  895. this.$message({type: 'error', message: response.data.msg});
  896. });
  897. },
  898. confirmMoreSend() {
  899. if (this.send_order_goods_ids == undefined || this.send_order_goods_ids.length <= 0) {
  900. this.$message.error("请选择分批发货订单商品!");
  901. return;
  902. }
  903. if (this.send.express_sn == "") {
  904. this.$message.error("快递单号不能为空!");
  905. return;
  906. }
  907. let json = {
  908. dispatch_type_id: this.send.dispatch_type_id,
  909. express_code: this.send.express_code,
  910. express_sn: this.send.express_sn,
  911. order_id: this.confirm_send_id,
  912. order_goods_ids: this.send_order_goods_ids,
  913. };
  914. console.log(json);
  915. let loading = this.$loading({
  916. target: document.querySelector("#separate-send"),
  917. background: 'rgba(0, 0, 0, 0)'
  918. });
  919. this.$http.post('{!! yzWebFullUrl('order.vue-operation.separate-send') !!}', json).then(function (response) {
  920. if (response.data.result) {
  921. this.$message({type: 'success', message: '发货成功!'});
  922. } else {
  923. this.$message({type: 'error', message: response.data.msg});
  924. }
  925. loading.close();
  926. this.more_send_show = false;
  927. location.reload(); //刷新页面
  928. }, function (response) {
  929. this.$message({type: 'error', message: response.data.msg});
  930. loading.close();
  931. this.more_send_show = false;
  932. })
  933. },
  934. orderConfirm(operationType, order) {
  935. console.log(operationType, order);
  936. if (operationType == 1) {
  937. this.confirmPay(order.id);
  938. } else if (operationType == 2) {
  939. this.confirmSend(order.id, order);
  940. } else if (operationType == 3) {
  941. this.confirmReceive(order.id);
  942. } else if (operationType == 'cancel_send') {
  943. this.cancelSend(order.id);
  944. } else if (operationType == 'separate_send') {
  945. this.separateSend(order.id, order);
  946. }
  947. },
  948. changePrice(id, item) {
  949. this.change_price_show = true;
  950. this.change_price_id = id;
  951. let loading = this.$loading({
  952. target: document.querySelector(".content"),
  953. background: 'rgba(0, 0, 0, 0)'
  954. });
  955. this.$http.post('{!! yzWebFullUrl('order.change-order-price.index-api') !!}', {order_id: this.change_price_id}).then(function (response) {
  956. if (response.data.result) {
  957. this.order_goods_model = response.data.data.order_goods_model;
  958. this.order_goods_model.forEach((item, index) => {
  959. this.order_goods_model[index].new_price = 0.00
  960. })
  961. this.order_model = response.data.data.order_model;
  962. this.dispatch_price = this.order_model.dispatch_price;
  963. this.getNewPrice();
  964. } else {
  965. this.$message({type: 'error', message: response.data.msg});
  966. }
  967. loading.close();
  968. }, function (response) {
  969. this.$message({type: 'error', message: response.data.msg});
  970. loading.close();
  971. }
  972. );
  973. },
  974. inputPrice(index, price) {
  975. if (index != 'dispatch_price') {
  976. this.order_goods_model.push({});
  977. this.order_goods_model.splice(this.order_goods_model.length - 1, 1)
  978. }
  979. if (this.judgeSign(price) == -1) {
  980. this.$message.error("请输入数字");
  981. if (index == 'dispatch_price') {
  982. this.dispatch_price = 0.00;
  983. } else {
  984. this.order_goods_model[index].new_price = 0.00
  985. }
  986. return false;
  987. }
  988. this.getNewPrice();
  989. },
  990. getNewPrice() {
  991. let new_price = 0;
  992. this.order_goods_model.forEach((item, index) => {
  993. new_price += parseFloat(item.new_price);
  994. })
  995. console.log(new_price)
  996. this.change_all_money = new_price;
  997. this.all_money = (parseFloat(this.order_model.price) - (parseFloat(this.order_model.dispatch_price))) + parseFloat(new_price) + parseFloat(this.dispatch_price);
  998. },
  999. clearDispatch() {
  1000. this.dispatch_price = 0.00;
  1001. this.getNewPrice();
  1002. },
  1003. sureChangePrice() {
  1004. let json = {
  1005. order_id: this.change_price_id,
  1006. dispatch_price: this.dispatch_price,
  1007. order_goods: [],
  1008. }
  1009. this.order_goods_model.forEach((item, index) => {
  1010. json.order_goods.push({order_goods_id: item.id, change_price: item.new_price});
  1011. })
  1012. console.log(json);
  1013. let loading = this.$loading({
  1014. target: document.querySelector("#change-price"),
  1015. background: 'rgba(0, 0, 0, 0)'
  1016. });
  1017. this.$http.post('{!! yzWebFullUrl('order.change-order-price.store-api') !!}', json).then(function (response) {
  1018. if (response.data.result) {
  1019. this.$message({type: 'success', message: '修改价格成功!'});
  1020. } else {
  1021. this.$message({type: 'error', message: response.data.msg});
  1022. }
  1023. loading.close();
  1024. this.change_price_show = false;
  1025. this.search(this.current_page);
  1026. }, function (response) {
  1027. this.$message({type: 'error', message: response.data.msg});
  1028. loading.close();
  1029. this.change_price_show = false;
  1030. })
  1031. },
  1032. judgeSign(num) {
  1033. var reg = new RegExp("^-?[0-9]*.?[0-9]*$");
  1034. if (reg.test(num)) {
  1035. var absVal = Math.abs(num);
  1036. return num == absVal ? '是正数' : '是负数';
  1037. } else {
  1038. return -1;
  1039. }
  1040. },
  1041. export1(export_type, template) {
  1042. let that = this;
  1043. console.log(that.search_form);
  1044. let json = that.search_form;
  1045. if (this.times && this.times.length > 0) {
  1046. json.start_time = this.times[0];
  1047. json.end_time = this.times[1];
  1048. }
  1049. let url = this.exportUrl;
  1050. url += "&export_type=" + export_type + "&template=" + template;
  1051. if (that.code) {
  1052. url += "&code=" + that.code
  1053. }
  1054. for (let i in json) {
  1055. if (json[i]) {
  1056. url += "&search[" + i + "]=" + json[i];
  1057. }
  1058. }
  1059. console.log(url);
  1060. window.location.href = url;
  1061. },
  1062. gotoGoods(id) {
  1063. window.location.href = `{!! yzWebFullUrl('goods.goods.edit') !!}` + `&id=` + id;
  1064. },
  1065. gotoMember(id) {
  1066. window.location.href = `{!! yzWebFullUrl('member.member.detail') !!}` + `&id=` + id;
  1067. },
  1068. escapeHTML(a) {
  1069. a = "" + a;
  1070. return a.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&apos;/g, "'");
  1071. },
  1072. getParam(name) {
  1073. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  1074. var r = window.location.search.substr(1).match(reg);
  1075. if (r != null) return unescape(r[2]);
  1076. return null;
  1077. },
  1078. },
  1079. })
  1080. </script>
  1081. @endsection