Commit a009a81a by 董有沛

合伙人修改和新增活动管理

parent 0542a66c
...@@ -11,6 +11,18 @@ let modify = (params) => postAction(prefix + "/school/partner/update" , params); ...@@ -11,6 +11,18 @@ let modify = (params) => postAction(prefix + "/school/partner/update" , params);
// 编辑 // 编辑
let getlistysm = (params) => postAction(prefix + "/ysmUser/getlist" , params); let getlistysm = (params) => postAction(prefix + "/ysmUser/getlist" , params);
// 新增用户
let addPartner = (params) => postAction(prefix + "/school/partner/addPartner" , params);
// 获取县分下拉列表
let getSubstList = (params) => postAction(prefix + "/school/schoolManagement/substList" , params);
// 获取县分下拉列表
let getSchoolList = (params) => postAction(prefix + "/school/schoolManagement/schoolList" , params);
// 获取学子公司职位下级成员列表
let getXzUserList = (params) => postAction(prefix + "/school/partner/getXzUserList" , params);
export { export {
findByList,modify,getlistysm findByList,modify,getlistysm,addPartner,getSubstList,getSchoolList,getXzUserList
} }
import {postAction,getAotion} from '@/api/manage'
const prefix = '/manager/ciop';
// 获取活动列表
let getList = (params) => postAction(prefix + "/activity/list" , params);
//新增
let addActivity = (params) => postAction(prefix + "/activity/addActivity" , params);
// 编辑
let updateActivity = (params) => postAction(prefix + "/activity/updateActivity" , params);
//新增
let deleteActivity = (params) => postAction(prefix + "/activity/deleteActivity" , params);
export {
getList,addActivity,updateActivity,deleteActivity
}
...@@ -4,7 +4,7 @@ const prefix = '/manager/ciop'; ...@@ -4,7 +4,7 @@ const prefix = '/manager/ciop';
// 获取活动列表 // 获取活动列表
let findByList = (params) => postAction(prefix + "/school/schoolManagement/findByList" , params); let findByList = (params) => postAction(prefix + "/school/schoolManagement/findByList" , params);
// 回显选择的套餐 // 回显选择的套餐findByList
let choosepages = (params) => postAction(prefix + "/school/schoolManagement/choosepages" , params); let choosepages = (params) => postAction(prefix + "/school/schoolManagement/choosepages" , params);
// 编辑 // 编辑
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<span class="table-page-search-submitButtons" style="float: left; overflow: hidden;"> <span class="table-page-search-submitButtons" style="float: left; overflow: hidden;">
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-button @click="search()" type="primary">查询</a-button> <a-button @click="search()" type="primary">查询</a-button>
<a-button @click="openAddUser()" style="margin-left: 8px" icon="plus" type="primary">新增</a-button>
</a-col> </a-col>
</span> </span>
</a-row> </a-row>
...@@ -39,35 +40,163 @@ ...@@ -39,35 +40,163 @@
</template> </template>
</s-table> </s-table>
<!--新增用户--弹框-->
<a-modal :title="titleName" :visible="addUser" @ok="createOk" @cancel="createCancel" html-type="submit" width="720px">
<a-form :form="addFormtable" autocomplete="off">
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="账号" >
<a-input placeholder="请输入账号" v-decorator="[ 'account', {rules: [{ required: true, message: '账号不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="电话" >
<a-input placeholder="请输入电话" v-decorator="[ 'phone', {rules: [{ required: true, message: '电话不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="姓名" >
<a-input placeholder="请输入姓名" v-decorator="[ 'name', {rules: [{ required: true, message: '姓名不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="身份证号" >
<a-input placeholder="请输入身份证号" v-decorator="[ 'idCard', {rules: [{ required: true, message: '身份证号不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="性别">
<a-select placeholder="请选择" v-decorator="[ 'sex', {rules: [{ required: true, message: '性别不能为空!' ,whitespace:true}]} ]">
<a-select-option key="">请选择</a-select-option>
<a-select-option key="1"></a-select-option>
<a-select-option key="2"></a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="年级">
<a-select placeholder="请选择" v-decorator="[ 'grade', {rules: [{ required: true, message: '年级不能为空!' ,whitespace:true}]} ]">
<a-select-option key="">请选择</a-select-option>
<a-select-option key="20级">20级</a-select-option>
<a-select-option key="19级">19级</a-select-option>
<a-select-option key="18级">18级</a-select-option>
<a-select-option key="17级">17级</a-select-option>
<a-select-option key="16级">16级</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="密码">
<a-input placeholder="请输入密码" type="password" v-decorator="[ 'password', {rules: [{ required: true, message: '密码不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="重复密码">
<a-input placeholder="请再次输入密码" type="password" v-decorator="[ 'repassword', {rules: [{ required: true, message: '重复密码不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="县分">
<a-select placeholder="请选择" @change="changeSubst(1)" v-model="addForm.subName" >
<a-select-option key="">请选择</a-select-option>
<a-select-option v-for="data in subNameList" :value="data">
{{ data}}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="学校名称">
<a-select placeholder="请选择" v-decorator="[ 'schoolId', {rules: [{ required: true, type: 'number',message: '学校不能为空!' ,whitespace:true}]} ]">
<a-select-option key="">请选择</a-select-option>
<a-select-option v-for="data in schoolList" :value="data.id">
{{ data.school_name}}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="学子公司职位">
<a-select placeholder="请选择" v-model="addForm.position" @change="changePosition(1)">
<a-select-option key="">非学子公司成员</a-select-option>
<a-select-option key="督导">督导</a-select-option>
<a-select-option key="楼长">楼长</a-select-option>
<a-select-option key="成员">成员</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :style="leaderDisplay" :wrapperCol="{span: 8, offset: 1}" label="学子公司上级">
<a-select placeholder="请选择" v-decorator="[ 'parentId', {rules: [{ required: false, message: '学子公司上级不能为空!' ,whitespace:true}]} ]">
<a-select-option key="">请选择</a-select-option>
<a-select-option v-for="data in xzUserList" :value="data.id">
{{ data.name}}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="角色" >
<!-- <a-input placeholder="请输入部门" v-model="modelData.content" @click="handelDepartment"></a-input> -->
<treecheck ref="tree1" @selectcheck="contentSelectCheck1" :treeCheckable="true" :createFun="userRoleTreeList"></treecheck>
</a-form-item>
</a-form>
</a-modal>
<!--编辑----弹框--> <!--编辑----弹框-->
<a-modal :title="titleName" :visible="modifyvisible" @ok="createfunctionOk" @cancel="createfunctionCancel" html-type="submit" width="720px"> <a-modal :title="titleName" :visible="modifyvisible" @ok="createfunctionOk" @cancel="createfunctionCancel" html-type="submit" width="720px">
<a-form :form="Formtable"> <a-form :form="Formtable">
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="合伙人电话号码"> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="电话号码">
<a-input placeholder="合伙人电话号码" v-decorator="[ 'phoneNum', {rules: [{ required: true, message: '合伙人电话号码不能为空!' ,whitespace:true}]} ]"></a-input> <a-input placeholder="电话号码" v-decorator="[ 'phone', {rules: [{ required: true, message: '电话号码不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="学校"> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="账号">
<a-input placeholder="学校" v-decorator="[ 'school', {rules: [{ required: true, message: '学校名不能为空!' ,whitespace:true}]} ]"></a-input> <a-input placeholder="账号" v-decorator="[ 'account', {rules: [{ required: true, message: '账号不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="合伙人姓名"> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="姓名">
<a-input placeholder="合伙人姓名" v-decorator="[ 'name', {rules: [{ required: true, message: '合伙人姓名不能为空!' ,whitespace:true}]} ]"></a-input> <a-input placeholder="姓名" v-decorator="[ 'name', {rules: [{ required: true, message: '姓名不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="合伙人账号"> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="身份证">
<a-input placeholder="合伙人账号" v-decorator="[ 'account', {rules: [{ required: true, message: '合伙人账号不能为空!' ,whitespace:true}]} ]"></a-input> <a-input placeholder="身份证" v-decorator="[ 'idCard', {rules: [{ required: true, message: '身份证不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="合伙人身份证">
<a-input placeholder="合伙人身份证" v-decorator="[ 'idCard', {rules: [{ required: true, message: '合伙人身份证不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="性别"> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="性别">
<a-radio-group v-decorator="['gender', {rules: [{ required: true, message: '合伙人身份证不能为空!' ,whitespace:true}]} ]" > <a-radio-group v-decorator="['sex', {rules: [{ required: true, message: '性别不能为空!' ,whitespace:true}]} ]" >
<a-radio value="1"></a-radio> <a-radio value="1"></a-radio>
<a-radio value="2"></a-radio> <a-radio value="2"></a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="县分"> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="年级">
<a-input placeholder="县分" v-decorator="[ 'area', {rules: [{ required: true, message: '县分不能为空!' ,whitespace:true}]} ]"></a-input> <a-select placeholder="请选择" v-decorator="[ 'grade', {rules: [{ required: true, message: '年级不能为空!' ,whitespace:true}]} ]">
<a-select-option key="">请选择</a-select-option>
<a-select-option key="20级">20级</a-select-option>
<a-select-option key="19级">19级</a-select-option>
<a-select-option key="18级">18级</a-select-option>
<a-select-option key="17级">17级</a-select-option>
<a-select-option key="16级">16级</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="县分">
<a-select placeholder="请选择" @change="changeSubst(2)" v-model="modifyForm.subName" >
<a-select-option key="">请选择</a-select-option>
<a-select-option v-for="data in subNameList" :value="data">
{{ data}}
</a-select-option>
</a-select>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="合伙人对应的微信账号">
<a-input placeholder="合伙人对应的微信账号" v-decorator="[ 'wxId' ]"></a-input> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="学校名称">
<a-select placeholder="请选择" v-model="modifyForm.schoolId">
<a-select-option key="">请选择</a-select-option>
<a-select-option v-for="data in schoolList" :value="data.id">
{{ data.school_name}}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="学子公司职位">
<a-select placeholder="请选择" v-model="modifyForm.position" @change="changePosition(2)">
<a-select-option key="">非学子公司成员</a-select-option>
<a-select-option key="督导">督导</a-select-option>
<a-select-option key="楼长">楼长</a-select-option>
<a-select-option key="成员">成员</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :style="leaderDisplay" :wrapperCol="{span: 8, offset: 1}" label="学子公司上级">
<a-select placeholder="请选择" v-model="modifyForm.parentId">
<a-select-option key="">请选择</a-select-option>
<a-select-option v-for="data in xzUserList" :value="data.id">
{{ data.name}}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="角色" >
<!-- <a-input placeholder="请输入部门" v-model="modelData.content" @click="handelDepartment"></a-input> -->
<treecheck ref="tree2" @selectcheck="contentSelectCheck2" :treeCheckable="true" :createFun="userRoleTreeList"></treecheck>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 12, offset: 1}" label="通过预实名账号"> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 12, offset: 1}" label="通过预实名账号">
<a-radio-group v-decorator="['ysm']" > <a-radio-group v-decorator="['ysm']" >
...@@ -82,45 +211,92 @@ ...@@ -82,45 +211,92 @@
<script> <script>
import STable from '@/components/table'; import STable from '@/components/table';
import {findByList,modify,getlistysm} from "@/api/school-center/PartnerManagementAPI" import {
import {cloneObject} from '@/utils/util'; findByList,modify,getlistysm,
addPartner,getSubstList,getSchoolList,getXzUserList
} from "@/api/school-center/PartnerManagementAPI"
import {cloneObject} from '@/utils/util'
import treecheck from '@/components/sysmanage/treeCheck'
import treeList from '@/components/sysmanage/treeList'
import {
getList,
tabList,
getUserInfo,
deleteList,
resetPass,
getAddUser,
userRoleTreeList,
getEditUser,
userFreeze,
userUnFreeze,
changeOtherPwd
} from '@/api/system';
export default { export default {
name: "PartnerManagement", name: "PartnerManagement",
components: { components: {
STable, STable,
treeList,
treecheck,
}, },
data: function () { data: function () {
return { return {
emptyText: {emptyText: '暂无数据'}, emptyText: {emptyText: '暂无数据'},
Formtable: this.$form.createForm(this, {name: 'Formtable'}), Formtable: this.$form.createForm(this, {name: 'Formtable'}),
addFormtable: this.$form.createForm(this, {name: 'addFormtable'}),
queryParam: { queryParam: {
name: '', name: '',
area:'', area:'',
school:'' school:''
}, },
addForm: {
account: '',
phone:'',
name:'',
idCard: '',
sex: '',
grade: '',
password: '',
repassword: '',
subName: '',
substName: '',
schoolId: '',
roleId: '',
position:'',
parentId:'',
parentIds:'',
},
leaderDisplay:'display:none',
modifyvisible:false, modifyvisible:false,
modifyForm: { modifyForm: {
id:"", id:"",
phoneNum: '', phone: '',
school:'', school:'',
name: '', name: '',
account: '', account: '',
idCard: '', idCard: '',
gender: '', sex: '',
grade: '',
area: '', area: '',
wxId: '',
ysm: '', ysm: '',
schoolId: '',
roleId: '',
position:'',
parentId:'',
}, },
autoCompleteResult:[], autoCompleteResult:[],
subNameList: [],
schoolList:[],
xzUserList:[],
addSubName:'',
columns: [ columns: [
{dataIndex: 'name', width: 100, title: '姓名 ', align: "center"}, {dataIndex: 'name', width: 100, title: '姓名 ', align: "center"},
{dataIndex: 'phoneNum', width: 200, title: '电话', align: "center"}, {dataIndex: 'phone', width: 200, title: '电话', align: "center"},
{dataIndex: 'school', width: 200, title: '学校 ', align: "center"}, {dataIndex: 'school', width: 200, title: '学校 ', align: "center"},
{dataIndex: 'idCard', width: 200, title: '身份证 ', align: "center"}, {dataIndex: 'idCard', width: 200, title: '身份证 ', align: "center"},
{dataIndex: 'account', width: 200, title: '账号 ', align: "center"}, {dataIndex: 'account', width: 200, title: '账号 ', align: "center"},
{dataIndex: 'gender', width: 100, title: '性别 ', align: "center",scopedSlots: {customRender: 'genderoperation'},}, {dataIndex: 'sex', width: 100, title: '性别 ', align: "center",scopedSlots: {customRender: 'genderoperation'},},
{dataIndex: 'area', width: 100, title: '县分 ', align: "center"}, {dataIndex: 'area', width: 100, title: '县分 ', align: "center"},
{dataIndex: 'wxId', width: 100, title: '微信 ', align: "center"},
{ {
dataIndex: 'operation', dataIndex: 'operation',
width: 100, width: 100,
...@@ -135,8 +311,18 @@ ...@@ -135,8 +311,18 @@
pageNo: parameter.pageNo, pageNo: parameter.pageNo,
pageSize: parameter.pageSize pageSize: parameter.pageSize
} }
//表示 //表示
let obj = cloneObject(this.queryParam) let obj = cloneObject(this.queryParam)
// 获取县分下拉清单
getSubstList(Object.assign(params,obj)).then(res => {
if (res.state == 'success') {
res.data.forEach((key)=>{
this.subNameList.push(key.sub_name)
})
}
})
return findByList(Object.assign(params,obj)).then(res => { return findByList(Object.assign(params,obj)).then(res => {
let data = {} let data = {}
if (res.state !== 'success') { if (res.state !== 'success') {
...@@ -158,7 +344,11 @@ ...@@ -158,7 +344,11 @@
} }
return data return data
}) })
} },
keyRecord: '',
recordId: '',
addUser: false,
userRoleTreeList:userRoleTreeList,
} }
}, },
methods:{ methods:{
...@@ -171,16 +361,23 @@ ...@@ -171,16 +361,23 @@
this.modifyvisible = true this.modifyvisible = true
setTimeout(() => { setTimeout(() => {
this.Formtable.setFieldsValue({ this.Formtable.setFieldsValue({
phoneNum: data.phoneNum, phone: data.phone,
school: data.school, schoolId: data.schoolId,
name: data.name, name: data.name,
account: data.account, account: data.account,
idCard: data.idCard, idCard: data.idCard,
gender: data.gender, sex: 2,
area: data.area, grade: '18级',
wxId: data.wxId,
ysm: data.ysm, ysm: data.ysm,
}) })
this.modifyForm.subName = data.area;
this.modifyForm.roleId = data.roleid;
this.modifyForm.position = data.position;
this.recordId = data.parentId;
this.changeSchool(data.schoolId);
this.changePosition(2);
this.$refs.tree2.setValue2(data.roleid);
}, 0) }, 0)
getlistysm().then(res => { getlistysm().then(res => {
if (res.state == "success") { if (res.state == "success") {
...@@ -190,22 +387,35 @@ ...@@ -190,22 +387,35 @@
}, },
//提交表单 //提交表单
createfunctionOk(){ createfunctionOk(){
this.Formtable.validateFields(['school', 'name',"account","idCard", 'gender',"area", 'wxId',"ysm" ,'phoneNum'], {force: true}, (err, values)=>{ this.Formtable.validateFields(["account",'phone','name',"idCard", 'sex','schoolId', 'roleid','ysm'], {force: true}, (err, values)=>{
if (!err){ if (!err){
this.modifyForm.school=values.school
this.modifyForm.name=values.name
this.modifyForm.account=values.account this.modifyForm.account=values.account
this.modifyForm.phone=values.phone
this.modifyForm.name=values.name
this.modifyForm.idCard=values.idCard this.modifyForm.idCard=values.idCard
this.modifyForm.gender=values.gender this.modifyForm.sex=values.sex
this.modifyForm.area=values.area
this.modifyForm.wxId=values.wxId
this.modifyForm.ysm=values.ysm this.modifyForm.ysm=values.ysm
this.modifyForm.phoneNum=values.phoneNum
if(this.modifyForm.idCard.length != 18){
this.$message.error( '身份证不合法', 5);
return null;
}
if(this.modifyForm.roleId == null || this.modifyForm.roleId == ''){
this.$message.error( '角色不能为空', 5);
return null;
}
if(this.modifyForm.roleId.substring(0,2) == '0,'){
// 剔除 '0,'
this.addForm.roleId = this.addForm.roleId.substring(2);
}
//修改数据 //修改数据
modify(this.modifyForm).then(res=>{ modify(this.modifyForm).then(res=>{
if (res.state=="success") { if (res.state=="success") {
this.$message.success(res.data ? res.data : '修改成功!', 5); this.$message.success(res.data ? res.data : '修改成功!', 5);
this.search(); this.search();
this.modifyvisible = false;
return null; return null;
} }
this.$message.error(res.data ? res.data : '修改失败!', 5); this.$message.error(res.data ? res.data : '修改失败!', 5);
...@@ -218,17 +428,260 @@ ...@@ -218,17 +428,260 @@
this.modifyvisible=false this.modifyvisible=false
this.autoCompleteResult=[] this.autoCompleteResult=[]
this.Formtable.setFieldsValue({ this.Formtable.setFieldsValue({
phoneNum: '', account: '',
school:'', phone: '',
name: '', name: '',
idCard: '',
sex: '',
grade: '',
password: '',
repassword: '',
schoolId: '',
parentId: '',
ysm: '',
})
this.addForm.subName = '';
this.addForm.position = '';
this.addForm.parentIds = '';
},
openAddUser() {
this.titleName = "新增"
this.addUser = true;
this.addFormtable.setFieldsValue({
account: '', account: '',
phone: '',
name: '',
idCard: '', idCard: '',
gender: '', sex: '',
area: '', grade: '',
wxId: '', password: '',
repassword: '',
schoolId: '',
parentId: '',
ysm: '', ysm: '',
}) })
}
this.addForm.subName = '';
this.addForm.position = '';
this.addForm.parentIds = '';
},
createOk(){
this.addFormtable.validateFields(["account", 'phone', "name", "idCard", "sex", 'grade',"password", 'repassword','schoolId','role','position','parentId'], {force: true}, (err, values)=>{
if (!err){
this.addForm.account=values.account
this.addForm.phone=values.phone
this.addForm.name=values.name
this.addForm.idCard=values.idCard
this.addForm.sex=values.sex
this.addForm.grade=values.grade
this.addForm.password=values.password
this.addForm.repassword=values.repassword
this.addForm.schoolId=values.schoolId
this.addForm.postion=values.position
this.addForm.parentId=values.parentId
this.addForm.substName=""
if(this.addForm.idCard.length != 18){
this.$message.error( '身份证不合法', 5);
return null;
}
if(this.addForm.password.length != 8){
this.$message.error( '密码长度不对', 5);
return null;
}
if(this.addForm.password != this.addForm.repassword){
this.$message.error( '两次密码必须一致', 5);
return null;
}
if(this.addForm.roleId == null || this.addForm.roleId == ''){
this.$message.error( '角色不能为空', 5);
return null;
}
if(this.addForm.parentId == undefined){
this.addForm.parentId = ''
this.addForm.parentIds = ''
}else{
this.xzUserList.forEach((key) => {
if(this.addForm.parentId == key.id){
if(this.addForm.position == '楼长'){
this.addForm.parentIds = key.id + ',';
}else{
this.addForm.parentIds = key.parentIds + key.id + ',';
}
}
})
}
if(this.addForm.roleId.substring(0,2) == '0,'){
// 剔除 '0,'
this.addForm.roleId = this.addForm.roleId.substring(2);
}
//修改数据
addPartner(this.addForm).then(res=>{
if (res.state=="success") {
this.$message.success(res.data ? res.data : '修改成功!', 5);
this.search();
this.addUser = false;
return null;
}
this.$message.error(res.data ? res.data : '修改失败!', 5);
})
}
})
},
createCancel(){
this.addUser=false;
this.addFormtable.setFieldsValue({
account: '',
phone: '',
name: '',
idCard: '',
sex: '',
grade: '',
password: '',
repassword: '',
schoolId: '',
parentId: '',
ysm: '',
})
this.addForm.subName = '';
this.addForm.position = '';
this.addForm.parentIds = '';
},
contentSelectCheck1(data){
let list = data.list;
let textlist = new Array();
let pObj = {};
list.forEach(element => {
/*if(element.plist){
element.plist.forEach(item2 =>{
textlist.push(item2);
})
}*/
if(element !== undefined){
if(!pObj[element.pId]){
pObj[element.pId] = {len:element.plen,list:[element.id]}
}else{
pObj[element.pId].list.push(element.id)
}
}
//textlist.push(element.id);
});
for (let name in pObj) {
if(pObj[name].len === pObj[name].list.length){
textlist.push(name)
textlist = [...textlist,...pObj[name].list];
}else{
textlist = [...textlist,...pObj[name].list];
}
}
this.addForm.roleId = textlist.join(",");
},
contentSelectCheck2(data){
let list = data.list;
let textlist = new Array();
let pObj = {};
list.forEach(element => {
/*if(element.plist){
element.plist.forEach(item2 =>{
textlist.push(item2);
})
}*/
if(!pObj[element.pId]){
pObj[element.pId] = {len:element.plen,list:[element.id]}
}else{
pObj[element.pId].list.push(element.id)
}
//textlist.push(element.id);
});
for (let name in pObj) {
if(pObj[name].len === pObj[name].list.length){
textlist.push(name)
textlist = [...textlist,...pObj[name].list];
}else{
textlist = [...textlist,...pObj[name].list];
}
}
this.modifyForm.roleId = textlist.join(",");
},
changeSubst(type){
let schoolParams = {};
if(type == 1){
schoolParams.subName = this.addForm.subName;
}else{
schoolParams.subName = this.modifyForm.subName;
}
this.schoolList = [];
getSchoolList(schoolParams).then(res => {
if (res.state == 'success') {
res.data.forEach((key) => {
this.schoolList.push(key)
})
}
})
},
changeSchool(schoolId){
let schoolParams = {};
schoolParams.subName = this.modifyForm.subName;
this.schoolList = [];
getSchoolList(schoolParams).then(res => {
if (res.state == 'success') {
res.data.forEach((key) => {
this.schoolList.push(key)
})
this.modifyForm.schoolId = schoolId;
}
})
},
changePosition(type){
let params = {};
if(type == 1){
params.position = this.addForm.position;
}else{
params.position = this.modifyForm.position;
}
this.addForm.parentIds = '';
if(params.position != '' && params.position != '督导'){
this.leaderDisplay = '';
if(params.position == '楼长'){
params.position = '督导'
}else{
params.position = '楼长'
}
this.xzUserList = [];
getXzUserList(params).then(res => {
if (res.state == 'success') {
this.keyRecord = ''
res.data.forEach((key) => {
this.xzUserList.push(key)
})
if(type == 1){
this.addForm.parentId = '';
}else{
if(this.recordId != ''){
this.modifyForm.parentId = this.recordId;
}
}
}
})
}else {
this.leaderDisplay = 'display:none';
this.addForm.parentId = '';
this.modifyForm.parentId = '';
}
},
} }
} }
</script> </script>
......
<template>
<div class="flex-container">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline">
<a-row :gutter="24">
<a-col :md="4" :sm="12">
<a-form-item label="活动标题:">
<a-input placeholder="活动标题" v-model="queryParam.title"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="12">
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}" label="活动类型">
<a-select placeholder="请选择" v-model="queryParam.activityType">
<a-select-option key="">请选择</a-select-option>
<a-select-option key="1">个人活动</a-select-option>
<a-select-option key="2">团队活动</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="12">
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}" label="活动小类">
<a-select placeholder="请选择" v-model="queryParam.subclass">
<a-select-option key="">请选择</a-select-option>
<a-select-option key="部长考核">部长考核</a-select-option>
<a-select-option key="前置营销">前置营销</a-select-option>
<a-select-option key="线上活动">线上活动</a-select-option>
<a-select-option key="线下活动">线下活动</a-select-option>
</a-select>
</a-form-item>
</a-col>
<span class="table-page-search-submitButtons" style="float: left; overflow: hidden;">
<a-col :md="6" :sm="24">
<a-button @click="search()" type="primary">查询</a-button>
<a-divider type="vertical"/>
<a-button @click="add()" type="primary">添加</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!--列表-->
<s-table :locale="emptyText" :columns="columns" :data="rowdata" bordered ref="table" size="small" class="flex-filling">
<template slot="operation" slot-scope="text,record">
<a @click="modifyfunction(record)">编辑</a>
</template>
</s-table>
<!--编辑----弹框-->
<a-modal :title="titleName" :visible="modifyvisible" @ok="createfunctionOk" @cancel="createfunctionCancel" html-type="submit" width="840px">
<a-form :form="Formtable">
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="活动标题">
<a-input placeholder="活动标题" v-decorator="[ 'title', {rules: [{ required: true, message: '活动标题不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="活动详情">
<a-input placeholder="活动详情" v-decorator="[ 'desc', {rules: [{ required: true, message: '活动详情不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="活动积分">
<a-input placeholder="活动积分" v-decorator="[ 'integral', {rules: [{ required: true, message: '活动积分不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="活动类型">
<a-radio-group v-decorator="['activityType', {rules: [{ required: true, message: '活动类型不能为空!'}]} ]">
<a-radio value="个人活动">个人活动</a-radio>
<a-radio value="团队活动">团队活动</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="活动小类">
<a-select placeholder="请选择" v-decorator="[ 'subclass', {rules: [{ required: true, message: '活动小类不能为空!' ,whitespace:true}]} ]">
<a-select-option key="">请选择</a-select-option>
<a-select-option key="部长考核">部长考核</a-select-option>
<a-select-option key="前置营销">前置营销</a-select-option>
<a-select-option key="线上活动">线上活动</a-select-option>
<a-select-option key="线下活动">线下活动</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="排序号">
<a-input v-decorator="[ 'sort', {rules: [{ required: true, message: '活动小类不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import STable from '@/components/table';
import {getList,addActivity,updateActivity,deleteActivity} from "@/api/school-center/activityAPI"
import {cloneObject} from '@/utils/util';
export default {
name: "activity",
components: {
STable,
},
data: function () {
return {
emptyText: {emptyText: '暂无数据'},
previewVisible: false,
previewImage: '',
fileList: [
],
fileid:{},
brackgroundurl:"manager/ciop/school/schoolManagement/qrcodeUpload",
// form
Formtable: this.$form.createForm(this, {name: 'Formtable'}),
titleName:"",
modifyForm: {
id: '',
title: '',
desc: '',
integral: '',
activityType: '',
subclass: '',
imageUrl: '',
range: '',
sort: '',
},
subNameList: [],
packageName:[],
chosePages:[],
products:[],
//输入框列表
queryParam: {
title: '',
activityType: '',
subclass: '',
status: '',
},
modifyvisible: false,
columns: [
{dataIndex: 'title', width: 200, title: '活动标题', align: "center"},
{dataIndex: 'desc', width: 200, title: '活动详情', align: "center"},
{dataIndex: 'integral', width: 200, title: '活动积分', align: "center"},
{dataIndex: 'activityType', width: 200, title: '活动类型', align: "center"},
{dataIndex: 'subclass', width: 200, title: '活动小类', align: "center"},
{dataIndex: 'creator', width: 200, title: '创建人', align: "center"},
{dataIndex: 'createTime', width: 200, title: '创建时间', align: "center"},
{
dataIndex: 'operation',
width: 200,
title: '操作',
align: "center",
scopedSlots: {customRender: 'operation'},
fixed: "right"
}]
,
rowdata: parameter => {
let params = {
pageNo: parameter.pageNo,
pageSize: parameter.pageSize
}
//表示
let obj = cloneObject(this.queryParam)
return getList(Object.assign(params, obj)).then(res => {
let data = {}
if (res.state !== 'success') {
this.emptyText.emptyText = '查询失败!'
this.$message.error("查询失败!", 5);
data = {
data: [],
pageSize: parameter.pageSize,
pageNo: 1,
totalCount: 0
}
} else {
if (res.data.records.length==0){
return data
}
data = {
data: res.data.records,
pageSize: parameter.pageSize,
pageNo: parameter.pageNo,
totalCount: res.data.total
}
}
return data
})
}
}
},
methods:{
getuuid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
},
baseuploadUrl(){
const env = process.env.NODE_ENV; //获取当前环境
let apis = "/";
if(env === 'development'){ //测试环境默认添加前缀
apis = '/api/';
}
return apis
},
uploadUrl(){
return this.baseuploadUrl() + this.brackgroundurl
}
,
//背景图
handleCancel() {
this.previewVisible = false;
},
handlePreview(file) {
this.previewImage = file.url || file.thumbUrl;
this.previewVisible = true;
},
handleChange(obj) {
if (this.fileList.length==2){
this.fileList.splice(0,1)
}else{
this.fileList = obj.fileList;
}
},
delet(deletdata){
let status=0;
if(deletdata.status==0){
status=1
}
let parent = {
id: deletdata.id,
status: status
}
hidestatus(parent).then(res=>{
if (res.state=="success"){
this.$message.success(res.data ? res.data : '修改成功!', 5);
this.search();
return null
}
this.$message.error(res.data ? res.data : '修改失败!', 5);
})
},
chosePagesfunction(data){
this.chosePages=data
},
search() {
this.$refs.table.refresh({search: true})
},
add(){
this.titleName="添加"
setTimeout(()=>{
this.Formtable.setFieldsValue({
id: '',
title: '',
desc: '',
integral: '',
activityType: '',
subclass: '',
imageUrl: '',
range: '',
sort: '',
})
},0)
this.modifyvisible=true;
},
modifyfunction(data){
//初始化
this.titleName="编辑"
let choosepagespare={
id:data.id
}
this.fileid={
id:data.id
}
// let url=this.baseuploadUrl()+"manager/"+data.serviceQrcode.replace("enclosure","ciop")
// if (!(data.serviceQrcode == null || data.serviceQrcode=="")) {
// //下载图片浏览
// this.fileList.push({
// uid: this.getuuid(),
// name: '找不到图片',
// status: 'done',
// url: url,
// })
// }
// this.modifyForm.id=data.id
// //查询中间表
// choosepages(choosepagespare).then(res=>{
// if (res.state == 'success'){
// let d= res.data.choosepages
// for (let i = 0; i <d.length ; i++) {
// this.chosePages.push(d[i])
// }
// }
// })
// let showband="0"
// if (data.isShowband=="1"){
// showband=data.isShowband
// }
// let isShowrh="0"
// if (data.isShowrh=="1"){
// isShowrh=data.isShowrh
// }
setTimeout(()=>{
this.Formtable.setFieldsValue({
title: data.title,
desc: data.title,
integral: data.title,
activityType: data.title,
subclass: data.title,
imageUrl: data.title,
range: data.title,
sort:"",
})
},0)
this.customimg="./img/custom"+data.serviceQrcode
this.modifyvisible=true;
},
//提交表单
createfunctionOk(){
this.Formtable.validateFields(['title', 'desc',"integral","activityType", 'subclass', 'sort',"range" ], {force: true}, (err, values)=>{
if (!err){
this.modifyForm.title=values.title
this.modifyForm.desc=values.desc
this.modifyForm.integral=values.integral
this.modifyForm.activityType=values.activityType
this.modifyForm.subclass=values.subclass
this.modifyForm.sort=values.sort
this.modifyForm.range=values.range
this.chosePages.forEach(value => {
if (value!=undefined){
this.modifyForm.chosePages=value+","+this.modifyForm.chosePages
}
})
//插入数据
if (this.modifyForm.id==""){
for (let key in this.modifyForm) {
if (this.modifyForm[key]==undefined){
this.modifyForm[key]=""
}
}
addActivity(this.modifyForm).then(res=>{
if (res.state=="success") {
this.$message.success(res.data ? res.data : '添加成功!', 5);
this.search();
this.modifyvisible=false
return null;
}
this.$message.error(res.data ? res.data : '添加失败!', 5);
})
return null;
}
//修改数据
updateActivity(this.modifyForm).then(res=>{
if (res.state=="success") {
this.$message.success(res.data ? res.data : '修改成功!', 5);
this.search();
this.modifyvisible=false
return null;
}
this.$message.error(res.data ? res.data : '修改失败!', 5);
})
}
})
},
createfunctionCancel(){
this.Formtable.setFieldsValue({
id: '',
title: '',
desc: '',
integral: '',
activityType: '',
subclass: '',
imageUrl: '',
range: '',
sort: '',
})
this.fileList=[]
this.modifyForm.id=""
this.modifyForm.chosePages=""
this.chosePages.splice(0,this.chosePages.length)
this.modifyvisible=false;
}
}
}
</script>
<style scoped>
</style>
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-form-item label="电话"> <a-form-item label="电话">
<a-input v-model="queryParams.phone" placeholder="请输入" /> <a-input v-model="queryParams.phone" placeholder="请输入" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment