|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="bgcolor assignPage">
|
|
|
<div class="navBarTOP">
|
|
|
- <van-nav-bar class="navBar" left-arrow title="客资分配" @click-left="onClickLeft" />
|
|
|
+ <van-nav-bar class="navBar" left-arrow :title="title" @click-left="onClickLeft" />
|
|
|
</div>
|
|
|
<div class="lineGrey"></div>
|
|
|
<div class="lineGrey"></div>
|
|
|
@@ -17,29 +17,62 @@
|
|
|
readonly
|
|
|
clickable
|
|
|
name="picker"
|
|
|
- :value="value1"
|
|
|
+ :value="assignTypeValue"
|
|
|
label="客资类型"
|
|
|
placeholder="点击选择客资类型"
|
|
|
:rules="[{ required: true, message: '请选择客资类型' }]"
|
|
|
@click="showPicker = true" />
|
|
|
+ <van-field
|
|
|
+ v-if="activaAssignTypeItem && activaAssignTypeItem.dictValue != 1"
|
|
|
+ readonly
|
|
|
+ clickable
|
|
|
+ name="picker"
|
|
|
+ :value="assignUserPostValue"
|
|
|
+ label="分配人员岗位"
|
|
|
+ placeholder="点击选择分配人员岗位"
|
|
|
+ :rules="[{ required: true, message: '请选择分配人员岗位' }]"
|
|
|
+ @click="assignUserPostShow = true" />
|
|
|
+ <van-field
|
|
|
+ readonly
|
|
|
+ clickable
|
|
|
+ name="picker"
|
|
|
+ :value="assignUserValue"
|
|
|
+ label="分配人员"
|
|
|
+ placeholder="点击选择分配人员"
|
|
|
+ :rules="[{ required: true, message: '请选择分配人员' }]"
|
|
|
+ @click="assignUserShow = true" />
|
|
|
<div style="margin: 16px">
|
|
|
<van-button round block type="info" native-type="submit">提交</van-button>
|
|
|
</div>
|
|
|
</van-form>
|
|
|
</div>
|
|
|
- <div class="tc" style="padding: 0 16px">
|
|
|
- <!-- <van-button class="submitBtn" block type="info" color="#0057ba" @click="onSubmit">
|
|
|
- 提交
|
|
|
- </van-button> -->
|
|
|
- </div>
|
|
|
<!-- 类型选择 -->
|
|
|
<van-popup v-model="showPicker" position="bottom">
|
|
|
<van-picker
|
|
|
show-toolbar
|
|
|
- :columns="columns"
|
|
|
+ value-key="dictLabel"
|
|
|
+ :columns="assignTypeData"
|
|
|
@confirm="onConfirm"
|
|
|
@cancel="showPicker = false" />
|
|
|
</van-popup>
|
|
|
+ <!-- 分配人员岗位 -->
|
|
|
+ <van-popup v-model="assignUserPostShow" position="bottom">
|
|
|
+ <van-picker
|
|
|
+ show-toolbar
|
|
|
+ value-key="postName"
|
|
|
+ :columns="assignUserPostData"
|
|
|
+ @confirm="onConfirmAssignUserPost"
|
|
|
+ @cancel="assignUserPost = false" />
|
|
|
+ </van-popup>
|
|
|
+ <!-- 分配人员选择 -->
|
|
|
+ <van-popup v-model="assignUserShow" position="bottom">
|
|
|
+ <van-picker
|
|
|
+ show-toolbar
|
|
|
+ value-key="nickName"
|
|
|
+ :columns="assignUserData"
|
|
|
+ @confirm="onConfirmAssignUser"
|
|
|
+ @cancel="assignUserShow = false" />
|
|
|
+ </van-popup>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -47,6 +80,11 @@
|
|
|
import { getCustomerClueInfoById } from '@/api/clew';
|
|
|
import { getDictOption } from '@/api/index';
|
|
|
import assignAwaitDetail from './assignAwaitDetail.vue';
|
|
|
+import {
|
|
|
+ selectUserListByCustomerType,
|
|
|
+ selectUserListByPostName,
|
|
|
+ allocationCustomer,
|
|
|
+} from '@/api/assignAwait';
|
|
|
|
|
|
export default {
|
|
|
name: 'assignPage',
|
|
|
@@ -58,11 +96,35 @@ export default {
|
|
|
id: '',
|
|
|
infoData: {},
|
|
|
collectionItemList: [],
|
|
|
- value1: '',
|
|
|
showPicker: false,
|
|
|
- columns: ['杭州', '宁波', '温州', '嘉兴', '湖州'],
|
|
|
+ assignUserPostShow: false,
|
|
|
+ assignUserShow: false,
|
|
|
+ columns: [],
|
|
|
+ valueKey: '',
|
|
|
+ assignTypeData: [], //客资类型下拉选数据
|
|
|
+ activaAssignTypeItem: null, //客资类型当前选择的数据
|
|
|
+ assignTypeValue: '', //客资类型选中value
|
|
|
+ assignUserPostData: [], //分配人员岗位下拉选数据
|
|
|
+ assignUserPostItem: null, //分配人员岗位当前选择的数据
|
|
|
+ assignUserPostValue: '', //分配人员岗位选中value
|
|
|
+ assignUserData: [], //分配人员下拉选数据
|
|
|
+ assignUserItem: null, //分配人员当前选择的数据
|
|
|
+ assignUserValue: '', //分配人员选中value
|
|
|
+ title: '',
|
|
|
};
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ 'activaAssignTypeItem.dictValue': {
|
|
|
+ handler(val) {
|
|
|
+ if (val) this.getSelectUserListByCustomerType();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ assignUserPostValue: {
|
|
|
+ handler(val) {
|
|
|
+ if (val) this.getSelectUserListByPostName();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
activated() {
|
|
|
this.id = this.$route.query.id;
|
|
|
this.getDictOptionFun();
|
|
|
@@ -70,7 +132,71 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
async getDictOptionFun() {
|
|
|
- let mapRangeOption = await getDictOption({}, 'jz_customer_type');
|
|
|
+ // 获取字典(jz_customer_type)参数对应的备注值,如果选择大型装企直接返回用户表列表
|
|
|
+ let customer = await getDictOption({}, 'jz_customer_type');
|
|
|
+ if (customer.data && customer.data.length) {
|
|
|
+ this.assignTypeData = customer.data;
|
|
|
+ this.activaAssignTypeItem = this.assignTypeData[0];
|
|
|
+ this.assignTypeValue = this.activaAssignTypeItem.dictLabel;
|
|
|
+ } else {
|
|
|
+ this.assignTypeData = [];
|
|
|
+ this.activaAssignTypeItem = null;
|
|
|
+ this.assignTypeValue = '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getSelectUserListByCustomerType() {
|
|
|
+ let params = JSON.parse(this.activaAssignTypeItem.remark);
|
|
|
+ selectUserListByCustomerType(params).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ // 如果选择大型装企直接返回用户表列表
|
|
|
+ if (this.activaAssignTypeItem.dictValue == 1) {
|
|
|
+ if (res.data && res.data.userList.length) {
|
|
|
+ this.assignUserData = res.data.userList;
|
|
|
+ this.assignUserItem = this.assignUserData[0];
|
|
|
+ this.assignUserValue = this.assignUserItem.nickName;
|
|
|
+ } else {
|
|
|
+ this.assignUserData = [];
|
|
|
+ this.assignUserItem = null;
|
|
|
+ this.assignUserValue = '';
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (res.data && res.data.postList.length) {
|
|
|
+ let resData = [];
|
|
|
+ res.data.postList.forEach((val) => {
|
|
|
+ resData.push({
|
|
|
+ postName: val,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ this.assignUserPostData = resData;
|
|
|
+ this.assignUserPostItem = this.assignUserPostData[0];
|
|
|
+ this.assignUserPostValue = this.assignUserPostItem.postName;
|
|
|
+ } else {
|
|
|
+ this.assignUserPostData = [];
|
|
|
+ this.assignUserPostItem = null;
|
|
|
+ this.assignUserPostValue = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$toast(res.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getSelectUserListByPostName() {
|
|
|
+ selectUserListByPostName({ postName: this.assignUserPostValue }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ if (res.data && res.data.userList.length) {
|
|
|
+ this.assignUserData = res.data.userList;
|
|
|
+ this.assignUserItem = this.assignUserData[0];
|
|
|
+ this.assignUserValue = this.assignUserItem.nickName;
|
|
|
+ } else {
|
|
|
+ this.assignUserData = [];
|
|
|
+ this.assignUserItem = null;
|
|
|
+ this.assignUserValue = '';
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$toast(res.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
getCustomerClueInfoById() {
|
|
|
this.id = this.$route.query.id;
|
|
|
@@ -79,6 +205,7 @@ export default {
|
|
|
getCustomerClueInfoById({ customerClueInfoId: this.id }).then((response) => {
|
|
|
if (response.code == 200) {
|
|
|
this.infoData = response.data;
|
|
|
+ this.title = response.data.name;
|
|
|
if (response.data.customerClue != null) {
|
|
|
this.collectionItemList = response.data.customerClue.customerClueItemList;
|
|
|
} else {
|
|
|
@@ -89,99 +216,57 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- onSubmit() {},
|
|
|
+ onSubmit() {
|
|
|
+ allocationCustomer({
|
|
|
+ userId: this.assignUserItem.userId || '', // string 用户ID
|
|
|
+ customerClueInfoId: this.id, // string 客资主键ID
|
|
|
+ customerClassify: this.activaAssignTypeItem.dictValue || '', // string 客资类型,(取值页面字典选择的值 jz_customer_type)
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$toast(res.msg);
|
|
|
+ this.onClickLeft();
|
|
|
+ } else {
|
|
|
+ this.$toast(res.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
// 校验错误返回信息
|
|
|
onFailed(errorInfo) {
|
|
|
console.log('failed', errorInfo);
|
|
|
},
|
|
|
onConfirm(value) {
|
|
|
- this.value = value;
|
|
|
+ this.activaAssignTypeItem = value;
|
|
|
+ this.assignTypeValue = this.activaAssignTypeItem.dictLabel;
|
|
|
this.showPicker = false;
|
|
|
},
|
|
|
+ onConfirmAssignUserPost(value) {
|
|
|
+ this.assignUserPostItem = value;
|
|
|
+ this.assignUserPostValue = this.assignUserPostItem.postName;
|
|
|
+ this.assignUserPostShow = false;
|
|
|
+ },
|
|
|
+ onConfirmAssignUser(value) {
|
|
|
+ this.assignUserItem = value;
|
|
|
+ this.assignUserValue = this.assignUserItem.nickName;
|
|
|
+ this.assignUserShow = false;
|
|
|
+ },
|
|
|
onClickLeft() {
|
|
|
this.$router.go(-1);
|
|
|
},
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
-<style scoped>
|
|
|
+<style scoped lang="scss">
|
|
|
.assignPage {
|
|
|
- .container {
|
|
|
- background-color: white;
|
|
|
- }
|
|
|
- .formLabel {
|
|
|
- border-bottom: 1px solid #f1f1f1;
|
|
|
- }
|
|
|
- .formLabel .van-cell {
|
|
|
- padding: 10px 0;
|
|
|
- font-size: 14px;
|
|
|
- }
|
|
|
- .formLabel .van-cell::after {
|
|
|
- border: 0;
|
|
|
- }
|
|
|
- .formLabeltext .van-field {
|
|
|
- border: 1px solid #f1f1f1;
|
|
|
- padding: 6px;
|
|
|
- width: 100%;
|
|
|
- border-radius: 4px;
|
|
|
- overflow: hidden;
|
|
|
- }
|
|
|
- .formLabel .van-field__control {
|
|
|
- padding: 0 10px;
|
|
|
- }
|
|
|
- .z-checkbox .van-radio {
|
|
|
- padding: 6px 0;
|
|
|
- }
|
|
|
- .z-cell .van-cell__title {
|
|
|
- font-size: 14px;
|
|
|
- }
|
|
|
}
|
|
|
</style>
|
|
|
-<style>
|
|
|
+<style lang="scss">
|
|
|
.assignPage {
|
|
|
- .cardclewContentCell {
|
|
|
- margin: 0 10px;
|
|
|
- }
|
|
|
- .formLabel .van-radio__label,
|
|
|
- .formLabel .van-checkbox__label {
|
|
|
- font-size: 14px;
|
|
|
- }
|
|
|
- .van-dialog__confirm,
|
|
|
- .van-dialog__confirm:active {
|
|
|
- color: #1989fa;
|
|
|
- }
|
|
|
- .cardclewContent {
|
|
|
- background: #fff;
|
|
|
- box-sizing: border-box;
|
|
|
- padding: 10px 16px;
|
|
|
- margin: 6px 10px 10px;
|
|
|
- }
|
|
|
- .cardclewContent .info {
|
|
|
- font-size: 14px;
|
|
|
- color: #444;
|
|
|
- line-height: 28px;
|
|
|
- }
|
|
|
- .cardclewContent .title p {
|
|
|
- padding: 0;
|
|
|
- margin: 0;
|
|
|
- }
|
|
|
- .cardclewContent .title .textLeft {
|
|
|
- display: inline-block;
|
|
|
- padding-bottom: 10px;
|
|
|
- }
|
|
|
- .dialogz {
|
|
|
- width: 100%;
|
|
|
- }
|
|
|
- .dialogz .van-dialog__content {
|
|
|
- height: 72vh;
|
|
|
- overflow-y: auto;
|
|
|
- }
|
|
|
- .radioboxss .van-radio {
|
|
|
- margin-bottom: 6px;
|
|
|
- }
|
|
|
- .fieldNumber {
|
|
|
- border: 1px solid #f1f1f1;
|
|
|
- padding-left: 5px !important;
|
|
|
+ .van-field__label {
|
|
|
+ width: 100px;
|
|
|
+ &::before {
|
|
|
+ content: '*';
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|