tb-person-filing-list.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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="../../static/kj/element-ui/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"></sa-item>
  28. <div class="c-item" v-if="sa.isAdmin()">
  29. <label class="c-label">备案组织:</label>
  30. <el-select v-model="p.deptId">
  31. <el-option label="请选择" v-for="(item,index) in deptList" :key="item.id" :label="item.name"
  32. :value="item.id"></el-option>
  33. </el-select>
  34. </div>
  35. <sa-item type="text" name="商铺号" v-if="sa.isAdmin()" v-model="p.shopCode"></sa-item>
  36. <div class="c-item">
  37. <el-select v-model="p.judgeState">
  38. <el-option label="全部" value=""></el-option>
  39. <el-option label="未审核" :value="0"></el-option>
  40. <el-option label="通过" :value="1"></el-option>
  41. <el-option label="不通过" :value="2"></el-option>
  42. </el-select>
  43. </div>
  44. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  45. <el-button type="info" icon="el-icon-refresh"
  46. @click="p.name='';p.phone='';p.deptId='';p.idCard='';p.judgeState='';p.shopCode='';f5()">重置</el-button>
  47. <el-button type="primary" icon="el-icon-plus" @click="add" v-if="sa.isAuth('tb-person-filing-add')">
  48. 新增</el-button>
  49. <el-button type="primary" icon="el-icon-upload" @click="importFn"
  50. v-if="sa.isAuth('tb-person-filing-import')">
  51. 导入备案</el-button>
  52. <el-button type="primary" icon="el-icon-upload" @click="face.visible=true"
  53. v-if="sa.isAuth('tb-person-filing-import')">
  54. 导入人脸</el-button>
  55. <el-button type="primary" icon="el-icon-upload" v-if="sa.isAuth('tb-person-filing-export')"
  56. @click='exportFn'>
  57. 导出</el-button>
  58. </el-form>
  59. <!-- ------------- 数据列表 ------------- -->
  60. <el-table class="data-table" ref="data-table" :data="dataList" style="margin-top: 10px;">
  61. <sa-td name="序号" type="index"></sa-td>
  62. <sa-td name="姓名" prop="name"></sa-td>
  63. <sa-td name="备案组织" prop="deptName" width="130"></sa-td>
  64. <sa-td name="备案场所" prop="venuesName" width="130"></sa-td>
  65. <sa-td name="联系号码" prop="phone" width="120"></sa-td>
  66. <sa-td name="身份证" prop="idCadStr" width="160"></sa-td>
  67. <sa-td type="img" name="人脸" prop="photo"> </sa-td>
  68. <sa-td name="商铺号" prop="shopCode" not="-"> </sa-td>
  69. <sa-td name="审核状态" prop="judgeState" type="enum" :jv="{0: '未审核', 1: '通过', 2: '不通过'}"></sa-td>
  70. <sa-td name="审核时间" prop="judgeTime" not="-" width="140"></sa-td>
  71. <sa-td name="创建时间" prop="createTime" width="140"></sa-td>
  72. <sa-td name="更新时间" prop="updateTime" width="140"></sa-td>
  73. <el-table-column label="操作" fixed="right" width="240px">
  74. <template slot-scope="s">
  75. <el-button v-if="sa.isAuth('tb-person-filing-judge')&&s.row.judgeState!=1" class="c-btn"
  76. type="success" @click="judgeFn(s.row)">审核
  77. </el-button>
  78. <el-button class="c-btn" type="primary" @click="issuedFn(s.row)"
  79. v-if="sa.isAuth('tb-person-filing-issued')&&s.row.judgeState==1">下发人脸
  80. </el-button>
  81. <el-button class="c-btn" type="success" @click="get(s.row)">查看
  82. </el-button>
  83. <el-button v-if="sa.isAuth('tb-person-filing-edit')" class="c-btn" type="primary"
  84. @click="update(s.row)">修改
  85. </el-button>
  86. <el-button v-if="sa.isAuth('tb-person-filing-del')" class="c-btn" type="danger"
  87. @click="del(s.row)">删除
  88. </el-button>
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. <!-- ------------- 分页 ------------- -->
  93. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  94. </sa-item>
  95. </div>
  96. <el-dialog title="批量导入" :visible.sync="form.visible" width="35%">
  97. <el-card class="box-card">
  98. <div slot="header" class="clearfix">
  99. <el-button style="float: right; padding-bottom: 10px" type="text" @click="downTemplate">模板下载
  100. </el-button>
  101. </div>
  102. <el-upload class="upload-demo" ref="importExcel" :headers="headers" drag :auto-upload="false"
  103. accept=".xls,.xlsx" :on-success="onSuccess" :action="importUrl">
  104. <i class="el-icon-upload"></i>
  105. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  106. <div class="el-upload__tip" slot="tip">只能上传excel文件</div>
  107. </el-upload>
  108. </el-card>
  109. <span slot="footer" class="dialog-footer">
  110. <el-button @click="cancelImport">取 消</el-button>
  111. <el-button type="primary" @click="sureImport">确定导入</el-button>
  112. </span>
  113. </el-dialog>
  114. <el-dialog title="导入人脸信息" :visible.sync="face.visible" width="35%">
  115. <el-card class="box-card">
  116. <el-upload class="upload-demo" ref="importExcel" :headers="headers" drag accept=".zip"
  117. :on-success="onSuccess" :action="importFaceUrl">
  118. <i class="el-icon-upload"></i>
  119. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  120. <div class="el-upload__tip" slot="tip">只能上传.zip压缩文件</div>
  121. </el-upload>
  122. <div style="margin-top: 10px;">
  123. <p>1、人脸图片请以<span style="color: red;font-weight: bold;">身份证号</span>命名</p>
  124. <p>2、上传的人脸人员信息需要已在系统备案</p>
  125. <p>3、将人员人脸图片打包成zip格式上传</p>
  126. </div>
  127. </el-card>
  128. </el-dialog>
  129. </div>
  130. <script>
  131. var app = new Vue({
  132. components: {
  133. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  134. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  135. },
  136. el: '.vue-box',
  137. data: {
  138. face: {
  139. visible: false,
  140. },
  141. form: {
  142. visible: false,
  143. deptId: ''
  144. },
  145. importUrl: sa.cfg.api_url + '/TbPersonFiling/import',
  146. importFaceUrl: sa.cfg.api_url + '/TbPersonFiling/importFace',
  147. headers: {
  148. 'satoken': sessionStorage.satoken
  149. },
  150. deptList: [],
  151. p: { // 查询参数
  152. id: '', //
  153. judgeState: '', // 单位ID
  154. deptId: '',
  155. name: '', // 姓名
  156. phone:'',
  157. type: '', // 类型(1=临时,2=内部)
  158. idCard: '', // 身份证
  159. pageSize: 15, // 页大小
  160. sortType: 0 // 排序方式
  161. },
  162. dataCount: 0,
  163. dataList: [], // 数据集合
  164. shopCodeList: []
  165. },
  166. methods: {
  167. exportFn() {
  168. sa.confirm('是否导出符合筛选条件的人员备案信息?', function() {
  169. sa.ajax('/TbPersonFiling/export', sa.removeNull(this.p), function(res) {
  170. window.location.href = res.data;
  171. }.bind(this))
  172. }.bind(this));
  173. },
  174. issuedFn(data) {
  175. sa.confirm('是否下发【' + data.name + '】的人脸信息到对应备案场所', function() {
  176. sa.ajax('/TbPersonFiling/issued', data, function(res) {
  177. sa.ok('人员信息已下发');
  178. }.bind(this))
  179. }.bind(this));
  180. },
  181. getShopCodeList() {
  182. sa.ajax('/TbPersonFiling/getShopCodeList', function(resp) {
  183. let list = resp.data;
  184. this.shopCodeList = list;
  185. }.bind(this))
  186. },
  187. importFn() {
  188. this.form.visible = true;
  189. },
  190. downTemplate() {
  191. window.location.href = '../../static/template/' + encodeURIComponent('备案导入模板.xlsx')
  192. },
  193. cancelImport() {
  194. this.$refs.importExcel.clearFiles();
  195. this.form.visible = false;
  196. this.face.visible = false;
  197. },
  198. sureImport() {
  199. sa.loading('正在上传');
  200. this.$refs.importExcel.submit();
  201. },
  202. onSuccess(resp) {
  203. sa.hideLoading();
  204. if (resp.code !== 200) {
  205. sa.error(resp.msg);
  206. } else {
  207. sa.alert('导入成功', this.cancelImport());
  208. setTimeout(() => {
  209. this.f5();
  210. }, 1000)
  211. }
  212. },
  213. getDeptList() {
  214. sa.ajax('/TbDept/getList', {
  215. pageNo: 1,
  216. pageSize: 100
  217. }, function(resp) {
  218. let list = resp.data;
  219. this.deptList = list;
  220. }.bind(this))
  221. },
  222. judgeFn(data) {
  223. sa.showIframe('审核', 'tb-person-filing-judge.html?id=' + data.id, '700px', '70%');
  224. },
  225. // 刷新
  226. f5: function() {
  227. sa.ajax('/TbPersonFiling/getList', sa.removeNull(this.p), function(res) {
  228. this.dataList = res.data; // 数据
  229. this.dataCount = res.dataCount; // 数据总数
  230. sa.f5TableHeight(); // 刷新表格高度
  231. }.bind(this));
  232. },
  233. // 查看
  234. get: function(data) {
  235. sa.showIframe('数据详情', 'tb-person-filing-info.html?id=' + data.id, '700px', '70%');
  236. },
  237. // 查看 - 根据选中的
  238. getBySelect: function(data) {
  239. var selection = this.$refs['data-table'].selection;
  240. if (selection.length == 0) {
  241. return sa.msg('请选择一条数据')
  242. }
  243. this.get(selection[0]);
  244. },
  245. // 修改
  246. update: function(data) {
  247. sa.showIframe('修改数据', 'tb-person-filing-add.html?id=' + data.id, '900px', '80%');
  248. },
  249. // 新增
  250. add: function(data) {
  251. sa.showIframe('新增数据', 'tb-person-filing-add.html?id=-1', '900px', '80%');
  252. },
  253. // 删除
  254. del: function(data) {
  255. sa.confirm('是否删除,此操作不可撤销', function() {
  256. sa.ajax('/TbPersonFiling/delete?id=' + data.id, function(res) {
  257. sa.arrayDelete(this.dataList, data);
  258. sa.ok('删除成功');
  259. sa.f5TableHeight(); // 刷新表格高度
  260. }.bind(this))
  261. }.bind(this));
  262. },
  263. // 批量删除
  264. deleteByIds: function() {
  265. // 获取选中元素的id列表
  266. let selection = this.$refs['data-table'].selection;
  267. let ids = sa.getArrayField(selection, 'id');
  268. if (selection.length == 0) {
  269. return sa.msg('请至少选择一条数据')
  270. }
  271. // 提交删除
  272. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  273. sa.ajax('/TbPersonFiling/deleteByIds', {
  274. ids: ids.join(',')
  275. }, function(res) {
  276. sa.arrayDelete(this.dataList, selection);
  277. sa.ok('删除成功');
  278. sa.f5TableHeight(); // 刷新表格高度
  279. }.bind(this))
  280. }.bind(this));
  281. },
  282. },
  283. created: function() {
  284. this.f5();
  285. sa.onInputEnter();
  286. this.getShopCodeList();
  287. if (sa.isAdmin()) {
  288. this.getDeptList();
  289. }
  290. }
  291. })
  292. </script>
  293. </body>
  294. </html>