index.php 56 KB

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