Parcourir la source

批量导入备案

qzyReal il y a 2 ans
Parent
commit
a2c7fba1b6

+ 18 - 0
.gitignore

@@ -0,0 +1,18 @@
+target/
+.project
+.classpath
+.settings
+
+.factorypath
+
+/.idea/
+
+node_modules/
+bin/
+.settings/
+unpackage/
+*.iml
+app.pid
+logs/
+
+

+ 6 - 0
sa-frame/menu-list-sp.js

@@ -243,6 +243,12 @@ window.menuList.unshift({
 								isShow: false,
 
 							},
+							{
+								id: 'tb-person-filing-import',
+								name: '导入',
+								isShow: false,
+
+							},
 						]
 					}
 				]

+ 2 - 1
sa-view-sp/sp-admin/admin-add.html

@@ -27,9 +27,9 @@
 						<el-input></el-input>
 						<el-input type="password"></el-input>
 					</div>
+					<sa-item type="text" name="账号" v-model="m.name" br need></sa-item>
 					<sa-item type="text" name="姓名" v-model="m.nickname" br need></sa-item>
 					<sa-item style="display: inline;" type="text" name="手机号" v-model="m.phone" br need></sa-item>
-					<span style="display: inline;">即登录账号</span>
 					<div class="c-item">
 						<label class="c-label"><span style="color: red;">*</span>所属组织:</label>
 						<el-select v-model="m.deptId">
@@ -87,6 +87,7 @@
 					ok: function() {
 						// 表单校验 
 						let m = this.m;
+						sa.checkNull(m.name, '请输入账号');
 						sa.checkNull(m.nickname, '请输入姓名');
 						let phone = m.phone;
 						if (!sa.isPhone(phone)) {

+ 21 - 3
sa-view-sp/sp-admin/admin-list.html

@@ -55,7 +55,8 @@
 				<el-table class="data-table" ref="data-table" :data="dataList">
 					<sa-td type="selection"></sa-td>
 					<sa-td type="text" name="姓名" prop="nickname"></sa-td>
-					<sa-td type="text" name="手机/账号" prop="phone" min-width="120px">
+					<sa-td type="text" name="账号" prop="name"></sa-td>
+					<sa-td type="text" name="手机" prop="phone" min-width="120px">
 						<template slot-scope="s">
 							<span v-if="s.row.phone">{{s.row.phone}}</span>
 							<span v-else>{{s.row.name}}</span>
@@ -82,6 +83,9 @@
 										<el-dropdown-item>修改组织</el-dropdown-item>
 									</span>
 									<span @click="updateName(s.row)">
+										<el-dropdown-item>修改账号</el-dropdown-item>
+									</span>
+									<span @click="updatePhone(s.row)">
 										<el-dropdown-item>改手机号</el-dropdown-item>
 									</span>
 									<span @click="updateNickName(s.row)">
@@ -235,13 +239,27 @@
 							})
 						});
 					},
+					updatePhone: function(data) {
+						layer.prompt({
+							title: '请输入新的手机号'
+						}, function(pass, index) {
+							layer.close(index);
+							sa.ajax('/admin/updatePhone', {
+								id: data.id,
+								phone: pass
+							}, function(res) {
+								data.phone = pass;
+								layer.msg('修改成功');
+							})
+						});
+					},
 					// 修改名称 
 					updateName: function(data) {
 						layer.prompt({
-							title: '请输入新的手机号'
+							title: '请输入新号'
 						}, function(pass, index) {
 							layer.close(index);
-							sa.ajax('/admin/update', {
+							sa.ajax('/admin/updateName', {
 								id: data.id,
 								name: pass
 							}, function(res) {

+ 4 - 0
sa-view-sp/sp-cfg/server-cfg.html

@@ -119,6 +119,9 @@
 						<sa-item type="enum" name="是否发送预警通知" v-model="m.sendAlarm" :jv="{1: '发送', 0: '不发送'}" jtype="1"
 							br>
 						</sa-item>
+						<sa-item  name="短信签名" v-model="m.smsSign"
+							br>
+						</sa-item>
 					</el-tab-pane>
 
 				</el-tabs>
@@ -143,6 +146,7 @@
 					tourLimit:1,
 					acidLimit:24,
 					sendAlarm: 1, // 新用户默认头像 
+					smsSign:'钦州码头智慧湾卡口智能防疫系统'
 				}
 			}
 		</script>

+ 76 - 2
sa-view/tb-person-filing/tb-person-filing-list.html

@@ -14,6 +14,7 @@
 		<script src="../../static/kj/jquery.min.js"></script>
 		<script src="../../static/kj/layer/layer.js"></script>
 		<script src="../../static/sa.js"></script>
+		<script src="../../static/kj/upload-util.js"></script>
 	</head>
 	<body>
 		<div class="vue-box" style="display: none;" :style="'display: block;'">
@@ -33,6 +34,9 @@
 						@click="p.name='',p.type='',p.idCard='',p.judgeState='',f5()">重置</el-button>
 					<el-button type="primary" icon="el-icon-plus" @click="add" v-if="sa.isAuth('tb-person-filing-add')">
 						新增</el-button>
+					<el-button type="primary" icon="el-icon-upload" @click="importFn"
+						v-if="sa.isAuth('tb-person-filing-import')">
+						导入</el-button>
 				</el-form>
 
 				<!-- ------------- 数据列表 ------------- -->
@@ -51,8 +55,8 @@
 					<sa-td name="更新时间" prop="updateTime" width="140"></sa-td>
 					<el-table-column label="操作" fixed="right" width="240px">
 						<template slot-scope="s">
-							<el-button v-if="sa.isAuth('tb-person-filing-judge')&&s.row.judgeState==0" class="c-btn" type="success"
-								@click="judgeFn(s.row)">审核
+							<el-button v-if="sa.isAuth('tb-person-filing-judge')&&s.row.judgeState==0" class="c-btn"
+								type="success" @click="judgeFn(s.row)">审核
 							</el-button>
 							<el-button class="c-btn" type="success" @click="get(s.row)">查看
 							</el-button>
@@ -69,6 +73,31 @@
 				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
 				</sa-item>
 			</div>
+			<el-dialog title="批量导入" :visible.sync="form.visible" width="30%">
+				<el-card class="box-card">
+				  <div slot="header" class="clearfix">
+				    <el-button style="float: right; padding-bottom: 10px" type="text" @click="downTemplate">模板下载</el-button>
+				  </div>
+				<el-upload
+				  class="upload-demo"
+				  ref="importExcel"
+				  :headers="headers"
+				  drag
+				  :auto-upload="false"
+				  accept=".xls,.xlsx"
+				  :on-success="onSuccess"
+				  :action="importUrl"
+				  >
+				  <i class="el-icon-upload"></i>
+				  <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+				  <div class="el-upload__tip" slot="tip">只能上传excel文件</div>
+				</el-upload>
+				</el-card>
+				<span slot="footer" class="dialog-footer">
+					<el-button @click="cancelImport">取 消</el-button>
+					<el-button type="primary" @click="sureImport">确定导入</el-button>
+				</span>
+			</el-dialog>
 		</div>
 		<script>
 			var app = new Vue({
@@ -78,6 +107,15 @@
 				},
 				el: '.vue-box',
 				data: {
+					form: {
+						visible: false,
+						deptId:''
+					},
+					importUrl:sa.cfg.api_url+'/TbPersonFiling/import',
+					headers:{
+						'satoken':sessionStorage.satoken
+					},
+					deptList:[],
 					p: { // 查询参数  
 						id: '', //  
 						judgeState: '', // 部门ID 
@@ -91,6 +129,41 @@
 					dataList: [], // 数据集合 
 				},
 				methods: {
+					importFn() {
+						this.form.visible=true;
+						this.getDeptList()
+					},
+					downTemplate(){
+						window.location.href='../../static/template/'+encodeURIComponent('备案导入模板.xlsx')
+					},
+					cancelImport(){
+						this.$refs.importExcel.clearFiles();
+						this.form.visible=false;
+					},
+					sureImport(){
+						sa.loading('正在上传');
+						this.$refs.importExcel.submit();
+					},
+					onSuccess(resp){
+						sa.hideLoading();
+						if(resp.code!==200){
+							sa.error(resp.msg);
+						}else{
+							sa.alert('导入成功',this.cancelImport());
+							setTimeout(()=>{
+								this.f5();
+							},1000)
+						}
+					},
+					getDeptList() {
+						sa.ajax('/TbDept/getList', {
+							pageNo: 1,
+							pageSize: 100
+						}, function(resp) {
+							let list = resp.data;
+							this.deptList = list;
+						}.bind(this))
+					},
 					judgeFn(data) {
 						sa.showIframe('审核', 'tb-person-filing-judge.html?id=' + data.id, '700px', '70%');
 					},
@@ -155,6 +228,7 @@
 				created: function() {
 					this.f5();
 					sa.onInputEnter();
+					console.log()
 				}
 			})
 		</script>

BIN
static/template/备案导入模板.xlsx