entryManagement.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. <template>
  2. <el-tabs v-model="activeName" @tab-click="handleClick">
  3. <el-tab-pane label="入账管理" name="first">
  4. <div style="display: inline-block;">
  5. <div style="position: relative;display: inline-block;margin: 3px;">
  6. <span>商铺名称:</span>
  7. <el-input
  8. style="width: 200px;"
  9. @keydown.enter.native="phoneSelect"
  10. placeholder="请输入商铺名称"
  11. v-model="shopName"
  12. >
  13. </el-input
  14. >&nbsp;&nbsp;
  15. </div>
  16. <div style="position: relative;display: inline-block;margin: 3px;">
  17. <span>商铺手机号:</span>
  18. <el-input
  19. style="width: 200px;"
  20. @keydown.enter.native="phoneSelect"
  21. placeholder="请输入商铺手机号"
  22. v-model="shopPhone"
  23. >
  24. </el-input
  25. >&nbsp;&nbsp;
  26. </div>
  27. <div style="position: relative;display: inline-block;margin: 3px;">
  28. <span>用户手机号:</span>
  29. <el-input
  30. style="width: 200px;"
  31. @keydown.enter.native="phoneSelect"
  32. placeholder="请输入用户手机号"
  33. v-model="userPhone"
  34. >
  35. </el-input
  36. >&nbsp;&nbsp;
  37. </div>
  38. <div style="position: relative;display: inline-block;margin: 3px;">
  39. <span>优惠活动:</span>
  40. <el-input
  41. style="width: 200px;"
  42. @keydown.enter.native="phoneSelect"
  43. placeholder="请输入优惠活动标题"
  44. v-model="activityTitle"
  45. >
  46. </el-input
  47. >&nbsp;&nbsp;
  48. </div>
  49. <div style="position: relative;display: inline-block;margin: 3px;">
  50. <span>订单号:</span>
  51. <el-input
  52. style="width: 200px;"
  53. @keydown.enter.native="phoneSelect"
  54. placeholder="请输入订单号"
  55. v-model="orderNumber"
  56. ></el-input
  57. >&nbsp;&nbsp;
  58. </div>
  59. <div style="margin:5px;display: inline-block;">
  60. <span>开始时间:</span>
  61. <el-date-picker
  62. style="width: 220px;margin-left: 10px;"
  63. v-model="startTime"
  64. align="right"
  65. type="datetime"
  66. format="yyyy-MM-dd HH:mm:ss"
  67. value-format="yyyy-MM-dd HH:mm:ss"
  68. placeholder="选择开始时间"
  69. >
  70. </el-date-picker
  71. >&nbsp;&nbsp;&nbsp;
  72. </div>
  73. <div style="margin:5px;display: inline-block;">
  74. <span>截止时间:</span>
  75. <el-date-picker
  76. style="width: 220px;margin-left: 10px;"
  77. v-model="endTime"
  78. align="right"
  79. type="datetime"
  80. format="yyyy-MM-dd HH:mm:ss"
  81. value-format="yyyy-MM-dd HH:mm:ss"
  82. placeholder="选择截止时间"
  83. >
  84. </el-date-picker>
  85. </div>
  86. <div style="display: inline-block;margin: 5px;">
  87. <span>异常订单:</span>
  88. <el-select
  89. @change="phoneSelect"
  90. :clearable="true"
  91. v-model="flag"
  92. placeholder="请选择异常订单"
  93. >
  94. <el-option label="非异常" value="0"></el-option>
  95. <el-option label="异常" value="1"></el-option>
  96. </el-select>
  97. </div>
  98. <el-button
  99. style="margin-left:15px;"
  100. size="mini"
  101. type="primary"
  102. icon="document"
  103. @click="phoneSelect"
  104. >查询
  105. </el-button>
  106. <el-button
  107. style="margin-left:15px;"
  108. size="mini"
  109. type="primary"
  110. icon="document"
  111. @click="cleans"
  112. >重置</el-button
  113. >
  114. <el-button
  115. style="margin-left:15px;"
  116. size="mini"
  117. type="warning"
  118. icon="document"
  119. @click="exportList"
  120. >
  121. 导出Excel
  122. </el-button>
  123. <!-- <el-button
  124. style="margin-left:15px;"
  125. size="mini"
  126. type="primary"
  127. icon="document"
  128. @click="abnormity"
  129. >查询异常订单</el-button
  130. > -->
  131. </div>
  132. <div style="color: orange;">
  133. *
  134. 导出订单提示:导出订单前请进行时间或者状态等筛选,否则导出订单量过多易出现卡顿或系统崩溃
  135. </div>
  136. <el-table v-loading="tableDataLoading" :data="tableData">
  137. <el-table-column
  138. fixed
  139. prop="id"
  140. label="编号"
  141. width="80"
  142. ></el-table-column>
  143. <el-table-column fixed prop="shopName" label="店铺"></el-table-column>
  144. <el-table-column
  145. fixed
  146. prop="shopPhone"
  147. label="店铺手机号"
  148. ></el-table-column>
  149. <el-table-column fixed prop="userName" label="下单用户">
  150. </el-table-column>
  151. <el-table-column prop="userPhone" label="手机号"></el-table-column>
  152. <el-table-column prop="title" label="标题" width="200">
  153. </el-table-column>
  154. <el-table-column prop="money" label="订单类型" width="110">
  155. <template slot-scope="scope">
  156. <span v-if="scope.row.orderTypeExtra == 1">到店取餐</span>
  157. <span v-if="scope.row.orderTypeExtra == 2">骑手配送</span>
  158. <span v-if="scope.row.orderTypeExtra == 3">商家配送</span>
  159. </template>
  160. </el-table-column>
  161. <el-table-column
  162. prop="orderAmount"
  163. label="订单总金额"
  164. ></el-table-column>
  165. <el-table-column
  166. prop="couponName"
  167. label="优惠活动标题"
  168. ></el-table-column>
  169. <el-table-column
  170. prop="activityDiscountAmount"
  171. label="活动优惠金额"
  172. ></el-table-column>
  173. <el-table-column
  174. prop="couponMoney"
  175. label="优惠券优惠金额"
  176. ></el-table-column>
  177. <el-table-column prop="payMoney" label="用户付款金额"></el-table-column>
  178. <el-table-column prop="smsMoneyTotal" label="短信费"></el-table-column>
  179. <el-table-column prop="errandMoney" label="跑腿费"> </el-table-column>
  180. <el-table-column prop="orderNumber" label="订单号" width="170">
  181. <!-- <template slot-scope="scope">
  182. <span style="cursor: pointer;"">{{
  183. scope.row.orderNumber
  184. }}</span>
  185. </template> -->
  186. </el-table-column>
  187. <el-table-column prop="money" label="商家实际收入" width="110">
  188. <template slot-scope="scope">
  189. <span
  190. @click="errandMoneyClick(scope.row)"
  191. style="cursor: pointer;color: #3e8ef7;"
  192. >{{ scope.row.money }}</span
  193. >
  194. </template>
  195. </el-table-column>
  196. <el-table-column prop="createTime" label="创建时间"></el-table-column>
  197. </el-table>
  198. <div style="text-align: center;margin-top: 10px;">
  199. <el-pagination
  200. @size-change="handleSizeChange"
  201. @current-change="handleCurrentChange"
  202. :page-sizes="[10, 20, 30, 40]"
  203. :page-size="limit"
  204. :current-page="page"
  205. layout="total,sizes, prev, pager, next"
  206. :total="totalCount"
  207. >
  208. </el-pagination>
  209. </div>
  210. </el-tab-pane>
  211. <!-- 导出限制 -->
  212. <el-dialog
  213. custom-class="export"
  214. :visible.sync="exportVisible"
  215. center
  216. :title="exportTitle"
  217. :close-on-click-modal="false"
  218. >
  219. <div class="con" v-show="exportFlag == 1">
  220. <img src="../../assets/img/error.png" alt="" />
  221. <span
  222. style="font-size:20px;color: #000;font-weight: 800;margin: 18px 0 5px;"
  223. >当前导出条数超过50000条,暂不支持导出</span
  224. >
  225. <span style="font-size:14px;color: #808080;"
  226. >(注:数据中的图片、附件只能以链接的形式导出)</span
  227. >
  228. </div>
  229. <div class="con" v-show="exportFlag == 2">
  230. <img class="gundong" src="../../assets/img/loading.png" alt="" />
  231. <span
  232. style="font-size:20px;color: #000;font-weight: 800;margin: 18px 0 5px;"
  233. >导出中...</span
  234. >
  235. <span style="font-size:14px;color: #808080;"
  236. >(注:请到个人导出记录查看并下载)</span
  237. >
  238. </div>
  239. <div class="con" v-show="exportFlag == 3">
  240. <img src="../../assets/img/success.png" alt="" />
  241. <span
  242. style="font-size:20px;color: #000;font-weight: 800;margin: 18px 0 5px;"
  243. >导出成功</span
  244. >
  245. <span style="font-size:14px;color: #808080;"
  246. >(注:请到个人导出记录查看并下载)</span
  247. >
  248. </div>
  249. <div class="con" v-show="exportFlag == 4">
  250. <img class="gundong" src="../../assets/img/loading.png" alt="" />
  251. <span
  252. style="font-size:20px;color: #000;font-weight: 800;margin: 18px 0 5px;"
  253. >版本迭代中,导出暂时无法使用</span
  254. >
  255. </div>
  256. <div class="btn">
  257. <el-button type="primary" @click="exportAffirm">确定</el-button>
  258. </div>
  259. </el-dialog>
  260. <!-- 点击跑腿费显示内容 -->
  261. <el-dialog
  262. custom-class="errandMoney"
  263. :visible.sync="errandMoneyVisible"
  264. center
  265. title="内容"
  266. :close-on-click-modal="true"
  267. >
  268. <span style="font-size: 15px;">{{ content }}</span>
  269. </el-dialog>
  270. </el-tabs>
  271. </template>
  272. <script>
  273. export default {
  274. data() {
  275. return {
  276. activeName: "first",
  277. shopName: "", //商铺名称
  278. shopPhone: "", //商铺手机号
  279. userPhone: "", //用户手机号
  280. activityTitle: "", //优惠活动
  281. orderNumber: "", //订单号
  282. startTime: "", //开始时间:
  283. endTime: "", //截止时间:
  284. flag: "", //异常订单
  285. limit: 10,
  286. page: 1,
  287. tableDataLoading: false,
  288. tableData: [],
  289. totalCount: 10,
  290. exportVisible: false,
  291. exportTitle: "",
  292. exportFlag: "",
  293. errandMoneyVisible: false,
  294. content: ""
  295. };
  296. },
  297. methods: {
  298. // 获取数据列表
  299. getList() {
  300. this.tableDataLoading = true;
  301. this.$http({
  302. url: this.$http.adornUrl("shop/shopmoney/accountEntryManagement"),
  303. method: "get",
  304. params: this.$http.adornParams({
  305. page: this.page,
  306. limit: this.limit,
  307. shopName: this.shopName,
  308. shopPhone: this.shopPhone,
  309. userPhone: this.userPhone,
  310. couponName: this.activityTitle,
  311. orderNumber: this.orderNumber,
  312. startTime: this.startTime,
  313. endTime: this.endTime,
  314. flag:this.flag
  315. })
  316. }).then(({ data }) => {
  317. console.log(data, "入账管理");
  318. if (data.code == 0) {
  319. this.tableDataLoading = false;
  320. this.tableData = data.data.list;
  321. this.totalCount = data.data.totalCount;
  322. } else {
  323. this.$message({
  324. message: data.msg,
  325. type: "warning",
  326. duration: 1500,
  327. onClose: () => {}
  328. });
  329. }
  330. });
  331. },
  332. phoneSelect() {
  333. this.page = 1;
  334. this.getList();
  335. },
  336. cleans() {
  337. this.shopName = ""; //商铺名称
  338. this.shopPhone = ""; //商铺手机号
  339. this.userPhone = ""; //用户手机号
  340. this.activityTitle = ""; //优惠活动
  341. this.orderNumber = ""; //订单号
  342. this.startTime = ""; //开始时间:
  343. this.endTime = ""; //截止时间:
  344. this.page = 1;
  345. this.getList();
  346. },
  347. abnormity() {
  348. this.page = 1;
  349. this.$http({
  350. url: this.$http.adornUrl("shop/shopmoney/accountEntryAbnormal"),
  351. method: "get",
  352. params: this.$http.adornParams({
  353. page: this.page,
  354. limit: this.limit,
  355. shopName: this.shopName,
  356. shopPhone: this.shopPhone,
  357. userPhone: this.userPhone,
  358. couponName: this.activityTitle,
  359. orderNumber: this.orderNumber,
  360. startTime: this.startTime,
  361. endTime: this.endTime
  362. })
  363. }).then(({ data }) => {
  364. console.log(data, "查询异常订单");
  365. if (data.code == 0) {
  366. this.tableDataLoading = false;
  367. this.tableData = data.data.list;
  368. this.totalCount = data.data.totalCount;
  369. } else {
  370. this.$message({
  371. message: data.msg,
  372. type: "warning",
  373. duration: 1500,
  374. onClose: () => {}
  375. });
  376. }
  377. });
  378. },
  379. handleSizeChange(val) {
  380. this.limit = val;
  381. this.getList();
  382. },
  383. handleCurrentChange(val) {
  384. this.page = val;
  385. this.getList();
  386. },
  387. // 导出
  388. exportList() {
  389. console.log(this.totalCount, "导出条数");
  390. this.exportTitle = "导出";
  391. // this.exportFlag = 4;
  392. this.exportVisible = true;
  393. if (this.totalCount >= 50000) {
  394. this.exportTitle = "导出错误";
  395. this.exportFlag = 1;
  396. } else {
  397. this.exportTitle = "导出";
  398. this.exportFlag = 2;
  399. this.exportVisible = true;
  400. var userId = this.$cookie.get("userId");
  401. this.$http({
  402. url: this.$http.adornUrl("admin/export/excelAccountEntry"),
  403. method: "get",
  404. // responseType: "blob",
  405. params: this.$http.adornParams({
  406. // 'page': page,
  407. // 'size': this.size,
  408. userId: userId,
  409. shopName: this.shopName,
  410. shopPhone: this.shopPhone,
  411. userPhone: this.userPhone,
  412. couponName: this.activityTitle,
  413. orderNumber: this.orderNumber,
  414. startTime: this.startTime,
  415. endTime: this.endTime,
  416. flag:this.flag
  417. })
  418. }).then(({ data }) => {
  419. console.log(data, "导出");
  420. if (data.code == 0) {
  421. this.exportTitle = "导出成功";
  422. this.exportFlag = 3;
  423. }
  424. // let blob = new Blob([data], {
  425. // type:
  426. // "application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  427. // });
  428. // if (window.navigator.msSaveOrOpenBlob) {
  429. // navigator.msSaveBlob(blob);
  430. // } else {
  431. // let url = window.URL.createObjectURL(blob);
  432. // let elink = document.createElement("a");
  433. // elink.download = "订单列表.xlsx";
  434. // elink.style.display = "none";
  435. // elink.href = url;
  436. // document.body.appendChild(elink);
  437. // elink.click();
  438. // document.body.removeChild(elink);
  439. // }
  440. });
  441. }
  442. },
  443. exportAffirm() {
  444. this.exportVisible = false;
  445. },
  446. // tabs切换
  447. handleClick(tab, event) {
  448. if (tab._props.label == "入账管理") {
  449. this.page = 1;
  450. this.limit = 10;
  451. this.getList();
  452. }
  453. },
  454. errandMoneyClick(row) {
  455. console.log(row);
  456. this.errandMoneyVisible = true;
  457. this.content = row.content;
  458. }
  459. },
  460. mounted() {
  461. this.getList();
  462. }
  463. };
  464. </script>
  465. <style scoped>
  466. /* 导出限制 */
  467. .el-tabs >>> .export {
  468. width: 500px;
  469. }
  470. .el-tabs >>> .export .con {
  471. display: flex;
  472. flex-direction: column;
  473. justify-content: center;
  474. align-items: center;
  475. margin-bottom: 20px;
  476. }
  477. .el-tabs >>> .export .con .gundong {
  478. animation: gundong 3s linear infinite;
  479. }
  480. @keyframes gundong {
  481. /* from表示动画的开始位置,也可以使用0%来表示。 */
  482. from {
  483. transform: rotate(0deg);
  484. }
  485. /* to表示动画的结束位置,也可以使用100%来表示。 */
  486. to {
  487. transform: rotate(360deg);
  488. }
  489. }
  490. .el-tabs >>> .export img {
  491. width: 70px;
  492. }
  493. .el-tabs >>> .export .btn {
  494. display: flex;
  495. flex-direction: row-reverse;
  496. }
  497. .el-tabs >>> .errandMoney {
  498. width: 450px;
  499. }
  500. </style>