order.vue 35 KB

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