tb-orders-list.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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="purchaserName" width="100px"></sa-td>
  54. <sa-td name="货主" prop="leaderName" width="100px"></sa-td>
  55. <sa-td name="转售金额" prop="resalePrice" width="80px"></sa-td>
  56. <sa-td name="订单状态" prop="orderFinish" type="enum" :jv="{0: '未完成[#ff910a]', 1: '已完成[green]'}" @change="s => updateOrderFinish(s.row)" width="80px"></sa-td>
  57. <sa-td name="支付状态" prop="isPay" type="enum" :jv="{0: '未支付[#ff910a]', 1: '支付成功[green]', 2: '支付失败[red]', 3: '支付中[blue]'}" width="80px"></sa-td>
  58. <sa-td name="补扣次数" prop="deductionCount" width="80px">
  59. <template slot-scope="s">
  60. <div v-if="s.row.deductionCount==0">0</div>
  61. <div v-else>{{s.row.deductionCount}}</div>
  62. </template>
  63. </sa-td>
  64. <sa-td name="补扣时间" prop="deductionTime" width="140px"></sa-td>
  65. <sa-td name="创建时间" prop="createTime" width="140px"></sa-td>
  66. <el-table-column label="操作" fixed="right" width="190px">
  67. <template slot-scope="s">
  68. <el-button class="c-btn" type="success" @click="get(s.row)">查看</el-button>
  69. <el-button class="c-btn" type="primary" icon="el-icon-info" @click="getBank(s.row)">银行回执</el-button>
  70. <span>
  71. <el-button
  72. class="c-btn" type="warning" @click="deduction(s.row)">采购补扣款</el-button>
  73. <el-button v-else :disabled="true" class="c-btn" type="warning">采购补扣款</el-button>
  74. </span>
  75. <el-button class="c-btn" type="primary" icon="el-icon-printer" @click="subPrint(s.row)">交易凭证</el-button>
  76. <el-button class="c-btn" type="info" icon="el-icon-info" @click="subEmail(s.row)">电子协议</el-button>
  77. </template>
  78. </el-table-column>
  79. </el-table>
  80. <!-- ------------- 分页 ------------- -->
  81. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  82. </div>
  83. </div>
  84. <script>
  85. var app = new Vue({
  86. components: {
  87. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  88. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  89. },
  90. el: '.vue-box',
  91. data: {
  92. p: { // 查询参数
  93. orderNo: '', // 订单编号
  94. goodsName: '', // 商品名称
  95. pageNo: 1, // 当前页
  96. pageSize: 10, // 页大小
  97. sortType: 0 // 排序方式
  98. },
  99. dataCount: 0,
  100. dataList: [], // 数据集合
  101. },
  102. methods: {
  103. // 刷新
  104. f5: function() {
  105. sa.ajax('/level-two-server/TbOrders/getList', sa.removeNull(this.p), function(res) {
  106. this.dataList = res.data; // 数据
  107. this.dataCount = res.dataCount; // 数据总数
  108. sa.f5TableHeight(); // 刷新表格高度
  109. }.bind(this));
  110. },
  111. // 查看
  112. get: function(data) {
  113. sa.showIframe('数据详情', 'tb-orders-info.html?id=' + data.id, '950px', '60%');
  114. },
  115. // 查看银行回执
  116. getBank: function(data) {
  117. sa.showIframe('银行回执', 'tb-orders-bank-list.html?orderNo=' + data.orderNo, '1300px', '90%');
  118. },
  119. // 交易凭证
  120. subPrint: function(data) {
  121. sa.showIframe('交易凭证', 'tb-orders-print.html?id=' + data.id, '1200px', '80%');
  122. },
  123. // 电子协议
  124. subEmail: function(data) {
  125. sa.showIframe('电子协议', 'tb-orders-email.html?id=' + data.id, '1000px', '90%');
  126. },
  127. deduction(data) {
  128. sa.confirm('是否执行补扣款操作', function() {
  129. sa.ajax('/level-two-server/TbOrders/deduction?id=' + data.id, function(res) {
  130. sa.ok('操作成功');
  131. sa.f5TableHeight(); // 刷新表格高度
  132. this.f5();
  133. }.bind(this))
  134. }.bind(this));
  135. },
  136. // 修改
  137. update: function(data) {
  138. sa.showIframe('修改数据', 'tb-orders-add.html?id=' + data.id, '1000px', '90%');
  139. },
  140. // 新增
  141. add: function(data) {
  142. sa.showIframe('新增数据', 'tb-orders-add.html?id=-1', '1000px', '90%');
  143. },
  144. // 删除
  145. del: function(data) {
  146. sa.confirm('是否删除,此操作不可撤销', function() {
  147. sa.ajax('/level-two-server/TbOrders/delete?id=' + data.id, function(res) {
  148. sa.arrayDelete(this.dataList, data);
  149. sa.ok('删除成功');
  150. sa.f5TableHeight(); // 刷新表格高度
  151. this.f5()
  152. }.bind(this))
  153. }.bind(this));
  154. },
  155. // 批量删除
  156. deleteByIds: function() {
  157. // 获取选中元素的id列表
  158. let selection = this.$refs['data-table'].selection;
  159. let ids = sa.getArrayField(selection, 'id');
  160. if(selection.length == 0) {
  161. return sa.msg('请至少选择一条数据')
  162. }
  163. // 提交删除
  164. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  165. sa.ajax('/level-two-server/TbOrders/deleteByIds', {ids: ids.join(',')}, function(res) {
  166. sa.arrayDelete(this.dataList, selection);
  167. sa.ok('删除成功');
  168. sa.f5TableHeight(); // 刷新表格高度
  169. }.bind(this))
  170. }.bind(this));
  171. },
  172. // 改 - 订单状态已完成 (0=禁用,1=启用)
  173. updateOrderFinish: function(data) {
  174. // 声明变量记录是否成功
  175. var isOk = false;
  176. var oldValue = data.orderFinish;
  177. var ajax = sa.ajax('/level-two-server/TbOrders/updateOrderFinish', {id: data.id, value: data.orderFinish}, function(res) {
  178. isOk = true;
  179. sa.msg('修改成功');
  180. }.bind(this));
  181. // 如果未能修改成功, 则回滚
  182. $.when(ajax).done(function() {
  183. if(isOk == false) {
  184. data.status = oldValue;
  185. }
  186. })
  187. }
  188. },
  189. created: function() {
  190. this.f5();
  191. sa.onInputEnter();
  192. }
  193. })
  194. </script>
  195. </body>
  196. </html>