tb-two-market-orders-list.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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="../../static/kj/element-ui/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. </head>
  17. <body>
  18. <div class="vue-box" style="display: none;" :style="'display: block;'">
  19. <div class="c-panel">
  20. <!-- ------------- 检索参数 ------------- -->
  21. <div class="c-title">检索参数</div>
  22. <el-form ref="form" :model='p' @submit.native.prevent>
  23. <sa-item type="text" name="订单编号" v-model="p.orderNo" width="7em"></sa-item>
  24. <sa-item type="text" name="商品名称" v-model="p.goodsName" width="7em"></sa-item>
  25. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  26. <el-button type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
  27. </el-form>
  28. <!-- ------------- 数据列表 ------------- -->
  29. <el-table class="data-table" ref="data-table" :data="dataList" >
  30. <sa-td type="index" name="序号"></sa-td>
  31. <sa-td name="订单编号" prop="orderNo" width="180"></sa-td>
  32. <sa-td name="所属互市区" prop="tradeAreaName" ></sa-td>
  33. <sa-td name="商品名称" prop="goodsName" width="280"></sa-td>
  34. <sa-td name="商品来源" prop="goodsFrom" ></sa-td>
  35. <sa-td name="卖家电话" prop="shipperPhone" ></sa-td>
  36. <sa-td name="卖家名称" prop="shipperName" ></sa-td>
  37. <sa-td name="收货人名称" prop="consigneeName" ></sa-td>
  38. <sa-td name="收货人电话号码" prop="consigneePhone" ></sa-td>
  39. <el-table-column label="操作" fixed="right" width="200px">
  40. <template slot-scope="s">
  41. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
  42. </template>
  43. </el-table-column>
  44. </el-table>
  45. <!-- ------------- 分页 ------------- -->
  46. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  47. </div>
  48. </div>
  49. <script>
  50. var app = new Vue({
  51. components: {
  52. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  53. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  54. },
  55. el: '.vue-box',
  56. data: {
  57. p: { // 查询参数
  58. orderNo: '', // 订单编号
  59. // goodsId: '', // 商品id
  60. goodsName: '', // 商品名称
  61. goodsFrom: '', // 商品来源(国家)
  62. shipperPhone: '', // 发货商电话
  63. shipperName: '', // 发货商名称
  64. // driverId: '', // 司机ID
  65. driverName: '', // 司机名称
  66. driverPhone: '', // 司机电话
  67. // carId: '', // 车型ID
  68. carType: '', // 车型名称
  69. consigneeName: '', // 收货人名称
  70. consigneePhone: '', // 收货人电话号码
  71. declarationNumber: '', // (预留字段) 申报订单号
  72. orderFinish: '', // 订单状态已完成 (0=禁用,1=启用)
  73. loadingAddress: '', // 装货地址
  74. unloadingAddress: '', // 卸货地址
  75. comment: '', // 备注
  76. // tradeAreaId: '', // 贸易区域id
  77. tradeAreaName: '', // 贸易区域名称
  78. pageNo: 1, // 当前页
  79. pageSize: 20, // 页大小
  80. sortType: 0 // 排序方式
  81. },
  82. dataCount: 0,
  83. dataList: [], // 数据集合
  84. },
  85. methods: {
  86. // 刷新
  87. f5: function() {
  88. sa.ajax('/level-two-server/TbOrders/getList', sa.removeNull(this.p), function(res) {
  89. this.dataList = res.data; // 数据
  90. this.dataCount = res.dataCount; // 数据总数
  91. sa.f5TableHeight(); // 刷新表格高度
  92. }.bind(this));
  93. },
  94. // 查看
  95. get: function(data) {
  96. sa.showIframe('数据详情', 'tb-orders-info.html?id=' + data.id, '1050px', '90%');
  97. },
  98. // 查看 - 根据选中的
  99. getBySelect: function(data) {
  100. var selection = this.$refs['data-table'].selection;
  101. if(selection.length == 0) {
  102. return sa.msg('请选择一条数据')
  103. }
  104. this.get(selection[0]);
  105. },
  106. // 修改
  107. update: function(data) {
  108. sa.showIframe('修改数据', 'tb-orders-add.html?id=' + data.id, '1000px', '90%');
  109. },
  110. // 新增
  111. add: function(data) {
  112. sa.showIframe('新增数据', 'tb-orders-add.html?id=-1', '1000px', '90%');
  113. },
  114. // 改 - 订单状态已完成 (0=禁用,1=启用)
  115. updateOrderFinish: function(data) {
  116. // 声明变量记录是否成功
  117. var isOk = false;
  118. var oldValue = data.orderFinish;
  119. var ajax = sa.ajax('/TbOrders/updateOrderFinish', {id: data.id, value: data.orderFinish}, function(res) {
  120. isOk = true;
  121. sa.msg('修改成功');
  122. }.bind(this));
  123. // 如果未能修改成功, 则回滚
  124. $.when(ajax).done(function() {
  125. if(isOk == false) {
  126. data.status = oldValue;
  127. }
  128. })
  129. },
  130. // 改 - 删除状态(0=禁用,1=启用)
  131. updateDeleteStatus: function(data) {
  132. // 声明变量记录是否成功
  133. var isOk = false;
  134. var oldValue = data.deleteStatus;
  135. var ajax = sa.ajax('/TbOrders/updateDeleteStatus', {id: data.id, value: data.deleteStatus}, function(res) {
  136. isOk = true;
  137. sa.msg('修改成功');
  138. }.bind(this));
  139. // 如果未能修改成功, 则回滚
  140. $.when(ajax).done(function() {
  141. if(isOk == false) {
  142. data.status = oldValue;
  143. }
  144. })
  145. },
  146. },
  147. created: function() {
  148. this.f5();
  149. sa.onInputEnter();
  150. }
  151. })
  152. </script>
  153. </body>
  154. </html>