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