Commit 22421249 by 罗承锋

修改学校配置

parent be37586f
......@@ -121,7 +121,6 @@
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="揽装工号">
<a-input placeholder="揽装工号" v-decorator="[ 'lzgh' ]"></a-input>
</a-form-item>
<!-- <a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="是否显示宽带办理">-->
<!-- <a-radio-group v-decorator="['isShowband']">-->
<!-- <a-radio value="0">不显示</a-radio>-->
......@@ -146,18 +145,24 @@
<!-- <a-radio value="1">是</a-radio>-->
<!-- </a-radio-group>-->
<!-- </a-form-item>-->
<a-form-item label="按钮配置" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<a-form-item label="按钮配置" :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}">
<template>
<a-tree
v-model="checkedKeys"
checkable
:expanded-keys="expandedKeys"
:auto-expand-parent="autoExpandParent"
:selected-keys="selectedKeys"
<a-tree-select
show-search
v-model="buttons"
style="width: 100%"
:tree-data="treeData"
@expand="onExpand"
@select="onSelect"
/>
placeholder="请选择按钮配置"
allow-clear
tree-checkable
:show-checked-strategy="SHOW_PARENT"
multiple
:treeCheckStrictly=treeCheckStrictly
tree-default-expand-all
@change="onTreeChange"
>
</a-tree-select>
</template>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="客服二维码">
......@@ -182,10 +187,11 @@
</a-modal>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 15, offset: 1}" label="套餐选择">
<a-checkbox-group :defaultValue="chosePages" @change="chosePagesfunction">
<a-checkbox-group v-model="chosePages" @change="chosePagesfunction">
<a-row>
<a-col :span="8" v-for=" data in packageName"><a-checkbox :value="data.value" >{{data.label}}</a-checkbox></a-col>
<a-col :span="8" v-for=" (data,index) in package" v-if="index < more"><a-checkbox :value="data.value" >{{data.label}}</a-checkbox></a-col>
</a-row>
<a-button @click="showMore" v-show="isShowMore">更多</a-button>
</a-checkbox-group>
</a-form-item>
</a-form>
......@@ -200,15 +206,21 @@
import {findByList,choosepages,modify,insert,hidestatus} from "@/api/school-center/schoolManagermentAPI"
import {cloneObject} from '@/utils/util';
import moment from "moment";
import { TreeSelect } from 'ant-design-vue';
const SHOW_PARENT = TreeSelect.SHOW_ALL;
import {getSchoolNames, initSubstName} from "../../../api/school-center/userManager/newUserAPI";
export default {
name: "schoolmanagement",
components: {
moment,
STable,
TreeSelect,
},
data: function () {
return {
treeCheckStrictly: true,
isShowMore: true,
SHOW_PARENT,
emptyText: {emptyText: '暂无数据'},
previewVisible: false,
previewImage: '',
......@@ -223,6 +235,7 @@
Formtable: this.$form.createForm(this, {name: 'Formtable'}),
titleName:"",
customimg:"",
buttons: [],
modifyForm: {
id:"",
networkCode: '',
......@@ -243,72 +256,105 @@
startDateStr: "",
endDateStr: "",
startDate: "",
endDate: ""
endDate: "",
},
expandedKeys: ['tcsj','xywbl', 'process'],
autoExpandParent: true,
checkedKeys: [],
selectedKeys: [],
treeData : [{
title: "首页按钮",
key: "main",
children:
[{
title: "手机卡办理",
key: "openmobile",
},{
title:"套餐升级",
key:"tcsj",
children: [{
title:"手机卡套餐升级",
key:"sjktcsj",
},{
title:"毕业生宽带优惠",
key:"byskdyh",
}]
treeData: [
{
title: '首页按钮',
value: 'indexButton',
key: 'indexButton',
disabled: true,
children: [
{
title: '手机卡办理',
value: 'sjkbl',
key: 'sjkbl',
},{
title: '套餐升级',
value: 'tcsj',
key: 'tcsj',
children: [{
title: '手机卡套餐升级',
value: 'sjktcsj',
key: 'sjktcsj',
},{
title:"校园网办理",
key:"xywbl",
children: [{
title:"普通校园网",
key:"isShowband",
},{
title:"高速校园网",
key:"isShowrh",
},{
title:"是否甩单",
key:"sfsj",
}]
},{
title:"校园网提速",
key:"xywts",
children: [{
title:"是否甩单",
key:"tssfsd",
}]
},{
title:"优惠购机",
key:"yhgj",
title: '毕业生宽带优惠',
value: 'bysrh',
key: 'bysrh',
}]
},{
title:"流程按钮",
key:"process",
children:
[{
title:"0息购机",
key:"netPhone",
},{
title:"线上线下",
key:"online",
},{
title:"是否已收到电信卡",
key:"isRecv",
}]
}],
},{
title: '校园网办理',
value: 'isShowband',
key: 'isShowband',
children: [
{
title: '普通校园网',
value: 'kdsl',
key: 'kdsl',
disabled: true,
},
{
title: '高速校园网',
value: 'isShowrh',
key: 'isShowrh',
disabled: true,
},
{
title: '是否甩单',
value: 'jiltKd',
key: 'jiltKd',
disabled: true,
},
]
},{
title: '校园网提速',
value: 'kdyBtn',
key: 'kdyBtn',
children: [
{
title: '是否甩单',
value: 'jiltKdy',
key: 'jiltKdy',
disabled: true,
}
]
},{
title: '优惠购机',
value: 'isShowyhgj',
key: 'isShowyhgj',
}
],
},
{
title: '流程按钮',
value: 'processButton',
key: 'processButton',
disabled: true,
children: [
{
title: '0息购机',
value: 'netPhone',
key: 'netPhone',
},
{
title: '线上线下',
value: 'udBtn',
key: 'udBtn',
},
{
title: '是否已收到电信卡',
value: 'isRecv',
key: 'isRecv',
},
],
},
],
subNames: [],
schoolNames: [],
subNameList: [],
packageName:[],
more: 6,
package: [],
chosePages:[],
products:[],
//输入框列表
......@@ -414,17 +460,23 @@
}
},
watch: {
checkedKeys(val) {
console.log('checkedKeys', val);
},
},
methods:{
showMore() {
this.isShowMore = false;
this.more = (this.packageName.length + 1);
},
onTreeChange(value) {
const values = [];
value.forEach(v => {
values.push(v.value);
})
this.modifyForm.buttons = values
},
changeStartDate(dates, dateString) {
console.log(dates);
this.modifyForm.datePeriod = dates;
this.modifyForm.startDate = dateString[0];
this.modifyForm.endDate = dateString[1];
console.log(this.modifyForm);
},
getuuid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
......@@ -461,16 +513,6 @@
}
},
onExpand(expandedKeys) {
this.expandedKeys = expandedKeys;
this.autoExpandParent = false;
},
onCheck(checkedKeys) {
this.checkedKeys = checkedKeys;
},
onSelect(selectedKeys, info) {
this.selectedKeys = selectedKeys;
},
delet(deletdata){
let status=0;
if(deletdata.status==0){
......@@ -497,26 +539,37 @@
},
add(){
this.titleName="添加"
this.isShowMore = true;
this.more = 6;
this.chosePages = [];
this.modifyForm.datePeriod = [];
this.modifyForm.startDate = "";
this.modifyForm.endDate = "";
this.modifyForm.buttons = [];
setTimeout(()=>{
this.Formtable.setFieldsValue({
isShowband:"0",
netPhone:"0",
isShowrh:"0",
isRecv:"0",
networkCode: '',
networkName: '',
greaterFifty: "",
greaterHundred: "",
})
},0)
this.buttons = [];
this.modifyvisible=true;
const temp = [];
this.packageName.forEach(pName => {
temp.push(pName);
})
this.package = temp;
},
modifyfunction(data){
// 清空编辑选中内容
this.checkedKeys = [];
this.isShowMore = true;
this.more = 6;
// 初始化按钮配置显示值
this.buttons = [];
// 初始化按钮配置选中值
this.modifyForm.buttons = [];
//初始化
this.titleName="编辑学校"
let choosepagespare={
......@@ -542,25 +595,39 @@
})
}
this.modifyForm.id=data.id
this.chosePages = [];
const head = [];
const temp = [];
this.packageName.forEach(pName => {
temp.push(pName);
})
//查询中间表
choosepages(choosepagespare).then(res=>{
console.log(res);
if (res.state == 'success'){
let d= res.data.choosepages
let d = res.data.choosepages
for (let i = 0; i <d.length ; i++) {
this.chosePages.push(d[i])
for(let j = 0; j < temp.length; ++j) {
if (this.chosePages.indexOf(temp[j].value) != -1) {
head.push(temp[j]);
temp.splice(j,1);
break;
}
}
}
if (head.length == 0) {
this.package = this.packageName;
}else{
for(let i = 0; i < temp.length; ++i) {
head.push(temp[i]);
}
this.package = head;
}
console.log(this.chosePages);
}
})
let showband="0"
if (data.isShowband=="1"){
showband=data.isShowband
}
let isShowrh="0"
if (data.isShowrh=="1"){
isShowrh=data.isShowrh
}
if (data.startDate == undefined || data.endDate == undefined) {
this.modifyForm.datePeriod = [];
this.modifyForm.startDate = "";
......@@ -570,7 +637,53 @@
this.modifyForm.startDate = moment(new Date(data.startDate)).format("YYYY-MM-DD");
this.modifyForm.endDate = moment(new Date(data.endDate)).format("YYYY-MM-DD");
}
const buttons = [];
if (data.isShowrh == 1) {
buttons.push({label: "高速校园网", value: "isShowrh"});
}
if(data.isRecv == 1) {
buttons.push({label: "是否已收到电信卡", value: "isRecv"});
}
if (data.isShowband == 1) {
buttons.push({label: "校园网办理", value: "isShowband"});
}
if (data.netPhone == 1) {
buttons.push({label: "0息购机", value: "netPhone"});
}
if (data.sjkbl == 1) {
buttons.push({label: "手机卡办理", value: "sjkbl"});
}
if (data.tcsj == 1) {
buttons.push({label: "套餐升级", value: "tcsj"});
}
if (data.sjktcsj == 1) {
buttons.push({label: "手机卡套餐升级", value: "sjktcsj"});
}
if (data.bysrh == 1) {
buttons.push({label: "毕业生宽带优惠", value: "bysrh"});
}
if (data.kdsl == 1) {
buttons.push({label: "普通校园网", value: "kdsl"});
}
if (data.jiltKd == 1) {
buttons.push({label: "是否甩单", value: "jiltKd"});
}
if (data.kdyBtn == 1) {
buttons.push({label: "校园网提速", value: "kdyBtn"});
}
if (data.jiltKdy == 1) {
buttons.push({label: "是否甩单", value: "jiltKdy"});
}
if (data.isShowyhgj == 1) {
buttons.push({label: "优惠购机", value: "isShowyhgj"});
}
if (data.udBtn == 1) {
buttons.push({label: "线上线下", value: "udBtn"});
}
this.buttons = buttons;
// 初始化选中值
this.onTreeChange(this.buttons);
setTimeout(()=>{
this.Formtable.setFieldsValue({
......@@ -579,28 +692,13 @@
bandproductId:data.bandproductId,
netId:data.netId,
lzgh:data.lzgh,
isShowband:showband,
netPhone:new String(data.netPhone).toString(),
isShowrh:isShowrh,
isRecv:new String(data.isRecv).toString(),
networkName: data.networkName,
networkCode: data.networkCode,
greaterFifty: data.greaterFifty,
greaterHundred: data.greaterHundred,
})
if (data.isShowrh == 1) {
this.checkedKeys.push("isShowrh");
}
if(data.isRecv == 1) {
this.checkedKeys.push("isRecv");
}
if (data.isShowband == 1) {
this.checkedKeys.push("isShowband");
}
if (data.netPhone == 1) {
this.checkedKeys.push("netPhone");
}
},0)
},50)
this.customimg="./img/custom"+data.serviceQrcode
this.modifyvisible=true;
},
......@@ -623,11 +721,26 @@
Vue.delete(this.modifyForm,'endDate');
this.modifyForm.greaterFifty = values.greaterFifty == undefined ? "" : values.greaterFifty
this.modifyForm.greaterHundred = values.greaterHundred == undefined ? "" : values.greaterHundred
this.modifyForm.isShowrh = (this.checkedKeys.indexOf("isShowrh") > -1) ? 1 : 0;
this.modifyForm.isShowband = (this.checkedKeys.indexOf("isShowband") > -1) ? 1 : 0;
this.modifyForm.netPhone = (this.checkedKeys.indexOf("netPhone") > -1) ? 1 : 0;
this.modifyForm.isRecv = (this.checkedKeys.indexOf("isRecv") > -1) ? 1 : 0;
console.log(this.chosePages);
console.log(this.buttons);
console.log(this.buttons.indexOf("isRecv") != -1);
this.modifyForm.isShowrh = (this.modifyForm.buttons.indexOf("isShowrh") > -1) ? 1 : 0;
this.modifyForm.isShowband = (this.modifyForm.buttons.indexOf("isShowband") > -1) ? 1 : 0;
this.modifyForm.netPhone = (this.modifyForm.buttons.indexOf("netPhone") > -1) ? 1 : 0;
this.modifyForm.isRecv = (this.modifyForm.buttons.indexOf("isRecv") > -1) ? 1 : 0;
this.modifyForm.sjkbl = (this.modifyForm.buttons.indexOf("sjkbl") > -1) ? 1 : 0;
this.modifyForm.tcsj = (this.modifyForm.buttons.indexOf("tcsj") > -1) ? 1 : 0;
this.modifyForm.sjktcsj = (this.modifyForm.buttons.indexOf("sjktcsj") > -1) ? 1 : 0;
this.modifyForm.bysrh = (this.modifyForm.buttons.indexOf("bysrh") > -1) ? 1 : 0;
this.modifyForm.kdsl = (this.modifyForm.buttons.indexOf("kdsl") > -1) ? 1 : 0;
this.modifyForm.jiltKd = (this.modifyForm.buttons.indexOf("jiltKd") > -1) ? 1 : 0;
this.modifyForm.kdyBtn = (this.modifyForm.buttons.indexOf("kdyBtn") > -1) ? 1 : 0;
this.modifyForm.jiltKdy = (this.modifyForm.buttons.indexOf("jiltKdy") > -1) ? 1 : 0;
this.modifyForm.isShowyhgj = (this.modifyForm.buttons.indexOf("isShowyhgj") > -1) ? 1 : 0;
this.modifyForm.udBtn = (this.modifyForm.buttons.indexOf("udBtn") > -1) ? 1 : 0;
this.chosePages.forEach(value => {
if (value!=undefined){
this.modifyForm.chosePages=value+","+this.modifyForm.chosePages
......@@ -685,7 +798,7 @@
this.modifyForm.id=""
this.modifyForm.chosePages=""
this.modifyForm.datePeriod = [];
this.chosePages.splice(0,this.chosePages.length)
this.chosePages = [];
this.modifyvisible=false;
},
getSchoolNames() {
......
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