|
@@ -29,25 +29,36 @@
|
|
|
</Col>
|
|
</Col>
|
|
|
<Col span="24">
|
|
<Col span="24">
|
|
|
<FormItem label="手机号:" prop="mobile" label-for="mobile">
|
|
<FormItem label="手机号:" prop="mobile" label-for="mobile">
|
|
|
- <Input v-model="formItem.mobile" placeholder="请输入手机号" :disabled="formItem.id"/>
|
|
|
|
|
|
|
+ <Input v-model="formItem.mobile" placeholder="请输入手机号" :disabled="formItem.id" />
|
|
|
</FormItem>
|
|
</FormItem>
|
|
|
</Col>
|
|
</Col>
|
|
|
|
|
+ <FormItem label="推荐员工:" label-for="spread_id" prop="spread_id">
|
|
|
|
|
+ <Select v-model="formItem.spread_id" style="width: 250px">
|
|
|
|
|
+ <Option value="">无</Option>
|
|
|
|
|
+ <Option v-for="item in ygList" :key="item.id" :value="item.id">
|
|
|
|
|
+ {{ item.name }}
|
|
|
|
|
+ </Option>
|
|
|
|
|
+ </Select>
|
|
|
|
|
+ <Button type="primary" class="ml10 search" @click="userSearchs">搜索</Button>
|
|
|
|
|
+ </FormItem>
|
|
|
<Col span="24">
|
|
<Col span="24">
|
|
|
- <FormItem label="销售比例:" label-for="sale_ratio" prop="sale_ratio" >
|
|
|
|
|
|
|
+ <FormItem label="销售比例:" label-for="sale_ratio" prop="sale_ratio">
|
|
|
<Input v-model="formItem.sale_ratio" placeholder="请输入销售比例" />
|
|
<Input v-model="formItem.sale_ratio" placeholder="请输入销售比例" />
|
|
|
</FormItem>
|
|
</FormItem>
|
|
|
</Col>
|
|
</Col>
|
|
|
<Col span="24">
|
|
<Col span="24">
|
|
|
- <FormItem label="手工比例:" label-for="craft_ratio " prop="craft_ratio" >
|
|
|
|
|
|
|
+ <FormItem label="手工比例:" label-for="craft_ratio " prop="craft_ratio">
|
|
|
<Input v-model="formItem.craft_ratio" placeholder="请输入手工比例" />
|
|
<Input v-model="formItem.craft_ratio" placeholder="请输入手工比例" />
|
|
|
</FormItem>
|
|
</FormItem>
|
|
|
</Col>
|
|
</Col>
|
|
|
<Col span="24">
|
|
<Col span="24">
|
|
|
<FormItem label="绑定用户:" label-for="mobile" prop="mobile">
|
|
<FormItem label="绑定用户:" label-for="mobile" prop="mobile">
|
|
|
- <Button v-if="checkUser.nickname || checkUser.phone" style="margin-right: 20rpx;">昵称:{{checkUser.nickname || '暂无'}} 手机号:{{checkUser.phone || '暂无'}}</Button>
|
|
|
|
|
- <Button type="primary" @click="chooseUser" >选择用户</Button>
|
|
|
|
|
|
|
+ <Button v-if="checkUser.nickname || checkUser.phone"
|
|
|
|
|
+ style="margin-right: 20rpx;">昵称:{{checkUser.nickname || '暂无'}}
|
|
|
|
|
+ 手机号:{{checkUser.phone || '暂无'}}</Button>
|
|
|
|
|
+ <Button type="primary" @click="chooseUser">选择用户</Button>
|
|
|
</FormItem>
|
|
</FormItem>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
</Col>
|
|
</Col>
|
|
|
<Col span="24" class="mt20">
|
|
<Col span="24" class="mt20">
|
|
|
<FormItem label="性别:">
|
|
<FormItem label="性别:">
|
|
@@ -145,6 +156,9 @@
|
|
|
import {
|
|
import {
|
|
|
mapState
|
|
mapState
|
|
|
} from 'vuex';
|
|
} from 'vuex';
|
|
|
|
|
+ import {
|
|
|
|
|
+ getYgList
|
|
|
|
|
+ } from "@/api/check";
|
|
|
export default {
|
|
export default {
|
|
|
name: 'systemSt',
|
|
name: 'systemSt',
|
|
|
components: {
|
|
components: {
|
|
@@ -192,7 +206,8 @@
|
|
|
direct_leader: 'ChenBin',
|
|
direct_leader: 'ChenBin',
|
|
|
position: '',
|
|
position: '',
|
|
|
sale_ratio: '',
|
|
sale_ratio: '',
|
|
|
- craft_ratio: ''
|
|
|
|
|
|
|
+ craft_ratio: '',
|
|
|
|
|
+ spread_id:'',
|
|
|
},
|
|
},
|
|
|
spinShow: false,
|
|
spinShow: false,
|
|
|
addresData: [],
|
|
addresData: [],
|
|
@@ -249,7 +264,8 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.getDepartmentList()
|
|
|
|
|
|
|
+ this.getDepartmentList();
|
|
|
|
|
+ this.getygList();
|
|
|
let data = {
|
|
let data = {
|
|
|
pid: 0
|
|
pid: 0
|
|
|
}
|
|
}
|
|
@@ -266,14 +282,15 @@
|
|
|
direct_leader: 'ChenBin',
|
|
direct_leader: 'ChenBin',
|
|
|
position: '',
|
|
position: '',
|
|
|
sale_ratio: '',
|
|
sale_ratio: '',
|
|
|
- craft_ratio: ''
|
|
|
|
|
|
|
+ craft_ratio: '',
|
|
|
|
|
+ ygList:[],
|
|
|
|
|
+ spread_id:'',
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// console.log(this.info,'infoinfoinfoinfo')
|
|
// console.log(this.info,'infoinfoinfoinfo')
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
- ...mapState('store/user',['info']),
|
|
|
|
|
|
|
+ ...mapState('store/user', ['info']),
|
|
|
labelWidth() {
|
|
labelWidth() {
|
|
|
return this.isMobile ? undefined : 120;
|
|
return this.isMobile ? undefined : 120;
|
|
|
},
|
|
},
|
|
@@ -281,8 +298,20 @@
|
|
|
return this.isMobile ? 'top' : 'right';
|
|
return this.isMobile ? 'top' : 'right';
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- mounted: function() {},
|
|
|
|
|
|
|
+ mounted: function() {
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 获取员工列表
|
|
|
|
|
+ getygList() {
|
|
|
|
|
+ getYgList({
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ limit: 1000
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ this.ygList = res.data.list
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
//获取用户id
|
|
//获取用户id
|
|
|
getUserId(row) {
|
|
getUserId(row) {
|
|
|
this.modals = false
|
|
this.modals = false
|
|
@@ -317,7 +346,8 @@
|
|
|
direct_leader: 'ChenBin',
|
|
direct_leader: 'ChenBin',
|
|
|
sale_ratio: 0,
|
|
sale_ratio: 0,
|
|
|
is_reservation: 0,
|
|
is_reservation: 0,
|
|
|
- craft_ratio: 0
|
|
|
|
|
|
|
+ craft_ratio: 0,
|
|
|
|
|
+ spread_id:''
|
|
|
}
|
|
}
|
|
|
this.add = 0;
|
|
this.add = 0;
|
|
|
this.isApi = 0;
|
|
this.isApi = 0;
|
|
@@ -341,21 +371,21 @@
|
|
|
console.log(this.formItem)
|
|
console.log(this.formItem)
|
|
|
this.$refs[name].validate((valid) => {
|
|
this.$refs[name].validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
- if(!this.formItem.sale_ratio) {
|
|
|
|
|
- return this.$Message.error('请输入销售比例');
|
|
|
|
|
- }
|
|
|
|
|
- if(!this.formItem.craft_ratio) {
|
|
|
|
|
|
|
+ // if(!this.formItem.sale_ratio) {
|
|
|
|
|
+ // return this.$Message.error('请输入销售比例');
|
|
|
|
|
+ // }
|
|
|
|
|
+ if (!this.formItem.craft_ratio) {
|
|
|
return this.$Message.error('请输入手工比例');
|
|
return this.$Message.error('请输入手工比例');
|
|
|
}
|
|
}
|
|
|
- if(this.formItem.id) {
|
|
|
|
|
|
|
+ if (this.formItem.id) {
|
|
|
editYg({
|
|
editYg({
|
|
|
id: this.formItem.id,
|
|
id: this.formItem.id,
|
|
|
- name: this.formItem.name,
|
|
|
|
|
- avatar: this.formItem.avatar,
|
|
|
|
|
- mobile: this.formItem.mobile,
|
|
|
|
|
- alias: this.formItem.alias,
|
|
|
|
|
- address: this.formItem.address,
|
|
|
|
|
- main_department: this.formItem.main_department,
|
|
|
|
|
|
|
+ name: this.formItem.name,
|
|
|
|
|
+ avatar: this.formItem.avatar,
|
|
|
|
|
+ mobile: this.formItem.mobile,
|
|
|
|
|
+ alias: this.formItem.alias,
|
|
|
|
|
+ address: this.formItem.address,
|
|
|
|
|
+ main_department: this.formItem.main_department,
|
|
|
department: this.formItem.department || [this.formItem.main_department],
|
|
department: this.formItem.department || [this.formItem.main_department],
|
|
|
uid: this.formItem.uid,
|
|
uid: this.formItem.uid,
|
|
|
userid: this.formItem.userid,
|
|
userid: this.formItem.userid,
|
|
@@ -365,7 +395,8 @@
|
|
|
craft_ratio: this.formItem.craft_ratio,
|
|
craft_ratio: this.formItem.craft_ratio,
|
|
|
is_reservation: this.formItem.is_reservation,
|
|
is_reservation: this.formItem.is_reservation,
|
|
|
enable: this.formItem.enable,
|
|
enable: this.formItem.enable,
|
|
|
-
|
|
|
|
|
|
|
+ spread_id:this.formItem.spread_id
|
|
|
|
|
+
|
|
|
}).then(async res => {
|
|
}).then(async res => {
|
|
|
this.$Message.success(res.msg);
|
|
this.$Message.success(res.msg);
|
|
|
this.isTemplate = false;
|
|
this.isTemplate = false;
|
|
@@ -374,7 +405,7 @@
|
|
|
}).catch(res => {
|
|
}).catch(res => {
|
|
|
this.$Message.error(res.msg);
|
|
this.$Message.error(res.msg);
|
|
|
})
|
|
})
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
addYg(this.formItem).then(async res => {
|
|
addYg(this.formItem).then(async res => {
|
|
|
this.$Message.success(res.msg);
|
|
this.$Message.success(res.msg);
|
|
|
this.isTemplate = false;
|
|
this.isTemplate = false;
|
|
@@ -384,7 +415,7 @@
|
|
|
this.$Message.error(res.msg);
|
|
this.$Message.error(res.msg);
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
} else {
|
|
} else {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|