From 9bae05316398fbb4d677fd6a9fb73e6f21c4262c Mon Sep 17 00:00:00 2001 From: qb <1191961160@qq.com> Date: Sat, 14 Sep 2024 09:09:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vehicle/basicdataVehicleAddForm.vue | 82 +++++------ .../vehicle/basicdataVehicleInfo.vue | 8 +- .../artery/truckLoadingDetails.vue | 43 +++--- .../warehouseWarehouseingAddReceipt.vue | 127 +++++++++--------- src/views/waybill/CreateZeroOrder.vue | 7 +- 5 files changed, 138 insertions(+), 129 deletions(-) diff --git a/src/views/basicdata/vehicle/basicdataVehicleAddForm.vue b/src/views/basicdata/vehicle/basicdataVehicleAddForm.vue index d50523d6..bff86c11 100644 --- a/src/views/basicdata/vehicle/basicdataVehicleAddForm.vue +++ b/src/views/basicdata/vehicle/basicdataVehicleAddForm.vue @@ -216,19 +216,26 @@ const details = reactive({ prop: 'vehicleModel', type: 3, checkarr: [], - change(value) { - console.log('value :>> ', value); - console.log('this :>> ', this); - const { vehicleCommander, vehicleHeight, approvedVolume, vehicleQuality, curbWeight } = - this.checkarr.find(val => val.value === value) || {}; - - details.form.vehicleCommander = isNumber(vehicleCommander) ? Number(vehicleCommander) : 0; - details.form.vehicleHeight = isNumber(vehicleHeight) ? Number(vehicleHeight) : 0; - details.form.approvedVolume = isNumber(approvedVolume) ? Number(approvedVolume) : 0; - details.form.vehicleQuality = isNumber(vehicleQuality) ? Number(vehicleQuality) : 0; - details.form.curbWeight = isNumber(curbWeight) ? Number(curbWeight) : 0; - }, - }, + change(value) {}, + }, + // { + // label: '车辆类型', + // prop: 'vehicleModel', + // type: 3, + // checkarr: [], + // change(value) { + // console.log('value :>> ', value); + // console.log('this :>> ', this); + // const { vehicleCommander, vehicleHeight, approvedVolume, vehicleQuality, curbWeight } = + // this.checkarr.find(val => val.value === value) || {}; + + // details.form.vehicleCommander = isNumber(vehicleCommander) ? Number(vehicleCommander) : 0; + // details.form.vehicleHeight = isNumber(vehicleHeight) ? Number(vehicleHeight) : 0; + // details.form.approvedVolume = isNumber(approvedVolume) ? Number(approvedVolume) : 0; + // details.form.vehicleQuality = isNumber(vehicleQuality) ? Number(vehicleQuality) : 0; + // details.form.curbWeight = isNumber(curbWeight) ? Number(curbWeight) : 0; + // }, + // }, { label: '车厢类型', prop: 'carType', @@ -241,7 +248,6 @@ const details = reactive({ type: 2, checkarr: [], precision: 2, - disabled: true, }, { label: '外廓高(M)', @@ -249,7 +255,6 @@ const details = reactive({ type: 2, checkarr: [], precision: 2, - disabled: true, }, { label: '付款方式', @@ -263,7 +268,6 @@ const details = reactive({ type: 2, checkarr: [], precision: 2, - disabled: true, }, { label: '车牌颜色', @@ -313,7 +317,6 @@ const details = reactive({ type: 2, checkarr: [], precision: 2, - disabled: true, }, { label: '整备质量(T)', @@ -321,7 +324,6 @@ const details = reactive({ type: 2, checkarr: [], precision: 2, - disabled: true, }, { label: '载荷质量(T)', @@ -464,6 +466,13 @@ const details = reactive({ type: 1, checkarr: [], }, + { + label: '结算类型', + prop: 'vehicleModelId', + type: 3, + checkarr: [], + change(value) {}, + }, { label: '备注', prop: 'notes', @@ -529,39 +538,30 @@ const initData = async () => { // 请求车辆类型 const handleCarModel = async () => { - const [res1, res2] = await Promise.all([getList(), getDictionaryBiz('basic_vehicle_model')]); + const res = await getList(); - const { code: code1, data: data1 } = res1.data; - const { code: code2, data: data2 } = res2.data; + const { code, data } = res.data; - if ( - code1 !== 200 || - code2 !== 200 || - getObjType(data1) !== 'array' || - getObjType(data2) !== 'array' - ) - return; + if (code !== 200 || getObjType(data) !== 'array') return; - // 处理数据 - for (let i = 0; i < data1.length; i++) { - const value = data1[i]; + const _arr = []; - for (let j = 0; j < data2.length; j++) { - const item = data2[j]; + // 处理数据 + for (let i = 0; i < data.length; i++) { + const value = data[i]; - if (value.vehicleModel !== item.dictKey) continue; - value.label = item.dictValue; - value.value = item.dictKey; - break; - } + _arr.push({ + value: value.id, + label: value.vehicleModel, + }); } // 赋值 for (let i = 0; i < details.carBasicForm.length; i++) { const value = details.carBasicForm[i]; - if (value.label !== '车辆类型') continue; - value.checkarr = data1; + if (value.label !== '结算类型') continue; + value.checkarr = _arr; break; } }; @@ -574,6 +574,8 @@ const initData = async () => { getDictionaryBiz('yes_no').then(res => handleData('是否车头', res)), // 挂车类型 getDictionaryBiz('basic_trailer_type').then(res => handleData('挂车类型', res)), + // 车辆类型 + getDictionaryBiz('basic_vehicle_model').then(res => handleData('车辆类型', res)), // 车厢类型 getDictionaryBiz('basic_car_type').then(res => handleData('车厢类型', res)), // 付款方式 diff --git a/src/views/basicdata/vehicle/basicdataVehicleInfo.vue b/src/views/basicdata/vehicle/basicdataVehicleInfo.vue index f1c1cbc3..975451e1 100644 --- a/src/views/basicdata/vehicle/basicdataVehicleInfo.vue +++ b/src/views/basicdata/vehicle/basicdataVehicleInfo.vue @@ -58,7 +58,11 @@ -