|
@@ -250,7 +250,7 @@ class CustomerProfile extends Component {
|
|
|
this.limitUser();
|
|
|
return {
|
|
|
title: "客户档案",
|
|
|
- path: "/pages/customerProfile/index?id=" + this.$instance.router.params.id,
|
|
|
+ path: "/pages/customerProfile/index?id=" + this.props.customerList[this.props.interviewIdx].id,
|
|
|
};
|
|
|
}
|
|
|
|
|
@@ -567,8 +567,9 @@ class CustomerProfile extends Component {
|
|
|
}
|
|
|
}
|
|
|
postAddProject() {
|
|
|
- const { checkProject, dtails, info } = this.state;
|
|
|
+ const { checkProject, dtails, info, projectList } = this.state;
|
|
|
const params = { uid: dtails.uid };
|
|
|
+
|
|
|
if (!checkProject.length) {
|
|
|
Taro.showToast({
|
|
|
title: "请选择要添加的项目",
|
|
@@ -576,6 +577,15 @@ class CustomerProfile extends Component {
|
|
|
});
|
|
|
return;
|
|
|
} else {
|
|
|
+ let isAdded = projectList.some(item => item.pid == checkProject[0].id)
|
|
|
+ if (isAdded) {
|
|
|
+ Taro.showToast({
|
|
|
+ title: checkProject[0].bname + '已存在,请勿重复添加!',
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
params.pid = checkProject[0].id;
|
|
|
if (checkProject[0].cSort == 9) {
|
|
|
if (!info.examineStatus) {
|
|
@@ -628,7 +638,7 @@ class CustomerProfile extends Component {
|
|
|
this.getProjectList();
|
|
|
} else {
|
|
|
Taro.showToast({
|
|
|
- title: v.error[0].message,
|
|
|
+ title: res.error[0].message,
|
|
|
icon: "none"
|
|
|
});
|
|
|
}
|
|
@@ -667,6 +677,7 @@ class CustomerProfile extends Component {
|
|
|
// 新建联系人
|
|
|
add() {
|
|
|
let data = this.state.obj
|
|
|
+ console.log(data)
|
|
|
for (let i in data) {
|
|
|
if (!data[i] && data[i] !== 0) {
|
|
|
Taro.showToast({
|
|
@@ -742,7 +753,7 @@ class CustomerProfile extends Component {
|
|
|
|
|
|
getUserList() {
|
|
|
findCustomerContacts({
|
|
|
- uid: this.$instance.router.params.id,
|
|
|
+ uid: this.props.customerList[this.props.interviewIdx].id,
|
|
|
})
|
|
|
.then((v) => {
|
|
|
if (v.error.length === 0) {
|
|
@@ -760,7 +771,7 @@ class CustomerProfile extends Component {
|
|
|
|
|
|
updateMainContact(id) {
|
|
|
updateMainContact({
|
|
|
- uid: this.$instance.router.params.id,
|
|
|
+ uid: this.props.customerList[this.props.interviewIdx].id,
|
|
|
ocbId: id,
|
|
|
}).then((v) => {
|
|
|
if (v.error.length === 0) {
|
|
@@ -781,7 +792,7 @@ class CustomerProfile extends Component {
|
|
|
|
|
|
limitUser() {
|
|
|
limitUser({
|
|
|
- uid: this.$instance.router.params.id,
|
|
|
+ uid: this.props.customerList[this.props.interviewIdx].id,
|
|
|
// hours: 1,
|
|
|
}).then((v) => {
|
|
|
if (v.error.length === 0) {
|
|
@@ -876,16 +887,16 @@ class CustomerProfile extends Component {
|
|
|
let name = data.name;
|
|
|
if (!!data.buyStatus) {
|
|
|
// 会员项目
|
|
|
- if (data.buyStatus == 1) {
|
|
|
+ if (data.buyStatus === 1) {
|
|
|
name = name + `(新购)`;
|
|
|
- } else if (data.buyStatus == 2) { } {
|
|
|
+ } else if (data.buyStatus === 2) {
|
|
|
name = name + `(复购${data.buyStatusOther})`;
|
|
|
}
|
|
|
} else if (!!data.examineStatus) {
|
|
|
// 高新项目
|
|
|
- if (data.examineStatus == 1) {
|
|
|
+ if (data.examineStatus === 1) {
|
|
|
name = name + `(初次审核)`;
|
|
|
- } else if (data.examineStatus == 2) {
|
|
|
+ } else if (data.examineStatus === 2) {
|
|
|
name = name + `(${data.examineStatusOther}年复审)`;
|
|
|
}
|
|
|
}
|
|
@@ -945,7 +956,7 @@ class CustomerProfile extends Component {
|
|
|
onClick={e => {
|
|
|
e.stopPropagation()
|
|
|
Taro.navigateTo({
|
|
|
- url: "/pages/situation/index?id=" + this.$instance.router.params.id + "¬Required=" + this.$instance.router.params.notRequired,
|
|
|
+ url: "/pages/situation/index?id=" + this.props.customerList[this.props.interviewIdx].id + "¬Required=" + this.$instance.router.params.notRequired,
|
|
|
});
|
|
|
}}
|
|
|
>公出记录</View>
|
|
@@ -1040,7 +1051,7 @@ class CustomerProfile extends Component {
|
|
|
this.setState({
|
|
|
isAdd: true,
|
|
|
obj: {
|
|
|
- uid: this.$instance.router.params.id,
|
|
|
+ uid: this.props.customerList[this.props.interviewIdx].id,
|
|
|
name: "",
|
|
|
position: "",
|
|
|
department: "",
|
|
@@ -1048,7 +1059,9 @@ class CustomerProfile extends Component {
|
|
|
}
|
|
|
})
|
|
|
}}
|
|
|
- >新增</View>
|
|
|
+ >
|
|
|
+ 新增
|
|
|
+ </View>
|
|
|
}
|
|
|
</View>
|
|
|
<View className="item-value">
|
|
@@ -1073,7 +1086,7 @@ class CustomerProfile extends Component {
|
|
|
upType: 5,
|
|
|
isOpened: true,
|
|
|
info: {
|
|
|
- uid: this.$instance.router.params.id,
|
|
|
+ uid: this.props.customerList[this.props.interviewIdx].id,
|
|
|
intendedProject: dtails.intendedProject,
|
|
|
},
|
|
|
checkOptions: []
|
|
@@ -1089,7 +1102,9 @@ class CustomerProfile extends Component {
|
|
|
<Text style={{ fontSize: '30rpx' }} style={{ marginRight: '10rpx' }}>
|
|
|
{this.renderProjectItemName(item)}
|
|
|
</Text>
|
|
|
- <AtIcon value="close" size='15' color="#f00" onClick={() => { this.handleDelProject(item) }} />
|
|
|
+
|
|
|
+ { item.type == 0 && <AtIcon value="close" size='15' color="#f00" onClick={() => { this.handleDelProject(item) }} /> }
|
|
|
+
|
|
|
</View>
|
|
|
})
|
|
|
}
|
|
@@ -1356,7 +1371,7 @@ class CustomerProfile extends Component {
|
|
|
this.setState({
|
|
|
isAdd: true,
|
|
|
obj: {
|
|
|
- uid: this.$instance.router.params.id,
|
|
|
+ uid: this.props.customerList[this.props.interviewIdx].id,
|
|
|
name: "",
|
|
|
position: "",
|
|
|
department: "",
|
|
@@ -1394,7 +1409,7 @@ class CustomerProfile extends Component {
|
|
|
upType: 5,
|
|
|
isOpened: true,
|
|
|
info: {
|
|
|
- uid: this.$instance.router.params.id,
|
|
|
+ uid: this.props.customerList[this.props.interviewIdx].id,
|
|
|
intendedProject: dtails.intendedProject,
|
|
|
},
|
|
|
checkOptions: []
|
|
@@ -1433,7 +1448,7 @@ class CustomerProfile extends Component {
|
|
|
upType: 1,
|
|
|
isOpened: true,
|
|
|
info: {
|
|
|
- uid: this.$instance.router.params.id,
|
|
|
+ uid: this.props.customerList[this.props.interviewIdx].id,
|
|
|
id: dtails.id,
|
|
|
inventionPatentCount: dtails.inventionPatentCount || 0,
|
|
|
utilityModelCount: dtails.utilityModelCount || 0,
|
|
@@ -1994,6 +2009,7 @@ class CustomerProfile extends Component {
|
|
|
placeholder='请填写部门'
|
|
|
value={obj.department}
|
|
|
onChange={e => {
|
|
|
+ console.log(e)
|
|
|
this.setState({
|
|
|
obj: Object.assign(obj, {
|
|
|
department: e,
|