Browse Source

修复部分bug

dev-xx
qb 8 months ago
parent
commit
a512b848cd
  1. 19
      src/api/basicdata/basicdataVehicleInfo.js
  2. 18
      src/components/ArteryPrintTemplate/ArteryPrintTemplate.vue
  3. 88
      src/option/basicdata/basicdataVehicleInfo.js
  4. 10
      src/option/distribution/addVehicleStowage.js
  5. 14
      src/views/basicdata/brand/basicClient.vue
  6. 474
      src/views/basicdata/vehicle/basicdataVehicleInfo.vue
  7. 377
      src/views/basicdata/warehouse/goodsAllocation/BasicdataGoodsAllocation copy.vue
  8. 10
      src/views/distribution/artery/AddVehicleStowage.vue

19
src/api/basicdata/basicdataVehicleInfo.js

@ -0,0 +1,19 @@
import request from '@/axios';
/** 车辆类型list */
export const getList = params => {
return request({
url: '/api/logpm-basic/carModel/list',
method: 'get',
params,
});
};
/** 保存 */
export const postSave = data => {
return request({
url: '/api/logpm-basic/carModel/save',
method: 'post',
data,
});
};

18
src/components/ArteryPrintTemplate/ArteryPrintTemplate.vue

@ -10,7 +10,7 @@
<img style="height: 40px" src="../../../public/img/htlogo.png" alt="暂无图片" /> <img style="height: 40px" src="../../../public/img/htlogo.png" alt="暂无图片" />
</th> </th>
<th colspan="6" style="font-size: 20px"> 线 </th> <th colspan="6" style="font-size: 20px"> 线 </th>
<th :colspan="8 + goodsTitleList.length + 1"> <th :colspan="6 + goodsTitleList.length + 1">
<img id="imgcode" :src="renderInfo.carsNoBase64" /> <img id="imgcode" :src="renderInfo.carsNoBase64" />
<div>{{ renderInfo.carsNo }}</div> <div>{{ renderInfo.carsNo }}</div>
</th> </th>
@ -23,16 +23,16 @@
'' ''
}} }}
</th> </th>
<th :colspan="8 + goodsTitleList.length + 1"> <th :colspan="6 + goodsTitleList.length + 1">
目的站{{ renderInfo.endWarehouseNames.slice(-1)[0] }} 目的站{{ renderInfo.endWarehouseNames.slice(-1)[0] }}
</th> </th>
</tr> </tr>
<tr> <tr>
<th colspan="4">司机{{ renderInfo.assistantName || '' }}</th> <th colspan="4">司机{{ renderInfo.assistantName || '' }}</th>
<th colspan="2">司机联系电话{{ renderInfo.assistantMobile || '' }}</th> <th colspan="2">司机电话{{ renderInfo.assistantMobile || '' }}</th>
<th colspan="3">车牌号{{ renderInfo.carNumber || '' }}</th> <th colspan="3">车牌号{{ renderInfo.carNumber || '' }}</th>
<th>卸车完成时间 {{ renderInfo.unloadDate || '年 月 日' }}</th> <th>卸车完成时间 {{ renderInfo.unloadDate || '年 月 日' }}</th>
<th :colspan="8 + goodsTitleList.length + 1">卸车人员签字</th> <th :colspan="6 + goodsTitleList.length + 1">卸车人员签字</th>
</tr> </tr>
<tr> <tr>
<th rowspan="2">序号</th> <th rowspan="2">序号</th>
@ -48,7 +48,7 @@
<th rowspan="2">计划件数</th> <th rowspan="2">计划件数</th>
<th rowspan="2">货位</th> <th rowspan="2">货位</th>
<th :colspan="goodsTitleList.length + 1">装车产品明细</th> <th :colspan="goodsTitleList.length + 1">装车产品明细</th>
<th rowspan="2">合计件数</th> <!-- <th rowspan="2">合计件数</th> -->
<th rowspan="2">卸车件数</th> <th rowspan="2">卸车件数</th>
<th rowspan="2">卸车网点</th> <th rowspan="2">卸车网点</th>
<th rowspan="2">卸车时间</th> <th rowspan="2">卸车时间</th>
@ -92,7 +92,7 @@
<!-- 小计 --> <!-- 小计 -->
<td contenteditable>{{ value.smallTotal }}</td> <td contenteditable>{{ value.smallTotal }}</td>
<!-- 合计件数 --> <!-- 合计件数 -->
<td contenteditable>{{ value.smallTotal }}</td> <!-- <td contenteditable>{{ value.smallTotal }}</td> -->
<!-- 卸车件数 --> <!-- 卸车件数 -->
<td contenteditable>{{ value.unloadNum }}</td> <td contenteditable>{{ value.unloadNum }}</td>
<!-- 卸车网点 --> <!-- 卸车网点 -->
@ -110,9 +110,9 @@
<td contenteditable>{{ totalPlanNum }}</td> <td contenteditable>{{ totalPlanNum }}</td>
<td></td> <td></td>
<td contenteditable v-for="item in goodsTitleList"></td> <td contenteditable v-for="item in goodsTitleList"></td>
<td></td>
<!-- 合计件数 -->
<td contenteditable>{{ totalNum }}</td> <td contenteditable>{{ totalNum }}</td>
<!-- 合计件数 -->
<!-- <td contenteditable>{{ totalNum }}</td> -->
<!-- 卸车件数 --> <!-- 卸车件数 -->
<td contenteditable>{{ totalUnLoadNum }}</td> <td contenteditable>{{ totalUnLoadNum }}</td>
<td></td> <td></td>
@ -120,7 +120,7 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td colspan="19" contenteditable> <td colspan="17" contenteditable>
<span style="display: inline-block; margin-right: 20px"> 投诉电话4000184668 </span> <span style="display: inline-block; margin-right: 20px"> 投诉电话4000184668 </span>
<span style="display: inline-block; margin-right: 20px"> 营业部电话4000184668 </span> <span style="display: inline-block; margin-right: 20px"> 营业部电话4000184668 </span>
<span style="display: inline-block; margin-right: 20px"> 系统单调度4000184668 </span> <span style="display: inline-block; margin-right: 20px"> 系统单调度4000184668 </span>

88
src/option/basicdata/basicdataVehicleInfo.js

@ -0,0 +1,88 @@
export const columnList = [
{
prop: '',
label: '复选框',
type: 0,
width: 55,
fixed: true,
},
{
prop: '',
label: '序号',
type: 12,
values: '',
width: 55,
fixed: true,
},
{
prop: 'vehicleModelName',
label: '车辆类型',
type: 3,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'vehicleCommander',
label: '车长(M)',
type: 2,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'vehicleHeight',
label: '外廓高',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'approvedVolume',
label: '核定体积',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'vehicleQuality',
label: '车辆总质量(T)',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'curbWeight',
label: '整备质量(T)',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: '',
label: '操作',
type: 6,
values: '',
width: '200',
checkarr: [],
fixed: 'right',
sortable: true,
},
];

10
src/option/distribution/addVehicleStowage.js

@ -604,6 +604,16 @@ export const newColumnList = [
fixed: false, fixed: false,
sortable: true, sortable: true,
}, },
{
prop: 'warehouseEntryTimeEnd',
label: '入库时间',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{ {
prop: 'remark', prop: 'remark',
label: '运单备注', label: '运单备注',

14
src/views/basicdata/brand/basicClient.vue

@ -521,7 +521,7 @@
</div> </div>
<!-- 日志 --> <!-- 日志 -->
<el-dialog title="客户日志" width="50%" :align-center="true" v-model="popUpShow.logVisted"> <el-dialog title="客户日志" width="70%" :align-center="true" v-model="popUpShow.logVisted">
<tablecmt ref="tableLogNode" class="mt10" :columnList="columnLogList" :tableData="logData"> <tablecmt ref="tableLogNode" class="mt10" :columnList="columnLogList" :tableData="logData">
<template #default="{ scope }"> </template> <template #default="{ scope }"> </template>
</tablecmt> </tablecmt>
@ -928,7 +928,7 @@ export default {
{ {
prop: 'clientName', prop: 'clientName',
label: '客户名称', label: '客户名称',
type: 2, type: 1,
values: '', values: '',
width: '150', width: '150',
checkarr: [], checkarr: [],
@ -939,7 +939,7 @@ export default {
{ {
prop: 'operator', prop: 'operator',
label: '操作人', label: '操作人',
type: 2, type: 1,
values: '', values: '',
width: '150', width: '150',
checkarr: [], checkarr: [],
@ -950,7 +950,7 @@ export default {
{ {
prop: 'content', prop: 'content',
label: '操作描述', label: '操作描述',
type: 2, type: 1,
values: '', values: '',
width: '500', width: '500',
checkarr: [], checkarr: [],
@ -961,7 +961,7 @@ export default {
{ {
prop: 'createTime', prop: 'createTime',
label: '操作时间', label: '操作时间',
type: 2, type: 1,
values: '', values: '',
width: '150', width: '150',
checkarr: [], checkarr: [],
@ -1181,14 +1181,14 @@ export default {
const { code, data } = res.data; const { code, data } = res.data;
if (code !== 200) return; if (code !== 200) return;
this.logData = data; this.logData = data || [];
// this.openAcountform.name = row.linkman; // this.openAcountform.name = row.linkman;
// this.openAcountform.phone = row.phone; // this.openAcountform.phone = row.phone;
// this.openAcountStatus = true; // this.openAcountStatus = true;
this.popUpShow.logVisted = true; this.popUpShow.logVisted = true;
await this.$nextTick(); await this.$nextTick();
console.log(this.$refs.tableLogNode.$el); setNodeHeight(this.$refs.tableLogNode.$el, '50vh');
// getClientLogList // getClientLogList
} catch (error) { } catch (error) {
console.log('error :>> ', error); console.log('error :>> ', error);

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

@ -0,0 +1,474 @@
<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 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="Plus" @click="handleAdd"> </el-button>
</div>
<!-- 头部右侧按钮模块 -->
<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>
<!-- 列表模块 -->
<tablecmt
:columnList="details.columnList"
:tableData="details.renderData"
:loading="loadingObj.list"
@inputTxt="inputsc"
@timeCheck="timesc"
@selectCheck="selectsc"
@selection="selectionChange"
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '操作'">
<el-text @click="() => handleEdit(slotProps.scope)">编辑</el-text>
</template>
</template>
</tablecmt>
</div>
</basic-container>
<!-- 处理异常 -->
<el-dialog
:title="details.title"
:visible.sync="details.popUpShow.vehicleInfoVisited"
width="780px"
:align-center="true"
v-model="details.popUpShow.vehicleInfoVisited"
>
<el-form :model="details.form" ref="formRef" label-width="120px">
<!-- 车辆类型 -->
<el-form-item v-for="item in details.formOption" :key="item.prop" :label="item.label">
<template v-if="item.type === 2">
<el-input-number
class="flex1 inputNumber"
v-model="details.form[item.prop]"
:controls="false"
:min="0"
:precision="item.precision"
:value-on-clear="0"
/>
</template>
<template v-else-if="item.type === 3">
<el-select v-model="details.form.vehicleModel" placeholder="请选择车辆类型" class="flex1">
<el-option
v-for="item in details.vehicleModelOption"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey"
/>
</el-select>
</template>
</el-form-item>
</el-form>
<div class="text-right">
<el-button icon="CircleClose" @click="() => (details.popUpShow.vehicleInfoVisited = false)">
</el-button>
<el-button type="primary" icon="Position" @click="handleSubmit"> </el-button>
</div>
</el-dialog>
<!-- 列表配置显示 -->
<edittablehead
@closce="showdrawer"
:drawerShow="drawerShow"
v-model="details.columnList"
:columnList="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,
getObjType,
handleSelectQuery,
handleInputQuery,
handleTranslationDataSeclect,
handleFilterData,
} from '@/utils/util';
import { columnList } from '@/option/basicdata/basicdataVehicleInfo';
import { useRouter } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus';
import { getToken } from '@/utils/auth';
import { getList, postSave } from '@/api/basicdata/basicdataVehicleInfo';
//
const $router = useRouter();
//
const formRef = ref();
const details = reactive<any>({
/** 是否开启搜索 */
search: true,
/** 表格搜索条件 */
query: {
inputQuery: {},
selectQuery: {},
},
/** 时间快捷选择设置 */
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];
},
},
],
/** 时间选择器数据 */
stockupDate: [],
/** 列表 */
columnList: deepClone(columnList),
/** 列表数据 */
data: [],
renderData: [],
/** 页面loading */
loadingObj: {
/** 列表加载loading */
list: false,
packageListLoading: false,
/** 页面loading */
pageLoading: false,
},
/** 列表复选框选中的数据 */
selectionList: [],
/** 是否显示设置表格 */
drawerShow: false,
/** 分页参数 */
page: {
pageNum: 1,
pageSize: 30,
total: 0,
},
/** 弹出层显示 */
popUpShow: {
/** 图片预览 */
vehicleInfoVisited: false,
},
/** 列表Dom节点 */
listNode: '',
form: {},
/** 全屏 */
fullscreenObj: {
/** 查看 */
view: false,
},
title: '新增',
type: 'add' as 'add' | 'edit',
vehicleModelOption: [],
formOption: [
{
prop: 'vehicleModel',
label: '车辆类型',
type: 3,
values: '',
},
{
prop: 'vehicleCommander',
label: '车长(M)',
type: 2,
precision: 2,
},
{
prop: 'vehicleHeight',
label: '外廓高',
type: 2,
precision: 4,
},
{
prop: 'approvedVolume',
label: '核定体积',
type: 2,
precision: 4,
},
{
prop: 'vehicleQuality',
label: '车辆总质量(T)',
type: 2,
precision: 4,
},
{
prop: 'curbWeight',
label: '整备质量(T)',
type: 2,
precision: 4,
},
],
});
const { search, query, data, loadingObj, selectionList, drawerShow, page } = toRefs(details);
/** vuex */
const permission = computed(() => mapGetters(['permission', 'tagWel', 'tagList']));
const initData = async () => {
try {
const res = await getDictionaryBiz('basic_car_type');
const { code, data } = res.data;
if (code !== 200) return;
details.vehicleModelOption = data;
for (let i = 0; i < details.columnList.length; i++) {
const value = details.columnList[i];
if (value.label !== '车辆类型') continue;
value.checkarr = data.map(val => {
return { label: val.dictValue, value: val.dictKey };
});
break;
}
} catch (error) {
console.log('error :>> ', error);
} finally {
}
};
initData();
/** 请求页面数据 */
const onLoad = async (page?: any, params = {}) => {
try {
details.loadingObj.list = true;
let _page = details.page;
if (page) _page = page;
//
const submitData = { ..._page, ...details.query, ...params };
const res = await getList(submitData);
console.log('res :>> ', res);
const { code, data } = res.data;
if (code !== 200) return;
details.data = data;
handleTranslationDataSeclect(details.data, details.columnList);
details.renderData = handleFilterData(details.data, [], details.query);
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.list = false;
}
};
onLoad();
/** 搜索 */
const searchChange = () => {
onLoad(details.page);
};
/** 清空表单 */
const searchReset = () => {
details.query = {};
details.stockupDate = [];
details.page.pageNum = 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.inputQuery, true);
details.renderData = handleFilterData(details.data, [], details.query);
};
/** 表格表头时间选择 */
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.selectQuery);
details.renderData = handleFilterData(details.data, [], details.query);
};
/** 表格表头复选框选择 */
const selectionChange = (list: any) => {
details.selectionList = list;
};
/** 每页数量改变执行的回调 */
const sizeChange = (pageSize: number) => {
details.page.pageSize = pageSize;
onLoad(details.page);
};
/** 页码改变执行的回调 */
const currentChange = current => {
details.page.pageNum = current;
onLoad();
};
/** 弹出层开启前清除数据 */
const beforeClose = done => {
done();
details.form = {};
details.selectionList = [];
details.view = false;
};
/** 新增 */
const handleAdd = () => {
details.title = '新增';
details.popUpShow.vehicleInfoVisited = true;
details.form = {};
for (let i = 0; i < details.formOption.length; i++) {
const value = details.formOption[i];
if (value.label === '车辆类型') continue;
details.form[value.prop] = 0;
}
};
/** 编辑 */
const handleEdit = ({ row }) => {
details.title = '编辑';
details.popUpShow.vehicleInfoVisited = true;
for (let i = 0; i < details.formOption.length; i++) {
const value = details.formOption[i];
// if (value.label === '') continue;
details.form[value.prop] = value.type === 2 ? Number(row[value.prop]) || 0 : row[value.prop];
}
details.form.id = row.id;
};
/** 提交 */
const handleSubmit = async () => {
try {
details.loadingObj.pageLoading = true;
details.popUpShow.vehicleInfoVisited = false;
const submitData = { ...details.form };
for (let i = 0; i < details.formOption.length; i++) {
const value = details.formOption[i];
if (value.label === '车辆类型') {
if (!submitData[value.prop]) return ElMessage.warning('请选择车辆类型');
continue;
}
submitData[value.prop] =
getObjType(submitData[value.prop]) !== 'number' || submitData[value.prop] < 0
? 0
: submitData[value.prop];
}
const res = await postSave(details.form);
const { code, msg } = res.data;
if (code !== 200) return;
msg && ElMessage.success(msg);
onLoad();
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
};
</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;
}
:deep(.el-tag) {
border: none;
&.blue {
background: var(--el-color-primary);
}
}
:deep(.el-input-number .el-input__inner) {
text-align: left !important;
}
.text-right {
text-align: right;
}
</style>

377
src/views/basicdata/warehouse/goodsAllocation/BasicdataGoodsAllocation copy.vue

@ -0,0 +1,377 @@
<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="货架:">
<el-select class="w100" v-model="query.abnormalStatus" clearable placeholder="异常状态">
<el-option label="待处理" :value="0" />
<el-option label="完结" :value="1" />
</el-select>
</el-form-item>
<el-form-item label="所在层" class="el-times">
<el-input v-model="query.waybillNo" clearable placeholder="请输入运单号"></el-input>
</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="handleAdd"> </el-button>
<el-button type="primary" icon="CircleCheck" @click="handleAdd"> </el-button>
<el-button type="primary" icon="Refresh" @click="handleAdd">一键下架</el-button>
<el-button type="primary" icon="Printer" @click="handleAdd">查看二维码</el-button>
</div>
<!-- 头部右侧按钮模块 -->
<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>
<!-- 列表模块 -->
<tablecmt
:columnList="details.columnList"
:tableData="data"
:loading="details.loadingObj.list"
@inputTxt="inputsc"
@timeCheck="timesc"
@selectCheck="selectsc"
@selection="selectionChange"
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '操作'">
<el-text>查看</el-text>
<el-text>禁用</el-text>
<el-text>一键下架</el-text>
</template>
</template>
</tablecmt>
<!-- 分页模块 -->
<div class="flex-c-sb">
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div>
<!-- 分页模块 -->
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.pageNum"
:page-sizes="[30, 50, 80, 120]"
:page-size="page.pageSize"
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"
:columnList="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,
getObjType,
handleSelectQuery,
handleInputQuery,
handleTranslationDataSeclect,
} from '@/utils/util';
import { columnList } from '@/option/basicdata/basicdataVehicleInfo';
import { useRouter } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus';
import { getToken } from '@/utils/auth';
import { postFindPageList, postDealAbnormal } from '@/api/distribution/abnormalList';
//
const $router = useRouter();
//
const formRef = ref();
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];
},
},
],
/** 时间选择器数据 */
stockupDate: [],
/** 列表 */
columnList: deepClone(columnList),
/** 列表数据 */
data: [],
/** 页面loading */
loadingObj: {
/** 列表加载loading */
list: false,
packageListLoading: false,
/** 页面loading */
pageLoading: false,
},
/** 列表复选框选中的数据 */
selectionList: [],
/** 是否显示设置表格 */
drawerShow: false,
/** 分页参数 */
page: {
pageNum: 1,
pageSize: 30,
total: 0,
},
/** 弹出层显示 */
popUpShow: {
/** 图片预览 */
vehicleInfoVisited: false,
},
/** 列表Dom节点 */
listNode: '',
form: {},
/** 全屏 */
fullscreenObj: {
/** 查看 */
view: false,
},
});
const { search, query, data, loadingObj, selectionList, drawerShow, page } = toRefs(details);
/** vuex */
const permission = computed(() => mapGetters(['permission', 'tagWel', 'tagList']));
const initData = async () => {
try {
const res = await getDictionaryBiz('basic_car_type');
const { code, data } = res.data;
if (code !== 200) return;
details.vehicleModelOption = data;
for (let i = 0; i < details.columnList.length; i++) {
const value = details.columnList[i];
if (value.label !== '车辆类型') continue;
value.checkarr = data.map(val => {
return { label: val.dictValue, value: val.dictKey };
});
break;
}
} catch (error) {
console.log('error :>> ', error);
} finally {
}
};
initData();
/** 请求页面数据 */
const onLoad = async (page?: any, params = {}) => {
try {
details.loadingObj.list = true;
let _page = details.page;
if (page) _page = page;
//
const submitData = { ..._page, ...details.query, ...params };
const res = await postFindPageList(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;
}
};
onLoad();
/** 搜索 */
const searchChange = () => {
onLoad(details.page);
};
/** 清空表单 */
const searchReset = () => {
details.query = {};
details.stockupDate = [];
details.page.pageNum = 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 = (pageSize: number) => {
details.page.pageSize = pageSize;
onLoad(details.page);
};
/** 页码改变执行的回调 */
const currentChange = current => {
details.page.pageNum = current;
onLoad();
};
/** 弹出层开启前清除数据 */
const beforeClose = done => {
done();
details.form = {};
details.selectionList = [];
details.view = false;
};
/** 新增 */
const handleAdd = () => {
details.popUpShow.vehicleInfoVisited = true;
details.form = {};
for (let i = 0; i < details.formOption.length; i++) {
const value = details.formOption[i];
if (value.label === '车辆类型') continue;
details.form[value.prop] = 0;
}
};
</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;
}
:deep(.el-tag) {
border: none;
&.blue {
background: var(--el-color-primary);
}
}
:deep(.el-input-number .el-input__inner) {
text-align: left !important;
}
.text-right {
text-align: right;
}
</style>

10
src/views/distribution/artery/AddVehicleStowage.vue

@ -336,7 +336,7 @@
</el-form-item> --> </el-form-item> -->
<el-form-item label="开单时间" class="el-times"> <el-form-item label="开单时间" class="el-times">
<el-date-picker <el-date-picker
v-model="query.enterTime" v-model="query.openTime"
type="daterange" type="daterange"
unlink-panels unlink-panels
range-separator="-" range-separator="-"
@ -349,7 +349,7 @@
</el-form-item> </el-form-item>
<el-form-item label="入库时间" class="el-times"> <el-form-item label="入库时间" class="el-times">
<el-date-picker <el-date-picker
v-model="query.openTime" v-model="query.enterTime"
type="daterange" type="daterange"
unlink-panels unlink-panels
range-separator="-" range-separator="-"
@ -468,7 +468,7 @@
</el-form-item> </el-form-item>
<el-form-item label="入库时间" class="el-times"> <el-form-item label="入库时间" class="el-times">
<el-date-picker <el-date-picker
v-model="item.timeQuery.openTimeArr" v-model="item.timeQuery.warehouseEntryTimeEndArr"
type="daterange" type="daterange"
unlink-panels unlink-panels
range-separator="-" range-separator="-"
@ -477,7 +477,9 @@
:shortcuts="shortcuts" :shortcuts="shortcuts"
clearable clearable
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@change="value => item.itemTimesc(value, { prop: 'openTimeArr' })" @change="
value => item.itemTimesc(value, { prop: 'warehouseEntryTimeEndArr' })
"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>

Loading…
Cancel
Save