order.vue 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227
  1. <template>
  2. <div class="app-container">
  3. <el-tabs v-model="activeName" @tab-click="handleClick">
  4. <el-tab-pane label="农商批发订单" :name="0"></el-tab-pane>
  5. <el-tab-pane label="同城秒送订单" :name="1"></el-tab-pane>
  6. <el-tab-pane label="福利专区订单" :name="2"></el-tab-pane>
  7. </el-tabs>
  8. <div class="header" style="width: 100%" v-if="!hdUserId">
  9. <el-row class="row" :gutter="12">
  10. <el-col :span="3">
  11. <el-card shadow="always">
  12. <div class="item">
  13. <div style="padding: 10px">
  14. <span>今日新增订单</span>
  15. </div>
  16. <div class="count">
  17. {{ orderStatistics ? orderStatistics.AllOrder : 0 }} 个
  18. </div>
  19. </div>
  20. </el-card>
  21. </el-col>
  22. <el-col :span="3">
  23. <el-card shadow="always">
  24. <div class="item">
  25. <div style="padding: 10px">
  26. <span>待发货</span>
  27. </div>
  28. <div class="count">
  29. {{ orderStatistics ? orderStatistics.waitDelivery : 0 }}个
  30. </div>
  31. </div>
  32. </el-card>
  33. </el-col>
  34. <el-col :span="3">
  35. <el-card shadow="always">
  36. <div class="item">
  37. <div style="padding: 10px">
  38. <span>待收货</span>
  39. </div>
  40. <div class="count">
  41. {{ orderStatistics ? orderStatistics.waitReceive : 0 }}个
  42. </div>
  43. </div>
  44. </el-card>
  45. </el-col>
  46. <el-col :span="3">
  47. <el-card shadow="always">
  48. <div class="item">
  49. <div style="padding: 10px">
  50. <span>待支付</span>
  51. </div>
  52. <div class="count">
  53. {{ orderStatistics ? orderStatistics.waitPay : 0 }}个
  54. </div>
  55. </div>
  56. </el-card>
  57. </el-col>
  58. <el-col :span="3">
  59. <el-card shadow="always">
  60. <div class="item">
  61. <div style="padding: 10px">
  62. <span>待退款</span>
  63. </div>
  64. <div class="count">
  65. {{ orderStatistics ? orderStatistics.waitRefund : 0 }}个
  66. </div>
  67. </div>
  68. </el-card>
  69. </el-col>
  70. <el-col :span="3">
  71. <el-card shadow="always">
  72. <div class="item">
  73. <div style="padding: 10px">
  74. <span>售后订单</span>
  75. </div>
  76. <div class="count">
  77. {{ orderStatistics ? orderStatistics.afterSalesOrder : 0 }}个
  78. </div>
  79. </div>
  80. </el-card>
  81. </el-col>
  82. <el-col :span="3">
  83. <el-card shadow="always">
  84. <div class="item">
  85. <div style="padding: 10px">
  86. <span>已完成订单</span>
  87. </div>
  88. <div class="count">
  89. {{
  90. orderStatistics.successOrderCount
  91. ? orderStatistics.successOrderCount
  92. : 0
  93. }}个
  94. </div>
  95. </div>
  96. </el-card>
  97. </el-col>
  98. <el-col :span="3">
  99. <el-card shadow="always">
  100. <div class="item">
  101. <div style="padding: 10px">
  102. <span>到账金额</span>
  103. </div>
  104. <div class="count">
  105. {{
  106. orderStatistics.divideSuccessPrice
  107. ? orderStatistics.divideSuccessPrice
  108. : 0
  109. }}元
  110. </div>
  111. </div>
  112. </el-card>
  113. </el-col>
  114. <el-col :span="3">
  115. <el-card shadow="always">
  116. <div class="item">
  117. <div style="padding: 10px">
  118. <span>冻结金额</span>
  119. </div>
  120. <div class="count">
  121. {{
  122. orderStatistics.divideWaitPrice
  123. ? orderStatistics.divideWaitPrice
  124. : 0
  125. }}元
  126. </div>
  127. </div>
  128. </el-card>
  129. </el-col>
  130. </el-row>
  131. </div>
  132. <el-form
  133. :model="queryParams"
  134. ref="queryForm"
  135. size="small"
  136. :inline="true"
  137. v-show="showSearch"
  138. label-width="80px"
  139. >
  140. <el-form-item label="商品名称" prop="spuName">
  141. <el-input
  142. v-model="queryParams.spuName"
  143. placeholder="请输入商品名称"
  144. clearable
  145. style="width: 180px"
  146. />
  147. </el-form-item>
  148. <el-form-item label="订单编号" prop="userOrderSn">
  149. <el-input
  150. v-model="queryParams.userOrderSn"
  151. placeholder="请输入订单编号"
  152. clearable
  153. style="width: 180px"
  154. />
  155. </el-form-item>
  156. <el-form-item label="买家手机号" prop="userPhone" label-width="140px">
  157. <el-input
  158. v-model="queryParams.userPhone"
  159. placeholder="请输入下单用户手机号"
  160. clearable
  161. style="width: 180px"
  162. />
  163. </el-form-item>
  164. <el-form-item label="下单人ID" prop="userId" label-width="140px">
  165. <el-input
  166. v-model="queryParams.userId"
  167. placeholder="请输入下单人ID"
  168. clearable
  169. style="width: 180px"
  170. />
  171. </el-form-item>
  172. <el-form-item label="下单时间" prop="createTime">
  173. <el-date-picker
  174. v-model="queryParams.createTime"
  175. value-format="yyyy-MM-dd"
  176. format="yyyy-MM-dd"
  177. type="date"
  178. placeholder="请选择下单时间"
  179. >
  180. </el-date-picker>
  181. </el-form-item>
  182. <el-form-item label="订单状态" prop="orderStatusKey">
  183. <el-select
  184. v-model="queryParams.orderStatusKey"
  185. placeholder="请选择订单状态"
  186. style="width: 180px"
  187. >
  188. <el-option label="全部" value=""> </el-option>
  189. <el-option label="待发货" value="WAIT_DELIVERY"> </el-option>
  190. <el-option label="待收货" value="WAIT_RECEIVE"> </el-option>
  191. <el-option label="待付款" value="WAIT_PAY"> </el-option>
  192. <el-option label="已完成" value="COMPLETE"> </el-option>
  193. <el-option label="已取消/申请售后" value="CANCEL"> </el-option>
  194. <el-option label="待发布货运信息" value="WAIT_PUBLISH_INVOICE">
  195. </el-option>
  196. <el-option label="等待司机接单" value="WAIT_DRIVER_ERCEIVE">
  197. </el-option>
  198. </el-select>
  199. </el-form-item>
  200. <el-form-item label="售后状态" prop="afterSaleStatus">
  201. <el-select
  202. v-model="queryParams.afterSaleStatus"
  203. placeholder="请选择售后状态"
  204. style="width: 180px"
  205. >
  206. <el-option label="全部" value=""> </el-option>
  207. <el-option label="未申请" value="0"> </el-option>
  208. <el-option label="已申请" value="1"> </el-option>
  209. <el-option label="审核失败" value="2"> </el-option>
  210. <el-option label="审核成功(退款中)" value="3"> </el-option>
  211. <el-option label="退款成功" value="4"> </el-option>
  212. <el-option label="退款失败(联系客服解决)" value="5"> </el-option>
  213. </el-select>
  214. </el-form-item>
  215. <el-form-item label="支付方式" prop="paymentType" label-width="140px">
  216. <el-select
  217. v-model="queryParams.paymentType"
  218. placeholder="请选择支付方式"
  219. style="width: 180px"
  220. >
  221. <el-option label="全部" value=""> </el-option>
  222. <el-option label="支付宝" value="alipay"> </el-option>
  223. <el-option label="微信支付" value="wechat"> </el-option>
  224. </el-select>
  225. </el-form-item>
  226. <el-form-item
  227. label="配送方式"
  228. prop="deliveryType"
  229. style="margin-left: 60px"
  230. >
  231. <el-select
  232. v-model="queryParams.deliveryType"
  233. placeholder="请选择支付方式"
  234. style="width: 180px"
  235. >
  236. <el-option label="全部" value=""> </el-option>
  237. <el-option label="自提" value="0"> </el-option>
  238. <el-option label="同城下单" value="1"> </el-option>
  239. <el-option label="异地下单" value="2" v-if="activeName == 0">
  240. </el-option>
  241. </el-select>
  242. </el-form-item>
  243. <el-form-item>
  244. <el-button
  245. type="primary"
  246. icon="el-icon-search"
  247. size="mini"
  248. @click="handleQuery"
  249. >搜索</el-button
  250. >
  251. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  252. >重置</el-button
  253. >
  254. </el-form-item>
  255. </el-form>
  256. <el-row :gutter="10" class="mb8">
  257. <el-col :span="1.5">
  258. <el-button
  259. type="primary"
  260. plain
  261. size="mini"
  262. @click="printOrderBtn"
  263. :disabled="!selectList.length > 0"
  264. >订单打印</el-button
  265. >
  266. </el-col>
  267. <el-col :span="1.5">
  268. <el-button
  269. type="primary"
  270. plain
  271. size="mini"
  272. @click="handleExport"
  273. :disabled="!selectList.length > 0"
  274. >导出</el-button
  275. >
  276. </el-col>
  277. <!-- <el-col :span="1.5">
  278. <el-button type="success" plain icon="el-icon-edit" size="mini" @click="All"
  279. >全选</el-button
  280. >
  281. </el-col> -->
  282. </el-row>
  283. <!-- :span-method="objectSpanMethod" -->
  284. <el-table
  285. ref="multipleTable"
  286. :span-method="objectSpanMethod"
  287. v-loading="loading"
  288. :data="spuList"
  289. @selection-change="handleSelectionChange"
  290. row-key="id"
  291. >
  292. <el-table-column type="selection" width="55" align="center" />
  293. <!-- <el-table-column label="序号" type="index" /> -->
  294. <el-table-column
  295. label="订单编号"
  296. align="center"
  297. prop="carPayNo"
  298. width="230"
  299. :show-overflow-tooltip="true"
  300. />
  301. <el-table-column
  302. label="商品名称"
  303. align="center"
  304. prop="skuName"
  305. width="200"
  306. >
  307. <template slot-scope="scope">
  308. {{
  309. scope.row.goodsInfo
  310. ? JSON.parse(scope.row.goodsInfo)[0].skuName
  311. : ""
  312. }}
  313. </template>
  314. </el-table-column>
  315. <el-table-column
  316. label="交易金额(元)"
  317. align="center"
  318. prop="paymentAmount"
  319. width="100"
  320. >
  321. <template slot-scope="scope">
  322. {{ scope.row.goodsAmount.toFixed(2) }}元
  323. </template>
  324. </el-table-column>
  325. <el-table-column
  326. label="收货人姓名"
  327. align="center"
  328. prop="consigneeContactName"
  329. width="100"
  330. />
  331. <el-table-column
  332. label="收货人手机号"
  333. align="center"
  334. prop="consigneeContactMobile"
  335. width="110"
  336. />
  337. <el-table-column
  338. label="下单人姓名"
  339. align="center"
  340. prop="userNick"
  341. width="120"
  342. />
  343. <el-table-column
  344. label="下单人ID"
  345. align="center"
  346. prop="userId"
  347. width="100"
  348. />
  349. <el-table-column
  350. label="下单时间"
  351. align="center"
  352. prop="createTime"
  353. width="160"
  354. />
  355. <el-table-column label="单价/数量" align="center" prop="price">
  356. <template slot-scope="scope">
  357. <span>
  358. {{
  359. scope.row.goodsInfo
  360. ? JSON.parse(scope.row.goodsInfo)[0].price + "元"
  361. : ""
  362. }}
  363. <br />
  364. {{
  365. scope.row.goodsInfo
  366. ? "共" + JSON.parse(scope.row.goodsInfo)[0].quantity
  367. : ""
  368. }}{{
  369. scope.row.goodsInfo ? JSON.parse(scope.row.goodsInfo)[0].unit : ""
  370. }}</span
  371. >
  372. </template>
  373. </el-table-column>
  374. <el-table-column label="支付方式" align="center" prop="packageType">
  375. <template slot-scope="scope">
  376. {{
  377. scope.row.paymentType == "alipay"
  378. ? "支付宝支付"
  379. : scope.row.paymentType == "wechat"
  380. ? "微信支付"
  381. : scope.row.paymentType == "card"
  382. ? "银行卡支付"
  383. : scope.row.paymentType == "firstuse"
  384. ? "先用后付"
  385. : ""
  386. }}
  387. </template>
  388. </el-table-column>
  389. <el-table-column label="支付状态" align="center" prop="paymentStatus">
  390. <template slot-scope="scope">
  391. {{
  392. scope.row.paymentStatus == "0"
  393. ? "待支付"
  394. : scope.row.paymentStatus == "1"
  395. ? "线上支付"
  396. : scope.row.paymentStatus == "2"
  397. ? "线下支付"
  398. : ""
  399. }}
  400. </template>
  401. </el-table-column>
  402. <el-table-column
  403. label="配送方式"
  404. align="center"
  405. prop="paymentType"
  406. width="120"
  407. >
  408. <template slot-scope="scope">
  409. {{
  410. scope.row.deliveryType == "0"
  411. ? "自提"
  412. : scope.row.deliveryType == "1"
  413. ? "同城下单"
  414. : scope.row.deliveryType == "2"
  415. ? "异地下单"
  416. : ""
  417. }}
  418. </template>
  419. </el-table-column>
  420. <el-table-column label="订单状态" align="center" width="120">
  421. <template slot-scope="scope">
  422. {{
  423. scope.row.orderStatus == 0
  424. ? "待商家确认修改运费"
  425. : scope.row.orderStatus == 10
  426. ? "等待买家支付"
  427. : scope.row.orderStatus == 20
  428. ? "等待商家发布货运信息"
  429. : scope.row.orderStatus == 90
  430. ? "等待司机接单"
  431. : scope.row.orderStatus == 100
  432. ? "等待司机支付保证金"
  433. : scope.row.orderStatus == 110
  434. ? "等待司机装货"
  435. : scope.row.orderStatus == 120
  436. ? "已装货,运输中"
  437. : scope.row.orderStatus == 30
  438. ? "司机已到达,等待买家签收"
  439. : scope.row.orderStatus == 40
  440. ? "买家已收货"
  441. : scope.row.orderStatus == 50
  442. ? "已取消"
  443. : scope.row.orderStatus == 60
  444. ? "退款中"
  445. : scope.row.orderStatus == 70
  446. ? "退款成功"
  447. : scope.row.orderStatus == 80
  448. ? "退款失败"
  449. : scope.row.orderStatus == 130
  450. ? "待处理售后"
  451. : scope.row.orderStatus == 140
  452. ? "已处理售后"
  453. : ""
  454. }}
  455. </template>
  456. </el-table-column>
  457. <el-table-column label="售后状态" align="center">
  458. <template slot-scope="scope">
  459. {{
  460. scope.row.afterSaleStatus == 0
  461. ? "未申请"
  462. : scope.row.afterSaleStatus == 1
  463. ? "已申请"
  464. : scope.row.afterSaleStatus == 2
  465. ? "审核失败"
  466. : scope.row.afterSaleStatus == 3
  467. ? "审核成功(退款中)"
  468. : scope.row.afterSaleStatus == 4
  469. ? "退款成功"
  470. : scope.row.afterSaleStatus == 5
  471. ? "退款失败(联系客服解决)"
  472. : ""
  473. }}
  474. </template>
  475. </el-table-column>
  476. <el-table-column label="操作" align="center" width="150">
  477. <template slot-scope="scope">
  478. <el-button
  479. size="mini"
  480. type="text"
  481. @click="handlexyhf(scope.row)"
  482. v-if="
  483. scope.row.paymentType == 'firstuse' &&
  484. scope.row.auditFirstUse != 0
  485. "
  486. >先用后付审核</el-button
  487. >
  488. <el-button
  489. size="mini"
  490. type="text"
  491. @click="handlexxzf(scope.row)"
  492. v-if="
  493. scope.row.paymentStatus == '2' &&
  494. scope.row.confirmOfflinePayment != 0
  495. "
  496. >确认是否已线下支付</el-button
  497. >
  498. <el-button
  499. size="mini"
  500. type="text"
  501. @click="handleDetail(scope.row)"
  502. v-hasPermi="['manage:order:detail']"
  503. >订单详情</el-button
  504. >
  505. </template>
  506. </el-table-column>
  507. </el-table>
  508. <pagination
  509. v-show="total > 0"
  510. :total="total"
  511. :page.sync="queryParams.pageNo"
  512. :limit.sync="queryParams.pageSize"
  513. @pagination="getList"
  514. />
  515. <!-- 添加或修改参数配置对话框 -->
  516. <el-dialog
  517. :title="title"
  518. :visible.sync="open"
  519. width="1000px"
  520. append-to-body
  521. >
  522. <el-descriptions title="订单详情" column="3">
  523. <el-descriptions-item label="订单编号">{{
  524. detailInfo ? detailInfo.userOrderSn : ""
  525. }}</el-descriptions-item>
  526. <el-descriptions-item label="订单状态">
  527. {{
  528. detailInfo
  529. ? detailInfo.orderStatus == 0
  530. ? "待商家确认修改运费"
  531. : detailInfo.orderStatus == 10
  532. ? "等待买家支付"
  533. : detailInfo.orderStatus == 20
  534. ? "等待商家发布货运信息"
  535. : detailInfo.orderStatus == 90
  536. ? "等待司机接单"
  537. : detailInfo.orderStatus == 100
  538. ? "等待司机支付保证金"
  539. : detailInfo.orderStatus == 110
  540. ? "等待司机装货"
  541. : detailInfo.orderStatus == 120
  542. ? "已装货,运输中"
  543. : detailInfo.orderStatus == 30
  544. ? "司机已到达,等待买家签收"
  545. : detailInfo.orderStatus == 40
  546. ? "买家已收货"
  547. : detailInfo.orderStatus == 50
  548. ? "已取消"
  549. : detailInfo.orderStatus == 60
  550. ? "退款中"
  551. : detailInfo.orderStatus == 70
  552. ? "退款成功"
  553. : detailInfo.orderStatus == 80
  554. ? "退款失败"
  555. : detailInfo.orderStatus == 130
  556. ? "待处理售后"
  557. : detailInfo.orderStatus == 140
  558. ? "已处理售后"
  559. : ""
  560. : ""
  561. }}</el-descriptions-item
  562. >
  563. <el-descriptions-item label="配送方式">
  564. {{
  565. detailInfo
  566. ? detailInfo.deliveryMethod == "0"
  567. ? "自提"
  568. : detailInfo.deliveryMethod == "1"
  569. ? "同城下单"
  570. : detailInfo.deliveryMethod == "2"
  571. ? "异地下单"
  572. : ""
  573. : ""
  574. }}
  575. </el-descriptions-item>
  576. <el-descriptions-item label="支付方式">
  577. {{
  578. detailInfo
  579. ? detailInfo.paymentType == "alipay"
  580. ? "支付宝"
  581. : detailInfo.paymentType == "wechat"
  582. ? "微信支付"
  583. : detailInfo.paymentType == "card"
  584. ? "银行卡支付"
  585. : detailInfo.paymentType == "firstuse"
  586. ? "银行卡支付"
  587. : ""
  588. : ""
  589. }}</el-descriptions-item
  590. >
  591. <el-descriptions-item label="支付状态">
  592. {{
  593. detailInfo
  594. ? detailInfo.paymentStatus == "0"
  595. ? "待支付"
  596. : detailInfo.paymentStatus == "1"
  597. ? "线上支付"
  598. : detailInfo.paymentStatus == "2"
  599. ? "线下支付"
  600. : ""
  601. : ""
  602. }}</el-descriptions-item
  603. >
  604. <el-descriptions-item label="下单时间">
  605. {{ parseTime(detailInfo.createTime) }}</el-descriptions-item
  606. >
  607. <el-descriptions-item label="付款时间">
  608. {{ parseTime(detailInfo.paymentTime) }}
  609. </el-descriptions-item>
  610. <!-- <el-descriptions-item label="担保服务费">
  611. {{ detailInfo ? detailInfo.serviceFee : "" }}
  612. </el-descriptions-item> -->
  613. <el-descriptions-item label="运费(元)">
  614. {{ detailInfo ? detailInfo.freightFee : "" }}</el-descriptions-item
  615. >
  616. <el-descriptions-item label="交易金额(元)">
  617. {{ detailInfo ? detailInfo.goodsAmount : "" }}
  618. </el-descriptions-item>
  619. </el-descriptions>
  620. <el-descriptions title="物流信息" column="3">
  621. <el-descriptions-item label="运单号">
  622. {{ detailInfo ? detailInfo.orderSn : "" }}</el-descriptions-item
  623. >
  624. <el-descriptions-item label="司机">{{
  625. detailInfo ? detailInfo.driverUservalue : ""
  626. }}</el-descriptions-item>
  627. <el-descriptions-item label="车型">{{
  628. detailInfo ? detailInfo.carType : ""
  629. }}</el-descriptions-item>
  630. <el-descriptions-item label="车牌号"
  631. >{{ detailInfo ? detailInfo.plateNo : "" }}
  632. </el-descriptions-item>
  633. <el-descriptions-item label="司机电话">{{
  634. detailInfo ? detailInfo.driverPhone : ""
  635. }}</el-descriptions-item>
  636. <el-descriptions-item label="装货时间">
  637. {{ detailInfo ? detailInfo.shipmentTime : "" }}</el-descriptions-item
  638. >
  639. <el-descriptions-item label="送达时间">
  640. {{ detailInfo ? detailInfo.arriveTime : "" }}</el-descriptions-item
  641. >
  642. </el-descriptions>
  643. <el-descriptions title="买家信息" column="3">
  644. <el-descriptions-item label="昵称">{{
  645. detailInfo ? detailInfo.userNick : ""
  646. }}</el-descriptions-item>
  647. <el-descriptions-item label="头像">
  648. <el-avatar
  649. v-if="detailInfo.userHeadUrl"
  650. :size="30"
  651. :src="detailInfo.userHeadUrl"
  652. ></el-avatar
  653. ></el-descriptions-item>
  654. <el-descriptions-item label="收货人">{{
  655. detailInfo ? detailInfo.consigneeContactName : ""
  656. }}</el-descriptions-item>
  657. <el-descriptions-item label="手机号">
  658. {{ detailInfo ? detailInfo.userPhone : "" }}</el-descriptions-item
  659. >
  660. <el-descriptions-item label="备注">
  661. {{ detailInfo ? detailInfo.orderRemark : "" }}</el-descriptions-item
  662. >
  663. <el-descriptions-item label="收货地址"
  664. >{{ detailInfo ? detailInfo.consigneeAddressDetail : "" }}
  665. </el-descriptions-item>
  666. </el-descriptions>
  667. <el-descriptions title="商品信息" column="3"> </el-descriptions>
  668. <el-table :data="detailInfo.orderGoodInfoList" style="width: 100%">
  669. <el-table-column prop="skuName" label="商品名称"> </el-table-column>
  670. <el-table-column prop="skuName" label="商品图片">
  671. <template slot-scope="scope">
  672. <el-image :src="scope.row.skuPic" style="width: 50px; height: 50px">
  673. </el-image>
  674. </template>
  675. </el-table-column>
  676. <el-table-column prop="price" label="商品单价(元)"> </el-table-column>
  677. <el-table-column prop="quantity" label="下单数量"> </el-table-column>
  678. <el-table-column prop="totalPrice" label="总金额(元)">
  679. </el-table-column>
  680. </el-table>
  681. </el-dialog>
  682. <!-- 添加或修改参数配置对话框 -->
  683. <el-dialog
  684. title="打印订单"
  685. :visible.sync="equipmentOpen"
  686. width="500px"
  687. append-to-body
  688. >
  689. <div>
  690. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  691. <el-form-item label="选择打印机" prop="sn">
  692. <el-select v-model="printForm.sn" placeholder="请选择打印机">
  693. <el-option
  694. v-for="item in printList"
  695. :key="item.value"
  696. :label="item.name"
  697. :value="item.sn"
  698. >
  699. </el-option>
  700. </el-select>
  701. </el-form-item>
  702. </el-form>
  703. </div>
  704. <div slot="footer" class="dialog-footer">
  705. <el-button type="primary" @click="printSubmitForm">确 定</el-button>
  706. <el-button @click="equipmentOpen = false">取 消</el-button>
  707. </div>
  708. </el-dialog>
  709. <!-- 添加或修改参数配置对话框 -->
  710. <el-dialog
  711. title="确认是否同意用户使用先用后付"
  712. :visible.sync="xyhfOpen"
  713. width="500px"
  714. append-to-body
  715. >
  716. <div>
  717. <el-form ref="form" :model="xyhf" :rules="rules" label-width="100px">
  718. <el-form-item label="是否同意" prop="auditFirstUse">
  719. <el-radio-group v-model="xyhf.auditFirstUse">
  720. <el-radio :label="0" :name="0">同意</el-radio>
  721. <el-radio :label="1" :name="1">拒绝</el-radio>
  722. </el-radio-group>
  723. </el-form-item>
  724. <div>同意时:确认收货3天内.需确认用户是否完成支付</div>
  725. <div>拒绝时:将自动取消该订单.用户支付服务费将原路退回</div>
  726. </el-form>
  727. </div>
  728. <div slot="footer" class="dialog-footer">
  729. <el-button type="primary" @click="xyhfOk">确 定</el-button>
  730. <el-button @click="xyhfOpen = false">取 消</el-button>
  731. </div>
  732. </el-dialog>
  733. <el-dialog
  734. title="确认是否已进行线下协商支付"
  735. :visible.sync="xxzfOpen"
  736. width="500px"
  737. append-to-body
  738. >
  739. <div>
  740. <el-form ref="form" :model="xxzf" :rules="rules" label-width="100px">
  741. <el-form-item label="是否同意" prop="auditFirstUse">
  742. <el-radio-group v-model="xxzf.confirmOfflinePayment">
  743. <el-radio :label="0" :name="0">用户已支付</el-radio>
  744. <el-radio :label="1" :name="1">用户未支付</el-radio>
  745. </el-radio-group>
  746. </el-form-item>
  747. </el-form>
  748. </div>
  749. <div slot="footer" class="dialog-footer">
  750. <el-button type="primary" @click="xxzfOk">确 定</el-button>
  751. <el-button @click="xyhfOpen = false">取 消</el-button>
  752. </div>
  753. </el-dialog>
  754. </div>
  755. </template>
  756. <script>
  757. import {
  758. statisticsOrderNum,
  759. queryUserOrderByShopId,
  760. userOrderInfo,
  761. auditFirstUserOrder,
  762. confirmUserOfflinePayment,
  763. } from "@/api/manage/order";
  764. import { printOrder, equipmentList } from "@/api/manage/equipment";
  765. import moment from "moment";
  766. import Utils from "@/utils/derive";
  767. export default {
  768. name: "Config",
  769. // dicts: ["sys_yes_no"],
  770. props: ["type", "userId"],
  771. data() {
  772. return {
  773. xxzfOpen: false,
  774. xxzf: {
  775. confirmOfflinePayment: "",
  776. },
  777. xyhf: {
  778. auditFirstUse: "",
  779. },
  780. xyhfOpen: false,
  781. activeName: 0,
  782. equipmentOpen: false,
  783. // 遮罩层
  784. loading: false,
  785. // 选中数组
  786. ids: [],
  787. // 非单个禁用
  788. single: true,
  789. // 非多个禁用
  790. multiple: true,
  791. // 显示搜索条件
  792. showSearch: true,
  793. // 总条数
  794. total: 0,
  795. // 参数表格数据
  796. spuList: [],
  797. // 弹出层标题
  798. title: "订单详情",
  799. // 是否显示弹出层
  800. open: false,
  801. // 日期范围
  802. dateRange: [],
  803. // 查询参数
  804. queryParams: {
  805. spuType: 0,
  806. userId: "",
  807. pageNo: 1,
  808. pageSize: 10,
  809. spuName: "",
  810. userOrderSn: "",
  811. userPhone: "",
  812. createTime: "",
  813. orderStatusKey: "",
  814. afterSaleStatus: "",
  815. paymentType: "",
  816. deliveryType: "",
  817. },
  818. printForm: {
  819. sn: "",
  820. },
  821. column: [
  822. { header: "订单编号", key: "carPayNo", width: 20 },
  823. { header: "买家姓名", key: "userNick", width: 20 },
  824. { header: "买家手机号", key: "userPhone", width: 20 },
  825. { header: "商品名称", key: "skuName", width: 20 },
  826. { header: "商品类型", key: "categoryName", width: 20 },
  827. { header: "商品价格", key: "price", width: 20 },
  828. { header: "包装方式", key: "packageType", width: 20 },
  829. { header: "规格名称", key: "specsName", width: 20 },
  830. { header: "规格值", key: "specsValue", width: 20 },
  831. { header: "实付金额(元)", key: "goodsAmount", width: 20 },
  832. { header: "商品数量", key: "goodsDetails", width: 20 },
  833. { header: "运费", key: "freightFee", width: 20 },
  834. { header: "订单状态", key: "orderStatus", width: 20 },
  835. { header: "售后状态", key: "afterSaleStatus", width: 20 },
  836. { header: "下单时间", key: "createTime", width: 20 },
  837. { header: "付款时间 ", key: "paymentTime", width: 20 },
  838. ],
  839. // 表单参数
  840. form: {},
  841. // 表单校验
  842. rules: {
  843. sn: [{ required: true, message: "请选择打印机", trigger: "blur" }],
  844. auditFirstUse: [{ required: true, message: "请选择", trigger: "blur" }],
  845. },
  846. orderStatistics: {},
  847. mergeObj: {}, // 用来记录需要合并行的下标
  848. selectList: [],
  849. selectListDC: [],
  850. detailInfo: {},
  851. dialogLoding: false,
  852. printList: [],
  853. hdUserId: "",
  854. rowInfo: {},
  855. };
  856. },
  857. watch: {
  858. userId(newV, oldV) {
  859. console.log(newV, oldV);
  860. this.hdUserId = this.userId;
  861. this.queryParams.userId = this.userId;
  862. this.getList();
  863. this.getEquipmentList();
  864. },
  865. },
  866. mounted() {
  867. if (this.userId) {
  868. this.queryParams.userId = this.userId;
  869. this.getList();
  870. this.getEquipmentList();
  871. } else {
  872. this.getList();
  873. this.getEquipmentList();
  874. this.getstatisticsOrder();
  875. }
  876. },
  877. methods: {
  878. handlexxzf(info) {
  879. this.rowInfo = info;
  880. this.xxzfOpen = true;
  881. },
  882. xxzfOk() {
  883. confirmUserOfflinePayment({
  884. id: this.rowInfo.id,
  885. confirmOfflinePayment: this.xxzf.confirmOfflinePayment,
  886. }).then((res) => {
  887. if (res.code == 200) {
  888. this.$modal.msgSuccess("操作成功!");
  889. this.xxzfOpen = false;
  890. this.getList();
  891. } else {
  892. this.xxzfOpen = false;
  893. this.$modal.msgError(res.msg);
  894. }
  895. });
  896. },
  897. xyhfOk() {
  898. auditFirstUserOrder({
  899. id: this.rowInfo.id,
  900. auditFirstUse: this.xyhf.auditFirstUse,
  901. }).then((res) => {
  902. if (res.code == 200) {
  903. this.$modal.msgSuccess("操作成功!");
  904. this.xyhfOpen = false;
  905. this.getList();
  906. } else {
  907. this.xyhfOpen = false;
  908. this.$modal.msgError(res.msg);
  909. }
  910. });
  911. },
  912. handlexyhf(record) {
  913. this.rowInfo = record;
  914. this.xyhfOpen = true;
  915. },
  916. handleClick() {
  917. this.queryParams.spuType = this.activeName;
  918. this.getList();
  919. this.getstatisticsOrder();
  920. },
  921. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  922. if (columnIndex === 0 || columnIndex === 1) {
  923. if (
  924. rowIndex === 0 ||
  925. row.carPayNo != this.spuList[rowIndex - 1].carPayNo
  926. ) {
  927. let rowspan = 0;
  928. this.spuList.forEach((element) => {
  929. if (element.carPayNo === row.carPayNo) {
  930. rowspan++;
  931. }
  932. });
  933. return [rowspan, 1];
  934. } else {
  935. return [0, 0];
  936. }
  937. }
  938. },
  939. getEquipmentList() {
  940. equipmentList().then((res) => {
  941. if (res.code == 200) {
  942. this.printList = res.data.records;
  943. }
  944. });
  945. },
  946. printSubmitForm() {
  947. if (!this.printForm.sn) {
  948. this.$message.error("请选择打印机!");
  949. return;
  950. }
  951. this.printForm.carPayNos = this.selectList.toString();
  952. printOrder(this.printForm)
  953. .then((res) => {
  954. if (res.code == 200) {
  955. this.equipmentOpen = false;
  956. this.selectList = [];
  957. this.$refs.multipleTable.clearSelection();
  958. this.$modal.msgSuccess("操作成功!");
  959. } else {
  960. this.equipmentOpen = false;
  961. this.$modal.msgError(res.msg);
  962. }
  963. })
  964. .catch((err) => {
  965. this.equipmentOpen = false;
  966. this.$modal.msgError(err);
  967. });
  968. },
  969. printOrderBtn() {
  970. this.equipmentOpen = true;
  971. },
  972. getstatisticsOrder() {
  973. statisticsOrderNum({ spuType: this.activeName }).then((res) => {
  974. if (res.code == 200) {
  975. this.orderStatistics = res.data;
  976. } else {
  977. this.$modal.msgError(res.msg);
  978. }
  979. });
  980. },
  981. getList() {
  982. this.selectList = [];
  983. this.loading = true;
  984. queryUserOrderByShopId(
  985. this.addDateRange(this.queryParams, this.dateRange)
  986. ).then((response) => {
  987. if (response.code !== 200) {
  988. this.loading = false;
  989. return;
  990. }
  991. try {
  992. // 扁平化嵌套结构
  993. const flattenedList = this.flattenOrderItems(response.data.records);
  994. console.log("flattenedList", flattenedList);
  995. // 处理商品信息和规格
  996. const processedList = flattenedList.map((item) => {
  997. const processedItem = { ...item };
  998. // 解析并合并商品信息
  999. if (item.goodsInfo) {
  1000. try {
  1001. const goods = JSON.parse(item.goodsInfo);
  1002. if (Array.isArray(goods) && goods.length > 0) {
  1003. // 合并第一个商品的信息
  1004. Object.assign(processedItem, goods[0]);
  1005. processedItem.specsName = goods
  1006. .map((good) => `${good.specsValue?.[0]?.specsName}`)
  1007. .toString();
  1008. processedItem.specsValue = goods
  1009. .map((good) => `${good.specsValue?.[0]?.specsValue}`)
  1010. .toString();
  1011. // 生成商品详情字符串
  1012. processedItem.goodsDetails = goods
  1013. .map(
  1014. (good) =>
  1015. `${good.skuName}(${
  1016. good.specsValue?.[0]?.specsName || ""
  1017. })-数量:${good.quantity}${good.unit}`
  1018. )
  1019. .join(";");
  1020. }
  1021. } catch (error) {
  1022. console.error("解析商品信息失败:", error);
  1023. processedItem.goodsDetails = "商品信息解析失败";
  1024. }
  1025. }
  1026. // 合并规格信息
  1027. if (Array.isArray(item.specsValue)) {
  1028. item.specsValue.forEach((spec) => {
  1029. Object.assign(processedItem, spec);
  1030. });
  1031. }
  1032. return processedItem;
  1033. });
  1034. console.log("12312312", processedList);
  1035. this.spuList = processedList;
  1036. this.total = response.data.total;
  1037. } catch (error) {
  1038. console.error("处理订单数据失败:", error);
  1039. this.spuList = [];
  1040. this.total = 0;
  1041. } finally {
  1042. this.loading = false;
  1043. }
  1044. });
  1045. },
  1046. // 扁平化订单项目
  1047. flattenOrderItems(records) {
  1048. return records.flatMap((record) => {
  1049. if (
  1050. Array.isArray(record.dxUserOrderVOList) &&
  1051. record.dxUserOrderVOList.length > 0
  1052. ) {
  1053. return record.dxUserOrderVOList.map((item) => ({
  1054. ...record,
  1055. ...item,
  1056. }));
  1057. }
  1058. return [record];
  1059. });
  1060. },
  1061. // 取消按钮
  1062. cancel() {
  1063. this.open = false;
  1064. this.reset();
  1065. },
  1066. // 表单重置
  1067. reset() {
  1068. this.resetForm("form");
  1069. },
  1070. /** 搜索按钮操作 */
  1071. handleQuery() {
  1072. this.queryParams.pageNo = 1;
  1073. this.getList();
  1074. },
  1075. /** 重置按钮操作 */
  1076. resetQuery() {
  1077. this.dateRange = [];
  1078. this.resetForm("queryForm");
  1079. this.handleQuery();
  1080. },
  1081. handleDetail(record) {
  1082. this.title = "商品详情";
  1083. this.open = true;
  1084. this.dialogLoding = true;
  1085. userOrderInfo(record.id)
  1086. .then((res) => {
  1087. if (res.code == 200) {
  1088. this.detailInfo = res.data;
  1089. this.detailInfo.deliveryMethod = record.deliveryType;
  1090. this.dialogLoding = false;
  1091. }
  1092. })
  1093. .catch((err) => {
  1094. this.dialogLoding = false;
  1095. console.log(err);
  1096. });
  1097. },
  1098. // 多选框选中数据
  1099. handleSelectionChange(selection) {
  1100. console.log("selection", selection);
  1101. this.selectList = selection.map((item) => item.carPayNo);
  1102. const payNoMap = {};
  1103. selection.forEach((row) => {
  1104. const carPayNo = row.carPayNo;
  1105. if (!payNoMap[carPayNo]) {
  1106. // 找到spuList中所有相同carPayNo的行
  1107. payNoMap[carPayNo] = this.spuList.filter(
  1108. (item) => item.carPayNo === carPayNo
  1109. );
  1110. }
  1111. });
  1112. // 将所有找到的行展平到selectListDC
  1113. this.selectListDC = Object.values(payNoMap).flat();
  1114. console.log(this.selectListDC);
  1115. },
  1116. /** 导出按钮操作 */
  1117. handleExport() {
  1118. let lists = [];
  1119. for (let index = 0; index < this.spuList.length; index++) {
  1120. for (let a = 0; a < this.selectListDC.length; a++) {
  1121. if (this.spuList[index].id == this.selectListDC[a].id) {
  1122. lists.push(this.spuList[index]);
  1123. }
  1124. }
  1125. }
  1126. // 定义订单状态映射表
  1127. const ORDER_STATUS_MAP = {
  1128. 0: "待商家确认修改运费",
  1129. 10: "等待买家支付",
  1130. 20: "等待商家发布货运信息",
  1131. 30: "司机已到达,等待买家签收",
  1132. 40: "买家已收货",
  1133. 50: "已取消",
  1134. 60: "退款中",
  1135. 70: "退款成功",
  1136. 80: "退款失败",
  1137. 90: "等待司机接单",
  1138. 100: "等待司机支付保证金",
  1139. 110: "等待司机装货",
  1140. 120: "已装货,运输中",
  1141. 130: "待处理售后",
  1142. 140: "已处理售后",
  1143. };
  1144. const AFTER_SALE_STATUS_MAP = {
  1145. 0: "未申请",
  1146. 1: "已申请",
  1147. 2: "审核失败",
  1148. 3: "审核成功(退款中)",
  1149. 4: "退款成功",
  1150. 5: "退款失败(联系客服解决)",
  1151. };
  1152. // 处理订单状态
  1153. lists.forEach((e) => {
  1154. // 订单状态处理(使用映射表)
  1155. if (AFTER_SALE_STATUS_MAP.hasOwnProperty(e.afterSaleStatus)) {
  1156. e.afterSaleStatus = AFTER_SALE_STATUS_MAP[e.afterSaleStatus];
  1157. } else {
  1158. e.afterSaleStatus = "未知状态"; // 处理未知状态
  1159. }
  1160. // 订单状态处理(使用映射表)
  1161. if (ORDER_STATUS_MAP.hasOwnProperty(e.orderStatus)) {
  1162. e.orderStatus = ORDER_STATUS_MAP[e.orderStatus];
  1163. } else {
  1164. e.orderStatus = "未知状态"; // 处理未知状态
  1165. }
  1166. });
  1167. console.log(lists);
  1168. Utils.exportExcel(this.column, lists, "订单列表"); //导出方法
  1169. },
  1170. },
  1171. };
  1172. </script>
  1173. <style scoped lang="scss">
  1174. .header {
  1175. margin-bottom: 30px;
  1176. .item {
  1177. height: 100px;
  1178. }
  1179. .row {
  1180. display: flex;
  1181. flex-direction: row;
  1182. justify-content: space-between;
  1183. align-items: center;
  1184. .count {
  1185. padding: 10px;
  1186. font-size: 20px;
  1187. font-weight: 500;
  1188. }
  1189. .zz {
  1190. font-size: 14px;
  1191. color: red;
  1192. padding: 0px 10px;
  1193. }
  1194. }
  1195. }
  1196. </style>