Commit 74929d3c by 李宁

1

1 parent 450c2360
......@@ -286,7 +286,7 @@
<el-option v-for="item in busiLabelStore" :label="item.tagName" :value="item.id" :disabled="isTagCanCho(item)"></el-option>
</el-select>
</el-form-item>
<el-form-item label="客户地址" :required="newOpportunity.tagIds.includes(1)||newOpportunity.tagIds.includes(2)">
<el-form-item label="客户地址" :required="needValidateAddress">
<el-form-item prop="city" v-if="newOpportunity.cityArr.length>0" style="display: inline-block">
<el-select
v-model="newOpportunity.city"
......@@ -507,6 +507,8 @@ export default {
}
},
busiLabelStore: [],
// 特殊标签ID组,用于互斥选择逻辑
specialTagIds: [1, 2, 43, 44, 45],
loading: false,
activeTab: 'all',
......@@ -530,6 +532,12 @@ export default {
scrollTimer: null,
}
},
computed: {
// 是否需要验证地址(选择特殊标签时需要)
needValidateAddress() {
return this.newOpportunity.tagIds.some(id => this.specialTagIds.includes(id))
}
},
created(){
let pa = JSON.parse(localStorage.getItem('accountInfo'))
this.getData.city = pa.cityCode||''
......@@ -687,7 +695,7 @@ export default {
}
},
shouldValidateAddress() {
return this.newOpportunity.tagIds.includes(1)||this.newOpportunity.tagIds.includes(2)
return this.newOpportunity.tagIds.some(id => this.specialTagIds.includes(id))
},
addressRender(row,column){
let value = row[column.property]
......@@ -711,27 +719,18 @@ export default {
})
},
isTagCanCho(row){
let arr = this.newOpportunity.tagIds
const selectedTags = this.newOpportunity.tagIds
if(arr.length == 0){
if(selectedTags.length === 0){
return false
}
if(arr.includes(1) || arr.includes(2)){
this.newOpportunity.opportunityType = 2
if(row.id!=1 && row.id!=2){
return true
}else{
return false
}
}else{
this.newOpportunity.opportunityType = 1
if(row.id==1 || row.id==2){
return true
}else{
return false
}
}
const hasSelectedSpecial = selectedTags.some(id => this.specialTagIds.includes(id))
const isCurrentSpecial = this.specialTagIds.includes(row.id)
this.newOpportunity.opportunityType = hasSelectedSpecial ? 2 : 1
return hasSelectedSpecial ? !isCurrentSpecial : isCurrentSpecial
},
addNewBusi(){
let nd = this.newOpportunity
......
......@@ -10,8 +10,8 @@ module.exports = {
devServer: {
proxy: {
'/compass': {
target: 'https://testznzl.lgyzpt.com/',
//target: 'http://39.107.104.220:8877',
//target: 'https://testznzl.lgyzpt.com/',
target: 'http://hhzj.lgyzpt.com/',
changeOrigin: true,
pathRewrite: {
'^/compass': 'compass'
......
......@@ -217,6 +217,6 @@
<script src="js/vue.min.js"></script>
<script src="js/util.js"></script>
<script src="js/addressData.js?3323"></script>
<script src="js/addBusi.js?0910001"></script>
<script src="js/addBusi.js?091wwww0001"></script>
</body>
</html>
\ No newline at end of file
......@@ -19,6 +19,8 @@ new Vue({
textDescription: '',
// API相关
isSubmitting: false,
// 特殊标签ID组,用于互斥选择逻辑
specialTagIds: [1, 2, 43, 44, 45],
// 弹窗相关
modifyPhone:{
......@@ -198,7 +200,8 @@ new Vue({
fd.append('customerAddress',this.haZjData.address?('--:'+this.haZjData.address):'')
const tagArr = selectedTypes.map(item=>{return item.id})
fd.append('opportunityType',(tagArr.includes(1)||tagArr.includes(2)?'2':'1'))
const hasSelectedSpecial = tagArr.some(id => this.specialTagIds.includes(id))
fd.append('opportunityType',(hasSelectedSpecial?'2':'1'))
fd.append('tagIds',tagArr.join(','))
fd.append('textDescription',this.textDescription)
......@@ -367,27 +370,18 @@ new Vue({
}else{
type.selected = !type.selected
let arr = this.businessTypes.filter(t => t.selected)
if(arr.length>0){
let idarr = arr.map(item=>{return item.id})
this.businessTypes.forEach(item=>{
if(idarr.includes(1) || idarr.includes(2)){
if(item.id!=1 && item.id!=2){
item.ifCho = false
}else{
item.ifCho = true
}
}else{
if(item.id==1 || item.id==2){
item.ifCho = false
}else{
item.ifCho = true
}
}
const selectedTypes = this.businessTypes.filter(t => t.selected)
if(selectedTypes.length > 0){
const selectedIds = selectedTypes.map(item => item.id)
const hasSelectedSpecial = selectedIds.some(id => this.specialTagIds.includes(id))
this.businessTypes.forEach(item => {
const isSpecial = this.specialTagIds.includes(item.id)
item.ifCho = hasSelectedSpecial ? isSpecial : !isSpecial
})
}else{
this.businessTypes.forEach(item=>{
this.businessTypes.forEach(item => {
item.ifCho = true
})
}
......@@ -681,7 +675,8 @@ new Vue({
fd.append('customerAddress',this.selectedAddressCode?(this.selectedAddressCode+":"+this.selectedAddressText+this.detailAddress):'')
const tagArr = selectedTypes.map(item=>{return item.id})
fd.append('opportunityType',(tagArr.includes(1)||tagArr.includes(2)?'2':'1'))
const hasSelectedSpecial = tagArr.some(id => this.specialTagIds.includes(id))
fd.append('opportunityType',(hasSelectedSpecial?'2':'1'))
fd.append('tagIds',tagArr.join(','))
fd.append('textDescription',this.textDescription)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!