reserve.php 67 KB

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