5 changed files with 640 additions and 7 deletions
@ -0,0 +1,614 @@ |
|||
<!--计划管理信息页--> |
|||
<template> |
|||
<div class="cr-body-content"> |
|||
<div ref="box"> |
|||
<flexbox class="content-header" id="planControl-content-header"> |
|||
<el-form |
|||
:model="listQuery" |
|||
ref="searchForm" |
|||
v-show="showSearch" |
|||
:inline="true"> |
|||
|
|||
|
|||
<el-form-item label="底盘号" prop="vin" > |
|||
<el-input |
|||
v-model="listQuery.vin" |
|||
clearable |
|||
size="small" |
|||
style="width: 120px" |
|||
/> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="车型代码" prop="vehicleModelCode" > |
|||
<el-input |
|||
v-model="listQuery.vehicleModelCode" |
|||
clearable |
|||
size="small" |
|||
style="width: 120px" |
|||
/> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="车型名称" prop="vehicleModelName"> |
|||
<el-input v-model="listQuery.vehicleModelName" clearable size="small" style="width: 120px" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="涂装下线时间" prop="paintOfflineTimeBegin"> |
|||
<el-date-picker |
|||
v-model="listQuery.paintOfflineTimeBegin" |
|||
size="small" |
|||
style="width: 200px" |
|||
type="datetime" |
|||
></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="-" prop="paintOfflineTimeEnd"> |
|||
<el-date-picker |
|||
v-model="listQuery.paintOfflineTimeEnd" |
|||
size="small" |
|||
style="width: 200px" |
|||
type="datetime" |
|||
></el-date-picker> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="总装上线时间" prop="onlineTimeBegin"> |
|||
<el-date-picker |
|||
v-model="listQuery.onlineTimeBegin" |
|||
size="small" |
|||
style="width: 200px" |
|||
type="datetime" |
|||
></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="-" prop="onlineTimeEnd"> |
|||
<el-date-picker |
|||
v-model="listQuery.onlineTimeEnd" |
|||
size="small" |
|||
style="width: 200px" |
|||
type="datetime" |
|||
></el-date-picker> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="序列号" prop="serialNumBegin"> |
|||
<el-input |
|||
v-model="listQuery.serialNumBegin" |
|||
clearable |
|||
size="small" |
|||
style="width: 120px" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="-" prop="serialNumEnd"> |
|||
<el-input |
|||
v-model="listQuery.serialNumEnd" |
|||
clearable |
|||
size="small" |
|||
style="width: 120px" |
|||
/> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="物流配货顺序号" prop="hostSNBegin"> |
|||
<el-input |
|||
v-model="listQuery.hostSNBegin" |
|||
clearable |
|||
size="small" |
|||
style="width: 120px" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="-" prop="hostSNEnd"> |
|||
<el-input |
|||
v-model="listQuery.hostSNEnd" |
|||
clearable |
|||
size="small" |
|||
style="width: 120px" |
|||
/> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="创建时间" prop="createTimeBegin"> |
|||
<el-date-picker |
|||
v-model="listQuery.createTimeBegin" |
|||
size="small" |
|||
style="width: 200px" |
|||
type="datetime" |
|||
></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="-" prop="createTimeEnd"> |
|||
<el-date-picker |
|||
v-model="listQuery.createTimeEnd" |
|||
size="small" |
|||
style="width: 200px" |
|||
type="datetime" |
|||
></el-date-picker> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="导入时间" prop="importTimeBegin"> |
|||
<el-date-picker |
|||
v-model="listQuery.importTimeBegin" |
|||
size="small" |
|||
style="width: 200px" |
|||
type="datetime" |
|||
></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="-" prop="importTimeEnd"> |
|||
<el-date-picker |
|||
v-model="listQuery.importTimeEnd" |
|||
size="small" |
|||
style="width: 200px" |
|||
type="datetime" |
|||
></el-date-picker> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<el-button |
|||
type="primary" |
|||
icon="el-icon-search" |
|||
size="mini" |
|||
@click="handleFilter" |
|||
>搜索</el-button |
|||
> |
|||
<el-button |
|||
icon="el-icon-refresh" |
|||
size="mini" |
|||
@click="resetQuery('searchForm')" |
|||
>重置</el-button |
|||
> |
|||
<el-button |
|||
type="warning" |
|||
plain |
|||
icon="el-icon-download" |
|||
size="mini" |
|||
style="margin-left: 15px" |
|||
@click="handleDownload()" |
|||
>导出(Excel)查询信息 |
|||
</el-button> |
|||
<el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="success" |
|||
icon="el-icon-plus" |
|||
@click="handleImport" |
|||
>导入 |
|||
</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<div class="tipper" v-if="tipper != ''" v-html="tipper"></div> |
|||
</el-form-item> |
|||
</el-form> |
|||
</flexbox> |
|||
</div> |
|||
<div class="l-table"> |
|||
<!--表格渲染--> |
|||
<el-table |
|||
ref="multipleTable" |
|||
v-loading="listLoading" |
|||
element-loading-text="拼命加载中..." |
|||
element-loading-spinner="el-icon-loading" |
|||
class="cr-table" |
|||
:data="list" |
|||
:height="tableHeight" |
|||
size="small" |
|||
stripe |
|||
border |
|||
highlight-current-row |
|||
style="width: 100%" |
|||
@sort-change="sortChange" |
|||
@selection-change="handleSelectionChange" |
|||
@row-click="handleRowClick" |
|||
> |
|||
<el-table-column |
|||
v-for="(item, index) in getDefaultField" |
|||
:key="index" |
|||
:prop="item.prop" |
|||
:label="item.label" |
|||
:min-width="item.width" |
|||
:formatter="fieldFormatter" |
|||
sortable="custom" |
|||
:gutter="0" |
|||
> |
|||
<template slot="header" slot-scope="scope"> |
|||
{{ scope.column.label }} |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
<!-- show-overflow-tooltip --> |
|||
|
|||
<div class="table-footer"> |
|||
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"--> |
|||
<pagination |
|||
v-show="totalCount > 0" |
|||
:total="totalCount" |
|||
:page.sync="page" |
|||
:limit.sync="listQuery.MaxResultCount" |
|||
@pagination="getList" |
|||
/> |
|||
<!-- 导入Excel组件 --> |
|||
<importExcel |
|||
ref="importexcel" |
|||
:show="showExcelImport" |
|||
:importURL="importExcelURL" |
|||
@close="importClose" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from "@/components/Pagination"; |
|||
import permission from "@/directive/permission/index.js"; |
|||
import CRMTableHead from "../../components/CRMTableHead"; |
|||
import importExcel from "@/components/ImportExcel-normal"; |
|||
import { mapGetters } from "vuex"; |
|||
import Lockr from "lockr"; |
|||
import moment from "moment"; |
|||
import message_table from "../../components/mixins/message_table"; |
|||
import { downloadFile } from "@/utils/crmindex.js"; |
|||
|
|||
//组件计量单位 |
|||
// const bomUnit = [ |
|||
// { key: 0, display_name: "PC" }, |
|||
// { key: 1, display_name: "TON" }, |
|||
// { key: 2, display_name: "Other" }, |
|||
// ]; |
|||
// const projectTypeKeyValue = bomUnit.reduce((acc, cur) => { |
|||
// acc[cur.key] = cur.display_name; |
|||
// return acc; |
|||
// }, {}); |
|||
|
|||
export default { |
|||
name: "RepeatM100", |
|||
components: { Pagination, CRMTableHead, importExcel }, |
|||
directives: { permission }, |
|||
mixins: [message_table], |
|||
data() { |
|||
return { |
|||
importExcelURL:'/api/newjit/import-note/import', |
|||
tipper:"", |
|||
showExcelImport: false, |
|||
form: {}, |
|||
list: null, |
|||
totalCount: 0, |
|||
listLoading: true, |
|||
listQuery: { |
|||
factory:undefined, |
|||
vin:undefined, |
|||
vehicleModelCode:undefined, |
|||
paintOfflineTimeBegin:undefined, |
|||
paintOfflineTimeEnd:undefined, |
|||
onlineTimeBegin:undefined, |
|||
onlineTimeEnd:undefined, |
|||
serialNumBegin:undefined, |
|||
serialNumEnd:undefined, |
|||
hostSNBegin:undefined, |
|||
hostSNEnd:undefined, |
|||
productLine:undefined, |
|||
createTimeBegin:undefined, |
|||
createTimeEnd:undefined, |
|||
importTimeBegin:undefined, |
|||
importTimeEnd:undefined, |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
}, |
|||
page: 1, |
|||
showSearch: true, |
|||
//bomUnit, |
|||
multipleSelection: [], |
|||
tableHeight: document.documentElement.clientHeight - 260, |
|||
}; |
|||
}, |
|||
mounted() { |
|||
this.getTipper(); |
|||
let timer = setInterval(() => { |
|||
this.getTipper(); |
|||
}, 60000); |
|||
// var offsetHei = document.documentElement.clientHeight; |
|||
// let boxH = this.$refs.box.offsetHeight; |
|||
// this.tableHeight = offsetHei - boxH - 57 - 79;//57为footer高度,79为页面上部标签高度 |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
}, |
|||
computed: { |
|||
getDefaultField() { |
|||
var tempsTabs = [{ |
|||
label: "底盘号", |
|||
prop: "vin", |
|||
width: 180 |
|||
}, |
|||
{ |
|||
label: "序列号", |
|||
prop: "serialNum", |
|||
width: 120 |
|||
}, |
|||
{ |
|||
label: "物流配货顺序号", |
|||
prop: "hostSN", |
|||
width: 120 |
|||
}, |
|||
//{ label: "主机厂生产线", prop: "productLine", width: 130 }, |
|||
//{ label: "工厂", prop: "factory", width: 120 }, |
|||
//{ label: "工位", prop: "workLocation", width: 120 }, |
|||
//{ label: "车位", prop: "vehicleLocation", width: 120 }, |
|||
//{ label: "车身号", prop: "vehicleBodyCode", width: 120 }, |
|||
{ |
|||
label: "车型代码", |
|||
prop: "vehicleModelCode", |
|||
width: 180 |
|||
}, |
|||
{ |
|||
label: "车型名称", |
|||
prop: "vehicleModelName", |
|||
width: 320 |
|||
}, |
|||
//{ label: "车型描述", prop: "vehicleModelDesc", width: 240 }, |
|||
//{ label: "规格", prop: "spec", width: 120 }, |
|||
{ |
|||
label: "上级产品系列", |
|||
prop: "specDesc", |
|||
width: 120 |
|||
}, //规格说明 |
|||
{ |
|||
label: "车型", |
|||
prop: "ehicleModel", |
|||
width: 120 |
|||
}, //new |
|||
{ |
|||
label: "公告车型", |
|||
prop: "AfficheVehicleModel", |
|||
width: 120 |
|||
}, //new |
|||
{ |
|||
label: "特殊车标识", |
|||
prop: "SpecialCarLogo", |
|||
width: 120 |
|||
}, //new |
|||
{ |
|||
label: "类别", |
|||
prop: "type", |
|||
width: 120 |
|||
}, |
|||
{ |
|||
label: "涂装下线EA1", |
|||
prop: "paintOfflineTime", |
|||
width: 150 |
|||
}, |
|||
{ |
|||
label: "总装上线EA2", |
|||
prop: "onlineTime", |
|||
width: 150 |
|||
}, |
|||
// { label: "内饰颜色", prop: "interiorColor", width: 120 }, |
|||
// { label: "外饰颜色", prop: "exteriorTrimmingColor", width: 120 }, |
|||
// { label: "目的", prop: "target", width: 120 }, |
|||
// { label: "备注", prop: "remark", width: 120 }, |
|||
// { label: "备注2", prop: "remark2", width: 120 }, |
|||
// { label: "备注3", prop: "remark3", width: 120 }, |
|||
// { label: "备注4", prop: "remark4", width: 120 }, |
|||
// { label: "备注5", prop: "remark5", width: 120 }, |
|||
{ |
|||
label: "创建时间", |
|||
prop: "createTime", |
|||
width: 150 |
|||
}, |
|||
{ |
|||
label: "创建人", |
|||
prop: "createPerson", |
|||
width: 120 |
|||
}, |
|||
{ |
|||
label: "导入时间", |
|||
prop: "importTime", |
|||
width: 150 |
|||
}, |
|||
{ |
|||
label: "导入人", |
|||
prop: "importPerson", |
|||
width: 120 |
|||
}, |
|||
]; |
|||
return tempsTabs; |
|||
}, |
|||
...mapGetters(["userInfo"]), //获取当前用户信息 |
|||
}, |
|||
methods: { |
|||
/** 导出功能 */ |
|||
handleDownload() { |
|||
this.listLoading = true; |
|||
console.log("计划管理导出条件:" + JSON.stringify(this.listQuery)); |
|||
this.$axios |
|||
.posts("/api/newjit/import-note/export", this.listQuery) |
|||
.then((res) => { |
|||
let filename = res.item; |
|||
this.$axios |
|||
.BolbGets("/api/newjit/exclude-part-cfg/download/" + filename) |
|||
.then((response) => { |
|||
if (filename.indexOf("_") != -1) { |
|||
let downName = |
|||
filename.slice(0, filename.lastIndexOf("_")) + |
|||
filename.slice(filename.lastIndexOf(".")); |
|||
downloadFile(response, downName); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} else { |
|||
downloadFile(response, filename); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} |
|||
this.listLoading = false; |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}); |
|||
}, |
|||
/** 重置按钮操作 */ |
|||
resetQuery(refName) { |
|||
this.$refs[refName].resetFields(); |
|||
this.handleQuery(); |
|||
}, |
|||
/** 搜索按钮操作 */ |
|||
handleQuery() { |
|||
this.listQuery.SkipCount = 1; |
|||
this.getList(); |
|||
}, |
|||
//关闭导入窗体时调用 |
|||
importClose() { |
|||
this.showExcelImport = false; |
|||
}, |
|||
// 导入后回调 |
|||
importNormalCallback(res,fileuploadList){ |
|||
// 导入功能,第一次调用时 ret.Status = true 并且 ret.Message 不为空时, 弹出确认对话框,显示ret.Message, |
|||
// 如果选择是, 调用api/newjit/import-note/import,并且第二个参数forceExecute 传入true,选择否关闭 |
|||
if(res.status && res.message && res.message.length > 0){ |
|||
this.$confirm(`${res.message}, 是否确定继续导入`, '提示', { |
|||
confirmButtonText: '继续导入', |
|||
cancelButtonText: '取消导入', |
|||
type: 'warning' |
|||
}) |
|||
.then(() => { |
|||
this.listLoading = true |
|||
let fd = new FormData(); |
|||
fileuploadList.forEach((file) => { |
|||
fd.append("files", file); // 添加文件 |
|||
}); |
|||
fd.append("forceExecute", true); |
|||
this.$axios.posts(this.importExcelURL, fd) |
|||
.then(async (res) => { |
|||
this.listLoading = false |
|||
this.$message({ |
|||
message: "导入成功!", |
|||
type: "success", |
|||
}); |
|||
this.importClose() |
|||
this.getList(); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false |
|||
this.$message({ |
|||
message: res.message, |
|||
type: "error", |
|||
showClose:true |
|||
}); |
|||
this.importClose() |
|||
this.getList(); |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.importClose() |
|||
this.getList(); |
|||
}) |
|||
}else{ |
|||
this.importClose() |
|||
this.getList(); |
|||
} |
|||
}, |
|||
/** 刷新列表 */ |
|||
handleHandle(data) { |
|||
if (data.type !== "edit") { |
|||
this.getList(); |
|||
} |
|||
}, |
|||
/** 格式化字段 */ |
|||
fieldFormatter(row, column) { |
|||
return row[column.property] || "--"; |
|||
}, |
|||
getList(data){ |
|||
this.listLoading = true; |
|||
if (data != undefined) { |
|||
this.listQuery.SkipCount = (this.page - 1) * data.limit; |
|||
} else { |
|||
this.listQuery.SkipCount = (this.page - 1) * this.listQuery.MaxResultCount; |
|||
} |
|||
this.$axios.gets("/api/newjit/import-note/list", this.listQuery) |
|||
.then((response) => { |
|||
this.list = response.items; |
|||
this.totalCount = response.totalCount; |
|||
setTimeout(() => { |
|||
//大数据量加载时 |
|||
this.listLoading = false; |
|||
}, 500); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
handleFilter() { |
|||
this.page = 1; |
|||
this.getList(); |
|||
}, |
|||
sortChange(data) { |
|||
const { prop, order } = data; |
|||
if (!prop || !order) { |
|||
this.listQuery.Sorting = undefined |
|||
this.handleFilter(); |
|||
return; |
|||
} |
|||
this.listQuery.Sorting = prop + " " + order; |
|||
this.handleFilter(); |
|||
}, |
|||
|
|||
handleSelectionChange(val) { |
|||
this.multipleSelection = val; |
|||
}, |
|||
handleRowClick(row, column, event) { |
|||
this.$refs.multipleTable.clearSelection(); |
|||
this.$refs.multipleTable.toggleRowSelection(row); |
|||
}, |
|||
handleImport() { |
|||
//导入 |
|||
this.showExcelImport = true; |
|||
}, |
|||
// 更改主表格高度 |
|||
changeMainTableHeight(){ |
|||
this.$nextTick(()=>{ |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
// let boxH = this.$refs.box.offsetHeight; |
|||
let headerH = document.getElementById("planControl-content-header").clientHeight |
|||
let footerH = this.totalCount > 0 ? 67 : 0 //footer高度 |
|||
this.tableHeight = offsetHei - headerH - 67 - 79; //79为页面上部标签高度 |
|||
//this.tableHeight = offsetHei -260 |
|||
}) |
|||
}, |
|||
getTipper(){ |
|||
if(this.$route.name != 'pg-planControl'){ |
|||
return |
|||
} |
|||
this.$axios.posts( "/api/newjit/import-note/print-timeout-remind" ).then((res) => { |
|||
this.tipper = "" |
|||
let _item = "" |
|||
let _style = "" |
|||
if (res.timeoutMinutes >= res.configMinutes) { |
|||
//写提示信息 |
|||
_style = "color:red;font-weight:bold" |
|||
} else { |
|||
_style = "color:green" |
|||
} |
|||
_item = `<span style=${_style}>已经${res.timeoutMinutes}分钟没有导入计划\xa0\xa0\xa0\xa0</span>` |
|||
this.tipper += _item |
|||
|
|||
this.$nextTick(() => { |
|||
this.changeMainTableHeight() |
|||
}) |
|||
}) |
|||
} |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "../../../pg-fis/styles/crmtable.scss"; |
|||
.tipper{ |
|||
border: solid 1px #ddd; |
|||
border-radius: 5px; |
|||
display: inline-block; |
|||
padding: 10px; |
|||
line-height: 20px; |
|||
} |
|||
</style> |
|||
|
|||
|
Loading…
Reference in new issue