lialiaoruku修改
This commit is contained in:
@@ -101,11 +101,12 @@
|
||||
code: '',
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
dataList: [],
|
||||
// dataList: [
|
||||
// {site_code: 's01', vehicle_code: 'v01', checked: false},
|
||||
// {site_code: 's04', vehicle_code: 'v04', checked: false}
|
||||
// ],
|
||||
// dataList: [],
|
||||
dataList: [
|
||||
{site_code: 's01', vehicle_code: 'v01', checked: false},
|
||||
{site_code: 's04', vehicle_code: 'v04', checked: false},
|
||||
{site_code: 's05', vehicle_code: 'v05', checked: false}
|
||||
],
|
||||
allCheck: false,
|
||||
checkedArr: [],
|
||||
pkId: '',
|
||||
@@ -151,12 +152,6 @@
|
||||
el.checked = this.allCheck
|
||||
})
|
||||
},
|
||||
toAllCheck () {
|
||||
this.allCheck = !this.allCheck
|
||||
this.dataList.map(el => {
|
||||
el.checked = this.allCheck
|
||||
})
|
||||
},
|
||||
toCheck (e) {
|
||||
e.checked = !e.checked
|
||||
this.checkedArr = this.dataList.filter(el => el.checked === true)
|
||||
@@ -167,14 +162,13 @@
|
||||
this.checkedArr = []
|
||||
},
|
||||
async _getInBillList () {
|
||||
this.toAllCheck()
|
||||
try {
|
||||
let res = await getInBillList()
|
||||
if (res.code === '200') {
|
||||
this.dataList = [...res.data]
|
||||
this.allCheck = true
|
||||
this.dataList.map(el => {
|
||||
el.checked = this.allCheck
|
||||
this.$set(el, 'checked', false)
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
@@ -187,11 +181,14 @@
|
||||
},
|
||||
async _zwConfirmIn () {
|
||||
this.disabled = true
|
||||
this.checkedArr = this.dataList.filter(el => el.checked === true)
|
||||
if (!this.checkedArr.length) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
// 去掉checked字段再上传
|
||||
this.checkedArr.forEach(item => delete item.checked);
|
||||
let res = await zwConfirmIn(this.checkedArr)
|
||||
if (res.code === '200') {
|
||||
uni.showToast({
|
||||
|
||||
Reference in New Issue
Block a user