index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowForm">
  4. <el-radio-group v-model="status" size="medium" @change="changeStatus()">
  5. <el-radio-button :label="''">全部({{total.all}})</el-radio-button>
  6. <el-radio-button :label="1">进行中({{total.jxz}})</el-radio-button>
  7. <el-radio-button :label="2">未开始({{total.wks}})</el-radio-button>
  8. <el-radio-button :label="3">已过期({{total.ygq}})</el-radio-button>
  9. </el-radio-group>
  10. <div class="mymain-container" style="margin-top: 20px">
  11. <div class="btn-group clearfix">
  12. <div class="fl">
  13. <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">新增</el-button>
  14. </div>
  15. </div>
  16. <div class="table">
  17. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
  18. <el-table-column align="center" label="活动名称" prop="name" min-width="120"></el-table-column>
  19. <el-table-column align="center" label="参与产品数量" prop="goodsNum" min-width="120"></el-table-column>
  20. <el-table-column align="center" label="活动时间" min-width="200">
  21. <template slot-scope="scope">
  22. {{ scope.row.startTime | dateToDayFilter }} 至 {{ scope.row.endTime | dateToDayFilter }}
  23. </template>
  24. </el-table-column>
  25. <el-table-column align="center" label="状态" prop="status"></el-table-column>
  26. <el-table-column align="center" label="订单数量" prop="orderNums" min-width="100"></el-table-column>
  27. <el-table-column align="center" label="订单总金额" prop="orderTotalAmount" min-width="100"></el-table-column>
  28. <el-table-column align="center" label="创建人" prop="createBy" min-width="100"></el-table-column>
  29. <el-table-column align="center" label="创建时间" prop="createTime" min-width="160"></el-table-column>
  30. <el-table-column align="center" label="更新人" prop="updateBy" min-width="100"></el-table-column>
  31. <el-table-column align="center" label="更新时间" prop="updateTime" min-width="160"></el-table-column>
  32. <el-table-column align="center" label="操作" fixed="right" width="160">
  33. <template slot-scope="scope">
  34. <el-button type="text" @click="toForm(scope.row)">编辑</el-button>
  35. <el-button type="text" @click="openOrderDetail(scope.row.id)">详情</el-button>
  36. <el-button type="text" @click="handleExport(scope.row.id)">导出订单</el-button>
  37. </template>
  38. </el-table-column>
  39. </el-table>
  40. </div>
  41. <div class="pagination clearfix">
  42. <div class="fr">
  43. <el-pagination
  44. @size-change="handleSizeChange"
  45. @current-change="handleCurrentChange"
  46. :current-page="currentPage"
  47. :page-sizes="[10, 20, 30, 50]"
  48. :page-size="10"
  49. layout="total, sizes, prev, pager, next, jumper"
  50. :total="listTotal">
  51. </el-pagination>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <!-- 订单详情 -->
  57. <el-dialog title="订单详情" :visible.sync="orderDialog" :show-close="false" width="70%" :close-on-click-modal="false">
  58. <div class="table" style="margin: 10px 0 20px;">
  59. <el-table
  60. v-loading="orderTable_listLoading"
  61. :data="orderTable_dataList"
  62. element-loading-text="Loading"
  63. tooltip-effect="dark"
  64. style="width: 100%"
  65. max-height="400">
  66. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  67. <el-table-column align="center" prop="orderId" label="订单编号" min-width="180" show-overflow-tooltip></el-table-column>
  68. <el-table-column align="center" prop="goodsName" label="商品名称" min-width="200" show-overflow-tooltip></el-table-column>
  69. <el-table-column align="center" prop="num" label="件数" min-width="100"></el-table-column>
  70. <el-table-column align="center" prop="payAmount" label="订单金额" min-width="100"></el-table-column>
  71. <el-table-column align="center" prop="shareRate" label="佣金比例" min-width="100"></el-table-column>
  72. <el-table-column align="center" prop="orderStatus" label="订单状态" min-width="100">
  73. <template slot-scope="scope">
  74. {{scope.row.orderStatus | statusFilter}}
  75. </template>
  76. </el-table-column>
  77. <el-table-column align="center" prop="createTime" label="下单时间" min-width="160"></el-table-column>
  78. <el-table-column align="center" label="操作" min-width="80">
  79. <template slot-scope="scope">
  80. <el-button type="text" @click="toOrderDetail(scope.row.orderId)">详情</el-button>
  81. </template>
  82. </el-table-column>
  83. </el-table>
  84. </div>
  85. <div class="pagination clearfix">
  86. <div class="fr">
  87. <el-pagination
  88. @current-change="orderTableCurrentChange"
  89. :current-page="orderTable_currentPage"
  90. :page-size="orderTable_pageSize"
  91. background
  92. layout="prev, pager, next"
  93. :total="orderTable_listTotal">
  94. </el-pagination>
  95. </div>
  96. </div>
  97. <div slot="footer" class="dialog-footer">
  98. <el-button @click="orderDialog = false">关 闭</el-button>
  99. </div>
  100. </el-dialog>
  101. <FullpieceDiscountForm :listItem="queryItem" v-if="isShowForm" @backList="backList" />
  102. </div>
  103. </template>
  104. <script>
  105. import { getList, getTotal, getOrderList } from "@/api/fullpiece_discount";
  106. import { downloadFiles } from '@/utils/util'
  107. import FullpieceDiscountForm from "@/views/mallManagement/activity/components/fullpiece_discount_form";
  108. export default {
  109. components: {
  110. FullpieceDiscountForm
  111. },
  112. filters: {
  113. statusFilter(val) {
  114. const MAP = {
  115. NOPAY: '待付款',
  116. DFH: '待发货',
  117. YFH: '已发货',
  118. OVER: '已完成',
  119. CLOSE: '已关闭',
  120. REFUND: '售后',
  121. TIMEOUT: '已超时',
  122. }
  123. return MAP[val];
  124. }
  125. },
  126. data() {
  127. return {
  128. status: '',
  129. total: {
  130. all: 0,
  131. jxz: 0,
  132. wks: 0,
  133. ygq: 0
  134. },
  135. dataList: null, // 列表数据
  136. listLoading: true, // 列表加载loading
  137. currentPage: 1, // 当前页码
  138. pageSize: 10, // 每页数量
  139. listTotal: 0, // 列表总数
  140. queryItem: {},
  141. isShowForm: false,
  142. detailId: '',
  143. orderDialog: false, // 订单详情 - 弹窗
  144. orderTable_dataList: null, // 订单详情 - 列表数据
  145. orderTable_listLoading: true, // 订单详情 - 列表加载loading
  146. orderTable_currentPage: 1, // 订单详情 - 当前页码
  147. orderTable_pageSize: 10, // 订单详情 - 每页数量
  148. orderTable_listTotal: 0, // 订单详情 - 列表总数
  149. }
  150. },
  151. created() {
  152. this.getTotal();
  153. this.getList();
  154. },
  155. methods: {
  156. getTotal() {
  157. getTotal().then(res => {
  158. this.total = res.data;
  159. })
  160. },
  161. getList() {
  162. this.listLoading = true;
  163. getList({
  164. pageNum: this.currentPage,
  165. pageSize: this.pageSize,
  166. status: this.status
  167. }).then(res => {
  168. this.dataList = res.data.records;
  169. this.listTotal = res.data.total;
  170. this.listLoading = false;
  171. })
  172. },
  173. // 更改每页数量
  174. handleSizeChange(val) {
  175. this.pageSize = val;
  176. this.currentPage = 1;
  177. this.getList();
  178. },
  179. // 更改当前页
  180. handleCurrentChange(val) {
  181. this.currentPage = val;
  182. this.getList();
  183. },
  184. changeStatus() {
  185. this.currentPage = 1;
  186. this.getList();
  187. },
  188. // 进入表单
  189. toForm(item) {
  190. this.queryItem = item;
  191. this.isShowForm = true;
  192. },
  193. backList(needRefresh) {
  194. this.queryItem = {};
  195. this.isShowForm = false;
  196. if(needRefresh) {
  197. this.currentPage = 1;
  198. this.getList();
  199. }
  200. },
  201. // 订单详情 - 获取列表
  202. getOrderList() {
  203. getOrderList({
  204. pageNum: this.orderTable_currentPage,
  205. pageSize: this.orderTable_pageSize,
  206. id: this.detailId
  207. }).then(res => {
  208. this.orderTable_dataList = res.data.records;
  209. this.orderTable_listTotal = res.data.total;
  210. this.orderTable_listLoading = false;
  211. })
  212. },
  213. // 订单详情 - 打开弹窗
  214. openOrderDetail(id) {
  215. this.detailId = id;
  216. this.orderDialog = true;
  217. this.orderTable_currentPage = 1;
  218. this.getOrderList();
  219. },
  220. // 订单详情 - 更改列表当前页
  221. orderTableCurrentChange(val) {
  222. this.orderTable_currentPage = val;
  223. this.getOrderList();
  224. },
  225. // 订单详情
  226. toOrderDetail(orderId) {
  227. let {href} = this.$router.resolve({path: `/mallManagement/order/order_list_children/order_detail?orderId=${orderId}`});
  228. window.open(href, '_blank');
  229. // this.$router.push({
  230. // name: "order_detail",
  231. // query: {
  232. // orderId
  233. // }
  234. // })
  235. },
  236. // 导出
  237. handleExport(id) {
  238. let screenData = {
  239. promotionFullPieceId: id
  240. };
  241. downloadFiles('order/export', screenData);
  242. },
  243. }
  244. }
  245. </script>
  246. <style scoped lang="scss">
  247. .dialog-container {
  248. .left {
  249. width: 140px;
  250. height: 350px;
  251. overflow-y: scroll;
  252. .group {
  253. margin-top: 10px;
  254. }
  255. .child {
  256. margin-top: 5px;
  257. .item {
  258. padding-left: 18px;
  259. }
  260. }
  261. .item {
  262. cursor: pointer;
  263. line-height: 24px;
  264. }
  265. }
  266. .right {
  267. width: calc(100% - 140px);
  268. height: 350px;
  269. box-sizing: border-box;
  270. padding-left: 20px;
  271. }
  272. }
  273. .goods-container {
  274. .item {
  275. margin-bottom: 10px;
  276. &:last-child {
  277. margin-bottom: 0;
  278. }
  279. }
  280. }
  281. .couponDetail {
  282. height: 60vh;
  283. overflow-y: scroll;
  284. padding-right: 20px;
  285. .item {
  286. font-size: 16px;
  287. margin-bottom: 20px;
  288. &>span {
  289. float: left;
  290. &:first-child {
  291. width: 140px;
  292. text-align: right;
  293. margin-right: 10px;
  294. font-weight: 500;
  295. }
  296. }
  297. .table-span {
  298. width: calc(100% - 170px);
  299. }
  300. }
  301. }
  302. .addMember {
  303. display: flex;
  304. align-items: center;
  305. justify-content: center;
  306. border: 1px solid #EBEEF5;
  307. border-top: none;
  308. height: 50px;
  309. }
  310. // .memberTable {
  311. // ::v-deep .el-table__header-wrapper .el-checkbox {
  312. // display: none;
  313. // }
  314. // }
  315. </style>