index.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. <div id="app" v-cloak>
  2. <el-card shadow="never" style="border:0;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  3. <div slot="header">
  4. <div>
  5. <span>订单列表</span>
  6. </div>
  7. </div>
  8. <div class="table-body">
  9. 商品名称:
  10. <div class="input-item">
  11. <el-input @keyup.enter.native="search" size="small" placeholder="商品名称" v-model="searchData.search_words" clearable @clear="search"></el-input>
  12. </div>
  13. 供应链:
  14. <el-select size="small" v-model="searchData.supply_id" class="select" style="float:none;width: 140px;">
  15. <el-option v-for="item in supplyList" :label="item.app_name" :value="item.id">
  16. </el-option>
  17. </el-select>
  18. 订单号:
  19. <div class="input-item">
  20. <el-input @keyup.enter.native="search" size="small" placeholder="订单号" v-model="searchData.order_no" clearable @clear="search"></el-input>
  21. </div>
  22. 用户ID:
  23. <div class="input-item">
  24. <el-input @keyup.enter.native="search" size="small" placeholder="用户ID" v-model="searchData.user_id" clearable @clear="search"></el-input>
  25. </div>
  26. 收件人:
  27. <div class="input-item">
  28. <el-input @keyup.enter.native="search" size="small" placeholder="收件人" v-model="searchData.name" clearable @clear="search"></el-input>
  29. </div>
  30. 平台类型:
  31. <el-select size="small" v-model="searchData.source" @change='search' class="select" style="float:none;width: 140px;">
  32. <el-option key="1" label="云仓" value="1"></el-option>
  33. <el-option key="2" label="京东" value="2"></el-option>
  34. <el-option key="6" label="阿里巴巴" value="6"></el-option>
  35. <el-option key="7" label="天猫" value="7"></el-option>
  36. </el-select>
  37. 推单状态:
  38. <el-select size="small" v-model="searchData.push_status" @change='search' class="select" style="float:none;width: 140px;">
  39. <el-option key="0" label="全部" value="0"></el-option>
  40. <el-option key="1" label="未推单" value="1"></el-option>
  41. <el-option key="2" label="推单中" value="2"></el-option>
  42. <el-option key="3" label="推单成功" value="3"></el-option>
  43. <el-option key="4" label="推单失败" value="4"></el-option>
  44. <el-option key="5" label="已退单" value="5"></el-option>
  45. </el-select>
  46. <!-- 订单状态:
  47. <el-select size="small" v-model="searchData.order_status" @change='search' class="select" style="float:none;width: 140px;">
  48. <el-option key="0" label="全部" value="0"></el-option>
  49. <el-option v-for="(item,key) in order_status_list" :key="key" :label="item" :value="key"></el-option>
  50. </el-select> -->
  51. <div style="display: inline-block;margin-left: 10px;">
  52. <el-button type="primary" size="small" @click="search">查询</el-button>
  53. <el-button type="primary" size="small" @click="resetForm" style=" margin-left: 0px;background-color: #ef1818;border-color: #ef1818;">重置</el-button>
  54. </div>
  55. </div>
  56. <div class="table-body">
  57. <el-row>
  58. <el-col :sm="1" style="text-align: right">
  59. <el-button size="mini" @click="batchPatchOrder" type="primary">批量补单</el-button>
  60. </el-col>
  61. </el-row>
  62. <!--商品信息-->
  63. <template>
  64. <el-table ref="multipleTable" :data="order_list" @selection-change="handleSelectionChange">
  65. <!-- 空数据 -->
  66. <template slot="empty">
  67. <el-empty description="暂无订单"></el-empty>
  68. </template>
  69. <el-table-column type="selection">
  70. </el-table-column>
  71. <el-table-column prop="order_no" align="center" label="订单编号">
  72. </el-table-column>
  73. <el-table-column prop="goods_name" align="center" label="商品标题">
  74. <template slot-scope="scope">
  75. <div class="ellipsis" style="clear:both;">{{ stateFormat(scope.row.mallOrderDetail.goods_name) }}</div>
  76. </template>
  77. </el-table-column>
  78. <el-table-column prop="img" align="center" label="商品图片">
  79. <template slot-scope="scope">
  80. <div class="goods-image">
  81. <com-image mode="aspectFill" :src="scope.row.mallOrderDetail.pic_url"></com-image>
  82. </div>
  83. </template>
  84. </el-table-column>
  85. <el-table-column prop="mallOrderDetail.goods_attr_name" align="center" label="商品属性">
  86. </el-table-column>
  87. <el-table-column prop="supply_name" align="center" label="供应链">
  88. </el-table-column>
  89. <el-table-column prop="goods_price" label="订单总价" align="center">
  90. <template slot-scope="scope">
  91. {{scope.row.mallOrder.goods_price}}
  92. </template>
  93. </el-table-column>
  94. <el-table-column prop="pay_money" label="实际支付" align="center">
  95. <template slot-scope="scope">
  96. {{scope.row.mallOrder.pay_money}}
  97. </template>
  98. </el-table-column>
  99. <el-table-column prop="consignee" label="收件人" align="center">
  100. <template slot-scope="scope">
  101. <div>{{scope.row.mallOrder.consignee}}</div>
  102. <div>{{scope.row.mallOrder.mobile}}</div>
  103. </template>
  104. </el-table-column>
  105. <el-table-column prop="pay_at" label="支付时间" align="center">
  106. <template slot-scope="scope">
  107. {{scope.row.mallOrder.pay_time|dateTimeFormat('Y-m-d H:i:s')}}
  108. </template>
  109. </el-table-column>
  110. <el-table-column prop="status_text" label="推单状态" align="center">
  111. <template slot-scope="scope">
  112. {{scope.row.status_text}}
  113. </template>
  114. </el-table-column>
  115. <el-table-column prop="updated_at" label="更新时间" align="center">
  116. <template slot-scope="scope">
  117. {{scope.row.updated_at|dateTimeFormat('Y-m-d H:i:s')}}
  118. </template>
  119. </el-table-column>
  120. <el-table-column prop="error" label="推单信息" align="center">
  121. <template slot-scope="scope">
  122. <div class="ellipsis" style="clear:both;">{{scope.row.error}}</div>
  123. </template>
  124. </el-table-column>
  125. <el-table-column align="center" label="操作">
  126. <template slot-scope="scope">
  127. <el-button @click="orderDetail(scope.row)" type="text" size="small">
  128. 详情
  129. </el-button>
  130. <el-button
  131. v-if="(scope.row.status == 4) && (scope.row.mallOrder.order_source == 'QiJuhe')"
  132. @click="patchOrder(scope.row)"
  133. type="text"
  134. size="small"
  135. >补单</el-button>
  136. <el-button
  137. v-if="scope.row.refund_order_id > 0"
  138. @click="refundOrder(scope.row)"
  139. type="text"
  140. size="small"
  141. >售后</el-button>
  142. <el-button
  143. v-if="(scope.row.status == 4) && (scope.row.mallOrder.order_source == 'QiJuhe')"
  144. @click="changeOrder(scope.row)"
  145. type="text"
  146. size="small"
  147. >转普通订单</el-button>
  148. </template>
  149. </el-table-column>
  150. </el-table>
  151. </template>
  152. <!-- 分页 -->
  153. <el-row type="flex" class="page" justify="end">
  154. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount" v-if="order_list"></el-pagination>
  155. </el-row>
  156. </div>
  157. </el-card>
  158. </div>
  159. </el-card>
  160. </div>
  161. <script>
  162. var activity_id = <?php echo 1 ?>;
  163. const app = new Vue({
  164. el: '#app',
  165. filters: {
  166. addZero: function(data) {
  167. return Math.round((data / 100) * 100) / 100 + '元';
  168. },
  169. },
  170. data() {
  171. return {
  172. searchData: {
  173. search_words: '',
  174. source: '',
  175. range_type: '',
  176. range_from: '',
  177. range_to: '',
  178. is_free_shipping: '',
  179. name: '',
  180. push_status: '',
  181. order_no: '',
  182. user_id: '',
  183. supply_id: '',
  184. limit: 15
  185. },
  186. order_list: [],
  187. select_order: [],
  188. supplyList: [],
  189. category_1: [],
  190. category_2: [],
  191. category_3: [],
  192. category_id_1: '',
  193. category_id_2: '',
  194. category_id_3: '',
  195. order_status_list: [],
  196. level: 0,
  197. parent_id: 0,
  198. pageCount: 0,
  199. page: 1,
  200. member_page: 1,
  201. currentPage: null,
  202. listLoading: false,
  203. btnLoading: false,
  204. checked: false,
  205. type: '',
  206. sort: '',
  207. };
  208. },
  209. created() {
  210. this.searchData.order_no = getQuery('order_no')
  211. },
  212. methods: {
  213. handleSelectionChange(val) {
  214. this.select_order = val;
  215. },
  216. // 订单详情
  217. orderDetail(order) {
  218. navigateTo({
  219. r: 'mall/order/detail',
  220. id: order.order_id,
  221. }, true);
  222. },
  223. // 订单详情
  224. refundOrder(order) {
  225. navigateTo({
  226. r: 'mall/order/refund-detail',
  227. refund_order_id: order.refund_order_id,
  228. }, true);
  229. },
  230. // 推单
  231. batchPatchOrder() {
  232. let num = 0;
  233. let order_id = new Array();
  234. this.select_order.forEach(function(item, index) {
  235. num++;
  236. order_id.push(item.id);
  237. })
  238. if (num <= 0) {
  239. this.$message.error('请选择订单');
  240. return false;
  241. }
  242. let self = this;
  243. this.$confirm('是否要对该订单进行补单?', '提示', {
  244. confirmButtonText: '确定',
  245. cancelButtonText: '取消',
  246. type: 'warning'
  247. }).then(() => {
  248. this.patch_order(order_id);
  249. }).catch(() => {
  250. this.$message.info('已取消删除')
  251. })
  252. },
  253. // 推单
  254. patchOrder(order) {
  255. this.$confirm('是否要对该订单进行补单?', '提示', {
  256. confirmButtonText: '确定',
  257. cancelButtonText: '取消',
  258. type: 'warning'
  259. }).then(() => {
  260. this.patch_order([order.id]);
  261. }).catch(() => {
  262. this.$message.info('已取消删除')
  263. })
  264. },
  265. // 全选
  266. allSelect() {
  267. if (this.checked) {
  268. this.goods_list.forEach(function(item, index) {
  269. if (!item.storage) {
  270. item.is_select = true;
  271. }
  272. })
  273. } else {
  274. this.goods_list.forEach(function(item, index) {
  275. item.is_select = false;
  276. })
  277. }
  278. },
  279. //搜索
  280. search() {
  281. this.page = 1;
  282. this.getOrderList();
  283. },
  284. pagination(currentPage) {
  285. this.page = currentPage;
  286. this.getOrderList();
  287. },
  288. getSupply(){
  289. request({
  290. params: {
  291. r: 'qi-juhe/supplys/index',
  292. },
  293. method: 'get',
  294. }).then(e => {
  295. if (e.data.code === 0) {
  296. this.supplyList = e.data.data.list
  297. // this.searchData.supply_id = this.supplyList[0].id
  298. } else {
  299. this.$message.error(e.data.msg);
  300. }
  301. }).catch(e => {});
  302. },
  303. getOrderList() {
  304. this.listLoading = true;
  305. var param = this.searchData;
  306. param.r = 'qi-juhe/order/index';
  307. param.page = this.page;
  308. request({
  309. params: param,
  310. }).then(e => {
  311. if (e.data.code === 0) {
  312. this.order_list = e.data.data.list;
  313. this.order_status_list = e.data.data.order_status_list;
  314. this.pageCount = e.data.data.page_count;
  315. this.currentPage = e.data.data.pagination.current_page;
  316. } else {
  317. this.$message.error(e.data.msg);
  318. }
  319. this.listLoading = false;
  320. }).catch(e => {
  321. this.listLoading = false;
  322. });
  323. },
  324. patch_order(order_id) {
  325. this.listLoading = true;
  326. var param = {
  327. r: 'qi-juhe/order/patch-order',
  328. method: 'post',
  329. order_ids: order_id
  330. }
  331. request({
  332. params: param,
  333. }).then(e => {
  334. let self = this;
  335. if (e.data.code === 0) {
  336. let html = '';
  337. e.data.data.error.forEach(function(item, key) {
  338. html += '<p style="color: red">' + item.msg + '</p>'
  339. })
  340. e.data.data.success.forEach(function(item, key) {
  341. html += '<p style="color: green">' + item.msg + '</p>'
  342. })
  343. self.listLoading = false;
  344. this.$alert(html, '补单结果', {
  345. dangerouslyUseHTMLString: true,
  346. confirmButtonText: '确定'
  347. });
  348. this.getOrderList();
  349. } else {
  350. this.$message.error(e.data.msg);
  351. }
  352. }).catch(e => {
  353. this.listLoading = false;
  354. });
  355. },
  356. //重置
  357. resetForm() {
  358. this.searchData.search_words = '';
  359. this.searchData.source = '';
  360. this.searchData.range_type = '';
  361. this.searchData.range_from = '';
  362. this.searchData.range_to = '';
  363. this.searchData.is_free_shipping = '';
  364. this.searchData.name = '';
  365. this.searchData.push_status = '';
  366. this.searchData.order_no = '';
  367. this.searchData.user_id = '';
  368. this.searchData.supply_id = '';
  369. },
  370. // 限制字数
  371. stateFormat(str) {
  372. if (!str) return ''
  373. let num = 12
  374. if (str.length > num) {
  375. return str.slice(0, num) + '...'
  376. }
  377. return str
  378. },
  379. // 转订单
  380. changeOrder(row) {
  381. this.$confirm('确认转普通订单吗,转换后无法补单?', '提示', {
  382. confirmButtonText: '确定',
  383. cancelButtonText: '取消',
  384. type: 'warning'
  385. }).then(() => {
  386. request({
  387. params: {
  388. r: 'qi-juhe/order/change-order',
  389. id: row.id,
  390. },
  391. method: 'get',
  392. }).then(e => {
  393. if (e.data.code === 0) {
  394. this.$message.success(e.data.msg)
  395. setTimeout(() => {
  396. this.getOrderList();
  397. }, 1500)
  398. } else {
  399. this.$message.error(e.data.msg);
  400. }
  401. })
  402. })
  403. },
  404. },
  405. mounted: function() {
  406. this.page = getQuery('page') ? getQuery('page') : 1;
  407. this.getSupply();
  408. this.getOrderList();
  409. }
  410. });
  411. </script>
  412. <style>
  413. .table-body {
  414. padding: 20px;
  415. background-color: #fff;
  416. }
  417. /* .table-info .el-button {
  418. padding: 0 !important;
  419. border: 0;
  420. margin: 0 5px;
  421. } */
  422. .input-item {
  423. display: inline-block;
  424. width: 150px;
  425. margin: 0 0 20px;
  426. margin-right: 10px;
  427. }
  428. .input-item .el-input__inner {
  429. border-right: 1px solid #dcdfe6;
  430. }
  431. .input-item .el-input__inner:hover {
  432. border: 1px solid #dcdfe6;
  433. border-right: 0;
  434. outline: 0;
  435. }
  436. .input-item .el-input__inner:focus {
  437. border: 1px solid #dcdfe6;
  438. border-right: 0;
  439. outline: 0;
  440. }
  441. .input-item .el-input-group__append {
  442. background-color: #fff;
  443. border-left: 0;
  444. width: 10%;
  445. padding: 0;
  446. }
  447. .input-item .el-input-group__append .el-button {
  448. padding: 0;
  449. }
  450. .input-item .el-input-group__append .el-button {
  451. margin: 0;
  452. }
  453. .select {
  454. float: left;
  455. width: 100px;
  456. margin-right: 10px;
  457. }
  458. .el-table th>.cell {
  459. color: #333;
  460. font-weight: bold;
  461. font-size: 14px;
  462. }
  463. .el-table__footer-wrapper,
  464. .el-table__header-wrapper {
  465. border-bottom: 1.4px solid #D6D6D6;
  466. }
  467. .search-sort {
  468. display: inline-block;
  469. margin: 0px 10px;
  470. cursor: pointer;
  471. color: rgb(51, 51, 51);
  472. }
  473. .caret-wrapper {
  474. display: inline-flex;
  475. flex-direction: column;
  476. align-items: center;
  477. height: 25px;
  478. width: 11px;
  479. vertical-align: middle;
  480. cursor: pointer;
  481. overflow: initial;
  482. position: relative;
  483. }
  484. .caret-top {
  485. border: 5px solid transparent;
  486. margin: 1px 0;
  487. border-bottom-color: rgb(51, 51, 51);
  488. }
  489. .caret-bottom {
  490. border: 5px solid transparent;
  491. margin: 1px 0;
  492. border-top-color: rgb(51, 51, 51);
  493. }
  494. .active {
  495. border-top-color: rgb(41, 186, 156);
  496. }
  497. .ellipsis {
  498. font-size: 12px;
  499. color: #333;
  500. overflow: hidden;
  501. text-overflow: ellipsis;
  502. }
  503. .goods-wrapper {
  504. border: 2px solid #CCCCCC;
  505. display: inline-block
  506. }
  507. .goods-select {
  508. border: 2px solid #bb730c;
  509. }
  510. .goods-price {
  511. text-align: center;
  512. }
  513. .goods-price .number {
  514. color: red;
  515. font-weight: 600;
  516. font-size: 18px;
  517. }
  518. .goods-price .title {
  519. padding: 5px 0;
  520. color: #999;
  521. ;
  522. font-size: 10px;
  523. font-weight: 600;
  524. }
  525. .bottom-price .title {
  526. padding: 5px 0;
  527. color: #8b8888;
  528. ;
  529. font-size: 10px;
  530. }
  531. .bottom-price .number {
  532. color: #ff5100;
  533. font-size: 10px;
  534. }
  535. .goods-action {
  536. margin-top: 8px;
  537. }
  538. .goods-action .title {
  539. color: #0634aa;
  540. }
  541. .bottom-active {
  542. border-bottom-color: rgb(186, 41, 92);
  543. }
  544. .top-active {
  545. border-top-color: rgb(186, 41, 92);
  546. }
  547. .price {
  548. white-space: nowrap;
  549. }
  550. .goods-image {
  551. display: flex;
  552. justify-content: center;
  553. }
  554. .page {
  555. padding: 10px 0;
  556. }
  557. </style>