Browse Source

修复已知bug

dev-xx
马远东 8 months ago
parent
commit
e6e1e36d05
  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. 372
      src/views/distribution/inventory/delivery/SeparateTheList.vue
  11. 47
      src/views/system/pdaversion/pdaversionManage.vue

41
src/api/basicdata/basicdataCarrier.js

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

8
src/api/basicdata/basicdataVehicle.js

@ -27,6 +27,7 @@ export const getVehicle = () => {
}); });
}; };
/** 车辆详情 */
export const getDetail = id => { export const getDetail = id => {
return request({ return request({
url: '/api/logpm-basicdata/vehicle/detail', url: '/api/logpm-basicdata/vehicle/detail',
@ -106,3 +107,10 @@ export const getDictionary = params => {
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 { export const columnList = [
expand: false, {
index: true, prop: '',
border: true, label: '复选框',
selection: true, type: 0,
column: [ width: 55,
{ fixed: true,
label: "主键", },
prop: "id", {
display: false, prop: '',
hide: true, label: '序号',
}, type: 12,
{ values: '',
label: "租户号", width: 55,
prop: "tenantId", fixed: true,
display: false, },
hide: true, {
}, label: '类型',
{ prop: 'typeName',
label: "创建人", type: 3,
prop: "createUser", values: '',
display: false, width: '150',
hide: true, checkarr: [],
}, fixed: false,
{ sortable: true,
label: "创建时间", },
prop: "createTime", {
display: false, label: '承运商编号',
hide: true, prop: 'number',
}, type: 2,
{ values: '',
label: "更新人", width: '150',
prop: "updateUser", checkarr: [],
display: false, fixed: false,
hide: true, sortable: true,
}, },
{ {
label: "更新时间", label: '承运商电话',
prop: "updateTime", prop: 'carrierPhone',
display: false, type: 2,
hide: true, values: '',
}, width: '150',
{ checkarr: [],
label: "状态", fixed: false,
prop: "status", sortable: true,
display: false, },
hide: true, {
}, label: '承运商名称',
{ prop: 'carrierPhone',
label: "是否已删除;1-未删除,2-已删除", type: 2,
prop: "isDeleted", values: '',
display: false, width: '150',
hide: true, checkarr: [],
}, fixed: false,
{ sortable: true,
label: "创建部门", },
prop: "createDept", {
display: false, label: '负责人',
hide: true, prop: 'head',
}, type: 2,
{ values: '',
label: "类型", width: '150',
prop: "type", checkarr: [],
search: true, fixed: false,
width:"100px" sortable: true,
}, },
{ {
label: "承运商编号", label: '手机号',
prop: "number", prop: 'headPhone',
search: true, type: 2,
width:"100px" values: '',
}, width: '150',
{ checkarr: [],
label: "集团ID", fixed: false,
prop: "groupId", sortable: true,
search: true, },
width:"100px" {
}, label: '营业执照注册号',
{ prop: 'licenseNub',
label: "承运商电话", width: '150px',
prop: "carrierPhone", type: 2,
width:"100px" values: '',
}, width: '150',
// { checkarr: [],
// label: "绑定仓库Id", fixed: false,
// prop: "warehouseId", sortable: true,
// }, },
{ {
label: "负责人", label: '法人',
prop: "head", prop: 'legalPerson',
search: true, type: 2,
width:"100px" values: '',
}, width: '150',
{ checkarr: [],
label: "手机号", fixed: false,
prop: "headPhone", sortable: true,
width:"100px" },
}, {
{ label: '法人电话',
label: "营业执照注册号", prop: 'legalPersonPhone',
prop: "licenseNub", type: 2,
width:"150px" values: '',
}, width: '150',
{ checkarr: [],
label: "法人", fixed: false,
prop: "legalPerson", sortable: true,
width:"100px" },
}, {
{ label: '法人身份证',
label: "法人电话", prop: 'legalPersonId',
prop: "legalPersonPhone", type: 2,
width:"100px" values: '',
}, width: '150',
{ checkarr: [],
label: "法人身份证", fixed: false,
prop: "legalPersonId", sortable: true,
width:"100px" },
}, {
{ label: '邮箱',
label: "邮箱", prop: 'mailbox',
prop: "mailbox", type: 2,
width:"100px" values: '',
}, width: '150',
{ checkarr: [],
label: "客服电话", fixed: false,
prop: "customerServicePhone", sortable: true,
width:"100px" },
}, {
{ label: '客服电话',
label: "合同起始时间", prop: 'customerServicePhone',
prop: "contractStartTime", type: 2,
format: "YYYY-MM-DD", values: '',
valueFormat: "YYYY-MM-DD", width: '150',
width:"150px" checkarr: [],
}, fixed: false,
{ sortable: true,
label: "合同结束时间", },
prop: "contractEndTime", {
format: "YYYY-MM-DD", label: '合同起始时间',
valueFormat: "YYYY-MM-DD", prop: 'contractStartTime',
width:"150px" type: 2,
}, values: '',
// { width: '150',
// label: "合同附件", checkarr: [],
// prop: "contractAppendices", fixed: false,
// }, sortable: true,
// { },
// label: "道路运输许可证图片", {
// prop: "roadTransportPhoto", label: '合同结束时间',
// width:"100px" prop: 'contractEndTime',
// }, type: 2,
{ values: '',
label: "道路运输许可证编号", width: '150',
prop: "roadTransportNub", checkarr: [],
width:"170px" fixed: false,
}, sortable: true,
{ },
label: "物流园", {
prop: "logisticsPark", label: '道路运输许可证编号',
width:"100px" prop: 'roadTransportNub',
}, type: 2,
{ values: '',
label: "自由车辆数", width: '150',
prop: "freeVehiclesNub", checkarr: [],
width:"100px" fixed: false,
}, sortable: true,
{ },
label: "外部车辆数", {
prop: "externalVehiclesNub", label: '物流园',
width:"100px" prop: 'logisticsPark',
}, type: 2,
{ values: '',
label: "星级", width: '150',
prop: "starRating", checkarr: [],
width:"80px" fixed: false,
}, sortable: true,
{ },
label: "定位地址", {
prop: "locationAddress", label: '自由车辆数',
width:"100px" prop: 'freeVehiclesNub',
}, type: 2,
{ values: '',
label: "经度", width: '150',
prop: "longitude", checkarr: [],
width:"100px" fixed: false,
}, sortable: true,
{ },
label: "纬度", {
prop: "latitude", label: '外部车辆数',
width:"100px" prop: 'externalVehiclesNub',
}, type: 2,
{ values: '',
label: "备注", width: '150',
prop: "notes", checkarr: [],
width:"100px" fixed: false,
}, sortable: true,
// { },
// label: "照片信息", {
// prop: "photo", label: '星级',
// }, prop: 'starRating',
{ type: 2,
label: "预留1", values: '',
prop: "reserve1", width: '150',
display: false, checkarr: [],
hide: true, fixed: false,
}, sortable: true,
{ },
label: "预留2", {
prop: "reserve2", label: '定位地址',
display: false, prop: 'locationAddress',
hide: true, type: 2,
}, values: '',
{ width: '150',
label: "预留3", checkarr: [],
prop: "reserve3", fixed: false,
display: false, sortable: true,
hide: true, },
}, {
{ label: '经度',
label: "预留4", prop: 'longitude',
prop: "reserve4", type: 2,
display: false, values: '',
hide: true, width: '150',
}, checkarr: [],
{ fixed: false,
label: "预留5", sortable: true,
prop: "reserve5", },
display: false, {
hide: 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: '', values: '',
width: '150', width: '150',
checkarr: [], checkarr: [],
fixed: false, fixed: true,
sortable: 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> <template>
<basic-container> <basic-container v-loading="details.loadingObj.pageLoading">
<div class="avue-crud"> <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 :inline="true" :model="query" class="header_search">
<el-form-item label="类型"> <el-form-item label="车牌号:" class="el-times">
<el-select v-model="query.type" clearable placeholder="请选择类型"> <el-input v-model="query.stockupArea" clearable placeholder="请输入车牌号"></el-input>
<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-item> </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> <el-form-item class="el-btn">
<el-button type="primary" icon="el-icon-search" @click="searchChange"> </el-button> <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-item>
</el-form> </el-form>
</el-row> </div>
<el-row>
<div class="avue-crud__header"> <!-- 控件模块 -->
<!-- 头部左侧按钮模块 --> <div class="avue-crud__header">
<div class="avue-crud__left"> <!-- 头部左侧按钮模块 -->
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"> </el-button> <div class="avue-crud__left">
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain> </el-button> <!-- 新增 -->
</div> <el-button type="primary" icon="Plus" @click="handleAdd"> </el-button>
<!-- 头部右侧按钮模块 --> <!-- 删除 -->
<div class="avue-crud__right"> <el-button type="primary" icon="Delete" @click="() => handleDelete(true)">
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="el-icon-search" @click="searchHide" circle></el-button> </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>
</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%"/> <div class="avue-crud__right">
</el-form-item> <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%"/> <tablecmt
</el-form-item> :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> <el-text @click="handleAnException(slotProps.scope)"> 查看 </el-text>
<!-- 表单按钮 --> </template>
<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>
</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> </div>
</basic-container> </basic-container>
<!-- 列表配置显示 -->
<edittablehead
@closce="showdrawer"
:drawerShow="drawerShow"
v-model="details.columnList"
></edittablehead>
</template> </template>
<script> <script setup lang="ts">
import { getList, getDetail, add, update, remove } from "@/api/basicdata/basicdataCarrier"; import { ref, reactive, toRefs, computed, onMounted, nextTick } from 'vue';
import option from "@/option/basicdata/basicdataCarrier2"; import functions from '@/utils/functions.js';
import { mapGetters } from "vuex"; import dayjs from 'dayjs';
import { mapGetters } from 'vuex';
/** 获取字典 */
import { getDictionaryBiz } from '@/api/system/dict'; 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 () { const $router = useRouter();
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 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(); selectionList: [],
// /** 是否显示设置表格 */
this.queryDictionary(); drawerShow: false,
/** 分页参数 */
page: {
current: 1,
size: 30,
total: 0,
}, },
created() { /** 弹出层显示 */
popUpShow: {
/** 图片预览 */
abnormalVisited: false,
}, },
computed: { /** 列表Dom节点 */
...mapGetters(["permission"]), listNode: '',
ids () { form: {},
let ids = []; /** 全屏 */
this.selectionList.forEach(ele => { fullscreenObj: {
ids.push(ele.id); /** 查看 */
}); view: false,
return ids.join(",");
}
}, },
methods: { });
queryDictionary() {
getDictionaryBiz('basic_carrier_type').then(res => { const { search, query, shortcuts, stockupDate, data, loadingObj, selectionList, drawerShow, page } =
this.typeData = res.data.data; toRefs(details);
this.onLoad(this.page);
}); /** vuex */
}, const permission = computed(() => mapGetters(['permission', 'tagWel', 'tagList']));
init () {
this.height = this.setPx(document.body.clientHeight - 340); onMounted(() => {
}, const timer = setTimeout(() => {
searchHide () { details.listNode = document.querySelector('.maboxhi');
this.search = !this.search; details.listNode.style.transition = 'all .5s ease-out';
}, clearTimeout(timer);
searchChange () { }, 100);
this.onLoad(this.page); });
},
searchReset () { /** 请求页面数据 */
this.query = {}; const onLoad = debounce(async (page?: any, params = {}) => {
this.page.currentPage = 1; try {
this.onLoad(this.page); details.loadingObj.list = true;
}, let _page = details.page;
handleSubmit () { if (page) _page = page;
this.$refs.form.validate(valid=>{ const _submitData = { ..._page, ...details.query, ...params };
if (valid) { delete _submitData.total;
if (!this.form.id) { //
add(this.form).then(() => { const res = await getList(_submitData);
this.box = false; console.log('res :>> ', res);
this.onLoad(this.page); const { code, data } = res.data;
this.$message({ if (code !== 200) return;
type: "success", details.data = data.records;
message: "操作成功!"
}); handleTranslationDataSeclect(details.data, details.columnList);
});
} else { details.page.total = data.total;
update(this.form).then(() => { } catch (error) {
this.box = false; console.log('error :>> ', error);
this.onLoad(this.page); } finally {
this.$message({ details.loadingObj.list = false;
type: "success", }
message: "操作成功!" }, 10);
});
}) const handleData = (key, res) => {
} const { code, data } = res.data;
} else { if (code !== 200) return;
console.log('error submit!!'); for (let i = 0; i < details.columnList.length; i++) {
return false; const value = details.columnList[i];
}
}); if (value.label === key)
}, return (value.checkarr =
handleAdd () { getObjType(data) === 'array'
this.title = '新增' ? data.map(val => {
this.form = {} val.label = val.dictValue;
this.box = true val.value = val.dictKey;
}, return val;
handleEdit (row) { })
this.title = '编辑' : []);
this.box = true }
getDetail(row.id).then(res => { };
this.form = res.data.data;
}); //
}, const initData = async () => {
handleView (row) { await Promise.all([
this.title = '查看' //
this.view = true; getDictionaryBiz('basic_carrier_type').then(res => handleData('类型', res)),
this.box = true;
getDetail(row.id).then(res => { onLoad(),
this.form = res.data.data; ]);
});
}, await nextTick();
handleDelete () { handleTranslationDataSeclect(details.data, details.columnList);
if (this.selectionList.length === 0) { console.log('details.columnList :>> ', details.columnList);
this.$message.warning("请选择至少一条数据"); };
return;
} initData();
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定", /** 搜索 */
cancelButtonText: "取消", const searchChange = () => {
type: "warning" onLoad(details.page);
}) };
.then(() => {
return remove(this.ids); /** 清空表单 */
}) const searchReset = () => {
.then(() => { details.query = {};
this.selectionClear(); details.stockupDate = [];
this.onLoad(this.page); details.page.currentPage = 1;
this.$message({ handleClearTableQuery(details.columnList);
type: "success", onLoad(details.page);
message: "操作成功!" };
});
}); /** 展开列表控件 */
}, const showdrawer = (_flag?: boolean) => {
rowDel (row) { details.drawerShow = _flag;
this.$confirm("确定将选择数据删除?", { };
confirmButtonText: "确定",
cancelButtonText: "取消", /** 是否开启搜索区 */
type: "warning" const searchHide = () => {
}) details.search = !details.search;
.then(() => {
return remove(row.id); setNodeHeight(details.listNode, '', true);
}) };
.then(() => {
this.onLoad(this.page); /** 表格表头输入框搜索 */
this.$message({ const inputsc = (index, row) => {
type: "success", handleInputQuery(index, row, details.query);
message: "操作成功!" onLoad(details.page);
}); };
});
}, /** 表格表头时间选择 */
beforeClose (done) { const timesc = (index, row) => {
done() console.log(index, row);
this.form = {}; if (!!index) {
this.view = false; index = dayjs(index).format('YYYY-MM-DD');
}, }
selectionChange (list) { details.query[row.prop] = index;
this.selectionList = list; if (!index) {
}, delete details.query[row.prop];
selectionClear () { }
this.selectionList = []; onLoad(details.page);
this.$refs.table.clearSelection(); };
},
currentChange (currentPage) { /** 表格表头下拉框选择 */
this.page.currentPage = currentPage; const selectsc = (index, row) => {
this.onLoad(this.page); handleSelectQuery(index, row, details.query);
},
sizeChange (pageSize) { onLoad(details.page);
this.page.pageSize = pageSize; };
this.onLoad(this.page);
}, /** 表格表头复选框选择 */
onLoad (page, params = {}) { const selectionChange = (list: any) => {
this.loading = true; details.selectionList = list;
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++) { const sizeChange = (size: number) => {
// eslint-disable-next-line no-empty details.page.size = size;
for (let j = 0; j < this.typeData.length; j++) { onLoad(details.page);
// eslint-disable-next-line no-empty };
if (data.records[i].type == this.typeData[j].dictKey){
data.records[i].type=this.typeData[j].dictValue; /** 页码改变执行的回调 */
} const currentChange = current => {
} details.page.current = current;
onLoad();
} };
this.page.total = data.total;
this.data = data.records; /** 新增 */
this.loading = false; const handleAdd = () => {
this.selectionClear(); $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> </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"> <div class="avue-crud__left">
<el-button type="primary" icon="Plus" @click="handleAdd"> </el-button> <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="Delete" @click="() => handleDelete(true)"
<el-button type="primary" icon="Download" @click="searchChange"> </el-button> > </el-button
>
<el-button type="primary" icon="Download" @click="handleExport"> </el-button>
<el-button type="primary" icon="Upload" @click="searchChange"> </el-button> <el-button type="primary" icon="Upload" @click="searchChange"> </el-button>
</div> </div>
<!-- 头部右侧按钮模块 --> <!-- 头部右侧按钮模块 -->
@ -53,11 +55,11 @@
> >
<template #default="slotProps"> <template #default="slotProps">
<template v-if="slotProps.scope.column.label === '操作'"> <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>
</template> </template>
</tablecmt> </tablecmt>
@ -110,6 +112,7 @@ import {
getObjType, getObjType,
} from '@/utils/util'; } from '@/utils/util';
import columnList from '@/option/basicdata/basicdataVehicle2.js'; import columnList from '@/option/basicdata/basicdataVehicle2.js';
import { useStore } from 'vuex';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus'; import { ElMessage, ElMessageBox } from 'element-plus';
import { import {
@ -122,12 +125,15 @@ import {
getVehicle, getVehicle,
$_Exportvehicle, $_Exportvehicle,
getDictionary, getDictionary,
getVehicleExport,
} from '@/api/basicdata/basicdataVehicle'; } from '@/api/basicdata/basicdataVehicle';
import { getOwn } from '@/api/basicdata/basicdataDriverArtery'; import { getOwn } from '@/api/basicdata/basicdataDriverArtery';
// //
const $router = useRouter(); const $router = useRouter();
const $store = useStore();
const details = reactive<any>({ const details = reactive<any>({
/** 是否开启搜索 */ /** 是否开启搜索 */
search: true, search: true,
@ -253,6 +259,7 @@ const handleData = (key, res) => {
} }
}; };
//
const initData = async () => { const initData = async () => {
await Promise.all([ await Promise.all([
// //
@ -372,11 +379,85 @@ const currentChange = current => {
onLoad(); onLoad();
}; };
/** 新增 */
const handleAdd = () => { 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({ $router.push({
path: '/basicdata/vehicle/basicdataVehicleAddForm', 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> </script>
<style scoped lang="scss"> <style scoped lang="scss">

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

@ -6,7 +6,7 @@
<div>车辆基本信息</div> <div>车辆基本信息</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 <el-form-item
v-for="item in details.carBasicForm" v-for="item in details.carBasicForm"
:label="item.label" :label="item.label"
@ -35,6 +35,7 @@
:value-on-clear="0" :value-on-clear="0"
:precision="item.precision || 0" :precision="item.precision || 0"
class="w100" class="w100"
:disabled="item.disabled || false"
></el-input-number> ></el-input-number>
</template> </template>
@ -46,6 +47,8 @@
class="w100" class="w100"
clearable clearable
filterable filterable
@change="value => item.change && item.change(value)"
:multiple="item.multiple || false"
> >
<el-option <el-option
v-for="val in item.checkarr" v-for="val in item.checkarr"
@ -86,35 +89,55 @@
<div>相关图片</div> <div>相关图片</div>
</div> </div>
<!-- 图片类型 -->
<div class="mt20 pl20 imgContainer"> <div class="mt20 pl20 imgContainer">
<div v-for="item in details.imgArr" :key="item.label" class="imgItem"> <div v-for="item in details.imgArr" :key="item.label" class="imgItem">
<div class="pageTitle title mb20">{{ item.label }}</div> <!-- 上传组件 -->
<el-upload <el-upload
v-model:file-list="item.imgList" v-model:file-list="item.imgList"
list-type="picture-card" list-type="picture"
:action="doubledCount" :action="doubledCount"
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
:on-success="res => handleAvatarSuccess(res, item)"
:headers="headers" :headers="headers"
multiple multiple
:show-file-list="false"
> >
<!-- <div class="flex-c-c mb20"> <template #default>
<div class="pageTitle title mr20">{{ item.label }}</div> <div class="pageTitle title mb20">
<span class="mr20" @click.stop="() => {}">
<el-button type="primary" icon="CirclePlus">添加图片</el-button> {{ item.label }}
</div> --> </span>
<template #default v-if="item.imgList.length === 0">
<el-icon> <el-button type="primary" icon="CirclePlus"> </el-button>
<Plus />
</el-icon> <el-button icon="Delete" @click.stop="() => handleEmpty(item)"> </el-button>
</div>
</template> </template>
</el-upload> </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> </div>
<!-- 底部控件 -->
<div class="footer_container"> <div class="footer_container">
<el-button icon="CircleClose"> </el-button> <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>
</div> </div>
</basic-container> </basic-container>
@ -122,21 +145,15 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, computed, nextTick } from 'vue'; 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 { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
import { getDictionaryBiz } from '@/api/system/dict'; import { getDictionaryBiz } from '@/api/system/dict';
import { deepClone, debounce, getObjType } from '@/utils/util'; import { deepClone, debounce, getObjType, isNumber } from '@/utils/util';
import { import { add, getDictionary, getDetail, update } from '@/api/basicdata/basicdataVehicle';
getList, import { getList } from '@/api/basicdata/basicdataVehicleInfo';
getDetail, import { getOwn } from '@/api/basicdata/basicdataDriverArtery';
add, import { useRoute, uesRouter } from 'vue-router';
update,
remove,
getVehicle,
$_Exportvehicle,
getDictionary,
} from '@/api/basicdata/basicdataVehicle';
const details = reactive({ const details = reactive({
carBasicForm: [ carBasicForm: [
@ -153,6 +170,13 @@ const details = reactive({
}, },
], ],
}, },
{
label: '车辆所属人',
prop: 'vehicleOwners',
type: 3,
multiple: true,
checkarr: [],
},
{ {
label: '车辆来源', label: '车辆来源',
prop: 'vehicleSource', prop: 'vehicleSource',
@ -185,6 +209,18 @@ const details = reactive({
prop: 'vehicleModel', prop: 'vehicleModel',
type: 3, type: 3,
checkarr: [], 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: '车厢类型', label: '车厢类型',
@ -197,25 +233,30 @@ const details = reactive({
prop: 'vehicleCommander', prop: 'vehicleCommander',
type: 2, type: 2,
checkarr: [], checkarr: [],
precision: 0, precision: 2,
disabled: true,
}, },
{ {
label: '外廓高(M)', label: '外廓高(M)',
prop: 'vehicleHeight', prop: 'vehicleHeight',
type: 2, type: 2,
checkarr: [], checkarr: [],
precision: 2,
disabled: true,
}, },
{ {
label: '付款方式', label: '付款方式',
prop: 'paymentMethod', prop: 'paymentMethod',
type: 1, type: 3,
checkarr: [], checkarr: [],
}, },
{ {
label: '核定体积', label: '核定体积',
prop: 'approvedVolume', prop: 'approvedVolume',
type: 1, type: 2,
checkarr: [], checkarr: [],
precision: 2,
disabled: true,
}, },
{ {
label: '车牌颜色', label: '车牌颜色',
@ -264,27 +305,30 @@ const details = reactive({
prop: 'vehicleQuality', prop: 'vehicleQuality',
type: 2, type: 2,
checkarr: [], checkarr: [],
precision: 4, precision: 2,
disabled: true,
}, },
{ {
label: '整备质量(T)', label: '整备质量(T)',
prop: 'curbWeight', prop: 'curbWeight',
type: 2, type: 2,
checkarr: [], checkarr: [],
precision: 4, precision: 2,
disabled: true,
}, },
{ {
label: '载荷质量(T)', label: '载荷质量(T)',
prop: 'loadMass', prop: 'loadMass',
type: 2, type: 2,
checkarr: [], checkarr: [],
precision: 4, precision: 2,
}, },
{ {
label: '外廓宽(M)', label: '外廓宽(M)',
prop: 'outerWidth', prop: 'outerWidth',
type: 2, type: 2,
checkarr: [], checkarr: [],
precision: 2,
}, },
{ {
label: '到期时间', label: '到期时间',
@ -421,14 +465,14 @@ const details = reactive({
}, },
], ],
imgArr: [ imgArr: [
{ label: '行驶证正面照片', imgList: [] }, { label: '行驶证正面照片', imgList: [], prop: 'drivingLicensePhoto' },
{ label: '行驶证反面照片', imgList: [] }, { label: '行驶证反面照片', imgList: [], prop: 'drivingLicensePhotoBack' },
{ label: '许可证照片', imgList: [] }, { label: '许可证照片', imgList: [], prop: 'licensePhoto' },
{ label: '车辆照片(最新)', imgList: [] }, { label: '车辆照片(最新)', imgList: [], prop: 'vehiclePhoto' },
{ label: '车尾照片', imgList: [] }, { label: '车尾照片', imgList: [], prop: 'vehicleRearPhoto' },
{ label: '道理运输照片', imgList: [] }, { label: '道理运输照片', imgList: [], prop: 'roadTransportPhoto' },
{ label: '人车合影照片', imgList: [] }, { label: '人车合影照片', imgList: [], prop: 'vehiclePeoplePhoto' },
{ label: '保险卡照片', imgList: [] }, { label: '保险卡照片', imgList: [], prop: 'insuranceCardPhoto' },
], ],
form: {}, form: {},
// loading // loading
@ -436,8 +480,20 @@ const details = reactive({
/** 页面 */ /** 页面 */
pageLoading: false, 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 handleData = (key, res) => {
const { code, data } = res.data; const { code, data } = res.data;
if (code !== 200) return; if (code !== 200) return;
@ -456,7 +512,48 @@ const handleData = (key, res) => {
} }
}; };
//
const initData = async () => { 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([ await Promise.all([
// //
getDictionaryBiz('basic_vehicle_source').then(res => handleData('车辆来源', res)), getDictionaryBiz('basic_vehicle_source').then(res => handleData('车辆来源', res)),
@ -464,8 +561,6 @@ const initData = async () => {
getDictionaryBiz('yes_no').then(res => handleData('是否车头', res)), getDictionaryBiz('yes_no').then(res => handleData('是否车头', res)),
// //
getDictionaryBiz('basic_trailer_type').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)), 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_energy_type').then(res => handleData('能源类型', res)),
// //
getDictionaryBiz('basic_plate_type').then(res => handleData('车牌类型', res)), getDictionaryBiz('basic_plate_type').then(res => handleData('车牌类型', res)),
//
handleCarModel(),
// //
getDictionary().then(res => { getDictionary().then(res => {
const { code, data } = res.data; 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++) { for (let i = 0; i < details.carBasicForm.length; i++) {
const value = details.carBasicForm[i]; const value = details.carBasicForm[i];
details.form[value.prop] = value.type === 2 ? 0 : ''; 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(); initData();
@ -531,12 +680,77 @@ const headers = computed(() => {
return { 'Blade-Auth': 'Bearer ' + getToken() }; 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 { 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) { } catch (error) {
console.log('error :>> ', error); console.log('error :>> ', error);
} finally { } finally {
details.loadingObj.pageLoading = false;
} }
}; };
</script> </script>
@ -571,6 +785,13 @@ const handleSubmit = () => {
} }
} }
:deep(.el-form) {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
}
//
.imgContainer { .imgContainer {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@ -584,6 +805,18 @@ const handleSubmit = () => {
font-weight: bold; font-weight: bold;
// margin-bottom: 20px; // 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; 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> </style>

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>

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

@ -182,7 +182,7 @@ import { mapGetters } from 'vuex';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js'; import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
import { handleClearTableQuery } from '@/utils/util'; import { handleClearTableQuery } from '@/utils/util';
import axios from "axios"; import axios from 'axios';
export default { export default {
data() { data() {
return { return {
@ -453,46 +453,45 @@ export default {
console.log(file, '文件上传'); console.log(file, '文件上传');
const responses = await this.$fileslicing(this, file); // () const responses = await this.$fileslicing(this, file); // ()
console.log(responses, 'responses'); console.log(responses, 'responses');
let time= setTimeout(()=>{ let time = setTimeout(() => {
let response=responses let response = responses;
if (response && response.code === 200) { if (response && response.code === 200) {
// this.form.filelink // this.form.filelink
if (!this.form.filelink) { if (!this.form.filelink) {
this.form.filelink = []; this.form.filelink = [];
console.log('初始化 this.form.filelink 为空数组'); console.log('初始化 this.form.filelink 为空数组');
} }
// //
if (!this.form.filelink[0]) { if (!this.form.filelink[0]) {
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[0] 为 { response: { data: {} } }');
} else { } else {
if (!this.form.filelink[0].response) { if (!this.form.filelink[0].response) {
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[0].response 为 { data: {} }');
} }
if (!this.form.filelink[0].response.data) { if (!this.form.filelink[0].response.data) {
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[0].response.data 为 {}');
} }
} }
console.log('在赋值之前的 this.form.filelink:', this.form.filelink); console.log('在赋值之前的 this.form.filelink:', this.form.filelink);
this.form.filelink[0].response.data.link = response.data.domain + response.data.name; this.form.filelink[0].response.data.link = response.data.domain + response.data.name;
console.log('赋值之后的 this.form.filelink:', this.form.filelink); console.log('赋值之后的 this.form.filelink:', this.form.filelink);
} else {
} else {
console.error('文件上传失败或响应无效', response); console.error('文件上传失败或响应无效', response);
} }
clearTimeout(time) clearTimeout(time);
},0) }, 0);
} catch (error) { } catch (error) {
console.error('文件上传过程中发生错误', error); console.error('文件上传过程中发生错误', error);
} }
}, },
handleSubmit() { handleSubmit() {
if (!this.form.id) { 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.link = this.form.filelink[0].response.data.link;
this.form.versionCode = this.form.versionName.split('.').join(''); this.form.versionCode = this.form.versionName.split('.').join('');
this.form.newTypes = this.form.link.indexOf('wgt') == -1 ? '1' : '2'; this.form.newTypes = this.form.link.indexOf('wgt') == -1 ? '1' : '2';

Loading…
Cancel
Save