Commit 16eea796 by 吴学德

学校管理编辑

parent 99488060
...@@ -4,6 +4,14 @@ const prefix = '/schoolcenter/ciop'; ...@@ -4,6 +4,14 @@ const prefix = '/schoolcenter/ciop';
// 获取活动列表 // 获取活动列表
let findByList = (params) => postAction(prefix + "/school/schoolManagement/findByList" , params); let findByList = (params) => postAction(prefix + "/school/schoolManagement/findByList" , params);
// 回显选择的套餐
let choosepages = (params) => postAction(prefix + "/school/schoolManagement/choosepages" , params);
// 编辑
let modify = (params) => postAction(prefix + "/school/schoolManagement/update" , params);
//新增
let insert= (params) => postAction(prefix + "/school/schoolManagement/insert" , params);
export { export {
findByList findByList,choosepages,modify,insert
} }
\ No newline at end of file
...@@ -24,19 +24,11 @@ ...@@ -24,19 +24,11 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </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.netType">
<a-select-option key="">请选择</a-select-option>
<a-select-option key="0"></a-select-option>
<a-select-option key="1"></a-select-option>
</a-select>
</a-form-item>
</a-col>
<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-divider type="vertical"/>
<a-button @click="add()" type="primary">添加</a-button>
</a-col> </a-col>
</span> </span>
</a-row> </a-row>
...@@ -74,9 +66,9 @@ ...@@ -74,9 +66,9 @@
</s-table> </s-table>
<!--编辑----弹框--> <!--编辑----弹框-->
<a-modal title="编辑学校" :visible="modifyvisible" @ok="createfunctionOk" @cancel="createfunctionCancel" html-type="submit" width="1024px"> <a-modal :title="titleName" :visible="modifyvisible" @ok="createfunctionOk" @cancel="createfunctionCancel" html-type="submit" width="840px">
<a-form :form="Formtable"> <a-form :form="Formtable">
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 9, offset: 1}" label="县分"> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="县分">
<a-select placeholder="请选择" v-decorator="[ 'subName', {rules: [{ required: true, message: '县分不能为空!' ,whitespace:true}]} ]"> <a-select placeholder="请选择" v-decorator="[ 'subName', {rules: [{ required: true, message: '县分不能为空!' ,whitespace:true}]} ]">
<a-select-option key="">请选择</a-select-option> <a-select-option key="">请选择</a-select-option>
<a-select-option v-for="data in subNameList" :key="data"> <a-select-option v-for="data in subNameList" :key="data">
...@@ -84,53 +76,57 @@ ...@@ -84,53 +76,57 @@
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 9, offset: 1}" label="学校名称"> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="学校名称">
<a-input placeholder="学校名称" v-decorator="[ 'schoolName', {rules: [{ required: true, message: '学校名称不能为空!' ,whitespace:true}]} ]"></a-input> <a-input placeholder="学校名称" v-decorator="[ 'schoolName', {rules: [{ required: true, message: '学校名称不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 9, offset: 1}" label="单宽学校名称"> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="单宽学校名称">
<a-input placeholder="单宽学校名称" v-decorator="[ 'number', {rules: [{ required: true, message: '输入格式不正确!' ,whitespace:true,pattern:'^(([0-9]{8})|(1[0-9]{10}))$'}]} ]"></a-input> <a-select placeholder="请选择" v-decorator="[ 'bandproductId']">
<a-select-option key="">请选择</a-select-option>
<a-select-option v-for="data in products" :key="data.productId">
{{ data.ProductUniversity}}
</a-select-option>
</a-select>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 9, offset: 1}" label="网点id(合伙人id)"> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="网点id(合伙人id)">
<a-input placeholder="网点id(合伙人id)" v-decorator="[ 'netId', {rules: [{ required: true, message: '网点id不能为空!' ,whitespace:true}]} ]"></a-input> <a-input placeholder="网点id(合伙人id)" v-decorator="[ 'netId']"></a-input>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 9, offset: 1}" label="揽装工号"> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="揽装工号">
<a-input placeholder="揽装工号" v-decorator="[ 'lzgh', {rules: [{ required: true, message: '黄名单的备注不能为空!' ,whitespace:true}]} ]"></a-input> <a-input placeholder="揽装工号" v-decorator="[ 'lzgh' ]"></a-input>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 9, offset: 1}" label="是否显示宽带办理"> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="是否显示宽带办理">
<a-radio-group v-decorator="['isShowband']"> <a-radio-group v-decorator="['isShowband']">
<a-radio value="0">不显示</a-radio> <a-radio value="0">不显示</a-radio>
<a-radio value="1">显示</a-radio> <a-radio value="1">显示</a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 9, offset: 1}" label="是否显示0息购机"> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="是否显示0息购机">
<a-radio-group v-decorator="['netPhone']"> <a-radio-group v-decorator="['netPhone']">
<a-radio value="0">不显示</a-radio> <a-radio value="0">不显示</a-radio>
<a-radio value="1">显示</a-radio> <a-radio value="1">显示</a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 9, offset: 1}" label="是否显示融合办理"> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="是否显示融合办理">
<a-radio-group v-decorator="['isShowrh']"> <a-radio-group v-decorator="['isShowrh']">
<a-radio value="0">不显示</a-radio> <a-radio value="0">不显示</a-radio>
<a-radio value="1">显示</a-radio> <a-radio value="1">显示</a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 9, offset: 1}" label="是否已收到电信卡"> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="是否已收到电信卡">
<a-radio-group v-decorator="['isRecv']"> <a-radio-group v-decorator="['isRecv']">
<a-radio value="0"></a-radio> <a-radio value="0"></a-radio>
<a-radio value="1"></a-radio> <a-radio value="1"></a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 9, offset: 1}" label="客户二维码"> <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="客户二维码">
<img :src="customimg" style="width: 150px"> <img :src="customimg" style="width: 150px">
</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: 15, offset: 1}" label="套餐选择">
<a-checkbox-group :defaultValue="chosePages" @change="chosePagesfunction">
<a-row> <a-row>
<a-col :span="8" v-for="data in packageName"><a-checkbox :value="data">{{data}}</a-checkbox></a-col> <a-col :span="8" v-for=" data in packageName"><a-checkbox :value="data.value" >{{data.label}}</a-checkbox></a-col>
</a-row> </a-row>
</a-form-item> </a-checkbox-group>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 12, offset: 1}" label="二维码默认办理卡品">
<a-radio-group :options="taochangName" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-modal> </a-modal>
...@@ -139,7 +135,7 @@ ...@@ -139,7 +135,7 @@
<script> <script>
import STable from '@/components/table'; import STable from '@/components/table';
import {findByList} from "@/api/school-center/schoolManagermentAPI" import {findByList,choosepages,modify,insert} from "@/api/school-center/schoolManagermentAPI"
import {cloneObject} from '@/utils/util'; import {cloneObject} from '@/utils/util';
export default { export default {
name: "schoolmanagement", name: "schoolmanagement",
...@@ -150,24 +146,30 @@ ...@@ -150,24 +146,30 @@
return { return {
// form // form
Formtable: this.$form.createForm(this, {name: 'Formtable'}), Formtable: this.$form.createForm(this, {name: 'Formtable'}),
titleName:"",
customimg:"", customimg:"",
modifyForm: { modifyForm: {
subName: '', id:"",
status: '', subName:"",
schoolName: '', schoolName:"",
netType: '', netId:"",
isShowband:"0" lzgh:"",
bandproductId:'',
isShowband:"",
netPhone:"",
isShowrh:"",
isRecv:"",
chosePages:""
}, },
subNameList: [], subNameList: [],
packageName:[], packageName:[],
taochangName:[], chosePages:[],
checkboxdata:[], products:[],
//输入框列表 //输入框列表
queryParam: { queryParam: {
subName: '', subName: '',
status: '', status: '',
schoolName: '', schoolName: '',
netType: '',
}, },
modifyvisible: false, modifyvisible: false,
columns: [ columns: [
...@@ -206,30 +208,76 @@ ...@@ -206,30 +208,76 @@
totalCount: 0 totalCount: 0
} }
} else { } else {
if (res.data.records.length==0){
return data
}
data = { data = {
data: res.data.records, data: res.data.records,
pageSize: parameter.pageSize, pageSize: parameter.pageSize,
pageNo: parameter.pageNo, pageNo: parameter.pageNo,
totalCount: res.data.total totalCount: res.data.total
} }
if (this.subNameList.length==0){
res.data.records[0].subNameList.forEach((key)=>{
this.subNameList.push(key.subNameList)
})
res.data.records[0].packageName.forEach((key)=>{
let id=""+key.id
let d={
label: key.packageName,
value: id
}
this.packageName.push(d)
})
res.data.records[0].products.forEach((key)=>{
let productId=""+key.productId
let d={
productId: productId,
ProductUniversity: key.ProductUniversity
}
this.products.push(d)
})
}
} }
return data return data
}) })
}, }
packagedata:""
} }
}, },
methods:{ methods:{
chosePagesfunction(data){
this.chosePages=data
},
search() { search() {
this.$refs.table.refresh({search: true}) this.$refs.table.refresh({search: true})
}, },
modifyfunction(data){ add(){
data.subNameList.forEach((key)=>{ this.titleName="添加"
this.subNameList.push(key.subNameList) setTimeout(()=>{
this.Formtable.setFieldsValue({
isShowband:"0",
netPhone:"0",
isShowrh:"0",
isRecv:"0",
}) })
data.packageName.forEach((key)=>{ },0)
this.packageName.push(key.packageName) this.modifyvisible=true;
this.taochangName.push(key.name) },
modifyfunction(data){
//初始化
this.titleName="编辑学校"
let choosepagespare={
id:data.id
}
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" let showband="0"
if (data.isShowband=="1"){ if (data.isShowband=="1"){
...@@ -243,6 +291,7 @@ ...@@ -243,6 +291,7 @@
this.Formtable.setFieldsValue({ this.Formtable.setFieldsValue({
subName:data.subName, subName:data.subName,
schoolName:data.schoolName, schoolName:data.schoolName,
bandproductId:data.bandproductId,
netId:data.netId, netId:data.netId,
lzgh:data.lzgh, lzgh:data.lzgh,
isShowband:showband, isShowband:showband,
...@@ -254,14 +303,73 @@ ...@@ -254,14 +303,73 @@
this.customimg="./img/custom"+data.serviceQrcode this.customimg="./img/custom"+data.serviceQrcode
this.modifyvisible=true; this.modifyvisible=true;
}, },
//提交表单
createfunctionOk(){ createfunctionOk(){
this.Formtable.validateFields(['schoolName', 'bandproductId',"subName","lzgh", 'netId',"isShowband", 'isShowrh',"netPhone" ,'isRecv'], {force: true}, (err, values)=>{
if (!err){
this.modifyForm.subName=values.subName
this.modifyForm.schoolName=values.schoolName
this.modifyForm.netId=values.netId
this.modifyForm.lzgh=values.lzgh
this.modifyForm.bandproductId=values.bandproductId
this.modifyForm.isShowband=values.isShowband
this.modifyForm.netPhone=values.netPhone
this.modifyForm.isShowrh=values.isShowrh
this.modifyForm.isRecv=values.isRecv
this.modifyForm.chosePages=""
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]=""
}
}
insert(this.modifyForm).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);
})
return null;
}
//修改数据
modify(this.modifyForm).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);
})
}
})
}, },
createfunctionCancel(){ createfunctionCancel(){
this.Formtable.setFieldsValue({
subName:"",
schoolName:"",
netId:"",
lzgh:"",
bandproductId:"",
isShowband:"",
netPhone:"",
isShowrh:"",
isRecv:"",
})
this.modifyForm.id=""
this.modifyForm.chosePages=""
this.chosePages.splice(0,this.chosePages.length)
this.modifyvisible=false; this.modifyvisible=false;
this.packageName=[]
this.taochangName=[]
this.subNameList=[]
} }
}, },
created(){ created(){
......
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