index.php 57 KB

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