diff --git a/src/views/distribution/signfor/distributionSignfor.vue b/src/views/distribution/signfor/distributionSignfor.vue index 73f711ac..1fbb4678 100644 --- a/src/views/distribution/signfor/distributionSignfor.vue +++ b/src/views/distribution/signfor/distributionSignfor.vue @@ -801,7 +801,7 @@ export default { // // console.log("<><><>>",ids); // getSignforExportOwn(row).then(res => { // // console.log(res.data); - // downloadXls(res.data, '签收数据.xlsx'); + // downloadXls(res.data, '签收数据.xlsx');` // }); }, @@ -810,23 +810,24 @@ export default { }, //查询司机信息 - getMasterDriverData() { - return new Promise((rv, rev) => { - getDriverList(1, 10, '').then(res => { - const data = res.data.data; - let po = []; - data.records.forEach(item => { - let a = { - dictKey: item.id, - dictValue: item.name, - }; - po.push(a); - }); - this.driverData = po; - console.log('===============>', res.data.data); - rv(res.data.data.records); - }); - }); + async getMasterDriverData() { + try { + const res = await getDriverList(1, 10, ''); + const { code, data } = res.data; + if (code !== 200) { + return + } + console.log(res, '司机信息'); + this.driverData = data.map(item => ({ + dictKey: item.id, + dictValue: item.name, + })); + + console.log('===============>', data); + return Promise.resolve(data.records); + } catch (error) { + console.error('Error:', error); + } }, selectionsc(value) { console.log(value);