reserve.php 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('component/order-address', __DIR__);
  4. ComponentHelper::loadComponentView('component/order-shipping', __DIR__);
  5. ComponentHelper::loadComponentView('com-export-dialog');
  6. ?>
  7. <div id="app" v-cloak>
  8. <el-tabs type="border-card" v-model="orderTypeTab" @tab-click="orderTypeTabClick">
  9. <el-tab-pane label="商品订单" name="gorder">
  10. </el-tab-pane>
  11. <el-tab-pane label="服务订单" name="rorder">
  12. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;" v-loading="listLoading">
  13. <div slot="header">
  14. <span>订单列表</span>
  15. <div style="float: right; margin: -5px 0">
  16. <!-- <el-button type="primary" size="small" @click="handle('edit')">添加商品</el-button>-->
  17. <!-- <el-button type="primary" size="small">订单导出</el-button>-->
  18. <!-- <com-export-dialog
  19. style="float: right;margin-top: -5px"
  20. :field_list='export_list'
  21. :action_url="export_url"
  22. :params="search_data">
  23. </com-export-dialog> -->
  24. </div>
  25. </div>
  26. <div class="table-body">
  27. <el-tabs v-model="activeName" @tab-click="handleClick">
  28. <el-tab-pane v-for="item in tabs" :key="item.value" :label="item.name" :name="item.value">
  29. <el-form :inline="true" :model="search_data" size="small" class="demo-form-inline">
  30. <el-form-item label="下单时间">
  31. <el-date-picker style="margin-top: 1px;" @change="changeTime" v-model="datetime" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']"></el-date-picker>
  32. </el-form-item>
  33. <el-form-item label="">
  34. <el-input placeholder="请输入订单号" v-model="search_data.order_no"></el-input>
  35. </el-form-item>
  36. <el-form-item label="">
  37. <el-input placeholder="请输入内容" v-model="search_data.type_value" class="input-with-select">
  38. <el-select v-model="search_data.type" slot="prepend" placeholder="请选择">
  39. <el-option label="用户ID" value="user_id"></el-option>
  40. <el-option label="手机号码" value="mobile"></el-option>
  41. </el-select>
  42. </el-input>
  43. </el-form-item>
  44. <el-form-item>
  45. <el-button type="primary" @click="search">搜索</el-button>
  46. <el-button type="danger" @click="clearSearch" v-if="show_clear_search_btn">清除条件</el-button>
  47. </el-form-item>
  48. </el-form>
  49. <!-- 订单表格 start -->
  50. <div class="order-table">
  51. <ul class="tab-title" flex="dir:left cross:center">
  52. <li class="width-50" flex="main:center">
  53. <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="allSelOrder"></el-checkbox>
  54. </li>
  55. <li class="width-400">商品信息</li>
  56. <li class="width-pre10">价格/数量</li>
  57. <li class="width-pre10">实付款</li>
  58. <li class="width-s">服务地址</li>
  59. <li class="width-s" v-if="is_show_username==1">真实姓名</li>
  60. <li class="width-pre10">状态</li>
  61. <li class="width-pre10">门店名称</li>
  62. <li class="">操作</li>
  63. </ul>
  64. <div class="tab-cont" v-for="(item, index) in list" :key="index">
  65. <div class="tab-cont-row" flex="main:justify cross:center">
  66. <div flex="dir:left cross:center">
  67. <div class="width-50" flex="main:center">
  68. <!-- <el-checkbox v-model="item.select" @change=""></el-checkbox> -->
  69. <el-checkbox-group v-model="checkedOrder" @change="orderChange">
  70. <el-checkbox :label="item.id">{{''}}</el-checkbox>
  71. </el-checkbox-group>
  72. </div>
  73. <div style="padding-right: 20px;">订单({{ item.id }})编号:{{ item.order_no || '-' }}</div>
  74. <div v-if="item.base_user" style="padding-right: 20px;">用户({{item.base_user.id}}):{{ item.base_user.nickname || item.base_user.username }}</div>
  75. <div style="padding-right: 20px;">下单时间:{{ item.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  76. <el-tag size="small" style="padding-right: 20px;" v-if="marketing_type_map[item.marketing_type]">{{marketing_type_map[item.marketing_type]}}</el-tag>
  77. <el-tag size="small" v-if="item.reserve" :type="reserve_type_text[item.reserve.reserve_type].type">
  78. {{reserve_type_text[item.reserve.reserve_type].title}}
  79. </el-tag>
  80. </div>
  81. </div>
  82. <ul class="tab-cont-info" flex="dir:left cross:center" v-for="(it, i) in item.detail" v-if="true">
  83. <li class="width-50" :class="i == item.detail.length - 1 ? 'no-border-bottom' : 'border-bottom'"></li>
  84. <li class="tab-shop-info width-400" flex="dir:left" :class="i == item.detail.length - 1 ? 'no-border-bottom' : 'border-bottom'">
  85. <div style="position: relative;">
  86. <el-image style="width: 50px; height: 50px; border-radius: 5px;" :src="it.pic_url"></el-image>
  87. <span v-if="repeal_list[it.is_feedback]" class="com-order-refund-status">{{ repeal_list[it.is_feedback] }}</span>
  88. </div>
  89. <div class="tab-goods-name">
  90. <com-ellipsis :line="1" :text="it.goods_name+''"></com-ellipsis>
  91. <template>
  92. <el-tag style="margin-right: 2px;margin-top: 5px;" size="small">
  93. {{ it.goods_attr_name || '无规格' }}
  94. </el-tag>
  95. </template>
  96. </div>
  97. </li>
  98. <li class="width-pre10 border-right" :class="i == item.detail.length - 1 ? 'no-border-bottom' : 'border-bottom'">
  99. <div class="cursor" flex="cross:center" @mouseover="mouseOver(index, i)" @mouseleave="mouseLeave">
  100. <p style="padding-right: 10px;">
  101. {{ getOrderPrice(it) }}
  102. <span v-if="it.adjust_money != 0">(调价:¥{{ it.adjust_money }})</span>
  103. </p>
  104. </div>
  105. <p>{{ it.num }}件</p>
  106. </li>
  107. <li class="width-pre10 border-right">
  108. <div v-show="i == 0">
  109. <p>{{ item.pay_money }}</p>
  110. <p>(含运费¥{{ item.shipping_money }})</p>
  111. <p>
  112. <el-tag size="small" type="warning">{{payment_type_list[item.payment_type]}}</el-tag>
  113. </p>
  114. </div>
  115. </li>
  116. <li class="width-s border-right">
  117. <div v-show="i == 0">
  118. <p>{{ item.receiver_name | emptyFilled }}</p>
  119. <p>{{ item.mobile |emptyFilled}} </p>
  120. <p style="display: flex;align-items: center;">
  121. <com-ellipsis v-if="(item.region_name + item.address).trim() != 'null'" :line="1" :text="item.region_name + item.address + ''"></com-ellipsis>
  122. <span v-else>--</span>
  123. </p>
  124. </div>
  125. </li>
  126. <li class="width-s border-right" v-if="is_show_username==1&&item.base_user">
  127. <div v-show="i == 0">
  128. <p>{{ item.base_user.username }}</p>
  129. </div>
  130. </li>
  131. <li class="width-pre10 border-right">
  132. <div v-show="i == 0">
  133. <el-tag size="small">{{ order_status_list[item.order_status] }}</el-tag>
  134. </div>
  135. </li>
  136. <li class="width-pre10 border-right">
  137. <div v-show="i == 0">
  138. <el-tag size="small">{{ item.store_name }}</el-tag>
  139. </div>
  140. </li>
  141. <li v-show="i == 0">
  142. <el-button size="small" type="text" @click="handle('detail',item)">详情</el-button>
  143. <el-button v-if="item.Printer && item.Printer.is_show_printer==1" size="small" type="text" @click="handle('printer',item)">打印小票</el-button>
  144. <template v-for="operate_item in status_operate_list[item.order_status]['operate']">
  145. <el-button size="small" type="text" @click="handle(operate_item.code,item)">{{operate_item.name}}</el-button>
  146. </template>
  147. </li>
  148. </ul>
  149. </div>
  150. </div>
  151. <div style="text-align: right;margin: 20px 0;">
  152. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  153. </div>
  154. <!-- 订单表格 end -->
  155. </el-tab-pane>
  156. </el-tabs>
  157. </div>
  158. </el-card>
  159. </el-tab-pane>
  160. </el-tabs>
  161. <!-- TODO: 修改价格 (一期没有)-->
  162. <!-- <el-dialog title="订单改价" :visible.sync="isShowChangePrice">
  163. <el-form :model="change_price_form" ref="goodsValidateForm" label-width="80px" size="small">
  164. <el-table :data="change_price_form.detail" :span-method="objectSpanMethod" border>
  165. <el-table-column prop="goods_name" label="商品" width="180"></el-table-column>
  166. <el-table-column width="100" prop="price" label="单价(元)">
  167. <template slot-scope="scope">
  168. <span>{{scope.row.price}}元</span>
  169. </template>
  170. </el-table-column>
  171. <el-table-column width="50" prop="price" label="数量">
  172. <template slot-scope="scope">
  173. <span>{{scope.row.num}}</span>
  174. </template>
  175. </el-table-column>
  176. <el-table-column prop="goods_price" label="小计">
  177. <template slot-scope="scope">
  178. <span>{{scope.row.price*scope.row.num}}元</span>
  179. </template>
  180. </el-table-column>
  181. <el-table-column prop="discount_sum" label="优惠" >
  182. <template slot-scope="scope">
  183. <el-tooltip class="item" effect="dark" content="优惠 = 会员折扣 + 优惠券 + 积分抵扣 + 会员价 + 涨减价" placement="top">
  184. <span>{{(scope.row.discount_sum).toFixed(2)}}元</span>
  185. </el-tooltip>
  186. </template>
  187. </el-table-column>
  188. <el-table-column prop="" label="涨价或减价">
  189. <template slot-scope="scope">
  190. <el-input type="number" size="small" v-model="scope.row.adjust_money" @input="sumChangePrice(scope,$event)"></el-input>
  191. </template>
  192. </el-table-column>
  193. <el-table-column prop="" label="运费">
  194. <template slot-scope="scope">
  195. <el-input size="small" v-model="change_price_form.shipping_money" @input="sumChangeShipping($event)" onkeyup="if(value<0){value=0}else{value=toNumber(value,2)}"></el-input>
  196. </template>
  197. </el-table-column>
  198. </el-table>
  199. <div style="padding-top: 20px;" class="change_formula">
  200. <p> 实付总金额 = 小计 + 店铺优惠 + 小计涨减价 + 运费 </p>
  201. </div>
  202. <div style="padding-top: 20px;" class="change_price">
  203. <p> <label>实付总金额 </label> ¥{{change_price_form.new_pay_money}} </p>
  204. </div>
  205. </el-form>
  206. <div slot="footer" class="dialog-footer">
  207. <el-button @click="isShowChangePrice = false">取 消</el-button>
  208. <el-button type="primary" @click="handle('change_price',change_price_form,true)" :loading="changePriceLoading">确 定</el-button>
  209. </div>
  210. </el-dialog> -->
  211. <!-- TODO:备注 (一期没有)-->
  212. <!-- <el-dialog title="备注" width="600px" :visible.sync="isShowRemark">
  213. <el-form :model="remark_form" ref="goodsValidateForm" label-width="80px" size="small">
  214. <el-form-item label="" prop="remark">
  215. <el-input type="textarea" placeholder="卖家备注" v-model="remark_form.seller_remark"></el-input>
  216. </el-form-item>
  217. </el-form>
  218. <div slot="footer" class="dialog-footer">
  219. <el-button @click="isShowRemark = false">取 消</el-button>
  220. <el-button type="primary" @click="handle('remark',remark_form,true)" :loading="remarkLoading">确 定</el-button>
  221. </div>
  222. </el-dialog> -->
  223. <!-- TODO: 修改地址 (一期没有)-->
  224. <!-- <order-address :is_show="isShowChangeAddress" :change-address-loading="changeAddressLoading" @sure="handleChangeAddress" :order_info="change_address_form" @close="isShowChangeAddress = false"></order-address> -->
  225. <!-- TODO: 发货 -->
  226. <!-- <order-shipping :is_show="isShowChangeShipping" :change-shipping-loading="changeShippingLoading" :order_info="shipping_form" @submit="handleShipping" @close="isShowChangeShipping = false"></order-shipping> -->
  227. <el-dialog class="fenRunData" title="分润明细" :visible.sync="dialogTableVisible_fenRun">
  228. <el-tabs v-model="activeNames" @tab-click="commissionHandleClick">
  229. <el-tab-pane label="佣金" name="commission">
  230. <el-table :data="fenRunData">
  231. <el-table-column label="用户">
  232. <template slot-scope="scope">
  233. <div class="table-info-img-text">
  234. <el-image class="table-info-img circle" :src="scope.row.avatar_url">
  235. <div slot="error" class="image-slot">
  236. <el-image class="table-info-img" src="/resources/img/common/default-avatar.png"></el-image>
  237. </div>
  238. </el-image>
  239. <div class="table-info-text">
  240. <div>{{scope.row.nickname}}<span style="color:blue">({{scope.row.user_id}})</span></div>
  241. <div>{{scope.row.mobile}}</div>
  242. </div>
  243. </div>
  244. </template>
  245. </el-table-column>
  246. <el-table-column property="change_num" label="佣金"></el-table-column>
  247. <el-table-column property="is_frozen" label="状态"></el-table-column>
  248. <el-table-column property="capital_type_text" label="类型"></el-table-column>
  249. <el-table-column property="from_type_text" label="所属插件"></el-table-column>
  250. </el-table>
  251. </el-tab-pane>
  252. <el-tab-pane label="积分" name="score">
  253. <el-table :data="fenRunData">
  254. <el-table-column label="用户">
  255. <template slot-scope="scope">
  256. <image style="width: 50px;height: 50px; border-radius: 50%;" :src="scope.row.avatar_url? scope.row.avatar_url:'resources/img/mall/default_avatar_url.png'"></image>
  257. <div style="color:#000;">{{scope.row.nickname}}</div>
  258. </template>
  259. </el-table-column>
  260. <el-table-column property="change_num" label="积分"></el-table-column>
  261. <el-table-column property="is_frozen" label="状态"></el-table-column>
  262. <el-table-column property="capital_type_text" label="类型"></el-table-column>
  263. <el-table-column property="from_type_text" label="所属插件"></el-table-column>
  264. </el-table>
  265. </el-tab-pane>
  266. </el-tabs>
  267. </el-dialog>
  268. </div>
  269. <script>
  270. const app = new Vue({
  271. el: '#app',
  272. data() {
  273. return {
  274. orderTypeTab:'rorder',
  275. is_show_username: <?= $is_show_username ?>,
  276. price: 0,
  277. visibles: false,
  278. hidden: false,
  279. current: -1,
  280. detailIndex: -1,
  281. checkAll: false,
  282. checked: false,
  283. select: '',
  284. input3: '',
  285. goods_name: '',
  286. goods_id: '',
  287. is_show_change_price: true,
  288. marketing_type_map: {},
  289. reserve_type_text: [
  290. {
  291. title: '家政服务',
  292. type: 'danger'
  293. },
  294. {
  295. title: '预约服务',
  296. type: 'success'
  297. }
  298. ],
  299. // TODO: 一期操作只有 查看详情、分润明细
  300. status_operate_list: {
  301. '0': {
  302. operate: [
  303. // {
  304. // 'type': 'text',
  305. // 'name': '支付',
  306. // 'code': 'pay'
  307. // },
  308. // {
  309. // 'type': 'text',
  310. // 'name': '关闭交易',
  311. // 'code': 'cancel'
  312. // },
  313. // {
  314. // 'type': 'text',
  315. // 'name': '修改价格',
  316. // 'code': 'change_price'
  317. // },
  318. // {
  319. // 'type': 'text',
  320. // 'name': '备注',
  321. // 'code': 'remark'
  322. // },
  323. ]
  324. },
  325. '1': {
  326. operate: [
  327. // {
  328. // 'type': 'text',
  329. // 'name': '发货',
  330. // 'code': 'shipping'
  331. // }, {
  332. // 'type': 'text',
  333. // 'name': '修改地址',
  334. // 'code': 'change_address'
  335. // }, {
  336. // 'type': 'text',
  337. // 'name': '备注',
  338. // 'code': 'remark'
  339. // },
  340. {
  341. 'type': 'text',
  342. 'name': '分润明细',
  343. 'code': 'fen_run'
  344. },
  345. ]
  346. },
  347. '2': {
  348. operate: [
  349. // {
  350. // 'type': 'text',
  351. // 'name': '确认收货',
  352. // 'code': 'take-delivery'
  353. // }, {
  354. // 'type': 'text',
  355. // 'name': '备注',
  356. // 'code': 'remark'
  357. // },
  358. {
  359. 'type': 'text',
  360. 'name': '分润明细',
  361. 'code': 'fen_run'
  362. },
  363. ]
  364. },
  365. '3': {
  366. operate: [
  367. // {
  368. // 'type': 'text',
  369. // 'name': '订单完成',
  370. // 'code': 'sales'
  371. // },
  372. {
  373. 'type': 'text',
  374. 'name': '分润明细',
  375. 'code': 'fen_run'
  376. },
  377. ]
  378. },
  379. '4': {
  380. operate: [
  381. {
  382. 'type': 'text',
  383. 'name': '分润明细',
  384. 'code': 'fen_run'
  385. },
  386. ]
  387. },
  388. '6': {
  389. operate: [
  390. // {
  391. // 'type': 'text',
  392. // 'name': '确认自提',
  393. // 'code': 'shipping'
  394. // },
  395. // {
  396. // 'type': 'text',
  397. // 'name': '修改地址',
  398. // 'code': 'change_address'
  399. // },
  400. // {
  401. // 'type': 'text',
  402. // 'name': '备注',
  403. // 'code': 'remark'
  404. // },
  405. {
  406. 'type': 'text',
  407. 'name': '分润明细',
  408. 'code': 'fen_run'
  409. },
  410. ]
  411. },
  412. '7': {
  413. operate: [
  414. {
  415. 'type': 'text',
  416. 'name': '分润明细',
  417. 'code': 'fen_run'
  418. },
  419. ],
  420. },
  421. '-1': {
  422. operate: [{
  423. 'type': 'text',
  424. 'name': '售后审核',
  425. 'code': 'sales_review'
  426. },
  427. {
  428. 'type': 'text',
  429. 'name': '分润明细',
  430. 'code': 'fen_run'
  431. },
  432. ]
  433. },
  434. '-2': {
  435. operate: [{
  436. 'type': 'text',
  437. 'name': '售后完成',
  438. 'code': 'sales_finish'
  439. },
  440. {
  441. 'type': 'text',
  442. 'name': '分润明细',
  443. 'code': 'fen_run'
  444. },
  445. ]
  446. },
  447. '-3': {
  448. operate: [{
  449. 'type': 'text',
  450. 'name': '售后完成',
  451. 'code': 'sales_finish'
  452. },
  453. {
  454. 'type': 'text',
  455. 'name': '分润明细',
  456. 'code': 'fen_run'
  457. },
  458. ]
  459. },
  460. '-4': {
  461. operate: [
  462. // {
  463. // 'type': 'text',
  464. // 'name': '备注',
  465. // 'code': 'remark'
  466. // }, {
  467. // 'type': 'text',
  468. // 'name': '删除',
  469. // 'code': 'destroy'
  470. // }
  471. ]
  472. },
  473. '-5': {
  474. operate: [
  475. // {
  476. // 'type': 'text',
  477. // 'name': '备注',
  478. // 'code': 'remark'
  479. // }, {
  480. // 'type': 'text',
  481. // 'name': '删除',
  482. // 'code': 'destroy'
  483. // }
  484. ]
  485. },
  486. },
  487. repeal_list: {
  488. '1': '售后中',
  489. '2': '售后完成',
  490. },
  491. tabs: [
  492. {
  493. name: '全部',
  494. value: '999'
  495. },
  496. {
  497. name: '未付款',
  498. value: '0'
  499. },
  500. {
  501. name: '已付款',
  502. value: '1'
  503. },
  504. {
  505. name: '待服务',
  506. value: '2'
  507. },
  508. {
  509. name: '待验收',
  510. value: '3'
  511. },
  512. {
  513. name: '已完成',
  514. value: '4'
  515. },
  516. {
  517. name: '已关闭',
  518. value: '-4'
  519. },
  520. ],
  521. order_status_list: {
  522. '0': "待付款",
  523. '1': "已支付",
  524. '2': "待服务",
  525. '3': "待验收",
  526. '4': "已验收",
  527. '-4': "已关闭",
  528. '-2': "退款中",
  529. '-1': "售后申请"
  530. },
  531. payment_type_list: {
  532. '0': "在线支付",
  533. '1': "微信",
  534. '2': "支付宝",
  535. '3': "银联卡",
  536. '5': "余额支付",
  537. '7': "汇聚支付",
  538. '8': "汇聚快捷支付",
  539. '100': "线下支付"
  540. },
  541. shipping_type_list: {
  542. '1': "物流配送",
  543. '2': "买家自提",
  544. '3': "商家配送",
  545. '4': "本地配送"
  546. },
  547. selectList: [{
  548. value: 'order_sn',
  549. name: '订单号'
  550. }, ],
  551. keyword_1: '1',
  552. activeName: '999',
  553. list: [],
  554. export_list: {},
  555. listLoading: false,
  556. page: 1,
  557. pageCount: 0,
  558. mch_id: 0, // 这个地方不知道要怎么获取
  559. searchCats: [],
  560. datetime: [],
  561. search_data: { // 筛选条件
  562. order_status: null,
  563. cats: [],
  564. start: null,
  565. end: null,
  566. goods_id: null,
  567. order_no: null,
  568. type_value: null,
  569. type: null,
  570. order_id: 0,
  571. r: 'store/store-order/index',
  572. },
  573. isShowChangePrice: false,
  574. change_price_form: {
  575. detail: [],
  576. shipping_money: 0,
  577. },
  578. isShowChangeAddress: false,
  579. change_address_form: {},
  580. isShowChangeShipping: false,
  581. shipping_form: {},
  582. isShowRemark: false,
  583. remark_form: {},
  584. user_level: {},
  585. // loading
  586. changePriceLoading: false,
  587. remarkLoading: false,
  588. changeAddressLoading: false,
  589. changeShippingLoading: false,
  590. orderUrl: 'store/store-order/index',
  591. // export_url: 'store/store-order/index',
  592. checkedOrder: [], //选中的订单
  593. isIndeterminate: false,
  594. dialogTableVisible_fenRun: false,
  595. activeNames: 'commission',
  596. orderId: 0,
  597. fenRunData: [],
  598. changesShipping: 0,
  599. changeprice: 0,
  600. changeprice_status: false,
  601. };
  602. },
  603. mounted: function() {
  604. this.search_data.order_id = getQuery('order_id');
  605. this.getList(this.search_data);
  606. },
  607. computed: {
  608. show_clear_search_btn: function() {
  609. return !isEmpty(this.search_data.cats) || !isEmpty(this.search_data.start) ||
  610. !isEmpty(this.search_data.end) || !isEmpty(this.search_data.goods_id) ||
  611. !isEmpty(this.search_data.order_no) || !isEmpty(this.search_data.type) ||
  612. !isEmpty(this.search_data.type_value);
  613. }
  614. },
  615. updated: function() {
  616. // console.log('ssssss')
  617. },
  618. methods: {
  619. change(e, type) {
  620. this.$forceUpdate();
  621. },
  622. //修改商品价格
  623. sumChangePrice(data, value) {
  624. if (value && !isNaN(value)) {
  625. if (value) {
  626. var change_price = parseFloat(this.change_price_form.detail[data.$index].goods_price) + parseFloat(value);
  627. var changesShipping = this.change_price_form.shipping_money;
  628. if (this.changesShipping > 0) { //当运费有修改时去修改的值
  629. changesShipping = this.changesShipping;
  630. }
  631. if (!changesShipping) {
  632. changesShipping = 0;
  633. }
  634. var changeprice = 0;
  635. var new_pay_money = 0;
  636. for (var i = 0; i < this.change_price_form.detail.length; i++) {
  637. if (this.change_price_form.detail[i].adjust_money && !isNaN(this.change_price_form.detail[i].adjust_money)) {
  638. var value_data = value.split(".");
  639. if (value_data.length > 1) {
  640. if (value_data[1].length > 2) {
  641. this.change_price_form.detail[i].adjust_money = parseFloat(value).toFixed(2);
  642. }
  643. }
  644. changeprice = parseFloat(changeprice) + parseFloat(this.change_price_form.detail[i].adjust_money);
  645. }
  646. new_pay_money += parseFloat(this.change_price_form.detail[i].goods_price);
  647. }
  648. if (change_price < 0) {
  649. this.change_price_form.new_pay_money = parseFloat(new_pay_money + parseFloat(changesShipping)).toFixed(2);
  650. this.change_price_form.detail[data.$index].new_goods_price = parseFloat(this.change_price_form.detail[data.$index].goods_price);
  651. this.$message.error("单个商品支付金额不可以小于零");
  652. } else {
  653. this.change_price_form.new_pay_money = (new_pay_money + parseFloat(changeprice) + parseFloat(changesShipping)).toFixed(2);
  654. if (this.change_price_form.new_pay_money < 0.1) {
  655. this.$message.error("实付金额不可以小于0.1");
  656. return false;
  657. }
  658. this.changeprice_status = true;
  659. this.change_price_form.detail[data.$index].new_goods_price = parseFloat(this.change_price_form.detail[data.$index].goods_price) + parseFloat(value);
  660. }
  661. }
  662. }
  663. return value;
  664. },
  665. //修改邮费
  666. sumChangeShipping(value) { //change_price_form.detail shipping_money
  667. var changeprice = 0;
  668. var new_pay_money = 0;
  669. for (var i = 0; i < this.change_price_form.detail.length; i++) {
  670. if (this.change_price_form.detail[i].adjust_money && !isNaN(this.change_price_form.detail[i].adjust_money)) {
  671. changeprice = parseFloat(changeprice) + parseFloat(this.change_price_form.detail[i].adjust_money);
  672. }
  673. new_pay_money += parseFloat(this.change_price_form.detail[i].goods_price);
  674. }
  675. if (value && !isNaN(value)) {
  676. this.change_price_form.new_pay_money = (new_pay_money + parseFloat(value) + parseFloat(changeprice)).toFixed(2);
  677. this.changesShipping = parseFloat(value).toFixed(2);
  678. }
  679. },
  680. objectSpanMethod({
  681. row,
  682. column,
  683. rowIndex,
  684. columnIndex
  685. }) {
  686. if (columnIndex === 6) {
  687. console.log(rowIndex, 'rowIndex');
  688. if (rowIndex === 0) {
  689. return {
  690. rowspan: this.change_price_form.detail.length,
  691. colspan: 1
  692. };
  693. } else {
  694. return {
  695. rowspan: 0,
  696. colspan: 0
  697. };
  698. }
  699. }
  700. return {
  701. rowspan: 1,
  702. colspan: 1
  703. };
  704. },
  705. mouseOver(index, i) {
  706. // console.log(i)
  707. this.current = index
  708. this.detailIndex = i
  709. this.hidden = true
  710. },
  711. mouseLeave() {
  712. this.hidden = false
  713. },
  714. remark() { // 备注
  715. },
  716. changeTime(e) {
  717. // console.log(e)
  718. this.search_data.start = e[0]
  719. this.search_data.end = e[1]
  720. },
  721. handleClick(res) { //标签页切换
  722. if (this.search_data.status == this.activeName) return;
  723. this.search_data.order_status = this.activeName;
  724. this.page = 1;
  725. this.getList(this.search_data);
  726. },
  727. search() {
  728. this.page = 1;
  729. this.getList(this.search_data);
  730. },
  731. clearSearch() {
  732. this.search_data.cats = [];
  733. this.search_data.start = null;
  734. this.search_data.end = null;
  735. this.search_data.order_status = null;
  736. this.search_data.order_no = null;
  737. this.search_data.type = null;
  738. this.search_data.type_value = null;
  739. this.datetime = [];
  740. this.getList();
  741. },
  742. handleChangeAddress(data) {
  743. this.handle('change_address', data, true);
  744. },
  745. handleShipping(data) {
  746. this.handle('shipping', data, true);
  747. },
  748. handle(type, data = null, submit = false) {
  749. console.log(type)
  750. let id = data ? parseInt(data.id) : '';
  751. let url = 'store/store-order/operate';
  752. switch (type) {
  753. // 订单详情
  754. case 'detail':
  755. let params = {
  756. r: 'store/store-order/reserve-detail'
  757. };
  758. if (id) params = Object.assign(params, {
  759. id: id
  760. });
  761. navigateTo(params);
  762. break;
  763. // 删除订单
  764. case 'destroy':
  765. param = {
  766. id: data.id,
  767. type
  768. };
  769. this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {
  770. type: 'warning'
  771. }).then(() => {
  772. this.send('store/store-order/del', param)
  773. }).catch((err) => {})
  774. break;
  775. // 取消订单
  776. case 'cancel':
  777. param = {
  778. id: id
  779. };
  780. this.$confirm('确定关闭订单吗?', '警告', {
  781. type: 'warning'
  782. }).then(() => {
  783. this.send('store/store-order/close', param)
  784. }).catch((err) => {})
  785. break;
  786. // 支付订单
  787. case 'pay':
  788. param = {
  789. id: id
  790. };
  791. this.$confirm('确定付款吗?', '警告', {
  792. type: 'warning'
  793. }).then(() => {
  794. this.send('store/store-order/pay', param)
  795. }).catch((err) => {})
  796. break;
  797. // 修改价格
  798. case 'change_price':
  799. if (submit) {
  800. //检测每个商品修改价格不可以小于0和商品总价不可以小于0
  801. for (var i = 0; i < this.change_price_form.detail.length; i++) {
  802. var change_price = (parseFloat(this.change_price_form.detail[i].goods_price) + parseFloat(this.change_price_form.detail[i].adjust_money)).toFixed(2);
  803. if (change_price < 0) {
  804. this.$message.error('单个商品的减价值不可以大于商品实付金额');
  805. return false;
  806. }
  807. }
  808. if (this.change_price_form.new_pay_money < 0.1) {
  809. this.$message.error("实付金额不可以小于0.1");
  810. return false;
  811. }
  812. this.changePriceLoading = true;
  813. this.send('store/store-order/change-price', this.change_price_form, (resp) => {
  814. if (resp.code == 0) this.isShowChangePrice = false;
  815. });
  816. setTimeout(() => {
  817. this.changePriceLoading = false;
  818. }, 100);
  819. } else {
  820. this.isShowChangePrice = true;
  821. var objString = JSON.stringify(data);
  822. this.change_price_form = JSON.parse(objString);
  823. this.$set(this.change_price_form, 'new_pay_money', this.change_price_form.pay_money);
  824. for (var i = 0; i < this.change_price_form.detail.length; i++) {
  825. this.$set(this.change_price_form.detail[i], 'new_goods_price', this.change_price_form.detail[i].goods_price);
  826. this.$set(this.change_price_form.detail[i], 'new_adjust_money', this.change_price_form.detail[i].adjust_money);
  827. //his.change_price_form.detail[i].adjust_money = 0;
  828. var discount_money = (parseFloat(this.change_price_form.detail[i].price) * this.change_price_form.detail[i].num) - parseFloat(this.change_price_form.detail[i].goods_price);
  829. this.$set(this.change_price_form.detail[i], 'discount_sum', discount_money);
  830. }
  831. }
  832. break;
  833. // 修改收货地址
  834. case 'change_address':
  835. if (submit) {
  836. this.changeAddressLoading = true;
  837. this.send('store/store-order/change-address', data, (resp) => {
  838. if (resp.code == 0) this.isShowChangeAddress = false;
  839. });
  840. setTimeout(() => {
  841. this.changeAddressLoading = false;
  842. }, 100);
  843. } else {
  844. this.isShowChangeAddress = true
  845. var objString = JSON.stringify(data);
  846. this.change_address_form = JSON.parse(objString);
  847. }
  848. break;
  849. // 备注
  850. case 'remark':
  851. if (submit) {
  852. this.remarkLoading = true;
  853. this.send('store/store-order/remark', this.remark_form, (resp) => {
  854. if (resp.code == 0) this.isShowRemark = false;
  855. });
  856. setTimeout(() => {
  857. this.remarkLoading = false;
  858. }, 100);
  859. } else {
  860. this.isShowRemark = true
  861. var objString = JSON.stringify(data);
  862. this.remark_form = JSON.parse(objString);
  863. }
  864. break;
  865. // 物流发货
  866. case 'shipping':
  867. if (submit) {
  868. this.changeShippingLoading = true;
  869. this.send('store/store-order/shipping', data, (resp) => {
  870. if (resp.code == 0) this.isShowChangeShipping = false;
  871. });
  872. setTimeout(() => {
  873. this.changeShippingLoading = false;
  874. }, 100);
  875. } else {
  876. this.isShowChangeShipping = true
  877. var objString = JSON.stringify(data);
  878. this.shipping_form = JSON.parse(objString);
  879. }
  880. break;
  881. // 收货
  882. case 'take-delivery':
  883. param = {
  884. id: id
  885. };
  886. this.$confirm('确定收货吗?', '警告', {
  887. type: 'warning'
  888. }).then(() => {
  889. this.send('store/store-order/take-delivery', param)
  890. }).catch((err) => {})
  891. break;
  892. // 订单完成
  893. case 'sales':
  894. param = {
  895. id: id
  896. };
  897. this.$confirm('确定完成订单吗?', '警告', {
  898. type: 'warning'
  899. }).then(() => {
  900. this.send('store/store-order/sales-order', param)
  901. }).catch((err) => {})
  902. break;
  903. case 'fen_run':
  904. this.dialogTableVisible_fenRun = true;
  905. this.orderId = id;
  906. this.getCapitalLog(id, this.activeNames)
  907. break;
  908. case 'printer':
  909. param = {
  910. order_id: data.main_order_id
  911. };
  912. this.$confirm('确定打印?', '警告', {
  913. type: 'warning'
  914. }).then(() => {
  915. this.send('printer/default/printer', param)
  916. }).catch((err) => {
  917. })
  918. break;
  919. }
  920. },
  921. send(url, params, callback) {
  922. let self = this;
  923. request({
  924. params: {
  925. r: url,
  926. },
  927. method: 'post',
  928. data: params
  929. }).then(e => {
  930. if (e.data.code == 0) {
  931. self.$message.success(e.data.msg);
  932. self.getList(this.search_data);
  933. } else {
  934. self.$message.error(e.data.msg);
  935. }
  936. if (callback) callback(e.data);
  937. }).catch(e => {
  938. console.log(e);
  939. });
  940. },
  941. searchClick() {
  942. this.page = 1;
  943. this.getList();
  944. },
  945. pagination(currentPage) {
  946. let self = this;
  947. self.page = currentPage;
  948. self.getList(this.search_data);
  949. },
  950. // 获取订单列表
  951. getList(params = {}) {
  952. let self = this;
  953. let basic_params = {
  954. r: 'store/store-order/index',
  955. page: self.page,
  956. is_reserve: 1
  957. };
  958. params = Object.assign(basic_params, params);
  959. if (self.listLoading == false) {
  960. self.listLoading = true;
  961. request({
  962. params: params,
  963. method: 'get',
  964. }).then(e => {
  965. self.listLoading = false;
  966. if (e.data.code == 0) {
  967. self.list = e.data.data.list;
  968. self.marketing_type_map = e.data.data.marketing_type_map;
  969. this.export_list = e.data.data.export_list;
  970. self.pageCount = e.data.data.page_count;
  971. } else {
  972. self.$message.error(e.data.msg);
  973. }
  974. }).catch(e => {
  975. self.$message.error(e.data.msg);
  976. self.listLoading = false;
  977. });
  978. }
  979. },
  980. orderChange(val) {
  981. let checkedCount = val.length;
  982. this.checkAll = checkedCount == this.list.length;
  983. this.isIndeterminate = checkedCount > 0 && checkedCount < this.list.length;
  984. },
  985. allSelOrder(boo) {
  986. let ids = [];
  987. this.list.forEach(v => {
  988. ids.push(v.id);
  989. })
  990. this.checkedOrder = boo ? ids : [];
  991. this.isIndeterminate = false;
  992. },
  993. commissionHandleClick(tab, event) {
  994. console.log(this.activeNames);
  995. this.getCapitalLog(this.orderId, this.activeNames)
  996. },
  997. getCapitalLog(orderId, wallet_type) {
  998. request({
  999. params: {
  1000. r: 'store/store-order/commission-and-score-list',
  1001. order_id: orderId,
  1002. wallet_type: wallet_type,
  1003. },
  1004. method: 'get',
  1005. }).then(e => {
  1006. if (e.data.code == 0) {
  1007. this.fenRunData = e.data.data.list;
  1008. this.user_level = e.data.data.user_level;
  1009. } else {
  1010. self.$message.error(e.data.msg);
  1011. }
  1012. }).catch(e => {
  1013. console.log(e);
  1014. });
  1015. },
  1016. getOrderPrice(data) {
  1017. let text = '';
  1018. switch (data.marketing_type) {
  1019. case 'ScoreMall':
  1020. text = data.extra_info;
  1021. break;
  1022. default:
  1023. text = '¥' + data.goods_price;
  1024. }
  1025. return text;
  1026. },
  1027. orderTypeTabClick(tab,event){
  1028. if('rorder' == this.orderTypeTab) navigateTo({r:'store/store-order/reserve'});
  1029. if('gorder' == this.orderTypeTab) navigateTo({r:'store/store-order/index'});
  1030. },
  1031. }
  1032. });
  1033. </script>
  1034. <style>
  1035. .vue-line-clamp p {
  1036. line-height: 22px;
  1037. }
  1038. .demo-form-inline .el-select .el-input {
  1039. width: 100px;
  1040. }
  1041. /* 订单表格 start */
  1042. .width-pre10 {
  1043. width: 10%;
  1044. }
  1045. .width-50 {
  1046. width: 50px;
  1047. }
  1048. .width-400 {
  1049. width: 350px;
  1050. }
  1051. .order-table {
  1052. overflow-x: scroll;
  1053. }
  1054. .tab-title,
  1055. .tab-cont {
  1056. width: 100%;
  1057. min-width: 1290px;
  1058. font-size: 13px;
  1059. }
  1060. .tab-title {
  1061. padding: 20px 0;
  1062. }
  1063. .tab-title>li {
  1064. padding: 0 10px;
  1065. }
  1066. .tab-cont {
  1067. border: 1px solid #F2F2F2;
  1068. margin-bottom: 20px;
  1069. }
  1070. .tab-cont-row {
  1071. padding: 10px 0;
  1072. background-color: #F7F7F7;
  1073. }
  1074. .tab-cont-info {
  1075. height: 100px;
  1076. }
  1077. .tab-cont-info>li {
  1078. /* display: flex;
  1079. flex-direction: column;
  1080. justify-content: center; */
  1081. height: 100%;
  1082. padding: 16px 10px;
  1083. }
  1084. .tab-btns {
  1085. width: 320px;
  1086. margin-right: 20px;
  1087. }
  1088. .tab-goods-name {
  1089. margin: 0 10px;
  1090. }
  1091. .border-right {
  1092. border-right: 1px solid #f2f2f2;
  1093. }
  1094. .border-bottom {
  1095. border-bottom: 1px solid #f2f2f2;
  1096. }
  1097. .no-border-bottom {
  1098. border-bottom: none !important;
  1099. }
  1100. .cursor {
  1101. cursor: pointer;
  1102. }
  1103. .edit-icon {
  1104. color: #03c5ff;
  1105. cursor: pointer;
  1106. }
  1107. .popover-btn {
  1108. font-size: 12px;
  1109. padding: 0 10px;
  1110. border-right: 1px solid var(--primary, #03c5ff);
  1111. cursor: pointer;
  1112. display: inline-block;
  1113. line-height: 1;
  1114. color: #03c5ff;
  1115. }
  1116. .popover-btn:last-child {
  1117. border-right: none;
  1118. }
  1119. .width-s {
  1120. width: 250px;
  1121. }
  1122. .el-button--text {
  1123. padding: 0 !important;
  1124. }
  1125. .com-order-refund-status {
  1126. position: absolute;
  1127. bottom: 18px;
  1128. left: 0px;
  1129. height: 20px;
  1130. width: 50px;
  1131. background-color: #FF7171;
  1132. color: #fff;
  1133. text-align: center;
  1134. border-radius: 0 0 5px 5px;
  1135. font-size: 12px;
  1136. }
  1137. .fenRunData .el-dialog__body {
  1138. padding: 0px 10px 0 10px;
  1139. }
  1140. .change_price p {
  1141. padding: 5px;
  1142. font-size: 15px;
  1143. width: 200px;
  1144. }
  1145. .change_price {
  1146. width: 200px;
  1147. margin: 0px 0 0px 81%;
  1148. }
  1149. .change_price label {
  1150. float: left;
  1151. width: 100px;
  1152. text-align: right;
  1153. padding-right: 20px;
  1154. }
  1155. .change_formula {
  1156. float: left;
  1157. width: 300px;
  1158. color: #6c6969;
  1159. font-size: 12px;
  1160. }
  1161. /* 订单表格 end */
  1162. </style>