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