diff --git a/src/components/SelectBox/SelectBox.vue b/src/components/SelectBox/SelectBox.vue index 4c95168f..757e2448 100644 --- a/src/components/SelectBox/SelectBox.vue +++ b/src/components/SelectBox/SelectBox.vue @@ -21,7 +21,7 @@ : 'min-width:' + props.minWidth : '' " - v-if="isShowBox" + v-if="isShowBox && !props.disabled" > <div class="content"> <SelectComponent @@ -67,6 +67,9 @@ const props = defineProps([ /** 是否禁用 : 默认false */ 'disabled', ]); + +console.log('props :>> ', props); + const $emit = defineEmits(['update:modelValue']); const _computed = computed({ diff --git a/src/views/distribution/inventory/BookingNote.vue b/src/views/distribution/inventory/BookingNote.vue index 7d8b8dbc..26550851 100644 --- a/src/views/distribution/inventory/BookingNote.vue +++ b/src/views/distribution/inventory/BookingNote.vue @@ -71,9 +71,50 @@ ></el-input> </el-form-item> + <el-form-item label="发站:" prop="departure"> + <el-input readonly v-model="query['departure']" placeholder="到站地址"></el-input> + </el-form-item> + <el-form-item label="到站:" prop="destination"> <el-input readonly v-model="query['destination']" placeholder="到站地址"></el-input> </el-form-item> + <!-- <el-form-item label="发站:" prop="departure"> + <div class="w100"> + <el-cascader + pleceholder="请选择到站地址" + :options="details.regionOptione" + style="width: 100%" + v-model="query.departure" + :props="{ + checkStrictly: true, + }" + > + <template #default="{ node, data }"> + <span>{{ data.label }}</span> + <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span> + </template> + </el-cascader> + </div> + </el-form-item> + + <el-form-item label="到站:" prop="destination"> + <div class="w100"> + <el-cascader + pleceholder="请选择到站地址" + :options="details.regionOptione" + style="width: 100%" + v-model="query.destination" + :props="{ + checkStrictly: true, + }" + > + <template #default="{ node, data }"> + <span>{{ data.label }}</span> + <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span> + </template> + </el-cascader> + </div> + </el-form-item> --> <el-form-item label="目的仓:" class="el-times" prop="queryDestinationWarehouseName"> <el-input @@ -1323,9 +1364,56 @@ const handleComputed = (row: any) => { getLazyTreeAll().then(res => { if (res.data.success) { details.regionOptione = res.data.data; + + // 转译到站 + if (details.regionOptione.length !== 0) { + handleTranslationLocation('departure'); + handleTranslationLocation('destination'); + } } }); +// 改单时, 对数据库内到站值进行转译 +const handleTranslationLocation = key => { + // 获取数据库中地址值 + const _location = details.query[key]; + + let _arr = []; + + // 循环查找匹配的到站地址 + for (const iterator of details.regionOptione) { + let isBreak = false; + + if (iterator.label === _location) { + _arr = [iterator.label]; + isBreak = true; + } else if (getObjType(iterator.children) === 'array') { + for (const item of iterator.children) { + if (item.label === _location) { + _arr = [iterator.label, item.label]; + isBreak = true; + break; + } else if (getObjType(item.children) === 'array') { + for (const value of item.children) { + if (value.label === _location) { + _arr = [iterator.label, item.label, value.label]; + isBreak = true; + break; + } + } + } + } + if (isBreak) break; + } + + if (isBreak) break; + } + + const _label = _arr.slice(1).join('/'); + + details.query[key] = _label; +}; + /** 请求页面数据 */ const onLoad = async () => { try { @@ -1360,8 +1448,12 @@ const onLoad = async () => { details.query.daoPay = isNumber(data.warehouseWaybill.dPay) ? Number(data.warehouseWaybill.dPay) : data.warehouseWaybill.dPay; + // 转译到站 - console.log('details.query :>> ', details.query); + if (details.regionOptione.length !== 0) { + handleTranslationLocation('departure'); + handleTranslationLocation('destination'); + } // 初始化goodsList if (data.warehouseWaybill.detailList.length === 0) diff --git a/src/views/waybill/CreateZeroOrder.vue b/src/views/waybill/CreateZeroOrder.vue index 34da83a3..e7f9cf28 100644 --- a/src/views/waybill/CreateZeroOrder.vue +++ b/src/views/waybill/CreateZeroOrder.vue @@ -543,6 +543,7 @@ :focus="handleCloseSelcet" v-model="item.goodsName" :class="!item.goodsId ? 'is-error' : ''" + :disabled="query.zeroEditStatus === 0" placeholder="货物名称" > <div v-loading="item.loading"> @@ -565,6 +566,7 @@ <el-form-item label="件数:" label-width="fit-content" prop="num" class="el-times"> <el-input-number + :disabled="query.zeroEditStatus === 0" :value-on-clear="0" :controls="false" v-model="item.num"