Browse Source

修复部分bug

dev-xx
qb 8 months ago
parent
commit
adae1f836b
  1. 169
      src/option/basicdata/basicdataCarrier2.js
  2. 233
      src/views/basicdata/carrier/basicdataCarrier2.vue
  3. 2
      src/views/waybill/TemporaryStorageList.vue

169
src/option/basicdata/basicdataCarrier2.js

@ -46,7 +46,7 @@ export const columnList = [
},
{
label: '承运商名称',
prop: 'carrierPhone',
prop: 'carrierName',
type: 2,
values: '',
width: '150',
@ -268,4 +268,171 @@ export const columnList = [
},
];
export const formOptions = [
{
label: '类型',
prop: 'typeName',
type: 1,
checkarr: [],
rules: [],
},
{
label: '承运商编号',
prop: 'number',
type: 1,
multiple: true,
checkarr: [],
rules: [
{
required: true,
message: '输入承运商编号',
trigger: ['blur', 'change'],
},
],
},
{
label: '承运商电话',
prop: 'carrierPhone',
type: 1,
checkarr: [],
},
{
label: '承运商名称',
prop: 'carrierName',
type: 1,
checkarr: [],
},
{
label: '负责人',
prop: 'head',
type: 1,
checkarr: [],
},
{
label: '手机号',
prop: 'headPhone',
type: 1,
checkarr: [],
},
{
label: '营业执照注册号',
prop: 'licenseNub',
type: 1,
checkarr: [],
},
{
label: '法人',
prop: 'legalPerson',
type: 1,
checkarr: [],
rules: [
{
required: true,
message: '输入法人名称',
trigger: ['blur', 'change'],
},
],
},
{
label: '法人电话',
prop: 'legalPersonPhone',
type: 1,
checkarr: [],
},
{
label: '法人身份证',
prop: 'legalPersonId',
type: 1,
checkarr: [],
},
{
label: '邮箱',
prop: 'mailbox',
type: 1,
checkarr: [],
},
{
label: '客服电话',
prop: 'customerServicePhone',
type: 1,
checkarr: [],
},
{
label: '合同开始时间',
prop: 'contractStartTime',
type: 4,
checkarr: [],
},
{
label: '合同结束时间',
prop: 'contractEndTime',
type: 4,
checkarr: [],
},
{
label: '道路运输许可证编号',
prop: 'roadTransportNub',
type: 1,
checkarr: [],
rules: [
{
required: true,
message: '输入道路运输许可证编号',
trigger: ['blur', 'change'],
},
],
},
{
label: '物流园',
prop: 'logisticsPark',
type: 1,
checkarr: [],
},
{
label: '自有车辆数',
prop: 'freeVehiclesNub',
type: 2,
checkarr: [],
precision: 0,
},
{
label: '外部车辆数',
prop: 'externalVehiclesNub',
type: 2,
checkarr: [],
precision: 0,
},
{
label: '星级',
prop: 'starRating',
type: 2,
checkarr: [],
precision: 0,
},
{
label: '定位地址',
prop: 'locationAddress',
type: 1,
checkarr: [],
},
{
label: '经度',
prop: 'longitude',
type: 1,
checkarr: [],
},
{
label: '纬度',
prop: 'latitude',
type: 1,
checkarr: [],
},
{
label: '备注',
prop: 'notes',
type: 5,
checkarr: [],
},
];
export default columnList;

233
src/views/basicdata/carrier/basicdataCarrier2.vue

@ -82,6 +82,150 @@
>
</el-pagination>
</div>
<div>
<!-- 新增/编辑 -->
<el-dialog
destroy-on-close
:modal-append-to-body="false"
:append-to-body="false"
class="el-dialog-addTagVisited"
width="80%"
v-model="details.popUpShow.dialogVisible"
:fullscreen="details.fullscreenObj.dialogVisible"
:show-close="false"
draggable
>
<!-- 标题 -- 头部控件区 -->
<template #header="{ close, titleId, titleClass }">
<div class="my-header flex-c-sb" draggable>
<div class="fwb" :id="titleId" :class="titleClass">新增</div>
<div class="flex-c-c">
<div @click="() => handleFullScrean('dialogVisible')" class="mr20">
<!-- 全屏显示按钮 -->
<el-button type="text" v-if="!details.fullscreenObj.dialogVisible">
<el-icon size="20px" class=""><FullScreen /></el-icon>
</el-button>
<el-button type="text" v-else>
<el-icon size="20px" class=""><CopyDocument /></el-icon>
</el-button>
</div>
<!-- 弹窗关闭按钮 -->
<el-button type="text">
<el-icon size="20px" class="" @click="close"><Close /></el-icon>
</el-button>
</div>
</div>
</template>
<div v-loading="details.loadingObj.addTagLoading">
<el-form inline class="mt20 pl20" ref="formRef" :model="details.form">
<el-form-item
v-for="item in details.formOptions"
:label="item.label"
label-width="160px"
:class="item.type !== 5 ? 'w30' : 'w100'"
:rules="item.rules"
:prop="item.prop"
>
<!-- 普通输入框 -->
<template v-if="item.type === 1">
<el-input
class="w100"
:placeholder="`请输入${item.label}`"
v-model="details.form[item.prop]"
clearable
></el-input>
</template>
<!-- 数字输入框 -->
<template v-else-if="item.type === 2">
<el-input-number
:controls="false"
v-model="details.form[item.prop]"
:placeholder="`请输入${item.label}`"
:min="item.min || 0"
:value-on-clear="0"
:precision="item.precision || 0"
class="w100"
:disabled="item.disabled || false"
></el-input-number>
</template>
<!-- 下拉框 -->
<template v-else-if="item.type === 3">
<el-select
v-model="details.form[item.prop]"
:placeholder="`请选择${item.label}`"
class="w100"
clearable
filterable
@change="value => item.change && item.change(value)"
:multiple="item.multiple || false"
>
<el-option
v-for="val in item.checkarr"
:key="val.value"
:label="val.label"
:value="val.value"
/>
</el-select>
</template>
<!-- 时间选择 -->
<template v-else-if="item.type === 4">
<el-date-picker
v-model="details.form[item.prop]"
type="date"
:placeholder="`请选择${item.label}`"
class="w100"
:default-value="new Date()"
:value-format="item.valueFormat || 'YYYY-MM-DD'"
clearable
/>
</template>
<!-- 备注 -->
<template v-else-if="item.type === 5">
<el-input
type="textarea"
v-model="details.form[item.prop]"
clearable
:placeholder="`请选择${item.label}`"
class="w100"
/>
</template>
</el-form-item>
</el-form>
</div>
<div class="flex-c-c dialog-footer">
<el-button icon="Close" @click="details.popUpShow.addTagVisited = false">
</el-button>
<!-- 重置 -->
<el-button
icon="Refresh"
type="primary"
:loading="details.loadingObj.addTagLoading"
@click="() => handleRefreshAddTag(ruleFormRef)"
>
</el-button>
<!-- 提交 -->
<el-button
icon="Position"
type="primary"
:loading="details.loadingObj.addTagLoading"
@click="() => handleSubmitAddTag(ruleFormRef)"
>
</el-button>
</div>
</el-dialog>
</div>
</div>
</basic-container>
@ -112,7 +256,7 @@ import {
handleTranslationDataSeclect,
getObjType,
} from '@/utils/util';
import { columnList } from '@/option/basicdata/basicdataCarrier2.js';
import { columnList, formOptions } from '@/option/basicdata/basicdataCarrier2.js';
import { useRouter } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus';
import { getList, getDetail, add, update, remove } from '@/api/basicdata/basicdataCarrier';
@ -158,7 +302,7 @@ const details = reactive<any>({
/** 列表 */
columnList: deepClone(columnList),
/** 列表数据 */
data: [{}],
data: [],
/** 页面loading */
loadingObj: {
/** 列表加载loading */
@ -178,8 +322,8 @@ const details = reactive<any>({
},
/** 弹出层显示 */
popUpShow: {
/** 图片预览 */
abnormalVisited: false,
/** 新增 | 编辑 | 查看 */
dialogVisible: false,
},
/** 列表Dom节点 */
listNode: '',
@ -187,8 +331,9 @@ const details = reactive<any>({
/** 全屏 */
fullscreenObj: {
/** 查看 */
view: false,
dialogVisible: false,
},
formOptions: deepClone(formOptions),
});
const { search, query, shortcuts, stockupDate, data, loadingObj, selectionList, drawerShow, page } =
@ -206,11 +351,10 @@ onMounted(() => {
});
/** 请求页面数据 */
const onLoad = debounce(async (page?: any, params = {}) => {
const onLoad = debounce(async (params = {}) => {
try {
details.loadingObj.list = true;
let _page = details.page;
if (page) _page = page;
const _submitData = { ..._page, ...details.query, ...params };
delete _submitData.total;
//
@ -266,7 +410,7 @@ initData();
/** 搜索 */
const searchChange = () => {
onLoad(details.page);
onLoad();
};
/** 清空表单 */
@ -275,7 +419,7 @@ const searchReset = () => {
details.stockupDate = [];
details.page.currentPage = 1;
handleClearTableQuery(details.columnList);
onLoad(details.page);
onLoad();
};
/** 展开列表控件 */
@ -293,7 +437,7 @@ const searchHide = () => {
/** 表格表头输入框搜索 */
const inputsc = (index, row) => {
handleInputQuery(index, row, details.query);
onLoad(details.page);
onLoad();
};
/** 表格表头时间选择 */
@ -306,14 +450,14 @@ const timesc = (index, row) => {
if (!index) {
delete details.query[row.prop];
}
onLoad(details.page);
onLoad();
};
/** 表格表头下拉框选择 */
const selectsc = (index, row) => {
handleSelectQuery(index, row, details.query);
onLoad(details.page);
onLoad();
};
/** 表格表头复选框选择 */
@ -324,7 +468,7 @@ const selectionChange = (list: any) => {
/** 每页数量改变执行的回调 */
const sizeChange = (size: number) => {
details.page.size = size;
onLoad(details.page);
onLoad();
};
/** 页码改变执行的回调 */
@ -333,11 +477,35 @@ const currentChange = current => {
onLoad();
};
/**
* 是否开启全屏
* @params(_type) 开启或关闭
*/
const handleFullScrean = (_name: string, _type: 'open' | 'close') => {
let _node: any = '';
if (_name) _node = document.querySelector(`.${_name} .maboxhi`);
switch (_name) {
case 'packageOrderListlVisited':
details.fullscreenObj.packageOrderListlVisited =
!details.fullscreenObj.packageOrderListlVisited;
if (_type === 'close') {
if (_node) setNodeHeight(_node, '500px');
} else {
if (_node) setNodeHeight(_node, '800px');
}
break;
default:
details.fullscreenObj[_name] = !details.fullscreenObj[_name];
break;
}
};
/** 新增 */
const handleAdd = () => {
$router.push({
path: '/basicdata/vehicle/basicdataVehicleAddForm',
});
details.popUpShow.dialogVisible = true;
};
/**
@ -370,7 +538,7 @@ const handleDelete = (isBatch, row: any = {}) => {
const { code, msg } = res.data;
if (code !== 200) return ElMessage.error(msg);
ElMessage.success('删除成功');
onLoad(details.page);
onLoad();
} catch (error) {
console.log('error :>> ', error);
} finally {
@ -396,7 +564,38 @@ const handleDelete = (isBatch, row: any = {}) => {
margin-top: 20px;
}
.mr20 {
margin-right: 20px;
}
.fwb {
font-weight: bold;
}
//
:deep(.el-overlay) {
position: absolute;
}
:deep(.el-overlay-dialog) {
position: absolute;
}
:deep(.el-form) {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
}
.w30 {
width: 30%;
}
.w100 {
width: 100% !important;
}
:deep(.el-input__inner) {
text-align: left;
}
</style>

2
src/views/waybill/TemporaryStorageList.vue

@ -26,7 +26,7 @@
</el-form-item>
</el-form>
</div>
handleFullScrean
<div style="display: flex">
<el-tabs
v-model="details.orderStatus"

Loading…
Cancel
Save