Browse Source

三方新增司机和车辆限制

dev-xx
qb 9 months ago
parent
commit
b44505d20c
  1. 5
      src/components/SelectBox/SelectBox.vue
  2. 4
      src/components/edittablehead/index.vue
  3. 128
      src/views/distribution/artery/addTripartiteTransfer.vue

5
src/components/SelectBox/SelectBox.vue

@ -8,6 +8,7 @@
@blur="handleBlur" @blur="handleBlur"
@change="handleChange" @change="handleChange"
:clearable="props.clearable !== false" :clearable="props.clearable !== false"
:disabled="props.disabled === true"
></el-input> ></el-input>
<div <div
@ -62,6 +63,8 @@ const props = defineProps([
'minWidth', 'minWidth',
/** 是否清空 : 默认true */ /** 是否清空 : 默认true */
'clearable', 'clearable',
/** 是否禁用 : 默认false */
'disabled',
]); ]);
const $emit = defineEmits(['update:modelValue']); const $emit = defineEmits(['update:modelValue']);
@ -131,7 +134,7 @@ defineExpose({ handleShow, handleClose });
background: #fff; background: #fff;
border-radius: 3px; border-radius: 3px;
box-shadow: 0px 0px 0.625vw rgba(0, 0, 0, 0.12); box-shadow: 0px 0px 0.625vw rgba(0, 0, 0, 0.12);
animation: dow 0.5s ease-in-out; animation: dow 0.3s ease-in-out;
&::before { &::before {
content: ''; content: '';

4
src/components/edittablehead/index.vue

@ -160,7 +160,7 @@ const initTable = async () => {
for (let i = 0; i < _oldArr.length; i++) { for (let i = 0; i < _oldArr.length; i++) {
const value = _oldArr[i]; const value = _oldArr[i];
if (item.prop !== value.prop) continue; if (item.prop + item.label + item.type !== value.prop + value.label + value.type) continue;
_setArr.push(item); _setArr.push(item);
_oldArr.splice(i, 1); _oldArr.splice(i, 1);
break; break;
@ -170,7 +170,7 @@ const initTable = async () => {
_setArr.push(..._oldArr); _setArr.push(..._oldArr);
console.log('_setArr :>> ', _setArr); console.log('_setArr :>> ', _setArr);
columnRef.value = _setArr; columnRef.value = [..._setArr];
handleClearTableQuery(_setArr); handleClearTableQuery(_setArr);
emit('update:modelValue', _setArr); emit('update:modelValue', _setArr);
} catch (error) { } catch (error) {

128
src/views/distribution/artery/addTripartiteTransfer.vue

@ -70,6 +70,16 @@
class="m-2" class="m-2"
placeholder="运费分摊方式" placeholder="运费分摊方式"
size="default" size="default"
@change="
val => {
console.log('val :>> ', val);
if (val + '' === '2') return;
details.form.driverName = '';
details.form.driverId = '';
details.form.driverMobile = '';
details.form.carNumber = '';
}
"
> >
<el-option <el-option
v-for="item in details.pageInfo.deliveryType || []" v-for="item in details.pageInfo.deliveryType || []"
@ -112,8 +122,28 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<div style="display: flex"> <div style="display: flex">
<el-form-item label="送货司机" prop="driverName" class="flex1 mr10"> <el-form-item
label="送货司机"
prop="driverName"
class="flex1 mr10"
:rules="
details.form.deliveryType + '' === '2'
? [
{
required: true,
message: '请选择送货司机',
trigger: ['change', 'blur'],
},
]
: [
{
required: false,
},
]
"
>
<el-select <el-select
:disabled="details.form.deliveryType + '' !== '2'"
v-model="form.driverName" v-model="form.driverName"
filterable filterable
:teleported="false" :teleported="false"
@ -137,40 +167,43 @@
</div> </div>
<div style="display: flex"> <div style="display: flex">
<el-form-item label="送货车辆" prop="driverName" class="flex1 mr10"> <el-form-item
<!-- <el-select label="送货车辆"
v-model="form.driverName" prop="carNumber"
filterable class="flex1 mr10"
:teleported="false" :rules="
remote details.form.deliveryType + '' === '2'
@change="handleNameChange" ? [
reserve-keyword {
placeholder="输入车牌" required: true,
:remote-method="remoteMethodDriver" message: '请选择或输入车牌号',
:loading="details.loadingObj.driverName" trigger: ['change', 'blur'],
> },
<el-option ]
v-for="val in details.driverListByName" : [
:key="val.driverName" {
:label="val.driverName" required: false,
:value="val.driverId" },
/> ]
</el-select> --> "
>
<SelectBox <SelectBox
ref="goodsNameRef" ref="carSelectRef"
className="goodsName" className="goodsName"
:input="() => debounce(handleFindCar(form.carNumber), 1000)" :input="() => debounce(handleFindCar(form.carNumber), 1000)"
v-model="form.carNumber" v-model="form.carNumber"
placeholder="请选择车辆" placeholder="请选择车辆"
:disabled="details.form.deliveryType + '' !== '2'"
> >
<div v-loading="details.loadingObj.loading"> <div v-loading="details.loadingObj.loading">
<template v-if="details.driverListByName > 0"> <template v-if="details.carListByName.length > 0">
<div <div
v-for="val in details.driverListByName" v-for="val in details.carListByName"
:key="val.driverName" :key="val.carNumber"
class="carRow"
@click="() => handleChooseCar(val)" @click="() => handleChooseCar(val)"
> >
{{ val.goodsName }} {{ val.carNumber }}
</div> </div>
</template> </template>
<template v-else> <template v-else>
@ -486,7 +519,14 @@ import dayjs from 'dayjs';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
/** 获取字典 */ /** 获取字典 */
import { getDictionaryBiz } from '@/api/system/dict'; import { getDictionaryBiz } from '@/api/system/dict';
import { downloadXls, computeNumber, setNodeHeight, debounce, deepClone } from '@/utils/util'; import {
downloadXls,
computeNumber,
setNodeHeight,
debounce,
deepClone,
getObjType,
} from '@/utils/util';
import { columnList, newColumnList } from '@/option/distribution/addVehicleStowage'; import { columnList, newColumnList } from '@/option/distribution/addVehicleStowage';
import { import {
postloadFindLoadInitData, postloadFindLoadInitData,
@ -495,7 +535,7 @@ import {
postFindCarrierByName, postFindCarrierByName,
postFindUseOrderList, postFindUseOrderList,
postSelectEditDetailByLoadId, postSelectEditDetailByLoadId,
postFindCarListByName postFindCarListByName,
} from '@/api/distribution/AddVehicleStowage'; } from '@/api/distribution/AddVehicleStowage';
import { import {
postSaveNewTripartiteTransfer, postSaveNewTripartiteTransfer,
@ -520,6 +560,9 @@ const ruleFormRef = ref();
const oldColumnListNode = ref(); const oldColumnListNode = ref();
const newColumnListNode = ref(); const newColumnListNode = ref();
//
const carSelectRef = ref();
const details = reactive<any>({ const details = reactive<any>({
/** 是否开启搜索 */ /** 是否开启搜索 */
search: true, search: true,
@ -584,6 +627,14 @@ const details = reactive<any>({
trigger: ['change'], trigger: ['change'],
}, },
], ],
/** 送货方式 */
deliveryType: [
{
required: true,
message: '请选择送货方式',
trigger: ['change'],
},
],
/** 客户类型 */ /** 客户类型 */
customerType: [ customerType: [
{ {
@ -671,6 +722,8 @@ const details = reactive<any>({
customerType: [], customerType: [],
/** 送货司机 */ /** 送货司机 */
driverListByName: [], driverListByName: [],
/** 车辆 */
carListByName: [],
/** 被选中在调度池的订单列表 */ /** 被选中在调度池的订单列表 */
orderCodeList: [], orderCodeList: [],
/** 修改时, 已存在调度池中的运单数据 */ /** 修改时, 已存在调度池中的运单数据 */
@ -917,14 +970,19 @@ remoteMethodDriver('');
/** 查询车辆 */ /** 查询车辆 */
const handleFindCar = async value => { const handleFindCar = async value => {
const res = await postFindCarListByName({ carNumber: value }); const res = await postFindCarListByName({ carNumber: value });
const { code, data } = res.data; const { code, data } = res.data;
if (code !== 200) return; if (code !== 200) return;
console.log('data :>> ', data);
details.carListByName = data; details.carListByName = data;
}; };
/** 选择车辆 */ /** 选择车辆 */
const handleChooseCar = val => {}; const handleChooseCar = val => {
details.form.carNumber = val.carNumber;
//
carSelectRef.value.handleClose();
};
/** 表格表头输入框搜索 */ /** 表格表头输入框搜索 */
const inputsc = (index, row) => { const inputsc = (index, row) => {
@ -1071,6 +1129,9 @@ const handleNameChange = () => {
form.value.driverName = _value.driverName; form.value.driverName = _value.driverName;
form.value.driverId = _value.driverId; form.value.driverId = _value.driverId;
form.value.driverMobile = _value.driverPhone; form.value.driverMobile = _value.driverPhone;
if (getObjType(_value.carNumberList) !== 'array' || _value.carNumberList.length === 0) return;
form.value.carNumber = _value.carNumberList[0] || '';
}; };
/** 关闭页面 */ /** 关闭页面 */
@ -1378,4 +1439,13 @@ const handleSubmit = (formEl: FormInstance | undefined) => {
.header_search > div { .header_search > div {
width: 40%; width: 40%;
} }
.carRow {
padding: 8px 10px;
text-align: left;
&:hover {
background: #f5f7fa;
}
}
</style> </style>

Loading…
Cancel
Save