tb-orders-list.html 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>二级市场订单表-列表</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <!-- 所有的 css & js 资源 -->
  8. <link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
  9. <link rel="stylesheet" href="../../static/sa.css">
  10. <script src="../../static/kj/vue.min.js"></script>
  11. <script src="../../static/kj/element-ui/index.js"></script>
  12. <script src="../../static/kj/httpVueLoader.js"></script>
  13. <script src="../../static/kj/jquery.min.js"></script>
  14. <script src="../../static/kj/layer/layer.js"></script>
  15. <script src="../../static/sa.js"></script>
  16. <script src="../../static/kj/upload-util.js"></script>
  17. </head>
  18. <body>
  19. <div class="vue-box" style="display: none;" :style="'display: block;'">
  20. <div class="c-panel">
  21. <!-- ------------- 检索参数 ------------- -->
  22. <div class="c-title">检索参数</div>
  23. <el-form ref="form" :model='p' @submit.native.prevent>
  24. <sa-item type="text" name="车牌号" v-model="p.veNo" width="80px"></sa-item>
  25. <sa-item type="text" name="货主" v-model="p.leaderName" width="90px"></sa-item>
  26. <sa-item type="text" name="订单编号" v-model="p.orderNo" width="90px"></sa-item>
  27. <sa-item name="订单状态" width="90px">
  28. <el-select v-model="p.orderFinish" style="width: 120px;">
  29. <el-option label="全部" value=""></el-option>
  30. <el-option label="未完成" value="0"></el-option>
  31. <el-option label="已完成" value="1"></el-option>
  32. </el-select>
  33. </sa-item>
  34. <sa-item name="支付状态" width="90px">
  35. <el-select v-model="p.isPay" style="width: 120px;">
  36. <el-option label="全部" value=""></el-option>
  37. <el-option label="未支付" value="0"></el-option>
  38. <el-option label="支付中" value="3"></el-option>
  39. <el-option label="支付失败" value="2"></el-option>
  40. <el-option label="支付成功" value="1"></el-option>
  41. </el-select>
  42. </sa-item>
  43. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  44. <el-button type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
  45. <!-- <el-button v-if="sa.isAuth('tb-orders-add')" size="mini" type="primary" @click="add()">新增</el-button> -->
  46. </el-form>
  47. <!-- ------------- 数据列表 ------------- -->
  48. <el-table class="data-table" ref="data-table" :data="dataList" >
  49. <sa-td type="index" width="30px"></sa-td>
  50. <sa-td name="车牌号" prop="veNo" width="80px"></sa-td>
  51. <sa-td name="订单编号" prop="orderNo" width="180px"></sa-td>
  52. <sa-td name="商品名称" prop="goodsName" ></sa-td>
  53. <sa-td name="货主" prop="leaderName" width="100px"></sa-td>
  54. <sa-td name="转售金额" prop="resalePrice" width="80px"></sa-td>
  55. <sa-td name="买家" prop="purchaserName" width="100px"></sa-td>
  56. <sa-td name="下单时间" prop="orderTime" width="100px"></sa-td>
  57. <sa-td name="订单状态" prop="orderFinish" type="enum" :jv="{0: '未完成[#ff910a]', 1: '已完成[green]'}" @change="s => updateOrderFinish(s.row)" width="80px"></sa-td>
  58. <sa-td name="支付状态" prop="isPay" type="enum" :jv="{0: '未支付[#ff910a]', 1: '支付成功[green]', 2: '支付失败[red]', 3: '支付中[blue]'}" width="80px"></sa-td>
  59. <sa-td name="补扣次数" prop="deductionCount" width="80px">
  60. <template slot-scope="s">
  61. <div v-if="s.row.deductionCount==0">0</div>
  62. <div v-else>{{s.row.deductionCount}}</div>
  63. </template>
  64. </sa-td>
  65. <sa-td name="补扣时间" prop="deductionTime" width="140px"></sa-td>
  66. <sa-td name="转售时间" prop="createTime" width="140px"></sa-td>
  67. <el-table-column label="操作" fixed="right" width="390px">
  68. <template slot-scope="s">
  69. <el-button class="c-btn" type="success" @click="get(s.row)">查看</el-button>
  70. <el-button class="c-btn" type="primary" icon="el-icon-info" @click="getBank(s.row)">银行回执</el-button>
  71. <span>
  72. <el-button
  73. class="c-btn" type="warning" @click="deduction(s.row)">采购补扣款</el-button>
  74. <el-button v-else :disabled="true" class="c-btn" type="warning">采购补扣款</el-button>
  75. </span>
  76. <el-button class="c-btn" type="primary" icon="el-icon-printer" @click="subPrint(s.row)">交易凭证</el-button>
  77. <el-button class="c-btn" type="info" icon="el-icon-info" @click="subEmail(s.row)">电子协议</el-button>
  78. </template>
  79. </el-table-column>
  80. </el-table>
  81. <!-- ------------- 分页 ------------- -->
  82. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  83. </div>
  84. </div>
  85. <script>
  86. var app = new Vue({
  87. components: {
  88. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  89. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  90. },
  91. el: '.vue-box',
  92. data: {
  93. p: { // 查询参数
  94. orderNo: '', // 订单编号
  95. goodsName: '', // 商品名称
  96. pageNo: 1, // 当前页
  97. pageSize: 10, // 页大小
  98. sortType: 0 // 排序方式
  99. },
  100. dataCount: 0,
  101. dataList: [], // 数据集合
  102. },
  103. methods: {
  104. // 刷新
  105. f5: function() {
  106. sa.ajax('/level-two-server/TbOrders/getList', sa.removeNull(this.p), function(res) {
  107. this.dataList = res.data; // 数据
  108. this.dataCount = res.dataCount; // 数据总数
  109. sa.f5TableHeight(); // 刷新表格高度
  110. }.bind(this));
  111. },
  112. // 查看
  113. get: function(data) {
  114. sa.showIframe('数据详情', 'tb-orders-info.html?id=' + data.id, '950px', '60%');
  115. },
  116. // 查看银行回执
  117. getBank: function(data) {
  118. sa.showIframe('银行回执', 'tb-orders-bank-list.html?orderNo=' + data.orderNo, '1300px', '90%');
  119. },
  120. // 交易凭证
  121. subPrint: function(data) {
  122. sa.showIframe('交易凭证', 'tb-orders-print.html?id=' + data.id, '1200px', '80%');
  123. },
  124. // 电子协议
  125. subEmail: function(data) {
  126. sa.showIframe('电子协议', 'tb-orders-email.html?id=' + data.id, '1000px', '90%');
  127. },
  128. deduction(data) {
  129. sa.confirm('是否执行补扣款操作', function() {
  130. sa.ajax('/level-two-server/TbOrders/deduction?id=' + data.id, function(res) {
  131. sa.ok('操作成功');
  132. sa.f5TableHeight(); // 刷新表格高度
  133. this.f5();
  134. }.bind(this))
  135. }.bind(this));
  136. },
  137. // 修改
  138. update: function(data) {
  139. sa.showIframe('修改数据', 'tb-orders-add.html?id=' + data.id, '1000px', '90%');
  140. },
  141. // 新增
  142. add: function(data) {
  143. sa.showIframe('新增数据', 'tb-orders-add.html?id=-1', '1000px', '90%');
  144. },
  145. // 删除
  146. del: function(data) {
  147. sa.confirm('是否删除,此操作不可撤销', function() {
  148. sa.ajax('/level-two-server/TbOrders/delete?id=' + data.id, function(res) {
  149. sa.arrayDelete(this.dataList, data);
  150. sa.ok('删除成功');
  151. sa.f5TableHeight(); // 刷新表格高度
  152. this.f5()
  153. }.bind(this))
  154. }.bind(this));
  155. },
  156. // 批量删除
  157. deleteByIds: function() {
  158. // 获取选中元素的id列表
  159. let selection = this.$refs['data-table'].selection;
  160. let ids = sa.getArrayField(selection, 'id');
  161. if(selection.length == 0) {
  162. return sa.msg('请至少选择一条数据')
  163. }
  164. // 提交删除
  165. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  166. sa.ajax('/level-two-server/TbOrders/deleteByIds', {ids: ids.join(',')}, function(res) {
  167. sa.arrayDelete(this.dataList, selection);
  168. sa.ok('删除成功');
  169. sa.f5TableHeight(); // 刷新表格高度
  170. }.bind(this))
  171. }.bind(this));
  172. },
  173. // 改 - 订单状态已完成 (0=禁用,1=启用)
  174. updateOrderFinish: function(data) {
  175. // 声明变量记录是否成功
  176. var isOk = false;
  177. var oldValue = data.orderFinish;
  178. var ajax = sa.ajax('/level-two-server/TbOrders/updateOrderFinish', {id: data.id, value: data.orderFinish}, function(res) {
  179. isOk = true;
  180. sa.msg('修改成功');
  181. }.bind(this));
  182. // 如果未能修改成功, 则回滚
  183. $.when(ajax).done(function() {
  184. if(isOk == false) {
  185. data.status = oldValue;
  186. }
  187. })
  188. }
  189. },
  190. created: function() {
  191. this.f5();
  192. sa.onInputEnter();
  193. }
  194. })
  195. </script>
  196. </body>
  197. </html>