|
@@ -219,10 +219,16 @@ export default {
|
|
// 新增/编辑
|
|
// 新增/编辑
|
|
handleSave () {
|
|
handleSave () {
|
|
const _this = this
|
|
const _this = this
|
|
- const newArr = this.chooseDealerList.map(item => {
|
|
|
|
- return item.dealerSn
|
|
|
|
- })
|
|
|
|
- _this.form.dealerSnList = newArr
|
|
|
|
|
|
+ if (_this.form.dealerScope === 'SOME_DEALER' && _this.chooseDealerList && _this.chooseDealerList.length > 0) {
|
|
|
|
+ const newArr = this.chooseDealerList.map(item => {
|
|
|
|
+ return item.dealerSn
|
|
|
|
+ })
|
|
|
|
+ _this.form.dealerSnList = newArr
|
|
|
|
+ } else {
|
|
|
|
+ _this.$message.error('请选择参与客户')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
this.$refs.ruleForm.validate(valid => {
|
|
this.$refs.ruleForm.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
const form = JSON.parse(JSON.stringify(_this.form))
|
|
const form = JSON.parse(JSON.stringify(_this.form))
|
|
@@ -295,12 +301,12 @@ export default {
|
|
},
|
|
},
|
|
// 导入参与客户
|
|
// 导入参与客户
|
|
hanldeOk (arr) {
|
|
hanldeOk (arr) {
|
|
- const list = [...this.chooseDealerList,...arr]
|
|
|
|
- let obj={}
|
|
|
|
- this.chooseDealerList = list.reduce((cur,next)=>{
|
|
|
|
- obj[next.dealerSn]?"":obj[next.dealerSn] = true && cur.push(next)
|
|
|
|
|
|
+ const list = [...this.chooseDealerList, ...arr]
|
|
|
|
+ const obj = {}
|
|
|
|
+ this.chooseDealerList = list.reduce((cur, next) => {
|
|
|
|
+ obj[next.dealerSn] ? '' : obj[next.dealerSn] = true && cur.push(next)
|
|
return cur
|
|
return cur
|
|
- },[])
|
|
|
|
|
|
+ }, [])
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|