测试提交浅水湾项目
This commit is contained in:
parent
3894a61f4d
commit
9e35bf418b
|
@ -3,7 +3,6 @@
|
|||
"version": "1.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "sell",
|
||||
|
|
|
@ -75,4 +75,12 @@ export const UploadPerson = (json) => axios({
|
|||
url: '/Person/UploadPerson',
|
||||
method: 'post',
|
||||
data: json
|
||||
})
|
||||
|
||||
|
||||
// 编辑用户
|
||||
export const UpdatePerosn = (id,json) => axios({
|
||||
url: '/Person/UpdatePerosn/'+id,
|
||||
method: 'put',
|
||||
data: json
|
||||
})
|
|
@ -1,7 +1,6 @@
|
|||
<template lang="html">
|
||||
<div class="product" >
|
||||
<div
|
||||
style="
|
||||
<div class="product">
|
||||
<div style="
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin: auto;
|
||||
|
@ -9,264 +8,301 @@
|
|||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
"
|
||||
>
|
||||
<div style="display: flex; width: 60%; flex-wrap: wrap">
|
||||
<el-select v-model="roles" multiple placeholder="请选择" style="width: 30%;" >
|
||||
<el-option
|
||||
v-for="item in roleList"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button style="margin-left: 10px;" type="primary" @click="search">查询</el-button>
|
||||
</div>
|
||||
|
||||
<div style="flex: 1">
|
||||
<el-button
|
||||
style="float: right;"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="add"
|
||||
>添加人员</el-button
|
||||
>
|
||||
</div>
|
||||
">
|
||||
<div style="display: flex; width: 60%; flex-wrap: wrap">
|
||||
<el-select v-model="roles" multiple placeholder="请选择" style="width: 30%;">
|
||||
<el-option v-for="item in roleList" :key="item" :label="item" :value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button style="margin-left: 10px;" type="primary" @click="search">查询</el-button>
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<div class="stu-table">
|
||||
<el-table
|
||||
:data="list"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
:header-cell-style="getRowClass"
|
||||
style="width: 100%"
|
||||
>
|
||||
|
||||
|
||||
<div style="flex: 1">
|
||||
<el-button style="float: right;" type="primary" icon="el-icon-plus" @click="add">添加人员</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<div class="stu-table">
|
||||
<el-table :data="list" v-loading="loading" stripe :header-cell-style="getRowClass" style="width: 100%">
|
||||
|
||||
<el-table-column prop="fj_Num" align="center" label="户号" :min-width="flexWidth('fj_Num', list, '户号')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" align="center" label="姓名" :min-width="flexWidth('name', list, '姓名')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="phone" align="center" label="手机号" :min-width="flexWidth('phone', list, '手机号')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="role" align="center" label="角色" :min-width="flexWidth('role', list, '角色')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" align="center" label="姓名" :min-width="flexWidth('name', list, '姓名')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="phone" align="center" label="手机号" :min-width="flexWidth('phone', list, '手机号')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="role" align="center" label="角色" :min-width="flexWidth('role', list, '角色')">
|
||||
</el-table-column>
|
||||
<el-table-column prop="isRegister" align="center" label="是否已注册"
|
||||
:min-width="flexWidth('isRegister', list, '是否已注册')">
|
||||
<template slot-scope="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag type="success" size="medium" v-if="scope.row.isRegister">已注册</el-tag>
|
||||
<el-tag type="warning" size="medium" v-if="!scope.row.isRegister">未注册</el-tag>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<el-dialog title="添加人员" :visible.sync="dialogFormVisible" width="30%" :close-on-click-modal="false">
|
||||
<el-form :model="form" :rules="rules" ref="ruleForm">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入姓名" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="phoneNum">
|
||||
<el-input type="text" v-model="form.phoneNum" placeholder="请输入手机号" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="房号" prop="fjNum">
|
||||
<el-select v-model="form.fjNum" placeholder="请选择房号" style="width: 100%;">
|
||||
<el-option :label="a.fj_num" :value="a.fj_num" v-for="(a,i) in fjList"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色" prop="role">
|
||||
<el-select v-model="form.role" placeholder="请选择角色" style="width: 100%;">
|
||||
<el-option label="业主" value="业主"></el-option>
|
||||
<el-option label="户主" value="户主"></el-option>
|
||||
<el-option label="保姆" value="保姆"></el-option>
|
||||
<el-option label="司机" value="司机"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="370" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="primary" plain icon="el-icon-s-tools"
|
||||
@click.native.stop="edit(scope.row)">编辑</el-button>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import { AddPerson,GetPersons } from "../../../api/index.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list:[],
|
||||
roleList:['户主','业主','司机','保姆'],
|
||||
roles:[],
|
||||
personIdList:[],
|
||||
dialogFormVisible:false,
|
||||
loading:false,
|
||||
companyId:"",
|
||||
staticJson:{title:"",list:[]},
|
||||
fjList:[],
|
||||
form:{
|
||||
name:"",
|
||||
phoneNum:"",
|
||||
fjNum:"",
|
||||
role:"",
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入姓名', trigger: 'blur' },
|
||||
],
|
||||
phoneNum: [
|
||||
{ required: true, message: '请输入手机号', trigger: 'blur' }
|
||||
],
|
||||
fjNum: [
|
||||
{ required: true, message: '请选择房号', trigger: 'change' }
|
||||
],
|
||||
role: [
|
||||
{ required: true, message: '请选择角色', trigger: 'change' }
|
||||
],
|
||||
|
||||
<el-dialog title="添加/编辑人员" :visible.sync="dialogFormVisible" width="30%" :close-on-click-modal="false">
|
||||
<el-form :model="form" :rules="rules" ref="ruleForm">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="phoneNum">
|
||||
<el-input type="text" v-model="form.phoneNum" :disabled="form.isRegister" placeholder="请输入手机号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="房号" prop="fjNum">
|
||||
<el-select v-model="form.fjNum" placeholder="请选择房号" style="width: 100%;">
|
||||
<el-option :label="a.fj_num" :value="a.fj_num" v-for="(a,i) in fjList"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色" prop="role">
|
||||
<el-select v-model="form.role" placeholder="请选择角色" style="width: 100%;">
|
||||
<el-option label="业主" value="业主"></el-option>
|
||||
<el-option label="户主" value="户主"></el-option>
|
||||
<el-option label="保姆" value="保姆"></el-option>
|
||||
<el-option label="司机" value="司机"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import { AddPerson, GetPersons, UpdatePerosn } from "../../../api/index.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
roleList: ['户主', '业主', '司机', '保姆'],
|
||||
roles: [],
|
||||
personIdList: [],
|
||||
dialogFormVisible: false,
|
||||
loading: false,
|
||||
companyId: "",
|
||||
staticJson: { title: "", list: [] },
|
||||
fjList: [],
|
||||
form: {
|
||||
name: "",
|
||||
phoneNum: "",
|
||||
fjNum: "",
|
||||
role: "",
|
||||
personId: "",
|
||||
isRegister: false,
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入姓名', trigger: 'blur' },
|
||||
],
|
||||
phoneNum: [
|
||||
{ required: true, message: '请输入手机号', trigger: 'blur' }
|
||||
],
|
||||
fjNum: [
|
||||
{ required: true, message: '请选择房号', trigger: 'change' }
|
||||
],
|
||||
role: [
|
||||
{ required: true, message: '请选择角色', trigger: 'change' }
|
||||
],
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
components: {
|
||||
}
|
||||
},
|
||||
activated() {
|
||||
|
||||
|
||||
components: {
|
||||
},
|
||||
activated() {
|
||||
|
||||
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.url = this.$store.state.url;
|
||||
this.getPerons();
|
||||
this.getFj();
|
||||
},
|
||||
methods: {
|
||||
edit(row) {
|
||||
this.form = { name: row.name, phoneNum: row.phone, fjNum: row.fj_Num, role: row.role, personId: row.id, isRegister: row.isRegister };
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.url = this.$store.state.url;
|
||||
add() {
|
||||
this.form = {
|
||||
name: "",
|
||||
phoneNum: "",
|
||||
fjNum: "",
|
||||
role: "",
|
||||
personId: "",
|
||||
isRegister: false,
|
||||
};
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
search() {
|
||||
this.getPerons();
|
||||
this.getFj();
|
||||
},
|
||||
methods: {
|
||||
add(){
|
||||
this.form={
|
||||
name:"",
|
||||
phoneNum:"",
|
||||
fjNum:"",
|
||||
role:"",
|
||||
};
|
||||
this.dialogFormVisible=true;
|
||||
},
|
||||
search(){
|
||||
this.getPerons();
|
||||
},
|
||||
roleChange(){
|
||||
this.getPerons();
|
||||
},
|
||||
getFj(){
|
||||
axios
|
||||
.get(this.url + "/Person/GetFjs",)
|
||||
.then((res) => {
|
||||
let result = res.data;
|
||||
if(result.code==0){
|
||||
this.fjList = result.data;
|
||||
} else{
|
||||
this.$message.error(result.msg);
|
||||
}
|
||||
})
|
||||
.catch((error) => {});
|
||||
},
|
||||
getPerons(){
|
||||
let str = "";
|
||||
this.roles.forEach((e,i) => {
|
||||
if(i==0){
|
||||
str += "?roles="+e
|
||||
} else{
|
||||
str += "&roles="+e
|
||||
}
|
||||
});
|
||||
GetPersons(str).then((res) => {
|
||||
roleChange() {
|
||||
this.getPerons();
|
||||
},
|
||||
getFj() {
|
||||
axios
|
||||
.get(this.url + "/Person/GetFjs",)
|
||||
.then((res) => {
|
||||
let result = res.data;
|
||||
if(result.code==0){
|
||||
this.list = result.data;
|
||||
} else{
|
||||
if (result.code == 0) {
|
||||
this.fjList = result.data;
|
||||
} else {
|
||||
this.$message.error(result.msg);
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val){
|
||||
this.personIdList = val.map(e => e.id);
|
||||
},
|
||||
|
||||
|
||||
getRowClass({ row, column, rowIndex, columnIndex }) {
|
||||
.catch((error) => { });
|
||||
},
|
||||
getPerons() {
|
||||
let str = "";
|
||||
this.roles.forEach((e, i) => {
|
||||
if (i == 0) {
|
||||
str += "?roles=" + e
|
||||
} else {
|
||||
str += "&roles=" + e
|
||||
}
|
||||
});
|
||||
axios
|
||||
.get(this.url + "/Person/GetPersons" + str,)
|
||||
.then((res) => {
|
||||
let result = res.data;
|
||||
if (result.code == 0) {
|
||||
this.list = result.data;
|
||||
} else {
|
||||
this.$message.error(result.msg);
|
||||
}
|
||||
})
|
||||
.catch((error) => { });
|
||||
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.personIdList = val.map(e => e.id);
|
||||
},
|
||||
|
||||
|
||||
getRowClass({ row, column, rowIndex, columnIndex }) {
|
||||
if (rowIndex == 0) {
|
||||
return "background:#fafafa ";
|
||||
}
|
||||
},
|
||||
|
||||
submit(){
|
||||
this.$refs['ruleForm'].validate((valid) => {
|
||||
if(valid){
|
||||
const reg = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
|
||||
if (!reg.test(this.form.phoneNum)) {
|
||||
this.$toast.fail("请输入正确的手机号码");
|
||||
return;
|
||||
}
|
||||
AddPerson(this.form).then((res) => {
|
||||
let result = res.data;
|
||||
if(result.code==0){
|
||||
this.getPerons();
|
||||
this.dialogFormVisible =false;
|
||||
this.$message.success('添加成功');
|
||||
} else{
|
||||
this.$message.error(result.msg);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
submit() {
|
||||
this.$refs['ruleForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
|
||||
if (this.form.personId) {
|
||||
console.log(this.form)
|
||||
UpdatePerosn(this.form.personId, this.form).then((res) => {
|
||||
let result = res.data;
|
||||
if (result.code == 0) {
|
||||
this.getPerons();
|
||||
this.dialogFormVisible = false;
|
||||
this.$message.success('更新成功');
|
||||
} else {
|
||||
this.$message.error(result.msg);
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
})
|
||||
} else {
|
||||
console.log(this.form)
|
||||
const reg = /^1[3|4|5|6|7|8|9][0-9]git pull\d{8}$/;
|
||||
if (!reg.test(this.form.phoneNum)) {
|
||||
this.$toast.fail("请输入正确的手机号码");
|
||||
return;
|
||||
}
|
||||
AddPerson(this.form).then((res) => {
|
||||
let result = res.data;
|
||||
if (result.code == 0) {
|
||||
this.getPerons();
|
||||
this.dialogFormVisible = false;
|
||||
this.$message.success('添加成功');
|
||||
} else {
|
||||
this.$message.error(result.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
input::-webkit-outer-spin-button,
|
||||
input::-webkit-inner-spin-button{
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
input::-webkit-outer-spin-button,
|
||||
input::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none !important;
|
||||
margin: 0;
|
||||
}
|
||||
.product{
|
||||
}
|
||||
|
||||
.product {
|
||||
width: 96%;
|
||||
height: auto;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.el-form-item__content {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.search {
|
||||
line-height: 60px;
|
||||
text-align: left;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.select-class {
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.stu-table .btn {
|
||||
width: 65px;
|
||||
height: 25px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.el-table tr {
|
||||
background: #081832;
|
||||
color: #fff;
|
||||
}
|
||||
.el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
|
||||
|
||||
.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell {
|
||||
background: rgb(36, 148, 215);
|
||||
color: #fff;
|
||||
}
|
||||
.el-table__body tr.current-row > td.el-table__cell {
|
||||
|
||||
.el-table__body tr.current-row>td.el-table__cell {
|
||||
background: rgb(4, 75, 137);
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
</style>
|
|
@ -56,7 +56,7 @@
|
|||
|
||||
</el-table>
|
||||
</div>
|
||||
<el-dialog title="已注册公众号人员" :visible.sync="dialogTableVisible">
|
||||
<el-dialog title="已注册且未提交问卷的公众号人员" :visible.sync="dialogTableVisible">
|
||||
<div style="width:100%;height:60px;display: flex;align-items: center;">
|
||||
<el-select v-model="roles" multiple placeholder="请选择" style="width: 30%;" @change="roleChange">
|
||||
<el-option v-for="item in roleList" :key="item" :label="item" :value="item">
|
||||
|
@ -66,7 +66,7 @@
|
|||
<el-table :data="gridData" ref="multipleTable" tooltip-effect="dark" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column prop="name" label="姓名"></el-table-column>
|
||||
<el-table-column prop="telphone" label="联系方式"></el-table-column>
|
||||
<el-table-column prop="phone" label="联系方式"></el-table-column>
|
||||
<el-table-column prop="role" label="角色"></el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
|
@ -123,9 +123,9 @@
|
|||
</el-dialog>
|
||||
<el-dialog title="投票明细" :visible.sync="dialogTpTableVisible" width="80%" :close-on-click-modal="false">
|
||||
<table-view ref="table" :datalist="tpmxList" :page="{}" :key="loadTable" width="100%"
|
||||
:propList="[{label:'房号',prop:'fj_Num'},{label:'姓名',prop:'name'},{label:'角色',prop:'role'},{label:'读取/提交时间',prop:'time'}]" :slots="[]"
|
||||
:propList="propList" :slots="[]"
|
||||
:isPage="false">
|
||||
|
||||
|
||||
|
||||
</table-view>
|
||||
</el-dialog>
|
||||
|
@ -140,6 +140,7 @@
|
|||
data() {
|
||||
return {
|
||||
loadTable: 0,
|
||||
propList:[],
|
||||
option: {
|
||||
title: {
|
||||
text: 'Referer of a Website',
|
||||
|
@ -250,7 +251,14 @@
|
|||
methods: {
|
||||
getTpMx(type) {
|
||||
this.submitState = true;
|
||||
console.log(111)
|
||||
if(type=='已读'){
|
||||
this.propList = [{label:'房号',prop:'fj_Num'},{label:'姓名',prop:'name'},{label:'角色',prop:'role'},{label:'读取时间',prop:'readTime'}];
|
||||
}
|
||||
else if(type=='已提交'){
|
||||
this.propList = [{label:'房号',prop:'fj_Num'},{label:'姓名',prop:'name'},{label:'角色',prop:'role'},{label:'提交时间',prop:'fillInTime'}];
|
||||
} else{
|
||||
this.propList = [{label:'房号',prop:'fj_Num'},{label:'姓名',prop:'name'},{label:'角色',prop:'role'}];
|
||||
}
|
||||
axios
|
||||
.get(this.url + "/Questionnaire/GetQuestionnaireSendTotalDetail/" + this.templateId, {params:{type:type}})
|
||||
.then((res) => {
|
||||
|
@ -272,14 +280,10 @@
|
|||
getPerons() {
|
||||
let str = "";
|
||||
this.roles.forEach((e, i) => {
|
||||
if (i == 0) {
|
||||
str += "?roles=" + e
|
||||
} else {
|
||||
str += "&roles=" + e
|
||||
}
|
||||
str += "&roles=" + e
|
||||
});
|
||||
axios
|
||||
.get(this.url + "/Person/GetPersons" + str,)
|
||||
.get(this.url + "/Person/GetPersons?isRegister=true&isFillIn=false&questionnaireId="+this.templateId+str,)
|
||||
.then((res) => {
|
||||
let result = res.data;
|
||||
if (result.code == 0) {
|
||||
|
|
Loading…
Reference in New Issue