Commit fa4e80b2 by 黄森林

账户预实名完成

parent 56936af7
import {postAction,downFilePost} from '@/api/manage'
const prefix = '/schoolcenter/ciop';
// 智能平台账号实名
let ysmUserList = (params) => postAction(prefix + "/ysmUser/list" , params);
let ysmUserNotThrough = (id,params) => postAction(prefix + "/ysmUser/notThrough/"+id,params);
let ysmUserInsert = (params) => postAction(prefix + "/ysmUser/insert" , params);
let ysmUserUpdate = (params) => postAction(prefix + "/ysmUser/update",params);
export {
ysmUserList,
ysmUserNotThrough,
ysmUserInsert,
ysmUserUpdate
}
\ No newline at end of file
...@@ -175,7 +175,10 @@ ...@@ -175,7 +175,10 @@
this.$refs.table.refresh({search: true}) this.$refs.table.refresh({search: true})
}, },
remove(id) { remove(id) {
productDelete(id).then(() => { productDelete(id).then((res) => {
if(res.state=="success"){
this.$notification.success({message: res.data, description: '', duration: 4})
}
this.$refs.table.refresh({search: true}) this.$refs.table.refresh({search: true})
}) })
}, },
...@@ -218,7 +221,9 @@ ...@@ -218,7 +221,9 @@
productInsert({product}).then((res) => { productInsert({product}).then((res) => {
this.modifyvisible=false; this.modifyvisible=false;
this.clearmodel() this.clearmodel()
if(res.state=="success"){
this.$notification.success({message: res.data, description: '', duration: 4}) this.$notification.success({message: res.data, description: '', duration: 4})
}
this.search() this.search()
}) })
}else { }else {
...@@ -227,7 +232,9 @@ ...@@ -227,7 +232,9 @@
productUpdate({product}).then((res) => { productUpdate({product}).then((res) => {
this.modifyvisible=false; this.modifyvisible=false;
this.clearmodel() this.clearmodel()
if(res.state=="success"){
this.$notification.success({message: res.data, description: '', duration: 4}) this.$notification.success({message: res.data, description: '', duration: 4})
}
this.search() this.search()
}) })
} }
...@@ -240,6 +247,7 @@ ...@@ -240,6 +247,7 @@
}, },
//清除弹窗信息 //清除弹窗信息
clearmodel() { clearmodel() {
this.add=true
let that = this; let that = this;
that.modelData.productMealPrice='' that.modelData.productMealPrice=''
that.modelData.productId='' that.modelData.productId=''
......
...@@ -181,7 +181,10 @@ ...@@ -181,7 +181,10 @@
this.$refs.table.refresh({search: true}) this.$refs.table.refresh({search: true})
}, },
remove(id) { remove(id) {
universityDelete(id).then(() => { universityDelete(id).then((res) => {
if(res.state=="success"){
this.$notification.success({message: res.data, description: '', duration: 4})
}
this.$refs.table.refresh({search: true}) this.$refs.table.refresh({search: true})
}) })
}, },
...@@ -234,7 +237,9 @@ ...@@ -234,7 +237,9 @@
universityInsert({university}).then((res) => { universityInsert({university}).then((res) => {
this.modifyvisible=false; this.modifyvisible=false;
this.clearmodel() this.clearmodel()
if(res.state=="success"){
this.$notification.success({message: res.data, description: '', duration: 4}) this.$notification.success({message: res.data, description: '', duration: 4})
}
this.search() this.search()
}) })
}else { }else {
...@@ -243,7 +248,9 @@ ...@@ -243,7 +248,9 @@
universityUpdate({university}).then((res) => { universityUpdate({university}).then((res) => {
this.modifyvisible=false; this.modifyvisible=false;
this.clearmodel() this.clearmodel()
if(res.state=="success"){
this.$notification.success({message: res.data, description: '', duration: 4}) this.$notification.success({message: res.data, description: '', duration: 4})
}
this.search() this.search()
}) })
} }
...@@ -256,6 +263,7 @@ ...@@ -256,6 +263,7 @@
}, },
//清除弹窗信息 //清除弹窗信息
clearmodel() { clearmodel() {
this.add=true
this.modelData.universityId='' this.modelData.universityId=''
this.Formtable.setFieldsValue({ this.Formtable.setFieldsValue({
"universityName":'', "universityName":'',
......
<template>
<div class="flex-container">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline">
<a-row :gutter="24">
<a-col :md="6" :sm="12">
<a-form-item label="预实名账号:">
<a-input placeholder="预实名账号" v-model="queryParam.userName"></a-input>
</a-form-item>
</a-col>
<a-col :md="3" :sm="12">
<a-button @click="search()" type="primary">查询</a-button>
</a-col>
<a-col :md="3" :sm="12">
<a-button @click="modifyfunction()" type="primary">添加</a-button>
</a-col>
</a-row>
</a-form>
</div>
<!--列表-->
<s-table :columns="columns" :data="rowdata" bordered ref="table" size="small" class="flex-filling">
<template slot="operation" slot-scope="text, record">
<span>
<a @click="modifyfunction(record)">修改</a>
<a-divider type="vertical"/>
<a-popconfirm v-if="record.status == 1" title="是否不通过佣金系统?" @confirm="notThrough(record.id,0)">
<a>不通过佣金系统</a>
</a-popconfirm>
<a-popconfirm v-if="record.status == 0" title="是否通过佣金系统?" @confirm="notThrough(record.id,1)">
<a>通过佣金系统</a>
</a-popconfirm>
</span>
</template>
</s-table>
<!----弹框-->
<a-modal :title="add ?'添加预实名账号': '编辑预实名账号'" :visible="modifyvisible" @ok="createfunctionOk" @cancel="createfunctionCancel" html-type="submit" width="1024px">
<a-form :form="Formtable">
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="账号:">
<a-input placeholder="预实名账号" v-decorator="[ 'userName', {rules: [{ required: true, message: '预实名账号不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="签名:">
<a-input placeholder="签名" v-decorator="[ 'sign', {rules: [{ required: true, message: '签名不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import STable from '@/components/table';
import {ysmUserList, ysmUserNotThrough, ysmUserInsert, ysmUserUpdate} from "@/api/school-center/ysmUser"
import {cloneObject} from '@/utils/util';
export default {
name: "ysmUser",
components: {
STable,
},
data(){
return {
Formtable: this.$form.createForm(this),
modifyvisible: false,
add: true,
queryParam: {
userName :''
},
modelData:{
id:'',
userName:'',
sign:''
},
columns: [
{dataIndex: 'userName', width: 200, title: '预实名账号'},
{dataIndex: 'sign', width: 200, title: '签名'},
{
dataIndex: 'operation',
width: 100,
title: '操作',
scopedSlots: {customRender: 'operation'},
fixed: "right"
}]
,
rowdata: parameter => {
let params = {
pageNo: parameter.pageNo,
pageSize: parameter.pageSize
}
let obj = cloneObject(this.queryParam)
//表示
return ysmUserList(Object.assign(params,obj)).then(res => {
let data = {}
if (res.state !== 'success') {
data = {
data: [],
pageSize: parameter.pageSize,
pageNo: 1,
totalCount: 0
}
} else {
data = {
data: res.data.records,
pageSize: parameter.pageSize,
pageNo: parameter.pageNo,
totalCount: res.data.total
}
}
return data
})
}
}
},
methods:{
search() {
this.$refs.table.refresh({search: true})
},
notThrough(id,status) {
ysmUserNotThrough(id,{status}).then((res) => {
if(res.state=="success"){
this.$notification.success({message: res.data, description: '', duration: 4})
}
this.$refs.table.refresh({search: true})
})
},
modifyfunction(data){
if(data != undefined ){
this.modelData.id=data.id
setTimeout(()=>{
this.Formtable.setFieldsValue({
"userName":data.userName,
"sign":data.sign
})
},0)
this.add=false;
}
this.modifyvisible=true;
},
createfunctionOk(){
let that = this;
that.Formtable.validateFields(['userName','sign'], {force: true}, (err, values) => {
if (err ) {
return;
}
that.modelData.userName=values.userName
that.modelData.sign=values.sign
if(this.add){
let obj= that.modelData;
delete obj.id
let ysmUser= JSON.stringify(obj);
ysmUserInsert({ysmUser}).then((res) => {
this.modifyvisible=false;
this.clearmodel()
if(res.state=="success"){
this.$notification.success({message: res.data, description: '', duration: 4})
}
this.search()
})
}else {
let obj= that.modelData;
let ysmUser= JSON.stringify(obj);
ysmUserUpdate({ysmUser}).then((res) => {
this.modifyvisible=false;
this.clearmodel()
if(res.state=="success"){
this.$notification.success({message: res.data, description: '', duration: 4})
}
this.search()
})
}
})
},
createfunctionCancel(){
this.modifyvisible=false;
this.clearmodel()
this.add=true;
},
//清除弹窗信息
clearmodel() {
this.add=true
let that = this;
that.modelData.id=''
this.Formtable.setFieldsValue({
userName:'',
sign:''
})
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
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