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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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="num" name="货运订单管理表主键" v-model="p.id"></sa-item>
  24. <sa-item type="text" name="一级市场订单ID" v-model="p.levelOneOrderId"></sa-item>
  25. <sa-item type="text" name="订单编号" v-model="p.orderNo"></sa-item>
  26. <sa-item type="text" name="商品id" v-model="p.goodsId"></sa-item>
  27. <sa-item type="text" name="商品名称" v-model="p.goodsName"></sa-item>
  28. <sa-item type="text" name="商品来源" v-model="p.goodsFrom"></sa-item>
  29. <sa-item type="text" name="发货商电话" v-model="p.shipperPhone"></sa-item>
  30. <sa-item type="text" name="发货商名称" v-model="p.shipperName"></sa-item>
  31. <sa-item type="text" name="司机ID" v-model="p.driverId"></sa-item>
  32. <sa-item type="text" name="司机名称" v-model="p.driverName"></sa-item>
  33. <sa-item type="text" name="司机电话" v-model="p.driverPhone"></sa-item>
  34. <sa-item type="text" name="车型ID" v-model="p.carId"></sa-item>
  35. <sa-item type="text" name="车型名称" v-model="p.carType"></sa-item>
  36. <sa-item type="text" name="收货人名称" v-model="p.consigneeName"></sa-item>
  37. <sa-item type="text" name="收货人电话号码" v-model="p.consigneePhone"></sa-item>
  38. <sa-item type="text" name="申报订单号" v-model="p.declarationNumber"></sa-item>
  39. <sa-item type="enum" name="订单状态已完成" v-model="p.orderFinish"
  40. :jv="{0: '禁用', 1: '启用'}" jtype="2" def="不限"></sa-item>
  41. <sa-item type="text" name="装货地址" v-model="p.loadingAddress"></sa-item>
  42. <sa-item type="text" name="卸货地址" v-model="p.unloadingAddress"></sa-item>
  43. <sa-item type="text" name="备注" v-model="p.comment"></sa-item>
  44. <sa-item type="text" name="更新时间" v-model="p.updateTime"></sa-item>
  45. <sa-item type="text" name="创建时间" v-model="p.createTime"></sa-item>
  46. <sa-item type="text" name="更新人名称" v-model="p.updateName"></sa-item>
  47. <sa-item type="enum" name="删除状态" v-model="p.deleteStatus"
  48. :jv="{0: '禁用', 1: '启用'}" jtype="2" def="不限"></sa-item>
  49. <sa-item type="text" name="更新人编号" v-model="p.updateBy"></sa-item>
  50. <sa-item type="text" name="创建人编号" v-model="p.createBy"></sa-item>
  51. <sa-item type="text" name="创建人名称" v-model="p.createName"></sa-item>
  52. <sa-item type="text" name="贸易区域id" v-model="p.tradeAreaId"></sa-item>
  53. <sa-item type="text" name="贸易区域名称" v-model="p.tradeAreaName"></sa-item>
  54. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  55. </el-form>
  56. <div class="fast-btn">
  57. <el-button v-if="sa.isAuth('tb-orders-add')" size="mini" type="primary" @click="add()">新增</el-button>
  58. <el-button size="mini" type="success" @click="getBySelect()">查看</el-button>
  59. <el-button size="mini" type="info" @click="sa.f5()">重置</el-button>
  60. </div>
  61. <!-- ------------- 数据列表 ------------- -->
  62. <el-table class="data-table" ref="data-table" :data="dataList" >
  63. <sa-td type="selection"></sa-td>
  64. <sa-td name="货运订单管理表主键" prop="id" type="num"></sa-td>
  65. <sa-td name="一级市场订单ID" prop="levelOneOrderId" ></sa-td>
  66. <sa-td name="订单编号" prop="orderNo" ></sa-td>
  67. <sa-td name="商品id" prop="goodsId" ></sa-td>
  68. <sa-td name="商品名称" prop="goodsName" ></sa-td>
  69. <sa-td name="商品来源" prop="goodsFrom" ></sa-td>
  70. <sa-td name="发货商电话" prop="shipperPhone" ></sa-td>
  71. <sa-td name="发货商名称" prop="shipperName" ></sa-td>
  72. <sa-td name="司机ID" prop="driverId" ></sa-td>
  73. <sa-td name="司机名称" prop="driverName" ></sa-td>
  74. <sa-td name="司机电话" prop="driverPhone" ></sa-td>
  75. <sa-td name="车型ID" prop="carId" ></sa-td>
  76. <sa-td name="车型名称" prop="carType" ></sa-td>
  77. <sa-td name="收货人名称" prop="consigneeName" ></sa-td>
  78. <sa-td name="收货人电话号码" prop="consigneePhone" ></sa-td>
  79. <sa-td name="申报订单号" prop="declarationNumber" ></sa-td>
  80. <sa-td name="订单状态已完成" prop="orderFinish" type="switch" :jv="{0: '禁用', 1: '启用'}" @change="s => updateOrderFinish(s.row)"></sa-td>
  81. <sa-td name="装货地址" prop="loadingAddress" ></sa-td>
  82. <sa-td name="卸货地址" prop="unloadingAddress" ></sa-td>
  83. <sa-td name="备注" prop="comment" ></sa-td>
  84. <sa-td name="更新时间" prop="updateTime" ></sa-td>
  85. <sa-td name="创建时间" prop="createTime" ></sa-td>
  86. <sa-td name="更新人名称" prop="updateName" ></sa-td>
  87. <sa-td name="删除状态" prop="deleteStatus" type="switch" :jv="{0: '禁用', 1: '启用'}" @change="s => updateDeleteStatus(s.row)"></sa-td>
  88. <sa-td name="更新人编号" prop="updateBy" ></sa-td>
  89. <sa-td name="创建人编号" prop="createBy" ></sa-td>
  90. <sa-td name="创建人名称" prop="createName" ></sa-td>
  91. <sa-td name="贸易区域id" prop="tradeAreaId" ></sa-td>
  92. <sa-td name="贸易区域名称" prop="tradeAreaName" ></sa-td>
  93. <el-table-column label="操作" fixed="right" width="240px">
  94. <template slot-scope="s">
  95. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
  96. <el-button v-if="sa.isAuth('tb-orders-edit')" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
  97. <el-button v-if="sa.isAuth('tb-orders-del')" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
  98. </template>
  99. </el-table-column>
  100. </el-table>
  101. <!-- ------------- 分页 ------------- -->
  102. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  103. </div>
  104. </div>
  105. <script>
  106. var app = new Vue({
  107. components: {
  108. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  109. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  110. },
  111. el: '.vue-box',
  112. data: {
  113. p: { // 查询参数
  114. id: '', // 货运订单管理表主键
  115. levelOneOrderId: '', // 一级市场订单ID
  116. orderNo: '', // 订单编号
  117. goodsId: '', // 商品id
  118. goodsName: '', // 商品名称
  119. goodsFrom: '', // 商品来源(国家)
  120. shipperPhone: '', // 发货商电话
  121. shipperName: '', // 发货商名称
  122. driverId: '', // 司机ID
  123. driverName: '', // 司机名称
  124. driverPhone: '', // 司机电话
  125. carId: '', // 车型ID
  126. carType: '', // 车型名称
  127. consigneeName: '', // 收货人名称
  128. consigneePhone: '', // 收货人电话号码
  129. declarationNumber: '', // (预留字段) 申报订单号
  130. orderFinish: '', // 订单状态已完成 (0=禁用,1=启用)
  131. loadingAddress: '', // 装货地址
  132. unloadingAddress: '', // 卸货地址
  133. comment: '', // 备注
  134. updateTime: '', // 更新时间
  135. createTime: '', // 创建时间
  136. updateName: '', // 更新人名称
  137. deleteStatus: '', // 删除状态(0=禁用,1=启用)
  138. updateBy: '', // 更新人编号
  139. createBy: '', // 创建人编号
  140. createName: '', // 创建人名称
  141. tradeAreaId: '', // 贸易区域id
  142. tradeAreaName: '', // 贸易区域名称
  143. pageNo: 1, // 当前页
  144. pageSize: 10, // 页大小
  145. sortType: 0 // 排序方式
  146. },
  147. dataCount: 0,
  148. dataList: [], // 数据集合
  149. },
  150. methods: {
  151. // 刷新
  152. f5: function() {
  153. sa.ajax('/TbOrders/getList', sa.removeNull(this.p), function(res) {
  154. this.dataList = res.data; // 数据
  155. this.dataCount = res.dataCount; // 数据总数
  156. sa.f5TableHeight(); // 刷新表格高度
  157. }.bind(this));
  158. },
  159. // 查看
  160. get: function(data) {
  161. sa.showIframe('数据详情', 'tb-orders-info.html?id=' + data.id, '1050px', '90%');
  162. },
  163. // 查看 - 根据选中的
  164. getBySelect: function(data) {
  165. var selection = this.$refs['data-table'].selection;
  166. if(selection.length == 0) {
  167. return sa.msg('请选择一条数据')
  168. }
  169. this.get(selection[0]);
  170. },
  171. // 修改
  172. update: function(data) {
  173. sa.showIframe('修改数据', 'tb-orders-add.html?id=' + data.id, '1000px', '90%');
  174. },
  175. // 新增
  176. add: function(data) {
  177. sa.showIframe('新增数据', 'tb-orders-add.html?id=-1', '1000px', '90%');
  178. },
  179. // 删除
  180. del: function(data) {
  181. sa.confirm('是否删除,此操作不可撤销', function() {
  182. sa.ajax('/TbOrders/delete?id=' + data.id, function(res) {
  183. sa.arrayDelete(this.dataList, data);
  184. sa.ok('删除成功');
  185. sa.f5TableHeight(); // 刷新表格高度
  186. }.bind(this))
  187. }.bind(this));
  188. },
  189. // 批量删除
  190. deleteByIds: function() {
  191. // 获取选中元素的id列表
  192. let selection = this.$refs['data-table'].selection;
  193. let ids = sa.getArrayField(selection, 'id');
  194. if(selection.length == 0) {
  195. return sa.msg('请至少选择一条数据')
  196. }
  197. // 提交删除
  198. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  199. sa.ajax('/TbOrders/deleteByIds', {ids: ids.join(',')}, function(res) {
  200. sa.arrayDelete(this.dataList, selection);
  201. sa.ok('删除成功');
  202. sa.f5TableHeight(); // 刷新表格高度
  203. }.bind(this))
  204. }.bind(this));
  205. },
  206. // 改 - 订单状态已完成 (0=禁用,1=启用)
  207. updateOrderFinish: function(data) {
  208. // 声明变量记录是否成功
  209. var isOk = false;
  210. var oldValue = data.orderFinish;
  211. var ajax = sa.ajax('/TbOrders/updateOrderFinish', {id: data.id, value: data.orderFinish}, function(res) {
  212. isOk = true;
  213. sa.msg('修改成功');
  214. }.bind(this));
  215. // 如果未能修改成功, 则回滚
  216. $.when(ajax).done(function() {
  217. if(isOk == false) {
  218. data.status = oldValue;
  219. }
  220. })
  221. },
  222. // 改 - 删除状态(0=禁用,1=启用)
  223. updateDeleteStatus: function(data) {
  224. // 声明变量记录是否成功
  225. var isOk = false;
  226. var oldValue = data.deleteStatus;
  227. var ajax = sa.ajax('/TbOrders/updateDeleteStatus', {id: data.id, value: data.deleteStatus}, function(res) {
  228. isOk = true;
  229. sa.msg('修改成功');
  230. }.bind(this));
  231. // 如果未能修改成功, 则回滚
  232. $.when(ajax).done(function() {
  233. if(isOk == false) {
  234. data.status = oldValue;
  235. }
  236. })
  237. },
  238. },
  239. created: function() {
  240. this.f5();
  241. sa.onInputEnter();
  242. }
  243. })
  244. </script>
  245. </body>
  246. </html>