|
@@ -12,11 +12,14 @@
|
|
|
class="sear"
|
|
|
placeholder="搜索"
|
|
|
prefix-icon="el-icon-search"
|
|
|
+ v-if="digs == 3 ?false : true"
|
|
|
v-model="input1">
|
|
|
</el-input>
|
|
|
<div class="industy_lis">
|
|
|
<div class="quan_bu" v-if="digs != 6">
|
|
|
<el-checkbox-button
|
|
|
+ @change="checkCountry"
|
|
|
+ v-model="Country"
|
|
|
:label="digs == 1?'全国':digs == 2?'全部行业':'全部类型'"
|
|
|
:class="{c_active:digs != 2}"
|
|
|
>
|
|
@@ -39,12 +42,10 @@
|
|
|
<!-- 信息类型 -->
|
|
|
<div class="lists msg_type" v-if="digs == 3">
|
|
|
<ul>
|
|
|
- <li v-for="item in groupData3" :key="item.title" class="li_data">
|
|
|
- <el-checkbox-group v-model="checkboxGroup3">
|
|
|
- <el-checkbox-button class="titles" :label="item.title">{{item.title}}</el-checkbox-button>
|
|
|
- </el-checkbox-group>
|
|
|
- <el-checkbox-group v-model="checkboxGroup3">
|
|
|
- <el-checkbox-button v-for="ite in item.list" :key="ite.name" :label="ite.name">{{ite.name}}</el-checkbox-button>
|
|
|
+ <li v-for="(item,i) in groupData3" :key="item.title" class="li_data">
|
|
|
+ <el-checkbox class="titles" v-model="selectcheckboxGroup3.status[i]" @change="handleCheckAllChange(item,i)">{{ item.title }}</el-checkbox>
|
|
|
+ <el-checkbox-group v-model="selectcheckboxGroup3.list[i]" @change="handleCheckedCitiesChange(item,i)">
|
|
|
+ <el-checkbox-button v-for="ite in item.list" :key="ite" :label="ite">{{ite}}</el-checkbox-button>
|
|
|
</el-checkbox-group>
|
|
|
</li>
|
|
|
</ul>
|
|
@@ -73,7 +74,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { scribeKey, buyerUpdate } from '@/api/api';
|
|
|
+import { scribeKey, buyerUpdate, updateInfotype} from '@/api/api';
|
|
|
import { industryData2, industryData3 } from'@/assets/js/industry_data.js';
|
|
|
|
|
|
export default {
|
|
@@ -83,14 +84,20 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ Country:false,
|
|
|
boxVisible: false,
|
|
|
care: 1,
|
|
|
mails: false,
|
|
|
keyShow: false,
|
|
|
input1: '',
|
|
|
checkboxGroup1: ['c21'],
|
|
|
- checkboxGroup2: [],
|
|
|
- checkboxGroup3: ['招标'],
|
|
|
+ checkboxGroup2: [''],
|
|
|
+ checkboxGroup3: [],
|
|
|
+ InformatioType:[],
|
|
|
+ selectcheckboxGroup3:{
|
|
|
+ status:[],
|
|
|
+ list:[]
|
|
|
+ },
|
|
|
checkboxGroup4: ['b1'],
|
|
|
activeNames: ['1'],
|
|
|
groupData1: [],
|
|
@@ -110,6 +117,40 @@ export default {
|
|
|
created() {
|
|
|
this.groupData2 = industryData2;
|
|
|
this.groupData3 = industryData3;
|
|
|
+ //信息类型数据处理
|
|
|
+ this.$watch('InformatioType', () =>{
|
|
|
+ this.selectcheckboxGroup3.status = [];
|
|
|
+ this.selectcheckboxGroup3.list = [];
|
|
|
+ this.Country = false;
|
|
|
+ if(this.InformatioType[0] =='全部类型'){
|
|
|
+ this.Country = true;
|
|
|
+ }
|
|
|
+ this.groupData3.forEach( (v,i) =>{
|
|
|
+ if(!Array.isArray(this.selectcheckboxGroup3.list[i])){
|
|
|
+ this.selectcheckboxGroup3.list[i] = [];
|
|
|
+ }
|
|
|
+ this.selectcheckboxGroup3.status[i] = false;
|
|
|
+ if(v.list){
|
|
|
+ v.list.forEach((item,x) =>{
|
|
|
+ let current = this.InformatioType.find(n =>n === item);
|
|
|
+ if(current !== undefined){
|
|
|
+ this.selectcheckboxGroup3.list[i].push(current);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(this.selectcheckboxGroup3.list[i].length === v.list.length){
|
|
|
+ this.selectcheckboxGroup3.status[i] = true
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ let current = this.InformatioType.find(n =>n === v.title);
|
|
|
+ if(current !== undefined){
|
|
|
+ this.selectcheckboxGroup3.list[i].push(current);
|
|
|
+ this.selectcheckboxGroup3.status[i] = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
this.checkboxGroup2 = this.boxData.buyerclass;
|
|
|
console.log(this.checkboxGroup2);
|
|
|
// scribeKey().then(res => {
|
|
@@ -125,8 +166,9 @@ export default {
|
|
|
// })
|
|
|
// })
|
|
|
},
|
|
|
+
|
|
|
methods: {
|
|
|
- fenLei(index,title) {
|
|
|
+ fenLei(index,title) {
|
|
|
console.log(title)
|
|
|
let arrIndex = this.leiIndex.indexOf(index);
|
|
|
if(arrIndex>-1){
|
|
@@ -139,21 +181,79 @@ export default {
|
|
|
console.log(this.arr)
|
|
|
// this.$parent.tableData[this.$parent.cellIndex].items = ''
|
|
|
},
|
|
|
- confirmed() {
|
|
|
- this.boxVisible = false;
|
|
|
- if (this.$parent.digIndex == 'sub') {
|
|
|
- this.$parent.bookForm.indust = String(this.boxData.buyerclass.join(",").replace(/,/g, "、"));
|
|
|
- buyerUpdate({buyer:this.boxData.buyerclass}).then(res => {
|
|
|
- if (res.data.status == 1) {
|
|
|
- this.$message({
|
|
|
- message: '设置成功',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
+ //全选
|
|
|
+ checkCountry(){
|
|
|
+ if(this.digs ==3){
|
|
|
+ this.InformatioType = []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //保存
|
|
|
+ confirmed() {
|
|
|
+ if(this.digs ==3){
|
|
|
+ let arr = '';
|
|
|
+ if(this.Country){
|
|
|
+ this.selectcheckboxGroup3.list.forEach( v =>{
|
|
|
+ if(v.length>0){
|
|
|
+ arr += `${v.join('、')}、`
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ arr = '全部类型'
|
|
|
+ }
|
|
|
+ arr = arr.replace(/(.*)、/,'$1');
|
|
|
+ let newArr = arr.split('、');
|
|
|
+ this.$parent.bookForm.mesge = arr;
|
|
|
+ updateInfotype({msg:newArr}).then(res =>{
|
|
|
+ if(res.data.status == 1){
|
|
|
+ this.$message({ message: '设置成功',type: 'success'});
|
|
|
+ }else{
|
|
|
+ this.$message({ message: '设置失败',type: 'warning'});
|
|
|
+ return;
|
|
|
}
|
|
|
})
|
|
|
- } else if (this.$parent.digIndex == 'distri') {
|
|
|
- this.$parent.tableData[this.$parent.cellIndex].buyerclass = String(this.boxData.buyerclass.join(",").replace(/,/g, "、"));
|
|
|
+ } else {
|
|
|
+ if (this.$parent.digIndex == 'sub') {
|
|
|
+ this.$parent.bookForm.indust = String(this.boxData.buyerclass.join(",").replace(/,/g, "、"));
|
|
|
+ buyerUpdate({buyer:this.boxData.buyerclass}).then(res => {
|
|
|
+ if (res.data.status == 1) {
|
|
|
+ this.$message({
|
|
|
+ message: '设置成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (this.$parent.digIndex == 'distri') {
|
|
|
+ this.$parent.tableData[this.$parent.cellIndex].buyerclass = String(this.boxData.buyerclass.join(",").replace(/,/g, "、"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.boxVisible = false;
|
|
|
+ },
|
|
|
+ //信息类型全部选择
|
|
|
+ handleCheckAllChange(val,i){
|
|
|
+ console.log(val)
|
|
|
+ if(val.list){
|
|
|
+ if(this.selectcheckboxGroup3.list[i].length == 0){
|
|
|
+ this.selectcheckboxGroup3.list.splice(i,1,val.list)
|
|
|
+ }else{
|
|
|
+ this.selectcheckboxGroup3.list.splice(i,1,[])
|
|
|
+ }
|
|
|
+ let checkedCount = val.list.length;
|
|
|
+ let status = checkedCount === this.selectcheckboxGroup3.list[i].length;
|
|
|
+ this.selectcheckboxGroup3.status.splice(i,1,status)
|
|
|
+ }else{
|
|
|
+ if(this.selectcheckboxGroup3.list[i].length == 0){
|
|
|
+ this.selectcheckboxGroup3.list[i].push(val.title)
|
|
|
+ }else{
|
|
|
+ this.selectcheckboxGroup3.list.splice(i,1,[])
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+ },
|
|
|
+ //单个选择
|
|
|
+ handleCheckedCitiesChange(value,i) {
|
|
|
+ let checkedCount = value.list.length;
|
|
|
+ let status = checkedCount === this.selectcheckboxGroup3.list[i].length;
|
|
|
+ this.selectcheckboxGroup3.status.splice(i,1,status)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -183,6 +283,16 @@ export default {
|
|
|
display: flex;
|
|
|
padding: 8px 20px;
|
|
|
box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.05);
|
|
|
+ /deep/.el-checkbox-button__inner{
|
|
|
+ color: #1d1d1d;
|
|
|
+ }
|
|
|
+ /deep/.el-checkbox-button.is-checked .el-checkbox-button__inner{
|
|
|
+ color: #2ABED1!important;
|
|
|
+ border: 1px solid $light_color !important;
|
|
|
+ }
|
|
|
+ /deep/.el-checkbox-button__inner:hover{
|
|
|
+ color: $light_color;
|
|
|
+ }
|
|
|
}
|
|
|
.lists {
|
|
|
.li_data {
|
|
@@ -191,7 +301,7 @@ export default {
|
|
|
text-align: left;
|
|
|
width: 100%;
|
|
|
min-height: 40px;
|
|
|
- margin-top: 10px;
|
|
|
+ margin-top: 14px;
|
|
|
box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.05);
|
|
|
h3 {
|
|
|
font-size: 12px;
|
|
@@ -201,8 +311,25 @@ export default {
|
|
|
background: #F5F5FB;
|
|
|
}
|
|
|
.el-checkbox-group {
|
|
|
- padding: 0 20px 8px 20px;
|
|
|
-
|
|
|
+ padding: 0 20px 14px 20px;
|
|
|
+ }
|
|
|
+ /deep/.titles{
|
|
|
+ .el-checkbox__input{
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ .el-checkbox__label{
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 2px 10px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #1d1d1d;
|
|
|
+ margin-left: 20px;
|
|
|
+ border-radius: 4px!important;
|
|
|
+ border: 1px solid #DCDFE6;
|
|
|
+ }
|
|
|
+ .el-checkbox__input.is-checked + .el-checkbox__label{
|
|
|
+ color: #2ABED1!important;
|
|
|
+ border: 1px solid $light_color !important;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.li_fen {
|