加功能
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" @tap="toChek(e)" :class="{'checked': pkId === e.group_id}">
|
||||
<tr v-for="(e, i) in dataList" :key="i" @tap="toChek(e)" :class="{'checked': e.checked}">
|
||||
<td>{{e.struct_code}}</td>
|
||||
<td>{{e.storagevehicle_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
@@ -61,7 +61,7 @@
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-6 button-default" @tap="clearUp">{{$t('button.clear')}}</button>
|
||||
<button class="zd-col-16 button-primary" :class="{'button-info': !pkId || !val1 || !index1}" @tap="_callMaterialConfirm">{{$t('button.confirm')}}</button>
|
||||
<button class="zd-col-16 button-primary" :class="{'button-info': allChecked.length === 0 || !val1 || !index1}" @tap="_callMaterialConfirm">{{$t('button.confirm')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -85,8 +85,7 @@
|
||||
options1: [],
|
||||
index1: '',
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
allChecked: [],
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
@@ -123,11 +122,14 @@
|
||||
}
|
||||
},
|
||||
async _linegetMaterialDtl () {
|
||||
this.pkId = ''
|
||||
this.allChecked = []
|
||||
try {
|
||||
let res = await linegetMaterialDtl(this.index, this.val2)
|
||||
if (res.status === '200') {
|
||||
this.dataList = [...res.data]
|
||||
this.dataList.map(el => {
|
||||
this.$set(el, 'checked', false)
|
||||
})
|
||||
} else {
|
||||
this.dataList = []
|
||||
}
|
||||
@@ -136,17 +138,17 @@
|
||||
}
|
||||
},
|
||||
toChek (e) {
|
||||
this.pkId = this.pkId === e.group_id ? '' : e.group_id
|
||||
this.pkObj = this.pkId === e.group_id ? e : {}
|
||||
e.checked = !e.checked
|
||||
this.allChecked = this.dataList.filter(el => el.checked === true)
|
||||
},
|
||||
async _callMaterialConfirm () {
|
||||
this.disabled = true
|
||||
if (!this.pkId || !this.val1 || !this.index1) {
|
||||
if (!this.allChecked.length === 0 || !this.val1 || !this.index1) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await callMaterialConfirm(this.val1, this.pkObj, this.index1)
|
||||
let res = await callMaterialConfirm(this.val1, this.allChecked, this.index1)
|
||||
if (res.status === '200') {
|
||||
this.clearUp()
|
||||
}
|
||||
@@ -164,8 +166,7 @@
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.index1 = ''
|
||||
this.pkId = ''
|
||||
this.pkObj = {}
|
||||
this.allChecked = []
|
||||
this.dataList = []
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user