Commit 74929d3c by 李宁

1

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