修复业务模块bug
This commit is contained in:
@@ -825,27 +825,15 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="司机" :required="['自运', '网货平台'].includes(dialogForm.carrierType)">
|
||||
<el-select
|
||||
<el-autocomplete
|
||||
v-model="dialogForm.driverName"
|
||||
clearable
|
||||
filterable
|
||||
allow-create
|
||||
default-first-option
|
||||
remote
|
||||
reserve-keyword
|
||||
:remote-method="loadDriverOptions"
|
||||
:debounce="300"
|
||||
:fetch-suggestions="fetchDriverSuggestions"
|
||||
:loading="driverLoading"
|
||||
placeholder="请输入"
|
||||
@change="handleDriverChange"
|
||||
@visible-change="visible => visible && loadDriverOptions(dialogForm.driverName)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in driverOptions"
|
||||
:key="item.id || item.driverName || item.name"
|
||||
:label="item.driverName || item.name"
|
||||
:value="item.driverName || item.name"
|
||||
/>
|
||||
</el-select>
|
||||
@select="item => handleDriverSuggestionSelect('dialog', item)"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" :required="['自运', '网货平台'].includes(dialogForm.carrierType)">
|
||||
<el-input v-model="dialogForm.driverPhone" clearable placeholder="请输入" />
|
||||
@@ -2079,6 +2067,26 @@ export default {
|
||||
this.dialogForm.driverPhone = driver.mobile || driver.driverPhone || driver.phone || '';
|
||||
}
|
||||
},
|
||||
fetchDriverSuggestions(queryString, callback) {
|
||||
this.loadDriverOptions(String(queryString || '').trim())
|
||||
.then(() =>
|
||||
callback(
|
||||
this.driverOptions.map(item => ({
|
||||
...item,
|
||||
value: item.driverName || item.name || '',
|
||||
}))
|
||||
)
|
||||
)
|
||||
.catch(() => callback([]));
|
||||
},
|
||||
handleDriverSuggestionSelect(target, item = {}) {
|
||||
const value = item.driverName || item.name || '';
|
||||
if (target === 'dialog') {
|
||||
this.dialogForm.driverName = value;
|
||||
const phone = item.mobile || item.driverPhone || item.phone || '';
|
||||
if (phone) this.dialogForm.driverPhone = phone;
|
||||
}
|
||||
},
|
||||
handleMileageInput(value) {
|
||||
this.dialogForm.mileage = String(value || '').replace(/[^\d.]/g, '');
|
||||
},
|
||||
@@ -2137,7 +2145,11 @@ export default {
|
||||
this.carrierLoading = true;
|
||||
try {
|
||||
this.carrierOptions = unwrapRecords(
|
||||
await getCustomerList(1, 20, { customerName: keyword })
|
||||
await getCustomerList(1, 20, {
|
||||
customerName: keyword,
|
||||
customerType: '承运商',
|
||||
status: 1,
|
||||
})
|
||||
);
|
||||
} finally {
|
||||
this.carrierLoading = false;
|
||||
|
||||
Reference in New Issue
Block a user