index.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. <?php
  2. ?>
  3. <div id="app" v-cloak>
  4. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  5. <div slot="header">
  6. <span>订单管理</span>
  7. </div>
  8. <div class="table-body">
  9. <div style="padding-bottom: 20px;">
  10. <div class="flex">
  11. <div class="flex" style="margin-right: 20px;">
  12. <el-input size="small" placeholder="请输入自提人用户ID" v-model="searchData.user_id"></el-input>
  13. </div>
  14. <div class="flex" style="margin-right: 20px;">
  15. <el-input size="small" placeholder="请输入自提人/手机号搜索" v-model="searchData.member"></el-input>
  16. </div>
  17. <div class="flex" style="margin-right: 20px;">
  18. <el-input size="small" placeholder="自提点名称" v-model="searchData.name"></el-input>
  19. </div>
  20. <div class="flex" style="margin-right: 20px;">
  21. <el-input size="small" placeholder="请输入团长昵称/手机号" v-model="searchData.head_member"></el-input>
  22. </div>
  23. <div class="flex" style="margin-right: 20px;">
  24. <el-date-picker v-model="addTime" type="datetimerange" range-separator="至"
  25. start-placeholder="开始日期" end-placeholder="结束日期"
  26. value-format="yyyy-MM-dd HH:mm:ss" @change="addTimeChange" :default-time="['00:00:00', '23:59:59']">
  27. </el-date-picker>
  28. </div>
  29. <div class="flex" style="margin-right: 20px;">
  30. <el-select v-model="searchData.order_status" placeholder="请选择" clearable>
  31. <el-option
  32. v-for="(item, key) in order_status_list"
  33. :key="key"
  34. :label="item.title"
  35. :value="key"></el-option>
  36. </el-select>
  37. </div>
  38. <el-button style="padding: 9px 15px !important;" size="small" type="primary" @click="searchs">搜索</el-button>
  39. <el-button type="warning" @click="clereSearch" v-if="searchData.user_id || searchData.name || searchData.head_member || searchData.member || searchData.date_start || searchData.date_end" style="font-size:12px;padding: 9px 15px !important;">清除搜索条件</el-button>
  40. </div>
  41. </div>
  42. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px; width: 100%">
  43. <el-table-column prop="id" label="序号" width="100" align="center"></el-table-column>
  44. <el-table-column label="订单号" width="100" align="center">
  45. <template slot-scope="scope">
  46. <div>{{scope.row.order.order_no}}</div>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="自提人" align="center">
  50. <template slot-scope="scope">
  51. <div class="table-info-img-text">
  52. <el-image class="table-info-img circle" :src="scope.row.buyer.avatar_url">
  53. <div slot="error" class="image-slot">
  54. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  55. </div>
  56. </el-image>
  57. <div class="table-info-text">
  58. <div style="color:#000; text-align: left">{{scope.row.buyer.nickname}}</div>
  59. <div style="font-size: 12px; text-align: left">ID:{{scope.row.buyer.id}}</div>
  60. </div>
  61. </div>
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="手机号" align="center">
  65. <template slot-scope="scope">
  66. <div>{{scope.row.buyer.mobile}}</div>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="商品信息" align="center">
  70. <template slot-scope="scope">
  71. <div class="table-info-img-text">
  72. <el-image class="table-info-img" :src="scope.row.order.detail[0].pic_url">
  73. <div slot="error" class="image-slot">
  74. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  75. </div>
  76. </el-image>
  77. <div class="table-info-text">
  78. <div style="color:#000; text-align: left">{{scope.row.order.detail[0].goods_name}} <a href="javascript:;" @click="goToOrderDetail(scope.row.order.id)">查看更多></a></div>
  79. <div style="font-size: 12px; text-align: left">规格: {{scope.row.order.detail[0].goods_attr_name}} 数量: {{scope.row.order.detail[0].num}}</div>
  80. </div>
  81. </div>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="自提点" align="center">
  85. <template slot-scope="scope">
  86. <div class="table-info-img-text">
  87. <el-image class="table-info-img circle" :src="scope.row.head.logo">
  88. <div slot="error" class="image-slot">
  89. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  90. </div>
  91. </el-image>
  92. <div class="table-info-text">
  93. <div style="color:#000; text-align: left">{{scope.row.head.name}}</div>
  94. <div style="font-size: 12px; text-align: left">ID:{{scope.row.head.id}}</div>
  95. </div>
  96. </div>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="团长信息" prop="user_id" align="center">
  100. <template slot-scope="scope">
  101. <div class="table-info-img-text">
  102. <el-image class="table-info-img circle" :src="scope.row.headUser.avatar_url">
  103. <div slot="error" class="image-slot">
  104. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  105. </div>
  106. </el-image>
  107. <div class="table-info-text">
  108. <div style="color:#000; text-align: left">{{scope.row.headUser.nickname}}</div>
  109. <div style="font-size: 12px; text-align: left">ID:{{scope.row.headUser.id}}</div>
  110. </div>
  111. </div>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="预计提货时间" align="center">
  115. <template slot-scope="scope">
  116. <div>{{scope.row.expected_receive_at}}</div>
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="状态" width="80px" align="center">
  120. <template slot-scope="scope">
  121. <el-tag size="mini" :type="order_status_list[scope.row.order.order_status].type">
  122. {{order_status_list[scope.row.order.order_status].title}}
  123. </el-tag>
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="备注" align="center">
  127. <template slot-scope="scope">
  128. <div v-if="scope.row.order.remark != ''">
  129. {{scope.row.order.remark}}
  130. </div>
  131. <div>-</div>
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="更新时间" prop="created_at" align="center">
  135. <template slot-scope="scope">
  136. <div>
  137. {{scope.row.updated_at | dateTimeFormat('Y-m-d H:i:s')}}
  138. </div>
  139. </template>
  140. </el-table-column>
  141. <el-table-column label="操作" width="100" fixed="right" align="center">
  142. <template slot-scope="scope">
  143. <el-button v-if="scope.row.order.order_status == 1" type="text" size="small" @click="goToOrderDetail(scope.row.order.id)">去发货</el-button>
  144. <div v-else>-</div>
  145. </template>
  146. </el-table-column>
  147. </el-table>
  148. <div style="text-align: right;margin: 20px 0;">
  149. <el-pagination @current-change="pagination" background layout="prev, pager, next, total" :page-count="pageCount" :total="rowCount"></el-pagination>
  150. </div>
  151. </div>
  152. </el-card>
  153. <el-dialog
  154. title="审核确认"
  155. :visible.sync="checkDialogShow"
  156. width="30%">
  157. <div>
  158. <!-- <el-alert-->
  159. <!-- :title="`您正在审核 ${currentItem.name} 自提点,审核结果为 ${form.status == 50 ? '驳回' : '通过'} 请谨慎操作!`"-->
  160. <!-- type="danger"-->
  161. <!-- :closable="false">-->
  162. <!-- </el-alert>-->
  163. <div style="padding: 10px; text-align: center">
  164. 您正在审核 <strong style="margin: 0 10px; font-size: 20px; color: #F56C6C">{{currentItem.name}}</strong> 自提点,审核结果为
  165. <strong style="margin: 0 10px; font-size: 20px; color: #F56C6C">{{form.status == 50 ? '驳回' : '通过'}}</strong> 请谨慎操作!
  166. </div>
  167. <el-form :model="form" ref="form" label-width="120px" size="small">
  168. <el-form-item label="审核备注" prop="remark" :rules="[
  169. {required: true, 'message': '审核备注不能为空'}
  170. ]">
  171. <el-input type="textarea" v-model="form.remark"></el-input>
  172. </el-form-item>
  173. </el-form>
  174. </div>
  175. <span slot="footer" class="dialog-footer">
  176. <el-button size="small" @click="checkDialogShow = false">取消{{form.status == 50 ? '驳回' : '通过'}}</el-button>
  177. <el-button size="small" :loading="loading" :disabled="loading" type="primary" @click="onCheckSubmit">确定{{form.status == 50 ? '驳回' : '通过'}}</el-button>
  178. </span>
  179. </el-dialog>
  180. </div>
  181. <script>
  182. const app = new Vue({
  183. el: '#app',
  184. data: {
  185. checkDialogShow: false,
  186. searchData: {
  187. user_id: '',
  188. member: '',
  189. head_member: '',
  190. date_end: '',
  191. date_start: '',
  192. name: '',
  193. limit: 10,
  194. order_status: undefined
  195. },
  196. currPage: 1,
  197. pageCount: 0,
  198. rowCount: 0,
  199. loading: false,
  200. dialogVisible: false,
  201. list: [],
  202. addTime: null,
  203. dialogLoading: false,
  204. order_status_list: {
  205. '0': {
  206. title: "待付款",
  207. type: 'info'
  208. },
  209. '1': {
  210. title: "待发货",
  211. type: 'primary'
  212. },
  213. '2': {
  214. title: "已发货",
  215. type: 'primary'
  216. },
  217. '3': {
  218. title: "已收货",
  219. type: 'success'
  220. },
  221. '4': {
  222. title: "已完成",
  223. type: "success"
  224. },
  225. '7': {
  226. title: "已核销",
  227. type: "success"
  228. },
  229. '-4': {
  230. title: "已关闭",
  231. type: "danger"
  232. },
  233. '-2': {
  234. title: "退款中",
  235. type: "warning"
  236. },
  237. '-1': {
  238. title: "售后申请",
  239. type: "warning"
  240. }
  241. },
  242. currentItem: {
  243. name: ''
  244. },
  245. form: {
  246. id: 0,
  247. remark: '',
  248. status: 0
  249. }
  250. },
  251. mounted() {
  252. this.loadData();
  253. },
  254. methods: {
  255. searchs() {
  256. this.currPage = 1;
  257. this.loadData();
  258. },
  259. addTimeChange(v) {
  260. this.searchData.date_start = v ? v[0] : '';
  261. this.searchData.date_end = v ? v[1] : '';
  262. },
  263. clereSearch() {
  264. this.searchData.member = '';
  265. this.searchData.head_member = '';
  266. this.searchData.user_id = '';
  267. this.searchData.date_start = '';
  268. this.searchData.date_end = '';
  269. this.searchData.name = '';
  270. this.currPage = 1;
  271. this.loadData();
  272. },
  273. loadData() {
  274. this.loading = true;
  275. request({
  276. params: {
  277. r: 'community/order/index',
  278. page: this.currPage,
  279. ...this.searchData,
  280. },
  281. method: 'get',
  282. }).then(e => {
  283. this.loading = false;
  284. if (e.data.code == 0) {
  285. this.list = e.data.data.list;
  286. this.pageCount = e.data.data.page_count;
  287. this.rowCount = e.data.data.row_count;
  288. } else {
  289. this.$message.error(e.data.msg);
  290. }
  291. }).catch(e => {
  292. this.loading = false;
  293. });
  294. },
  295. pagination(currentPage) {
  296. let self = this;
  297. self.currPage = currentPage;
  298. self.loadData();
  299. },
  300. onCheck(item, status) {
  301. this.currentItem = item
  302. this.form.status = status
  303. this.form.id = item.id
  304. this.form.remark = ''
  305. this.checkDialogShow = true
  306. },
  307. goToOrderDetail(id) {
  308. this.$navigate({
  309. r: 'mall/order/detail',
  310. id: id
  311. })
  312. },
  313. onCheckSubmit() {
  314. this.$refs['form'].validate((valid) => {
  315. if (valid) {
  316. this.loading = true
  317. request({
  318. method: 'post',
  319. params: {
  320. r: 'community/apply/check',
  321. },
  322. data: this.form
  323. }).then(e => {
  324. this.loading = false;
  325. if (e.data.code === 0) {
  326. this.$message.success(e.data.msg);
  327. this.currentItem.apply_status = this.form.status
  328. this.currentItem.check = {
  329. remark: this.form.remark,
  330. created_at: (new Date()).valueOf()
  331. }
  332. } else {
  333. this.$message.error(e.data.msg);
  334. }
  335. this.checkDialogShow = false
  336. }).catch(e => {
  337. this.loading = false;
  338. });
  339. } else {
  340. console.log(valid)
  341. }
  342. })
  343. }
  344. }
  345. });
  346. </script>
  347. <style>
  348. .el-tabs__header {
  349. font-size: 16px;
  350. }
  351. .table-body {
  352. padding: 20px;
  353. background-color: #fff;
  354. }
  355. .input-item {
  356. width: 250px;
  357. margin-right: 40px;
  358. }
  359. .input-item .el-input__inner {
  360. border-right: 0;
  361. }
  362. .input-item .el-input__inner:hover {
  363. border: 1px solid #dcdfe6;
  364. border-right: 0;
  365. outline: 0;
  366. }
  367. .input-item .el-input__inner:focus {
  368. border: 1px solid #dcdfe6;
  369. border-right: 0;
  370. outline: 0;
  371. }
  372. .input-item .el-input-group__append {
  373. background-color: #fff;
  374. border-left: 0;
  375. width: 10%;
  376. padding: 0;
  377. }
  378. .input-item .el-input-group__append .el-button {
  379. padding: 0;
  380. }
  381. .input-item .el-input-group__append .el-button {
  382. margin: 0;
  383. }
  384. .table-body {
  385. padding: 20px;
  386. background-color: #fff;
  387. }
  388. .table-body .el-button {
  389. padding: 0 !important;
  390. border: 0;
  391. margin: 0 5px;
  392. }
  393. .input-item {
  394. width: 250px;
  395. margin: 0 0 20px;
  396. display: inline-block;
  397. }
  398. .input-item .el-input__inner {
  399. border-right: 0;
  400. }
  401. .input-item .el-input__inner:hover {
  402. border: 1px solid #dcdfe6;
  403. border-right: 0;
  404. outline: 0;
  405. }
  406. .input-item .el-input__inner:focus {
  407. border: 1px solid #dcdfe6;
  408. border-right: 0;
  409. outline: 0;
  410. }
  411. .input-item .el-input-group__append {
  412. background-color: #fff;
  413. border-left: 0;
  414. width: 10%;
  415. padding: 0;
  416. }
  417. .input-item .el-input-group__append .el-button {
  418. padding: 0;
  419. }
  420. .input-item .el-input-group__append .el-button {
  421. margin: 0;
  422. }
  423. .batch {
  424. margin: 0 0 20px;
  425. display: inline-block;
  426. }
  427. .batch .el-button {
  428. padding: 9px 15px !important;
  429. }
  430. .el-table th>.cell {
  431. color: #333;
  432. font-weight: bold;
  433. font-size: 14px;
  434. }
  435. .el-table__footer-wrapper,
  436. .el-table__header-wrapper {
  437. border-bottom: 1.4px solid #D6D6D6;
  438. }
  439. .el-table .el-button {
  440. padding: 0 !important;
  441. border: 0;
  442. margin: 0 5px;
  443. }
  444. #app .copy .el-input-group__append {
  445. background-color: #409EFF;
  446. border-color: #409EFF;
  447. padding: 0 10px;
  448. }
  449. #app .table-body .copybtn {
  450. color: #fff;
  451. padding: 0 30px;
  452. }
  453. .el-alert {
  454. padding: 0;
  455. padding-left: 5px;
  456. padding-bottom: 5px;
  457. }
  458. .el-alert--info .el-alert__description {
  459. color: #606266;
  460. }
  461. .el-alert .el-button {
  462. margin-left: 20px;
  463. }
  464. .el-alert__content {
  465. display: flex;
  466. align-items: center;
  467. }
  468. .table-body .el-alert__title {
  469. margin-top: 5px;
  470. font-weight: 400;
  471. }
  472. .el-table th>.cell {
  473. color: #333;
  474. font-weight: bold;
  475. font-size: 14px;
  476. }
  477. .el-table__footer-wrapper,
  478. .el-table__header-wrapper {
  479. border-bottom: 1.4px solid #D6D6D6;
  480. }
  481. .item-box {
  482. margin-right: 20px;
  483. }
  484. .flex {
  485. display: flex;
  486. align-items: center;
  487. }
  488. .input-title {
  489. margin-right: 15px;
  490. }
  491. .item-box .label {
  492. margin-right: 8px;
  493. }
  494. .com-share-pop {
  495. display: inline-block;
  496. }
  497. .grid-icon {
  498. color: #999;
  499. cursor: pointer;
  500. font-size: 18px;
  501. }
  502. .el-input__inner {
  503. height: 32px;
  504. line-height: 32px;
  505. }
  506. .el-range-editor.el-input__inner {
  507. padding: 0 15px;
  508. }
  509. .el-date-editor .el-range-input,
  510. .el-date-editor .el-range-separator {
  511. font-size: 13px;
  512. height: auto;
  513. }
  514. </style>