tb-driver-bind.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>司机-列表</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  8. <!-- 所有的 css & js 资源 -->
  9. <link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
  10. <link rel="stylesheet" href="../../static/sa.css">
  11. <script src="../../static/kj/vue.min.js"></script>
  12. <script src="../../static/kj/element-ui/index.js"></script>
  13. <script src="../../static/kj/httpVueLoader.js"></script>
  14. <script src="../../static/kj/jquery.min.js"></script>
  15. <script src="../../static/kj/layer/layer.js"></script>
  16. <script src="../../static/sa.js"></script>
  17. <script src="../../static/kj/upload-util.js"></script>
  18. </head>
  19. <body>
  20. <div class="vue-box" style="display: none;" :style="'display: block;'">
  21. <div class="c-panel">
  22. <!-- ------------- 检索参数 ------------- -->
  23. <!-- <div class="c-title">检索参数</div> -->
  24. <el-form ref="form" :model='p' @submit.native.prevent>
  25. <sa-item type="text" name="姓名" v-model="p.name"></sa-item>
  26. <sa-item type="text" name="手机号" v-model="p.phone"></sa-item>
  27. <sa-item type="text" name="身份证号" v-model="p.idCard" width="90px"></sa-item>
  28. <sa-item name="审核状态" width="90px">
  29. <el-select v-model="p.auditStatus">
  30. <el-option label="全部" value=""></el-option>
  31. <el-option label="待审核" value="0"></el-option>
  32. <el-option label="审核通过" value="1"></el-option>
  33. <el-option label="审核不通过" value="2"></el-option>
  34. </el-select>
  35. </sa-item>
  36. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  37. <el-button icon="el-icon-refresh" type="info" @click="sa.f5()">重置</el-button>
  38. </el-form>
  39. <!-- ------------- 数据列表 ------------- -->
  40. <el-table class="data-table" ref="data-table" :data="dataList">
  41. <sa-td name="姓名" prop="name"></sa-td>
  42. <sa-td name="性别" prop="sex" type="enum" :jv="{1: '男', 2: '女'}"></sa-td>
  43. <sa-td name="出生年月" width="100px" prop="birthday" ></sa-td>
  44. <sa-td name="身份证号" width="170px" prop="idCard"></sa-td>
  45. <sa-td name="手机号" width="110px" prop="phone"></sa-td>
  46. <sa-td name="联系地址" width="150px" prop="address"></sa-td>
  47. <!-- <sa-td name="身份证照片" prop="idCardImg" type="img-list"></sa-td>
  48. <sa-td name="驾驶证号" prop="drivingLicenseId"></sa-td>-->
  49. <sa-td name="驾照类型" prop="driverTypeName" ></sa-td>
  50. <sa-td name="驾驶证照片" prop="drivingLicenseImg" type="img-list"></sa-td>
  51. <!-- <sa-td name="车辆行驶证号" prop="vehicleDrivingId" width="120px"></sa-td>
  52. <sa-td name="车辆行驶证照片" prop="vehicleDrivingImg" type="img-list"></sa-td>
  53. <sa-td name="车辆前脸照" prop="vehicleImg" type="img-list"></sa-td>
  54. -->
  55. <sa-td name="注册时间" width="140px" prop="registerTime"></sa-td>
  56. <sa-td name="审核状态" prop="auditStatus" type="enum" :jv="{0: '待审核', 1: '已审核', 2: '审核不通过'}"></sa-td>
  57. <!--<sa-td name="审核状态" prop="auditStatus"></sa-td>-->
  58. <sa-td name="审核时间" width="140px" prop="auditTime"></sa-td>
  59. <el-table-column label="操作" fixed="right" width="80px">
  60. <template slot-scope="s">
  61. <el-button v-if="sa.isAuth('tb-driver-edit')" class="c-btn" type="primary" icon="el-icon-edit"
  62. @click="handleBind(s.row)">绑定</el-button>
  63. </template>
  64. </el-table-column>
  65. </el-table>
  66. <!-- ------------- 分页 ------------- -->
  67. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount"
  68. @change="f5()"></sa-item>
  69. </div>
  70. <!-- 上传文件 -->
  71. <input ref="fileInput" type="file" style="display: none;" @click="handleFile(event)"></input>
  72. </div>
  73. <script>
  74. var app = new Vue({
  75. components: {
  76. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  77. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  78. },
  79. el: '.vue-box',
  80. data: {
  81. vehicleId: sa.p('id', 0), // 获取车辆ID
  82. p: { // 查询参数
  83. name: '', // 姓名
  84. phone: '', // 手机号
  85. idCard: '', // 身份证号
  86. pageNo: 1, // 当前页
  87. pageSize: 10, // 页大小
  88. sortType: 0 // 排序方式
  89. },
  90. dataCount: 0,
  91. dataList: [], // 数据集合
  92. },
  93. methods: {
  94. // 刷新
  95. f5: function () {
  96. sa.ajax('/transport-server/TbDriver/getNotBindCarDriverList', sa.removeNull(this.p), function (res) {
  97. res.data.forEach(element => {
  98. element.idCard = element.idCard.toString().replace(/^(.{4})(?:\w+)(.{4})$/,'$1****$2')
  99. });
  100. this.dataList = res.data; // 数据
  101. this.dataCount = res.dataCount; // 数据总数
  102. sa.f5TableHeight(); // 刷新表格高度
  103. }.bind(this));
  104. },
  105. // 查看
  106. get: function (data) {
  107. sa.showIframe('司机详情', 'tb-driver-info.html?id=' + data.id, '1050px', '90%');
  108. },
  109. // 查看 - 根据选中的
  110. getBySelect: function (data) {
  111. var selection = this.$refs['data-table'].selection;
  112. if (selection.length == 0) {
  113. return sa.msg('请选择一条数据')
  114. }
  115. this.get(selection[0]);
  116. },
  117. // 执行绑定
  118. handleBind: function (data) {
  119. let param = {"id": this.vehicleId, "driverId":data.id};
  120. sa.confirm('确定要绑定该司机吗?', function() {
  121. sa.ajax('/transport-server/TbVehicle/bindDriver' , param, function(res) {
  122. //sa.arrayDelete(this.dataList, data);
  123. sa.ok('绑定成功', this.clean);
  124. sa.alert('绑定成功', this.clean);
  125. //sa.f5TableHeight(); // 刷新表格高度
  126. }.bind(this))
  127. }.bind(this));
  128. },
  129. // 添完成后的动作
  130. clean: function() {
  131. if(this.id == 0) {
  132. this.m = this.createModel();
  133. } else {
  134. parent.app.f5(); // 刷新父页面列表
  135. sa.closeCurrIframe(); // 关闭本页
  136. }
  137. },
  138. handleFile(event) {
  139. console.log(event)
  140. const file = event.target.files[0]
  141. sa.ajax('/transport-server/TbDriver/driverImport', { file }, function (res) {
  142. // sa.ok('导入成功');
  143. // sa.f5TableHeight();
  144. })
  145. },
  146. },
  147. created: function () {
  148. this.f5();
  149. sa.onInputEnter();
  150. }
  151. })
  152. </script>
  153. </body>
  154. </html>