|
@@ -134,6 +134,7 @@ export default {
|
|
|
calendar_show: false,
|
|
|
maxDate: '2023-01-01',
|
|
|
minDate: '',
|
|
|
+ businessId:'',
|
|
|
list3: [
|
|
|
{
|
|
|
name: '一',
|
|
@@ -378,10 +379,49 @@ export default {
|
|
|
this.form.category = this.list[0].educationName + '-' + this.list[0].projectName + '-' + this.list[0].businessName;
|
|
|
}
|
|
|
},
|
|
|
- checkboxChange(e) {},
|
|
|
+ checkboxChange(e) {
|
|
|
+ let goodsId = e.name;
|
|
|
+ if(e.value) { //勾选
|
|
|
+ this.businessId = this.list2.find(listItem => listItem.goodsId == goodsId).businessId;
|
|
|
+ this.list2.forEach(listItem => {
|
|
|
+ if(listItem.businessId != this.businessId) {
|
|
|
+ listItem.disabled = true;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else { //取消
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let checkedNum = this.list2.filter(listItem => {
|
|
|
+ if(listItem.checked) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ if(this.list.length) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).length;
|
|
|
+
|
|
|
+ if(checkedNum == 0) { //全部取消,且没有已选择的
|
|
|
+ this.businessId = '';
|
|
|
+ this.list2.forEach(listItem => {
|
|
|
+ console.log(listItem)
|
|
|
+ listItem.disabled = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
checkSameItem() {
|
|
|
this.list2.map(val => {
|
|
|
val.disabled = false;
|
|
|
+ if(this.businessId) {
|
|
|
+ if(val.businessId != this.businessId) {
|
|
|
+ val.disabled = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
this.list.map(val1 => {
|
|
|
if (val.goodsId == val1.goodsId) {
|
|
|
val.disabled = true;
|
|
@@ -393,6 +433,7 @@ export default {
|
|
|
delItem(index) {
|
|
|
this.list.splice(index, 1);
|
|
|
if (this.list.length === 0) {
|
|
|
+ this.businessId = '';
|
|
|
this.form.category = '';
|
|
|
} else {
|
|
|
this.form.category = this.list[0].educationName + '-' + this.list[0].projectName + '-' + this.list[0].businessName;
|