|
|
@@ -1,56 +1,59 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-button size="mini" type="text" @click="editBtn">编 辑</el-button>
|
|
|
- <el-dialog title="新 增" :visible.sync="dialogFormVisible" width="80%">
|
|
|
+ <el-dialog title="新 增" :visible.sync="dialogFormVisible" width="50%">
|
|
|
<div slot="title" style="font-size: 15px">
|
|
|
编辑公海池
|
|
|
</div>
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-row>
|
|
|
- <el-form :model="form" :rules="rules" ref="form" label-width="120px" label-position="left" size="mini">
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="池名称" prop="poolname">
|
|
|
- <el-input v-model="form.poolname" placeholder="请输入池名称"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="最大保客数" prop="countlimit">
|
|
|
- <el-input v-model="form.countlimit" placeholder="成员最大保有客户数(0表示不设限)"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="跟进天数限制" prop="datafollowlimit">
|
|
|
- <el-input v-model="form.datafollowlimit" placeholder="跟进天数限制(超过天数后自动退回,0表示不设限)"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="成交天数限制" prop="deallimit">
|
|
|
- <el-input v-model="form.deallimit" placeholder="成交天数限制(超过天数后自动退回,0表示不限制)"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="说明" prop="remarks">
|
|
|
- <el-input v-model="form.remarks" type="textarea" placeholder="请输入说明"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <div style="display:flex;justfiy-content:eveny">
|
|
|
- <el-checkbox :true-label="1" :false-label="0" v-model="form.freeget" checked="checked">自由领取</el-checkbox>
|
|
|
- <el-checkbox :true-label="1" :false-label="0" v-model="form.isused" checked="checked">是否启用</el-checkbox>
|
|
|
- <el-checkbox :true-label="1" :false-label="0" v-model="form.isdefault" checked="checked">是否默认</el-checkbox>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </el-form>
|
|
|
- </el-row>
|
|
|
+ <div class="tab flex-align-center">
|
|
|
+ <p :class="activeName == '基本信息'?'tab-act':''" @click="tabChange('基本信息')">基本信息</p>
|
|
|
+ <p :class="activeName == '授权范围'?'tab-act':''" @click="tabChange('授权范围')">授权范围</p>
|
|
|
+ </div>
|
|
|
+ <div style="padding:16px 0;">
|
|
|
+ <el-form :model="form" v-show="activeName == '基本信息'" :rules="rules" ref="form" label-width="120px"
|
|
|
+ label-position="left" size="mini">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="池名称" prop="poolname">
|
|
|
+ <el-input v-model="form.poolname" placeholder="请输入池名称"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="最大保客数" prop="countlimit">
|
|
|
+ <el-input v-model="form.countlimit" placeholder="成员最大保有客户数(0表示不设限)"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="跟进天数限制" prop="datafollowlimit">
|
|
|
+ <el-input v-model="form.datafollowlimit" placeholder="跟进天数限制(超过天数后自动退回,0表示不设限)"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="成交天数限制" prop="deallimit">
|
|
|
+ <el-input v-model="form.deallimit" placeholder="成交天数限制(超过天数后自动退回,0表示不限制)"></el-input>
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <scopeOfauth :onlyread="true" :defaultData="defaultData" scrollHeight="300px" obiectName="sa_customerpool" appidname="sa_customerpoolid" :dataid="data.sa_customerpoolid" @onChecked="onChecked"></scopeOfauth>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="说明" prop="remarks">
|
|
|
+ <el-input v-model="form.remarks" type="textarea" placeholder="请输入说明"></el-input>
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- </el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <div style="display:flex;justify-content: space-evenly;margin-bottom:20px">
|
|
|
+ <div>
|
|
|
+ <el-checkbox :true-label="1" :false-label="0" v-model="form.freeget" checked="checked">自由领取
|
|
|
+ </el-checkbox>
|
|
|
+ <el-checkbox :true-label="1" :false-label="0" v-model="form.isused" checked="checked">是否启用</el-checkbox>
|
|
|
+ <el-checkbox :true-label="1" :false-label="0" v-model="form.isdefault" checked="checked">是否默认
|
|
|
+ </el-checkbox>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
+ <scopeOfauth :onlyread="true" v-show="activeName == '授权范围'" :defaultData="defaultData" scrollHeight="200px"
|
|
|
+ obiectName="sa_customerpool" appidname="sa_customerpoolid" :dataid="data.sa_customerpoolid"
|
|
|
+ @onChecked="onChecked">
|
|
|
+ </scopeOfauth>
|
|
|
+ </div>
|
|
|
<div class="dialog-footer">
|
|
|
<el-button size="small" @click="dialogFormVisible = false" class="normal-btn-width">取 消</el-button>
|
|
|
<el-button size="small" type="warning" @click="onSubmit" class="normal-btn-width btn-warning">确 定</el-button>
|
|
|
@@ -64,13 +67,14 @@ import scopeOfauth from '@/HDrpManagement/publicManage/components/scopeOfAuthori
|
|
|
import { log } from '@antv/g2plot/lib/utils'
|
|
|
export default {
|
|
|
name: "add",
|
|
|
- components:{scopeOfauth},
|
|
|
- data(){
|
|
|
+ components: { scopeOfauth },
|
|
|
+ data () {
|
|
|
return {
|
|
|
- dialogFormVisible:false,
|
|
|
- authData:'',
|
|
|
- defaultData:'',
|
|
|
- form:{
|
|
|
+ dialogFormVisible: false,
|
|
|
+ authData: '',
|
|
|
+ defaultData: '',
|
|
|
+ activeName: '基本信息',
|
|
|
+ form: {
|
|
|
"sa_customerpoolid": 0,
|
|
|
"poolname": "", //池名称
|
|
|
"freeget": 1, //自由领取
|
|
|
@@ -81,64 +85,89 @@ export default {
|
|
|
"deallimit": '', //成交天数限制(超过天数后自动退回,0表示不限制)
|
|
|
"isdefault": 1 //是否默认
|
|
|
},
|
|
|
- rules:{
|
|
|
- poolname:[
|
|
|
- { required: true, message: '请输入名称', trigger: 'blur'},
|
|
|
+ rules: {
|
|
|
+ poolname: [
|
|
|
+ { required: true, message: '请输入名称', trigger: 'blur' },
|
|
|
],
|
|
|
- countlimit:[
|
|
|
- { required: true, message: '请输入数据', trigger: 'blur'}
|
|
|
+ countlimit: [
|
|
|
+ { required: true, message: '请输入数据', trigger: 'blur' }
|
|
|
],
|
|
|
- datafollowlimit:[
|
|
|
- { required: true, message: '请输入数据', trigger: 'blur'}
|
|
|
+ datafollowlimit: [
|
|
|
+ { required: true, message: '请输入数据', trigger: 'blur' }
|
|
|
],
|
|
|
- deallimit:[
|
|
|
- { required: true, message: '请输入数据', trigger: 'blur'}
|
|
|
+ deallimit: [
|
|
|
+ { required: true, message: '请输入数据', trigger: 'blur' }
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
provide () {
|
|
|
return {
|
|
|
- rowData:() => this.data
|
|
|
+ rowData: () => this.data
|
|
|
}
|
|
|
},
|
|
|
- props:['data'],
|
|
|
- methods:{
|
|
|
+ props: ['data'],
|
|
|
+ methods: {
|
|
|
editBtn () {
|
|
|
this.query_auth()
|
|
|
this.dialogFormVisible = true
|
|
|
- this.form = Object.assign({},this.form,this.data)
|
|
|
+ this.form = Object.assign({}, this.form, this.data)
|
|
|
},
|
|
|
// 获取保存授权范围数据
|
|
|
onChecked (param) {
|
|
|
this.authData = param
|
|
|
console.log(this.authData);
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
- async onSubmit(){
|
|
|
- const res2 = await this.$api.requested({
|
|
|
- "id":"20221022111502",
|
|
|
- "content": this.authData
|
|
|
- })
|
|
|
- console.log(res2);
|
|
|
-
|
|
|
- // this.$refs['form'].validate(async (valid) => {
|
|
|
- // if (!valid) return false
|
|
|
- // const res = await this.$api.requested({
|
|
|
- // "id": "20221009100502",
|
|
|
- // "version":1,
|
|
|
- // "content": this.form
|
|
|
- // })
|
|
|
- // const res2 = await this.$api.requested({
|
|
|
- // "id":"20221022111502",
|
|
|
- // "content": this.authData
|
|
|
- // })
|
|
|
- // this.tool.showMessage(res,()=>{
|
|
|
- // this.$emit('onSuccess')
|
|
|
- // this.$refs['form'].resetFields();
|
|
|
- // this.dialogFormVisible = false
|
|
|
- // })
|
|
|
- // })
|
|
|
+ async onSubmit () {
|
|
|
+ this.$refs['form'].validate(async (valid) => {
|
|
|
+ if (!valid) return false
|
|
|
+ if (!this.authData) {
|
|
|
+ this.$alert('还未授权范围,是否直接无视', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ callback: async action => {
|
|
|
+ if (action == 'confirm') {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": "20221009100502",
|
|
|
+ "version": 1,
|
|
|
+ "content": this.form
|
|
|
+ })
|
|
|
+ if (this.authData) {
|
|
|
+ this.authData.sa_customerpoolid = res.data.sa_customerpoolid
|
|
|
+ const res2 = await this.$api.requested({
|
|
|
+ "id": "20221022111502",
|
|
|
+ "content": this.authData
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
+ this.$emit('onSuccess')
|
|
|
+ this.$refs['form'].resetFields();
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": "20221009100502",
|
|
|
+ "version": 1,
|
|
|
+ "content": this.form
|
|
|
+ })
|
|
|
+ if (this.authData) {
|
|
|
+ this.authData.sa_customerpoolid = res.data.sa_customerpoolid
|
|
|
+ const res2 = await this.$api.requested({
|
|
|
+ "id": "20221022111502",
|
|
|
+ "content": this.authData
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
+ this.$emit('onSuccess')
|
|
|
+ this.$refs['form'].resetFields();
|
|
|
+ this.activeName = '基本信息'
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 查询授权信息
|
|
|
async query_auth () {
|
|
|
@@ -146,17 +175,33 @@ export default {
|
|
|
"accesstoken": "456ae1e802b695b996e1bb8c2c405579",
|
|
|
"id": 20221022135202,
|
|
|
"content": {
|
|
|
- "sa_customerpoolid":this.data.sa_customerpoolid
|
|
|
+ "sa_customerpoolid": this.data.sa_customerpoolid
|
|
|
}
|
|
|
})
|
|
|
this.defaultData = res.data
|
|
|
console.log(this.defaultData);
|
|
|
-
|
|
|
+ },
|
|
|
+ tabChange (val) {
|
|
|
+ this.activeName = val
|
|
|
},
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-
|
|
|
+.tab p {
|
|
|
+ flex: 1;
|
|
|
+ height: 39px;
|
|
|
+ line-height: 39px;
|
|
|
+ text-align: center;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #999;
|
|
|
+ border-bottom: 2px solid #eeeeee;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+.tab-act {
|
|
|
+ color: #3874f6 !important;
|
|
|
+ border-bottom: 2px solid #3874f6 !important;
|
|
|
+}
|
|
|
</style>
|