tb-person-filing-list.html 8.5 KB

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