Browse Source

重构页面

dev-xx
qb 8 months ago
parent
commit
641c0825de
  1. 41
      src/api/basicdata/basicdataCarrier.js
  2. 8
      src/api/basicdata/basicdataVehicle.js
  3. 0
      src/api/distribution/SeparateTheList.js
  4. 503
      src/option/basicdata/basicdataCarrier2.js
  5. 2
      src/option/basicdata/basicdataVehicle2.js
  6. 48
      src/option/distribution/SeparateTheList.js
  7. 872
      src/views/basicdata/carrier/basicdataCarrier2.vue
  8. 91
      src/views/basicdata/vehicle/basicdataVehicle2.vue
  9. 356
      src/views/basicdata/vehicle/basicdataVehicleAddForm.vue
  10. 2
      src/views/basicdata/vehicle/basicdataVehicleInfo.vue
  11. 372
      src/views/distribution/inventory/delivery/SeparateTheList.vue
  12. 73
      src/views/system/pdaversion/pdaversionManage.vue

41
src/api/basicdata/basicdataCarrier.js

@ -8,43 +8,42 @@ export const getList = (current, size, params) => {
...params,
current,
size,
}
})
}
},
});
};
export const getDetail = (id) => {
export const getDetail = id => {
return request({
url: '/api/logpm-basicdata/carrier/detail',
method: 'get',
params: {
id
}
})
}
id,
},
});
};
export const remove = (ids) => {
export const remove = ids => {
return request({
url: '/api/logpm-basicdata/carrier/remove',
method: 'post',
params: {
ids,
}
})
}
},
});
};
export const add = (row) => {
export const add = row => {
return request({
url: '/api/logpm-basicdata/carrier/submit',
method: 'post',
data: row
})
}
data: row,
});
};
export const update = (row) => {
export const update = row => {
return request({
url: '/api/logpm-basicdata/carrier/submit',
method: 'post',
data: row
})
}
data: row,
});
};

8
src/api/basicdata/basicdataVehicle.js

@ -27,6 +27,7 @@ export const getVehicle = () => {
});
};
/** 车辆详情 */
export const getDetail = id => {
return request({
url: '/api/logpm-basicdata/vehicle/detail',
@ -106,3 +107,10 @@ export const getDictionary = params => {
params,
});
};
export const getVehicleExport = () => {
return request({
url: '/api/blade-basicdataVehicle/basicdataVehicle/export-basicdataVehicle',
method: 'get',
});
};

0
src/api/distribution/SeparateTheList.js

503
src/option/basicdata/basicdataCarrier2.js

@ -1,232 +1,271 @@
export default {
expand: false,
index: true,
border: true,
selection: true,
column: [
{
label: "主键",
prop: "id",
display: false,
hide: true,
},
{
label: "租户号",
prop: "tenantId",
display: false,
hide: true,
},
{
label: "创建人",
prop: "createUser",
display: false,
hide: true,
},
{
label: "创建时间",
prop: "createTime",
display: false,
hide: true,
},
{
label: "更新人",
prop: "updateUser",
display: false,
hide: true,
},
{
label: "更新时间",
prop: "updateTime",
display: false,
hide: true,
},
{
label: "状态",
prop: "status",
display: false,
hide: true,
},
{
label: "是否已删除;1-未删除,2-已删除",
prop: "isDeleted",
display: false,
hide: true,
},
{
label: "创建部门",
prop: "createDept",
display: false,
hide: true,
},
{
label: "类型",
prop: "type",
search: true,
width:"100px"
},
{
label: "承运商编号",
prop: "number",
search: true,
width:"100px"
},
{
label: "集团ID",
prop: "groupId",
search: true,
width:"100px"
},
{
label: "承运商电话",
prop: "carrierPhone",
width:"100px"
},
// {
// label: "绑定仓库Id",
// prop: "warehouseId",
// },
{
label: "负责人",
prop: "head",
search: true,
width:"100px"
},
{
label: "手机号",
prop: "headPhone",
width:"100px"
},
{
label: "营业执照注册号",
prop: "licenseNub",
width:"150px"
},
{
label: "法人",
prop: "legalPerson",
width:"100px"
},
{
label: "法人电话",
prop: "legalPersonPhone",
width:"100px"
},
{
label: "法人身份证",
prop: "legalPersonId",
width:"100px"
},
{
label: "邮箱",
prop: "mailbox",
width:"100px"
},
{
label: "客服电话",
prop: "customerServicePhone",
width:"100px"
},
{
label: "合同起始时间",
prop: "contractStartTime",
format: "YYYY-MM-DD",
valueFormat: "YYYY-MM-DD",
width:"150px"
},
{
label: "合同结束时间",
prop: "contractEndTime",
format: "YYYY-MM-DD",
valueFormat: "YYYY-MM-DD",
width:"150px"
},
// {
// label: "合同附件",
// prop: "contractAppendices",
// },
// {
// label: "道路运输许可证图片",
// prop: "roadTransportPhoto",
// width:"100px"
// },
{
label: "道路运输许可证编号",
prop: "roadTransportNub",
width:"170px"
},
{
label: "物流园",
prop: "logisticsPark",
width:"100px"
},
{
label: "自由车辆数",
prop: "freeVehiclesNub",
width:"100px"
},
{
label: "外部车辆数",
prop: "externalVehiclesNub",
width:"100px"
},
{
label: "星级",
prop: "starRating",
width:"80px"
},
{
label: "定位地址",
prop: "locationAddress",
width:"100px"
},
{
label: "经度",
prop: "longitude",
width:"100px"
},
{
label: "纬度",
prop: "latitude",
width:"100px"
},
{
label: "备注",
prop: "notes",
width:"100px"
},
// {
// label: "照片信息",
// prop: "photo",
// },
{
label: "预留1",
prop: "reserve1",
display: false,
hide: true,
},
{
label: "预留2",
prop: "reserve2",
display: false,
hide: true,
},
{
label: "预留3",
prop: "reserve3",
display: false,
hide: true,
},
{
label: "预留4",
prop: "reserve4",
display: false,
hide: true,
},
{
label: "预留5",
prop: "reserve5",
display: false,
hide: true,
},
]
}
export const columnList = [
{
prop: '',
label: '复选框',
type: 0,
width: 55,
fixed: true,
},
{
prop: '',
label: '序号',
type: 12,
values: '',
width: 55,
fixed: true,
},
{
label: '类型',
prop: 'typeName',
type: 3,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '承运商编号',
prop: 'number',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '承运商电话',
prop: 'carrierPhone',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '承运商名称',
prop: 'carrierPhone',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '负责人',
prop: 'head',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '手机号',
prop: 'headPhone',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '营业执照注册号',
prop: 'licenseNub',
width: '150px',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '法人',
prop: 'legalPerson',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '法人电话',
prop: 'legalPersonPhone',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '法人身份证',
prop: 'legalPersonId',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '邮箱',
prop: 'mailbox',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '客服电话',
prop: 'customerServicePhone',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '合同起始时间',
prop: 'contractStartTime',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '合同结束时间',
prop: 'contractEndTime',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '道路运输许可证编号',
prop: 'roadTransportNub',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '物流园',
prop: 'logisticsPark',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '自由车辆数',
prop: 'freeVehiclesNub',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '外部车辆数',
prop: 'externalVehiclesNub',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '星级',
prop: 'starRating',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '定位地址',
prop: 'locationAddress',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '经度',
prop: 'longitude',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '纬度',
prop: 'latitude',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '备注',
prop: 'notes',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
label: '道路运输许可证图片',
prop: 'notes',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'notes',
label: '操作',
width: '200',
type: 6,
values: '',
width: '200',
checkarr: [],
fixed: 'right',
sortable: true,
},
];
export default columnList;

2
src/option/basicdata/basicdataVehicle2.js

@ -21,7 +21,7 @@ export default [
values: '',
width: '150',
checkarr: [],
fixed: false,
fixed: true,
sortable: true,
},
{

48
src/option/distribution/SeparateTheList.js

@ -0,0 +1,48 @@
/** 自提详情内表格 */
export const columnList = [
// {
// prop: '',
// label: '复选框',
// type: 0,
// width: 55,
// fixed: true,
// },
{
prop: '',
label: '序号',
type: 12,
values: '',
width: 55,
fixed: true,
},
{
prop: 'oprationUserName',
label: '操作人',
type: 1,
values: '',
width: '150',
fixed: true,
sortable: true,
head: false,
},
{
prop: 'createTime',
label: '操作时间',
type: 1,
values: '',
width: '150',
fixed: true,
sortable: true,
head: false,
},
{
prop: 'content',
label: '操作内容',
type: 1,
values: '',
width: '600',
fixed: true,
sortable: true,
head: false,
},
];

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

@ -1,532 +1,402 @@
<template>
<basic-container>
<basic-container v-loading="details.loadingObj.pageLoading">
<div class="avue-crud">
<el-row v-if="!search" style="padding:6px 18px">
<!-- 搜索模块 -->
<div v-h5uShow="!search">
<!-- 查询模块 -->
<el-form :inline="true" :model="query">
<el-form-item label="类型">
<el-select v-model="query.type" clearable placeholder="请选择类型">
<el-option
v-for="item in typeData"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="承运商编号:">
<el-input v-model="query.number" placeholder="请输入承运商编号"></el-input>
</el-form-item>
<el-form-item label="集团ID:">
<el-input v-model="query.groupId" placeholder="请输入集团ID"></el-input>
<el-form :inline="true" :model="query" class="header_search">
<el-form-item label="车牌号:" class="el-times">
<el-input v-model="query.stockupArea" clearable placeholder="请输入车牌号"></el-input>
</el-form-item>
<el-form-item label="负责人:">
<el-input v-model="query.head" placeholder="请输入负责人"></el-input>
<el-form-item label="有效状态">
<el-select class="w100" v-model="query.value" clearable placeholder="有效状态">
<el-option label="有效" value="item.value" />
<el-option label="作废" value="item.value" />
</el-select>
</el-form-item>
<!-- 查询按钮 -->
<el-form-item>
<el-form-item class="el-btn">
<el-button type="primary" icon="el-icon-search" @click="searchChange"> </el-button>
<el-button icon="el-icon-delete" @click="searchReset()"> </el-button>
<el-button icon="el-icon-delete" @click="searchReset"> </el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"> </el-button>
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain> </el-button>
</div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="el-icon-search" @click="searchHide" circle></el-button>
</div>
</div>
</el-row>
<el-row>
<!-- 列表模块 -->
<el-table ref="table" v-loading="loading"
@selection-change="selectionChange"
:data="data"
:height="height"
style="width: 100%"
:border="option.border">
<el-table-column type="selection" v-if="option.selection" width="55" align="center"></el-table-column>
<el-table-column type="expand" v-if="option.expand" align="center"></el-table-column>
<el-table-column v-if="option.index" label="序号" type="index" width="80" align="center">
</el-table-column>
<template v-for="(item,index) in option.column">
<!-- table字段 -->
<el-table-column v-if="item.hide!==true"
:prop="item.prop"
align="center"
:label="item.label"
:width="item.width"
:key="index">
</el-table-column>
</template>
<!-- 操作栏模块 -->
<el-table-column prop="menu" label="操作" :width="220" align="center">
<template #="{row}">
<el-button type="primary" text icon="el-icon-view" @click="handleView(row)">查看</el-button>
<el-button type="primary" text icon="el-icon-edit" @click="handleEdit(row)">编辑</el-button>
<el-button type="primary" text icon="el-icon-delete" @click="rowDel(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row>
<div class="avue-crud__pagination" style="width:100%">
<!-- 分页模块 -->
<el-pagination align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[30, 50,80, 120]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total">
</el-pagination>
</div>
<!-- 控件模块 -->
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<!-- 新增 -->
<el-button type="primary" icon="Plus" @click="handleAdd"> </el-button>
<!-- 删除 -->
<el-button type="primary" icon="Delete" @click="() => handleDelete(true)">
</el-button>
</div>
</el-row>
<!-- 表单模块 -->
<el-dialog :title="title"
v-model="box"
width="50%"
:before-close="beforeClose"
append-to-body>
<el-form :disabled="view" ref="form" :model="form" :rules="validatorRules" label-width="80px">
<!-- 表单字段 -->
<el-row>
<el-col :span="11">
<el-form-item label="类型" prop="type">
<el-select v-model="form.type" clearable placeholder="请选择类型" style="position: absolute;right: 0px;width: 100%">
<el-option
v-for="item in typeData"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="承运商号" prop="number">
<el-input v-model="form.number" placeholder="请输入承运商编号" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="电话" prop="carrierPhone">
<el-input v-model="form.carrierPhone" placeholder="请输入承运商电话" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="负责人" prop="head">
<el-input v-model="form.head" placeholder="请输入负责人" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="手机号" prop="headPhone">
<el-input v-model="form.headPhone" placeholder="请输入手机号" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="注册号" prop="licenseNub">
<el-input v-model="form.licenseNub" placeholder="请输入营业执照注册号" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
</el-row>
<!-- <el-form-item label="绑定仓库Id" prop="warehouseId">-->
<!-- <el-input v-model="form.warehouseId" placeholder="请输入绑定仓库Id"/>-->
<!-- </el-form-item>-->
<el-row>
<el-col :span="11">
<el-form-item label="法人" prop="legalPerson">
<el-input v-model="form.legalPerson" placeholder="请输入法人" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="法人电话" prop="legalPersonPhone">
<el-input v-model="form.legalPersonPhone" placeholder="请输入法人电话" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="法人身份证" label-width="90px" prop="legalPersonId">
<el-input v-model="form.legalPersonId" placeholder="请输入法人身份证" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="邮箱" prop="mailbox">
<el-input v-model="form.mailbox" placeholder="请输入邮箱" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="客服电话" prop="customerServicePhone">
<el-input v-model="form.customerServicePhone" placeholder="请输入客服电话" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="道路运输许可证编号" label-width="150px" prop="roadTransportNub" >
<el-input v-model="form.roadTransportNub" placeholder="请输入道路运输许可证编号"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="合同起始时间" label-width="100px" prop="contractStartTime">
<el-date-picker v-model="form.contractStartTime" type="date" value-format="YYYY-MM-DD" placeholder="请输入合同起始时间" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="合同结束时间" label-width="100px" prop="contractEndTime">
<el-date-picker v-model="form.contractEndTime" type="date" value-format="YYYY-MM-DD" placeholder="请输入合同起始时间" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="物流园" prop="logisticsPark">
<el-input v-model="form.logisticsPark" placeholder="请输入物流园" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="自由车辆数" label-width="100px" prop="freeVehiclesNub">
<el-input v-model="form.freeVehiclesNub" placeholder="请输入自由车辆数" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="外部车辆数" label-width="100px" prop="externalVehiclesNub">
<el-input v-model="form.externalVehiclesNub" placeholder="请输入外部车辆数" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="星级" prop="starRating">
<el-input v-model="form.starRating" placeholder="请输入星级" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="定位地址" prop="locationAddress">
<el-input v-model="form.locationAddress" placeholder="请输入定位地址" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="经度" prop="longitude">
<el-input v-model="form.longitude" placeholder="请输入经度,保留4位小数" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="纬度" prop="latitude">
<el-input v-model="form.latitude" placeholder="请输入纬度,保留4位小数" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="notes">
<el-input v-model="form.notes" placeholder="请输入备注" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="照片信息" prop="photo">
<el-input v-model="form.photo" placeholder="请输入照片信息"/>
</el-form-item>
<el-form-item label="道路运输许可证图片" label-width="150px" prop="roadTransportPhoto">
<el-input v-model="form.roadTransportPhoto" placeholder="请输入道路运输许可证图片" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="Operation" @click="showdrawer(true)" circle></el-button>
<el-button icon="Search" @click="searchHide" circle></el-button>
</div>
</div>
<el-form-item label="合同附件" prop="contractAppendices">
<el-input v-model="form.contractAppendices" placeholder="请输入合同附件" style="position: absolute;right: 0px;width: 100%"/>
</el-form-item>
<!-- 列表模块 -->
<tablecmt
:columnList="details.columnList"
:tableData="data"
:loading="loadingObj.list"
@inputTxt="inputsc"
@timeCheck="timesc"
@selectCheck="selectsc"
@selection="selectionChange"
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '操作'">
<el-text @click="handleDelete(false, slotProps.scope.row)"> 删除 </el-text>
<el-text @click="handleAnException(slotProps.scope)"> 编辑 </el-text>
</el-form>
<!-- 表单按钮 -->
<template #footer>
<span v-if="!view" class="dialog-footer">
<el-button type="primary" icon="el-icon-circle-check" @click="handleSubmit"> </el-button>
<el-button icon="el-icon-circle-close" @click="box = false"> </el-button>
</span>
<el-text @click="handleAnException(slotProps.scope)"> 查看 </el-text>
</template>
</template>
</el-dialog>
</tablecmt>
<!-- 分页模块 -->
<div class="flex-c-sb mt20">
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div>
<!-- 分页模块 -->
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[30, 50, 80, 120]"
:page-size="page.size"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
</div>
</basic-container>
<!-- 列表配置显示 -->
<edittablehead
@closce="showdrawer"
:drawerShow="drawerShow"
v-model="details.columnList"
></edittablehead>
</template>
<script>
import { getList, getDetail, add, update, remove } from "@/api/basicdata/basicdataCarrier";
import option from "@/option/basicdata/basicdataCarrier2";
import { mapGetters } from "vuex";
<script setup lang="ts">
import { ref, reactive, toRefs, computed, onMounted, nextTick } from 'vue';
import functions from '@/utils/functions.js';
import dayjs from 'dayjs';
import { mapGetters } from 'vuex';
/** 获取字典 */
import { getDictionaryBiz } from '@/api/system/dict';
import {
downloadXls,
setNodeHeight,
getHtmls,
deepClone,
handleClearTableQuery,
debounce,
handleSelectQuery,
handleInputQuery,
handleTranslationDataSeclect,
getObjType,
} from '@/utils/util';
import { columnList } 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';
export default {
data () {
return {
height: 0,
//
title: '',
//
box: false,
//
search: true,
//
loading: true,
//
view: false,
//
query: {},
//
page: {
currentPage: 1,
pageSize: 30,
total: 40
},
//
form: {},
//
selectionList: [],
//
typeData:[],
//
option: option,
//
data: [],
//
validatorRules: {
longitude: [
{ required: true, message: '经度不能为空!',trigger: 'blur'},{pattern: /(^[1-9]\d{0,9}(\.\d{1,4})?$)|(^0(\.\d{1,2})?$)/, message: '格式不正确!'}
],
customerServicePhone: [
{pattern: /^1[34578]\d{9}$/, message: '格式不正确!'}
],
legalPersonPhone: [
{pattern: /^1[34578]\d{9}$/, message: '格式不正确!'}
],
headPhone: [
{pattern: /^1[34578]\d{9}$/, message: '格式不正确!'}
],
mailbox: [
{pattern: /^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,4}$/, message: '邮箱格式不正确!'}
],
latitude: [
{ required: true, message: '纬度不能为空!',trigger: 'blur'},{pattern: /(^[1-9]\d{0,9}(\.\d{1,4})?$)|(^0(\.\d{1,2})?$)/, message: '格式不正确!'}
],
freeVehiclesNub: [
{ required: true, message: '自由车辆不能为空!',trigger: 'blur'},{pattern: /(^[1-9]\d{0,9}(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/, message: '格式不正确!'}
],
externalVehiclesNub: [
{ required: true, message: '外来车辆数不能为空!',trigger: 'blur'}, {pattern: /(^[1-9]\d{0,9}(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/, message: '格式不正确!'}
],
starRating: [
{ required: true, message: '请输入星级!',trigger: 'blur'},{pattern: /(^[1-9]\d{0,9}(\.\d{1,3})?$)|(^0(\.\d{1,2})?$)/, message: '星级格式不正确!'}
],
purchaseAmount: [
{pattern: /(^[1-9]\d{0,9}(\.\d{1,3})?$)|(^0(\.\d{1,2})?$)/, message: '押金格式不正确!'}
],
//
const $router = useRouter();
const details = reactive<any>({
/** 是否开启搜索 */
search: true,
/** 表格搜索条件 */
query: {},
/** 时间快捷选择设置 */
shortcuts: [
{
text: '最近一周',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
return [start, end];
},
}
},
{
text: '最近一个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
return [start, end];
},
},
{
text: '最近三个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
return [start, end];
},
},
],
/** 列表 */
columnList: deepClone(columnList),
/** 列表数据 */
data: [{}],
/** 页面loading */
loadingObj: {
/** 列表加载loading */
list: false,
/** 页面loading */
pageLoading: false,
},
mounted () {
this.init();
//
this.queryDictionary();
/** 列表复选框选中的数据 */
selectionList: [],
/** 是否显示设置表格 */
drawerShow: false,
/** 分页参数 */
page: {
current: 1,
size: 30,
total: 0,
},
created() {
/** 弹出层显示 */
popUpShow: {
/** 图片预览 */
abnormalVisited: false,
},
computed: {
...mapGetters(["permission"]),
ids () {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
/** 列表Dom节点 */
listNode: '',
form: {},
/** 全屏 */
fullscreenObj: {
/** 查看 */
view: false,
},
methods: {
queryDictionary() {
getDictionaryBiz('basic_carrier_type').then(res => {
this.typeData = res.data.data;
this.onLoad(this.page);
});
},
init () {
this.height = this.setPx(document.body.clientHeight - 340);
},
searchHide () {
this.search = !this.search;
},
searchChange () {
this.onLoad(this.page);
},
searchReset () {
this.query = {};
this.page.currentPage = 1;
this.onLoad(this.page);
},
handleSubmit () {
this.$refs.form.validate(valid=>{
if (valid) {
if (!this.form.id) {
add(this.form).then(() => {
this.box = false;
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
} else {
update(this.form).then(() => {
this.box = false;
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
})
}
} else {
console.log('error submit!!');
return false;
}
});
},
handleAdd () {
this.title = '新增'
this.form = {}
this.box = true
},
handleEdit (row) {
this.title = '编辑'
this.box = true
getDetail(row.id).then(res => {
this.form = res.data.data;
});
},
handleView (row) {
this.title = '查看'
this.view = true;
this.box = true;
getDetail(row.id).then(res => {
this.form = res.data.data;
});
},
handleDelete () {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.selectionClear();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
rowDel (row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
beforeClose (done) {
done()
this.form = {};
this.view = false;
},
selectionChange (list) {
this.selectionList = list;
},
selectionClear () {
this.selectionList = [];
this.$refs.table.clearSelection();
},
currentChange (currentPage) {
this.page.currentPage = currentPage;
this.onLoad(this.page);
},
sizeChange (pageSize) {
this.page.pageSize = pageSize;
this.onLoad(this.page);
},
onLoad (page, params = {}) {
this.loading = true;
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data;
// eslint-disable-next-line no-empty
for (let i = 0; i < data.records.length; i++) {
// eslint-disable-next-line no-empty
for (let j = 0; j < this.typeData.length; j++) {
// eslint-disable-next-line no-empty
if (data.records[i].type == this.typeData[j].dictKey){
data.records[i].type=this.typeData[j].dictValue;
}
}
}
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
});
});
const { search, query, shortcuts, stockupDate, data, loadingObj, selectionList, drawerShow, page } =
toRefs(details);
/** vuex */
const permission = computed(() => mapGetters(['permission', 'tagWel', 'tagList']));
onMounted(() => {
const timer = setTimeout(() => {
details.listNode = document.querySelector('.maboxhi');
details.listNode.style.transition = 'all .5s ease-out';
clearTimeout(timer);
}, 100);
});
/** 请求页面数据 */
const onLoad = debounce(async (page?: any, params = {}) => {
try {
details.loadingObj.list = true;
let _page = details.page;
if (page) _page = page;
const _submitData = { ..._page, ...details.query, ...params };
delete _submitData.total;
//
const res = await getList(_submitData);
console.log('res :>> ', res);
const { code, data } = res.data;
if (code !== 200) return;
details.data = data.records;
handleTranslationDataSeclect(details.data, details.columnList);
details.page.total = data.total;
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.list = false;
}
}, 10);
const handleData = (key, res) => {
const { code, data } = res.data;
if (code !== 200) return;
for (let i = 0; i < details.columnList.length; i++) {
const value = details.columnList[i];
if (value.label === key)
return (value.checkarr =
getObjType(data) === 'array'
? data.map(val => {
val.label = val.dictValue;
val.value = val.dictKey;
return val;
})
: []);
}
};
//
const initData = async () => {
await Promise.all([
//
getDictionaryBiz('basic_carrier_type').then(res => handleData('类型', res)),
onLoad(),
]);
await nextTick();
handleTranslationDataSeclect(details.data, details.columnList);
console.log('details.columnList :>> ', details.columnList);
};
initData();
/** 搜索 */
const searchChange = () => {
onLoad(details.page);
};
/** 清空表单 */
const searchReset = () => {
details.query = {};
details.stockupDate = [];
details.page.currentPage = 1;
handleClearTableQuery(details.columnList);
onLoad(details.page);
};
/** 展开列表控件 */
const showdrawer = (_flag?: boolean) => {
details.drawerShow = _flag;
};
/** 是否开启搜索区 */
const searchHide = () => {
details.search = !details.search;
setNodeHeight(details.listNode, '', true);
};
/** 表格表头输入框搜索 */
const inputsc = (index, row) => {
handleInputQuery(index, row, details.query);
onLoad(details.page);
};
/** 表格表头时间选择 */
const timesc = (index, row) => {
console.log(index, row);
if (!!index) {
index = dayjs(index).format('YYYY-MM-DD');
}
details.query[row.prop] = index;
if (!index) {
delete details.query[row.prop];
}
onLoad(details.page);
};
/** 表格表头下拉框选择 */
const selectsc = (index, row) => {
handleSelectQuery(index, row, details.query);
onLoad(details.page);
};
/** 表格表头复选框选择 */
const selectionChange = (list: any) => {
details.selectionList = list;
};
/** 每页数量改变执行的回调 */
const sizeChange = (size: number) => {
details.page.size = size;
onLoad(details.page);
};
/** 页码改变执行的回调 */
const currentChange = current => {
details.page.current = current;
onLoad();
};
/** 新增 */
const handleAdd = () => {
$router.push({
path: '/basicdata/vehicle/basicdataVehicleAddForm',
});
};
/**
* isBatch 是否批量删除
* row 单个删除时当前行的数据
*/
const handleDelete = (isBatch, row: any = {}) => {
let ids = '';
if (isBatch) {
if (!details.selectionList.length) {
ElMessage.warning('请选择要删除的数据');
return;
}
ids = details.selectionList.map(v => v.id).join(',');
} else {
ids = row.id;
}
ElMessageBox.confirm('确定删除该数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
try {
details.loadingObj.pageLoading = true;
const res = await remove(ids);
const { code, msg } = res.data;
if (code !== 200) return ElMessage.error(msg);
ElMessage.success('删除成功');
onLoad(details.page);
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
})
.catch(() => {});
};
</script>
<style scoped lang="scss">
//
:deep(.el-date-editor.el-input) {
height: 100% !important;
width: 100% !important;
}
:deep(.el-range-editor.el-input__wrapper) {
height: 100% !important;
}
.mt20 {
margin-top: 20px;
}
.fwb {
font-weight: bold;
}
</style>

91
src/views/basicdata/vehicle/basicdataVehicle2.vue

@ -29,8 +29,10 @@
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" icon="Plus" @click="handleAdd"> </el-button>
<el-button type="primary" icon="Delete" @click="searchChange"> </el-button>
<el-button type="primary" icon="Download" @click="searchChange"> </el-button>
<el-button type="primary" icon="Delete" @click="() => handleDelete(true)"
> </el-button
>
<el-button type="primary" icon="Download" @click="handleExport"> </el-button>
<el-button type="primary" icon="Upload" @click="searchChange"> </el-button>
</div>
<!-- 头部右侧按钮模块 -->
@ -53,11 +55,11 @@
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '操作'">
<el-text @click="handleAnException(slotProps.scope)"> 删除 </el-text>
<el-text @click="handleDelete(false, slotProps.scope.row)"> 删除 </el-text>
<el-text @click="handleAnException(slotProps.scope)"> 编辑 </el-text>
<el-text @click="handleEdit(slotProps.scope)"> 编辑 </el-text>
<el-text @click="handleAnException(slotProps.scope)"> 查看 </el-text>
<el-text @click="handleView(slotProps.scope)"> 查看 </el-text>
</template>
</template>
</tablecmt>
@ -110,6 +112,7 @@ import {
getObjType,
} from '@/utils/util';
import columnList from '@/option/basicdata/basicdataVehicle2.js';
import { useStore } from 'vuex';
import { useRouter } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus';
import {
@ -122,12 +125,15 @@ import {
getVehicle,
$_Exportvehicle,
getDictionary,
getVehicleExport,
} from '@/api/basicdata/basicdataVehicle';
import { getOwn } from '@/api/basicdata/basicdataDriverArtery';
//
const $router = useRouter();
const $store = useStore();
const details = reactive<any>({
/** 是否开启搜索 */
search: true,
@ -253,6 +259,7 @@ const handleData = (key, res) => {
}
};
//
const initData = async () => {
await Promise.all([
//
@ -372,11 +379,85 @@ const currentChange = current => {
onLoad();
};
/** 新增 */
const handleAdd = () => {
$store.commit('DEL_ONCE_TAG', '/basicdata/vehicle/basicdataVehicleAddForm');
$router.push({
path: '/basicdata/vehicle/basicdataVehicleAddForm',
query: { type: 'add' },
});
};
/** 编辑 */
const handleEdit = ({ row }) => {
$store.commit('DEL_ONCE_TAG', '/basicdata/vehicle/basicdataVehicleAddForm');
$router.push({
path: '/basicdata/vehicle/basicdataVehicleAddForm',
query: { type: 'edit', name: `${row.vehicleNub} -- 编辑`, id: row.id },
});
};
/** 查看 */
const handleView = ({ row }) => {
$store.commit('DEL_ONCE_TAG', '/basicdata/vehicle/basicdataVehicleAddForm');
$router.push({
path: '/basicdata/vehicle/basicdataVehicleAddForm',
query: { type: 'view', name: `${row.vehicleNub} -- 查看`, id: row.id },
});
};
/**
* isBatch 是否批量删除
* row 单个删除时当前行的数据
*/
const handleDelete = (isBatch, row: any = {}) => {
let ids = '';
if (isBatch) {
if (!details.selectionList.length) {
ElMessage.warning('请选择要删除的数据');
return;
}
ids = details.selectionList.map(v => v.id).join(',');
} else {
ids = row.id;
}
ElMessageBox.confirm('确定删除该数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
try {
details.loadingObj.pageLoading = true;
const res = await remove(ids);
const { code, msg } = res.data;
if (code !== 200) return ElMessage.error(msg);
ElMessage.success('删除成功');
onLoad(details.page);
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
})
.catch(() => {});
};
/** 导出 */
const handleExport = () => {
getVehicleExport();
};
/** 导入 */
const handleImport = () => {
importExcel('/basicdata/vehicle/import', details.columnList);
};
</script>
<style scoped lang="scss">

356
src/views/basicdata/vehicle/basicdataVehicleAddForm.vue

@ -6,7 +6,7 @@
<div>车辆基本信息</div>
</div>
<el-form inline class="mt20 pl20" :model="details.form">
<el-form inline class="mt20 pl20" ref="formRef" :model="details.form">
<el-form-item
v-for="item in details.carBasicForm"
:label="item.label"
@ -35,6 +35,7 @@
:value-on-clear="0"
:precision="item.precision || 0"
class="w100"
:disabled="item.disabled || false"
></el-input-number>
</template>
@ -46,6 +47,8 @@
class="w100"
clearable
filterable
@change="value => item.change && item.change(value)"
:multiple="item.multiple || false"
>
<el-option
v-for="val in item.checkarr"
@ -86,35 +89,55 @@
<div>相关图片</div>
</div>
<!-- 图片类型 -->
<div class="mt20 pl20 imgContainer">
<div v-for="item in details.imgArr" :key="item.label" class="imgItem">
<div class="pageTitle title mb20">{{ item.label }}</div>
<!-- 上传组件 -->
<el-upload
v-model:file-list="item.imgList"
list-type="picture-card"
list-type="picture"
:action="doubledCount"
:before-upload="beforeAvatarUpload"
:on-success="res => handleAvatarSuccess(res, item)"
:headers="headers"
multiple
:show-file-list="false"
>
<!-- <div class="flex-c-c mb20">
<div class="pageTitle title mr20">{{ item.label }}</div>
<el-button type="primary" icon="CirclePlus">添加图片</el-button>
</div> -->
<template #default v-if="item.imgList.length === 0">
<el-icon>
<Plus />
</el-icon>
<template #default>
<div class="pageTitle title mb20">
<span class="mr20" @click.stop="() => {}">
{{ item.label }}
</span>
<el-button type="primary" icon="CirclePlus"> </el-button>
<el-button icon="Delete" @click.stop="() => handleEmpty(item)"> </el-button>
</div>
</template>
</el-upload>
<div class="imgRow">
<div v-for="(value, index) in item.imgList" :key="value.url">
<el-image
class="img"
:src="value.url"
v-loading="!value.imgUrl"
:zoom-rate="1.2"
:max-scale="7"
:min-scale="0.2"
:preview-src-list="item.imgList.map(val => val.imgUrl)"
:initial-index="index"
fit="cover"
/>
</div>
</div>
</div>
</div>
<!-- 底部控件 -->
<div class="footer_container">
<el-button icon="CircleClose"> </el-button>
<el-button type="primary" icon="Position"> </el-button>
<el-button type="primary" icon="Position" @click="handleSubmit"> </el-button>
</div>
</div>
</basic-container>
@ -122,21 +145,15 @@
<script setup lang="ts">
import { ref, reactive, computed, nextTick } from 'vue';
import { ElMessage } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { getToken } from '@/utils/auth';
import { getDictionaryBiz } from '@/api/system/dict';
import { deepClone, debounce, getObjType } from '@/utils/util';
import {
getList,
getDetail,
add,
update,
remove,
getVehicle,
$_Exportvehicle,
getDictionary,
} from '@/api/basicdata/basicdataVehicle';
import { deepClone, debounce, getObjType, isNumber } from '@/utils/util';
import { add, getDictionary, getDetail, update } from '@/api/basicdata/basicdataVehicle';
import { getList } from '@/api/basicdata/basicdataVehicleInfo';
import { getOwn } from '@/api/basicdata/basicdataDriverArtery';
import { useRoute, uesRouter } from 'vue-router';
const details = reactive({
carBasicForm: [
@ -153,6 +170,13 @@ const details = reactive({
},
],
},
{
label: '车辆所属人',
prop: 'vehicleOwners',
type: 3,
multiple: true,
checkarr: [],
},
{
label: '车辆来源',
prop: 'vehicleSource',
@ -185,6 +209,18 @@ 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;
},
},
{
label: '车厢类型',
@ -197,25 +233,30 @@ const details = reactive({
prop: 'vehicleCommander',
type: 2,
checkarr: [],
precision: 0,
precision: 2,
disabled: true,
},
{
label: '外廓高(M)',
prop: 'vehicleHeight',
type: 2,
checkarr: [],
precision: 2,
disabled: true,
},
{
label: '付款方式',
prop: 'paymentMethod',
type: 1,
type: 3,
checkarr: [],
},
{
label: '核定体积',
prop: 'approvedVolume',
type: 1,
type: 2,
checkarr: [],
precision: 2,
disabled: true,
},
{
label: '车牌颜色',
@ -264,27 +305,30 @@ const details = reactive({
prop: 'vehicleQuality',
type: 2,
checkarr: [],
precision: 4,
precision: 2,
disabled: true,
},
{
label: '整备质量(T)',
prop: 'curbWeight',
type: 2,
checkarr: [],
precision: 4,
precision: 2,
disabled: true,
},
{
label: '载荷质量(T)',
prop: 'loadMass',
type: 2,
checkarr: [],
precision: 4,
precision: 2,
},
{
label: '外廓宽(M)',
prop: 'outerWidth',
type: 2,
checkarr: [],
precision: 2,
},
{
label: '到期时间',
@ -421,14 +465,14 @@ const details = reactive({
},
],
imgArr: [
{ label: '行驶证正面照片', imgList: [] },
{ label: '行驶证反面照片', imgList: [] },
{ label: '许可证照片', imgList: [] },
{ label: '车辆照片(最新)', imgList: [] },
{ label: '车尾照片', imgList: [] },
{ label: '道理运输照片', imgList: [] },
{ label: '人车合影照片', imgList: [] },
{ label: '保险卡照片', imgList: [] },
{ label: '行驶证正面照片', imgList: [], prop: 'drivingLicensePhoto' },
{ label: '行驶证反面照片', imgList: [], prop: 'drivingLicensePhotoBack' },
{ label: '许可证照片', imgList: [], prop: 'licensePhoto' },
{ label: '车辆照片(最新)', imgList: [], prop: 'vehiclePhoto' },
{ label: '车尾照片', imgList: [], prop: 'vehicleRearPhoto' },
{ label: '道理运输照片', imgList: [], prop: 'roadTransportPhoto' },
{ label: '人车合影照片', imgList: [], prop: 'vehiclePeoplePhoto' },
{ label: '保险卡照片', imgList: [], prop: 'insuranceCardPhoto' },
],
form: {},
// loading
@ -436,8 +480,20 @@ const details = reactive({
/** 页面 */
pageLoading: false,
},
pageInfo: {
type: 'add' as 'add' | 'edit' | 'view',
id: '',
},
});
//
const formRef = ref();
// router
const $router = useRouter();
const $route = useRoute();
//
const handleData = (key, res) => {
const { code, data } = res.data;
if (code !== 200) return;
@ -456,7 +512,48 @@ const handleData = (key, res) => {
}
};
//
const initData = async () => {
//
const handleCarModel = async () => {
const [res1, res2] = await Promise.all([getList(), getDictionaryBiz('basic_vehicle_model')]);
const { code: code1, data: data1 } = res1.data;
const { code: code2, data: data2 } = res2.data;
if (
code1 !== 200 ||
code2 !== 200 ||
getObjType(data1) !== 'array' ||
getObjType(data2) !== 'array'
)
return;
//
for (let i = 0; i < data1.length; i++) {
const value = data1[i];
for (let j = 0; j < data2.length; j++) {
const item = data2[j];
if (value.vehicleModel !== item.dictKey) continue;
value.label = item.dictValue;
value.value = item.dictKey;
break;
}
}
//
for (let i = 0; i < details.carBasicForm.length; i++) {
const value = details.carBasicForm[i];
if (value.label !== '车辆类型') continue;
value.checkarr = data1;
break;
}
};
//
await Promise.all([
//
getDictionaryBiz('basic_vehicle_source').then(res => handleData('车辆来源', res)),
@ -464,8 +561,6 @@ 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)),
//
@ -478,6 +573,8 @@ const initData = async () => {
getDictionaryBiz('basic_energy_type').then(res => handleData('能源类型', res)),
//
getDictionaryBiz('basic_plate_type').then(res => handleData('车牌类型', res)),
//
handleCarModel(),
//
getDictionary().then(res => {
const { code, data } = res.data;
@ -496,13 +593,65 @@ const initData = async () => {
: []);
}
}),
//
getOwn().then(res => {
const { code, data } = res.data;
if (code !== 200) return;
for (let i = 0; i < details.carBasicForm.length; i++) {
const value = details.carBasicForm[i];
if (value.label === '车辆所属人')
return (value.checkarr =
getObjType(data) === 'array'
? data.map(val => {
val.label = val.name;
val.value = val.id;
return val;
})
: []);
}
}),
]);
details.pageInfo = $route.query;
for (let i = 0; i < details.carBasicForm.length; i++) {
const value = details.carBasicForm[i];
details.form[value.prop] = value.type === 2 ? 0 : '';
}
if (details.pageInfo.type === 'add') return;
const res = await getDetail(details.pageInfo.id);
const { code, data } = res.data;
if (code !== 200) return;
// details.form = data;
for (let i = 0; i < details.carBasicForm.length; i++) {
const value = details.carBasicForm[i];
if (value.type === 3 && value.multiple) {
details.form[value.prop] = details.form[value.prop]
? details.form[value.prop].split(',')
: [];
continue;
}
details.form[value.prop] = data[value.prop] || '';
}
for (let i = 0; i < details.imgArr.length; i++) {
const value = details.imgArr[i];
let _imgList = [];
const _value = data[value.prop];
value.imgList = _value
? _value.split(',').map(val => {
return { url: val, imgUrl: val };
})
: [];
}
};
initData();
@ -531,12 +680,77 @@ const headers = computed(() => {
return { 'Blade-Auth': 'Bearer ' + getToken() };
});
//
const handleAvatarSuccess = (response, item) => {
for (let i = 0; i < item.imgList.length; i++) {
const value = item.imgList[i];
console.log('value :>> ', value);
value.imgUrl =
value.response && value.response.code === 200 ? value.response.data.link : value.imgUrl || '';
}
ElMessage.success('上传成功');
};
/** 确认清空 */
const handleEmpty = item => {
if (item.imgList.length === 0) return ElMessage.warning('没有图片可以清空');
ElMessageBox.confirm('确定要清空吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
item.imgList = [];
})
.catch(() => {});
};
/** 提交 */
const handleSubmit = () => {
const handleSubmit = async () => {
try {
const _flag = await formRef.value.validate();
if (!_flag) return;
details.loadingObj.pageLoading = true;
const submitData = { ...details.form };
for (let i = 0; i < details.carBasicForm.length; i++) {
const value = details.carBasicForm[i];
if (value.type === 3 && value.multiple) {
submitData[value.prop] = details.form[value.prop].join(',');
}
}
for (let i = 0; i < details.imgArr.length; i++) {
const value = details.imgArr[i];
let _imgList = [];
for (let j = 0; j < value.imgList.length; j++) {
const item = value.imgList[j];
if (!item.imgUrl || /'blob'/.test(item.imgUrl))
return ElMessage.warning('存在异常图片,请等待上传完毕或移除');
_imgList.push(item.imgUrl);
}
submitData[value.prop] = _imgList.join(',');
}
details.pageInfo.id && (submitData.id = details.pageInfo.id);
const res = details.pageInfo.type === 'add' ? await add(submitData) : await update(submitData);
const { code, data } = res.data;
if (code !== 200) return;
console.log('details.form :>> ', details.form);
console.log('_flag :>> ', _flag);
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
};
</script>
@ -571,6 +785,13 @@ const handleSubmit = () => {
}
}
:deep(.el-form) {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
}
//
.imgContainer {
display: flex;
flex-wrap: wrap;
@ -584,6 +805,18 @@ const handleSubmit = () => {
font-weight: bold;
// margin-bottom: 20px;
}
.imgRow {
display: flex;
flex-wrap: wrap;
}
.img {
margin: 10px;
border-radius: 5px;
width: 100px;
height: 100px;
}
}
}
@ -617,4 +850,41 @@ const handleSubmit = () => {
display: flex;
}
}
:deep(.el-upload--picture-card) {
position: absolute;
top: 0;
left: 0;
}
:deep(.el-upload-list) {
&::before {
content: '';
display: block;
width: var(--el-upload-list-picture-card-size);
height: var(--el-upload-list-picture-card-size);
margin-bottom: 10px;
}
}
//
.errBtn {
background: #ff3e3e;
border-color: #fff;
color: #fff;
&:hover {
background: #ff5c5c;
}
}
.addBtn {
background: #1cd66c;
border-color: #fff;
color: #fff;
&:hover {
background: #ff5c5c;
}
}
</style>

2
src/views/basicdata/vehicle/basicdataVehicleInfo.vue

@ -256,7 +256,7 @@ const permission = computed(() => mapGetters(['permission', 'tagWel', 'tagList']
const initData = async () => {
try {
const res = await getDictionaryBiz('basic_car_type');
const res = await getDictionaryBiz('basic_vehicle_model');
const { code, data } = res.data;
if (code !== 200) return;
details.vehicleModelOption = data;

372
src/views/distribution/inventory/delivery/SeparateTheList.vue

@ -0,0 +1,372 @@
<template>
<basic-container v-loading="details.loadingObj.pageLoading">
<div class="avue-crud">
<!-- 搜索模块 -->
<div v-h5uShow="!search">
<!-- 查询模块 -->
<el-form :inline="true" :model="query" class="header_search">
<el-form-item label="车牌号:" class="el-times">
<el-input v-model="query.stockupArea" clearable placeholder="请输入车牌号"></el-input>
</el-form-item>
<el-form-item label="有效状态">
<el-select class="w100" v-model="query.value" clearable placeholder="有效状态">
<el-option label="有效" value="item.value" />
<el-option label="作废" value="item.value" />
</el-select>
</el-form-item>
<!-- 查询按钮 -->
<el-form-item class="el-btn">
<el-button type="primary" icon="el-icon-search" @click="searchChange"> </el-button>
<el-button icon="el-icon-delete" @click="searchReset"> </el-button>
</el-form-item>
</el-form>
</div>
<!-- 控件模块 -->
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" icon="Delete" @click="() => handleDelete(true)">
</el-button>
<el-button type="primary" icon="Download" @click="handleExport"> </el-button>
</div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
<el-button icon="Refresh" @click="searchChange" circle></el-button>
<el-button icon="Operation" @click="showdrawer(true)" circle></el-button>
<el-button icon="Search" @click="searchHide" circle></el-button>
</div>
</div>
<!-- 列表模块 -->
<tablecmt
:columnList="details.columnList"
:tableData="data"
:loading="loadingObj.list"
@inputTxt="inputsc"
@timeCheck="timesc"
@selectCheck="selectsc"
@selection="selectionChange"
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '操作'">
<el-text @click="handleView(slotProps.scope)"> </el-text>
<el-text @click="handleDelete(false, slotProps.scope.row)"> </el-text>
</template>
</template>
</tablecmt>
<!-- 分页模块 -->
<div class="flex-c-sb mt20">
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div>
<!-- 分页模块 -->
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[30, 50, 80, 120]"
:page-size="page.size"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
</div>
</basic-container>
<!-- 列表配置显示 -->
<edittablehead
@closce="showdrawer"
:drawerShow="drawerShow"
v-model="details.columnList"
></edittablehead>
</template>
<script setup lang="ts">
import { ref, reactive, toRefs, computed, onMounted, nextTick } from 'vue';
import functions from '@/utils/functions.js';
import dayjs from 'dayjs';
import { mapGetters } from 'vuex';
/** 获取字典 */
import { getDictionaryBiz } from '@/api/system/dict';
import {
downloadXls,
setNodeHeight,
getHtmls,
deepClone,
handleClearTableQuery,
debounce,
handleSelectQuery,
handleInputQuery,
handleTranslationDataSeclect,
getObjType,
} from '@/utils/util';
import { columnList } from '@/option/distribution/SeparateTheList.js';
import { useStore } from 'vuex';
import { useRouter } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus';
// import { } from '@/api/distribution/SeparateTheList';
//
const $router = useRouter();
const $store = useStore();
const details = reactive<any>({
/** 是否开启搜索 */
search: true,
/** 表格搜索条件 */
query: {},
/** 时间快捷选择设置 */
shortcuts: [
{
text: '最近一周',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
return [start, end];
},
},
{
text: '最近一个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
return [start, end];
},
},
{
text: '最近三个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
return [start, end];
},
},
],
/** 列表 */
columnList: deepClone(columnList),
/** 列表数据 */
data: [{}],
/** 页面loading */
loadingObj: {
/** 列表加载loading */
list: false,
/** 页面loading */
pageLoading: false,
},
/** 列表复选框选中的数据 */
selectionList: [],
/** 是否显示设置表格 */
drawerShow: false,
/** 分页参数 */
page: {
current: 1,
size: 30,
total: 0,
},
/** 弹出层显示 */
popUpShow: {
/** 图片预览 */
abnormalVisited: false,
},
/** 列表Dom节点 */
listNode: '',
form: {},
/** 全屏 */
fullscreenObj: {
/** 查看 */
view: false,
},
});
const { search, query, shortcuts, stockupDate, data, loadingObj, selectionList, drawerShow, page } =
toRefs(details);
/** vuex */
const permission = computed(() => mapGetters(['permission', 'tagWel', 'tagList']));
onMounted(() => {
const timer = setTimeout(() => {
details.listNode = document.querySelector('.maboxhi');
details.listNode.style.transition = 'all .5s ease-out';
clearTimeout(timer);
}, 100);
});
/** 请求页面数据 */
const onLoad = debounce(async (params = {}) => {
try {
details.loadingObj.list = true;
let _page = details.page;
//
const res = await getPage({ ..._page, ...details.query, ...params });
console.log('res :>> ', res);
const { code, data } = res.data;
if (code !== 200) return;
details.data = data.records;
handleTranslationDataSeclect(details.data, details.columnList);
details.page.total = data.total;
} catch (error) {
} finally {
details.loadingObj.list = false;
}
}, 10);
// onLoad();
/** 搜索 */
const searchChange = () => {
onLoad();
};
/** 清空表单 */
const searchReset = () => {
details.query = {};
details.stockupDate = [];
details.page.currentPage = 1;
handleClearTableQuery(details.columnList);
onLoad();
};
/** 展开列表控件 */
const showdrawer = (_flag?: boolean) => {
details.drawerShow = _flag;
};
/** 是否开启搜索区 */
const searchHide = () => {
details.search = !details.search;
setNodeHeight(details.listNode, '', true);
};
/** 表格表头输入框搜索 */
const inputsc = (index, row) => {
handleInputQuery(index, row, details.query);
onLoad();
};
/** 表格表头时间选择 */
const timesc = (index, row) => {
console.log(index, row);
if (!!index) {
index = dayjs(index).format('YYYY-MM-DD');
}
details.query[row.prop] = index;
if (!index) {
delete details.query[row.prop];
}
onLoad();
};
/** 表格表头下拉框选择 */
const selectsc = (index, row) => {
handleSelectQuery(index, row, details.query);
onLoad();
};
/** 表格表头复选框选择 */
const selectionChange = (list: any) => {
details.selectionList = list;
};
/** 每页数量改变执行的回调 */
const sizeChange = (size: number) => {
details.page.size = size;
onLoad();
};
/** 页码改变执行的回调 */
const currentChange = current => {
details.page.current = current;
onLoad();
};
/** 查看 */
const handleView = ({ row }) => {
$store.commit('DEL_ONCE_TAG', '/basicdata/vehicle/basicdataVehicleAddForm');
$router.push({
path: '/basicdata/vehicle/basicdataVehicleAddForm',
query: { type: 'view', name: `${row.vehicleNub} -- 查看`, id: row.id },
});
};
/**
* isBatch 是否批量删除
* row 单个删除时当前行的数据
*/
const handleDelete = (isBatch, row: any = {}) => {
let ids = '';
if (isBatch) {
if (!details.selectionList.length) {
ElMessage.warning('请选择要删除的数据');
return;
}
ids = details.selectionList.map(v => v.id).join(',');
} else {
ids = row.id;
}
ElMessageBox.confirm('确定删除该数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
try {
details.loadingObj.pageLoading = true;
const res = await remove(ids);
const { code, msg } = res.data;
if (code !== 200) return ElMessage.error(msg);
ElMessage.success('删除成功');
onLoad();
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
})
.catch(() => {});
};
/** 导出 */
const handleExport = () => {
getVehicleExport();
};
</script>
<style scoped lang="scss">
//
:deep(.el-date-editor.el-input) {
height: 100% !important;
width: 100% !important;
}
:deep(.el-range-editor.el-input__wrapper) {
height: 100% !important;
}
.mt20 {
margin-top: 20px;
}
.fwb {
font-weight: bold;
}
</style>

73
src/views/system/pdaversion/pdaversionManage.vue

@ -182,7 +182,7 @@ import { mapGetters } from 'vuex';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { getToken } from '@/utils/auth';
import { handleClearTableQuery } from '@/utils/util';
import axios from "axios";
import axios from 'axios';
export default {
data() {
return {
@ -437,62 +437,61 @@ export default {
handleClearTableQuery(this.columnList);
this.onLoad(this.page);
},
uploadBefore(rawFile, done, loading, column) {
if (rawFile.type !== 'image/png' && rawFile.type !== 'image/jpeg') {
ElMessage.error('图片格式只能为 png/jpg!');
return false;
} else if (rawFile.size / 1024 / 1024 > 10) {
ElMessage.error('图片大小不能大于10MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
},
async customUploadRequest({ file }) {
try {
async uploadBefore(rawFile, done, loading, column) {
if (rawFile.type !== 'image/png' && rawFile.type !== 'image/jpeg') {
ElMessage.error('图片格式只能为 png/jpg!');
return false;
} else if (rawFile.size / 1024 / 1024 > 10) {
ElMessage.error('图片大小不能大于10MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
},
async customUploadRequest({ file }) {
try {
console.log(file, '文件上传');
const responses = await this.$fileslicing(this, file); // ()
console.log(responses, 'responses');
let time= setTimeout(()=>{
let response=responses
let time = setTimeout(() => {
let response = responses;
if (response && response.code === 200) {
// this.form.filelink
if (!this.form.filelink) {
this.form.filelink = [];
console.log('初始化 this.form.filelink 为空数组');
this.form.filelink = [];
console.log('初始化 this.form.filelink 为空数组');
}
//
if (!this.form.filelink[0]) {
this.form.filelink[0] = { response: { data: {} } };
console.log('初始化 this.form.filelink[0] 为 { response: { data: {} } }');
this.form.filelink[0] = { response: { data: {} } };
console.log('初始化 this.form.filelink[0] 为 { response: { data: {} } }');
} else {
if (!this.form.filelink[0].response) {
this.form.filelink[0].response = { data: {} };
console.log('初始化 this.form.filelink[0].response 为 { data: {} }');
}
if (!this.form.filelink[0].response.data) {
this.form.filelink[0].response.data = {};
console.log('初始化 this.form.filelink[0].response.data 为 {}');
}
if (!this.form.filelink[0].response) {
this.form.filelink[0].response = { data: {} };
console.log('初始化 this.form.filelink[0].response 为 { data: {} }');
}
if (!this.form.filelink[0].response.data) {
this.form.filelink[0].response.data = {};
console.log('初始化 this.form.filelink[0].response.data 为 {}');
}
}
console.log('在赋值之前的 this.form.filelink:', this.form.filelink);
this.form.filelink[0].response.data.link = response.data.domain + response.data.name;
console.log('赋值之后的 this.form.filelink:', this.form.filelink);
} else {
} else {
console.error('文件上传失败或响应无效', response);
}
clearTimeout(time)
},0)
} catch (error) {
}
clearTimeout(time);
}, 0);
} catch (error) {
console.error('文件上传过程中发生错误', error);
}
},
}
},
handleSubmit() {
if (!this.form.id) {
console.log( this.form.filelink,' this.form.filelink');
console.log(this.form.filelink, ' this.form.filelink');
this.form.link = this.form.filelink[0].response.data.link;
this.form.versionCode = this.form.versionName.split('.').join('');
this.form.newTypes = this.form.link.indexOf('wgt') == -1 ? '1' : '2';

Loading…
Cancel
Save