44673626
3 years ago
15 changed files with 3108 additions and 100 deletions
@ -0,0 +1,837 @@ |
|||
<!--大众看板结算明细比对带条码--> |
|||
<template> |
|||
<div class="cr-body-content"> |
|||
<!--功能栏--> |
|||
<!-- 搜索 --> |
|||
<div style="float: left"> |
|||
<flexbox class="content-header"> |
|||
<el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="primary" |
|||
icon="el-icon-plus" |
|||
@click="handleCreate" |
|||
>统计 |
|||
</el-button> |
|||
</flexbox> |
|||
</div> |
|||
<!-- 刷新 --> |
|||
<div style="float: right"> |
|||
<flexbox class="content-header"> |
|||
<el-tooltip |
|||
class="item" |
|||
effect="dark" |
|||
content="手动刷新" |
|||
placement="top" |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
circle |
|||
icon="el-icon-refresh" |
|||
@click="refresh()" |
|||
/> |
|||
</el-tooltip> |
|||
|
|||
<span style="margin-left: 10px; color: #ff5640; float: right" |
|||
>说明:每间隔30秒进行自动刷新!</span |
|||
> |
|||
</flexbox> |
|||
</div> |
|||
|
|||
<!--主页面表格渲染--> |
|||
<el-table |
|||
ref="multipleTable" |
|||
v-loading="listLoading" |
|||
element-loading-text="拼命加载中..." |
|||
element-loading-spinner="el-icon-loading" |
|||
class="cr-table" |
|||
:data="list" |
|||
:height="tableHeight" |
|||
:cell-style="cellStyle" |
|||
size="small" |
|||
stripe |
|||
border |
|||
highlight-current-row |
|||
style="width: 100%" |
|||
@row-click="handleRowClick" |
|||
@filter-change="filterChange" |
|||
> |
|||
<el-table-column |
|||
v-for="(item, index) in getDefaultField" |
|||
:key="index" |
|||
:prop="item.prop" |
|||
:label="item.label" |
|||
:min-width="item.width" |
|||
:formatter="fieldFormatter" |
|||
sortable |
|||
show-overflow-tooltip |
|||
:gutter="0" |
|||
> |
|||
<template slot="header" slot-scope="scope"> |
|||
{{ scope.column.label }} |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<!-- 操作名称 --> |
|||
<el-table-column |
|||
prop="actionName" |
|||
label="操作名称(单击箭头过滤)" |
|||
width="165" |
|||
column-key="actionName" |
|||
:filters="[ |
|||
{ text: '导出', value: '导出' }, |
|||
{ text: '消息', value: '消息' }, |
|||
]" |
|||
filter-placement="bottom-end" |
|||
:filter-method="filterHandler" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div align="center"> |
|||
<el-tag |
|||
v-for="(item, index) in menuCateMap" |
|||
v-show="scope.row.actionName == item.value" |
|||
:key="index" |
|||
:type="item.cssName" |
|||
> |
|||
{{ item.label }} |
|||
</el-tag> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<!-- 状态 --> |
|||
<el-table-column |
|||
prop="stateName" |
|||
label="状态(单击箭头过滤)" |
|||
width="165" |
|||
column-key="stateName" |
|||
align="center" |
|||
:filters="[ |
|||
{ text: '执行完成(任务成功)', value: 'Succeeded' }, |
|||
{ text: '执行完成(任务失败)', value: 'Failed' }, |
|||
{ text: '执行中', value: 'Processing' }, |
|||
{ text: '等待执行', value: 'Scheduled' }, |
|||
]" |
|||
filter-placement="bottom-end" |
|||
:filter-method="filterHandler" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-tag |
|||
v-for="(item, index) in stateNameCateMap" |
|||
v-show="scope.row.stateName == item.value" |
|||
:key="index" |
|||
:type="item.cssName" |
|||
> |
|||
{{ item.label }} |
|||
</el-tag> |
|||
</template> |
|||
</el-table-column> |
|||
<!-- 操作 --> |
|||
<el-table-column label="操作" align="center" width="250"> |
|||
<template slot-scope="scope"> |
|||
<div align="center"> |
|||
<!-- <el-button |
|||
v-if="scope.row.actionName == '导出'" |
|||
size="mini" |
|||
type="text" |
|||
@click="handleDownload(scope.row)" |
|||
icon="el-icon-edit" |
|||
>下载</el-button |
|||
> --> |
|||
<el-button |
|||
v-if=" |
|||
scope.row.actionName == '导出' && |
|||
scope.row.stateName == 'Succeeded' && |
|||
scope.row.downFileName != '' |
|||
" |
|||
size="mini" |
|||
type="text" |
|||
@click="handleDownload(scope.row)" |
|||
icon="el-icon-edit" |
|||
>下载</el-button |
|||
> |
|||
<el-button |
|||
v-if=" |
|||
scope.row.actionName == '导出' && |
|||
scope.row.error != '' && |
|||
scope.row.stateName == 'Succeeded' |
|||
" |
|||
size="mini" |
|||
type="text" |
|||
@click="handleDownload(scope.row)" |
|||
icon="el-icon-edit" |
|||
>检验失败,下载</el-button |
|||
> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"--> |
|||
<div class="table-footer"> |
|||
<pagination |
|||
v-show="totalCount > 0" |
|||
:total="totalCount" |
|||
:page.sync="page" |
|||
:limit.sync="listQuery.MaxResultCount" |
|||
@pagination="getList" |
|||
/> |
|||
</div> |
|||
|
|||
<!-- 任务日志详细 --> |
|||
<el-dialog |
|||
title="任务详细" |
|||
:visible.sync="openView" |
|||
width="700px" |
|||
append-to-body |
|||
> |
|||
<el-form ref="form" :model="form" label-width="120px" size="mini"> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="overall"> |
|||
<!-- 步骤条 --> |
|||
<div class="steps-box"> |
|||
<ul class="steps"> |
|||
<li |
|||
v-for="(item, index) in stepList" |
|||
:key="index" |
|||
:class="{ active: activeIndex - 1 === index }" |
|||
> |
|||
<p :class="{ li_active: activeIndex > index }"> |
|||
<i :class="item.icon"></i> |
|||
</p> |
|||
<div |
|||
class="text" |
|||
:class="{ li_active: activeIndex > index }" |
|||
> |
|||
{{ item.title }} |
|||
</div> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
<!-- 步骤条对应内容 --> |
|||
<div class="Article-content"> |
|||
<el-tabs v-model="activeName"> |
|||
<el-tab-pane label="基本信息" name="first"> |
|||
<div class="dialog-body"> |
|||
<div |
|||
class="content" |
|||
v-for="(item, index) in stepList" |
|||
:key="index" |
|||
v-show="activeIndex == index + 1" |
|||
> |
|||
<div> |
|||
<el-card style="height: 300px; margin: 2px"> |
|||
<div |
|||
v-if="activeIndex == 1" |
|||
slot="header" |
|||
class="clearfix" |
|||
> |
|||
<span>当前状态:等待执行</span> |
|||
</div> |
|||
<div |
|||
v-else-if="activeIndex == 2" |
|||
slot="header" |
|||
class="clearfix" |
|||
> |
|||
<span>当前状态:执行中...</span> |
|||
</div> |
|||
<div |
|||
v-else-if="activeIndex == 3" |
|||
slot="header" |
|||
class="clearfix" |
|||
> |
|||
<div id="chatarea"> |
|||
<div |
|||
style="display: inline; color: #71d87f" |
|||
v-if="form.stateName == 'Succeeded'" |
|||
> |
|||
执行结果:执行成功 |
|||
</div> |
|||
<div |
|||
style="display: inline; color: #ff5640" |
|||
v-else-if="form.stateName == 'Failed'" |
|||
> |
|||
执行结果:执行失败 |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div> |
|||
<el-col :span="12"> |
|||
<el-form-item label="模块名称:">{{ |
|||
form.name |
|||
}}</el-form-item> |
|||
<el-form-item label="操作名称:">{{ |
|||
form.actionName |
|||
}}</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="创建人:">{{ |
|||
form.creator |
|||
}}</el-form-item> |
|||
<el-form-item label="创建时间:"> |
|||
<el-date-picker |
|||
value-format="yyyy-MM-dd hh:mm:ss" |
|||
format="yyyy-MM-dd hh:mm:ss" |
|||
v-model="form.createdAt" |
|||
type="date" |
|||
class="picker" |
|||
disabled |
|||
></el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="24"> |
|||
<el-form-item |
|||
label="异常信息:" |
|||
style="color: #ff5640" |
|||
v-if="form.stateName == 'Failed'" |
|||
> |
|||
<el-button |
|||
class="result-info__btn--err" |
|||
type="text" |
|||
@click="downloadErrData(form.error)" |
|||
>下载错误数据</el-button |
|||
> |
|||
</el-form-item> |
|||
<el-form-item |
|||
label="生成数据:" |
|||
style="color: #ff5640" |
|||
v-else-if=" |
|||
form.stateName == 'Succeeded' && |
|||
form.actionName == '导出' |
|||
" |
|||
> |
|||
<el-button |
|||
class="result-info__btn--err" |
|||
type="text" |
|||
@click="downloadErrData(form.downFileName)" |
|||
>下载生成数据</el-button |
|||
> |
|||
</el-form-item> |
|||
</el-col> |
|||
</div> |
|||
</el-card> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</div> |
|||
</div> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="openView = false">关 闭</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
|
|||
<!--统计功能表单渲染--> |
|||
<el-dialog |
|||
:visible.sync="dialogFormVisible" |
|||
:close-on-click-modal="false" |
|||
:title="formTitle" |
|||
append-to-body |
|||
width="550px" |
|||
> |
|||
<el-form ref="formCount" :inline="true" :model="formCount" size="mini"> |
|||
<el-row> |
|||
<el-col :md="4" :xs="24"> |
|||
<el-form-item label="选择版本" required /> |
|||
</el-col> |
|||
<el-col :md="20" :xs="24" style="margin-left: -80px"> |
|||
<el-form-item prop="versionValue"> |
|||
<el-select |
|||
v-model="formCount.versionValue" |
|||
size="medium" |
|||
clearable |
|||
style="width: 188px; margin-right: 15px" |
|||
placeholder="请选择" |
|||
> |
|||
<el-option |
|||
v-for="item in versionList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<!-- <el-row> |
|||
<el-col :md="4" :xs="24"> |
|||
<el-form-item label="适用功能" required /> |
|||
</el-col> |
|||
<el-col :md="20" :xs="24" style="margin-left: -80px"> |
|||
<el-form-item prop="customerCode"> |
|||
<el-select |
|||
v-model="formCount.customerCode" |
|||
size="medium" |
|||
clearable |
|||
style="width: 188px; margin-right: 15px" |
|||
placeholder="请选择" |
|||
> |
|||
<el-option label="结算" value="R0003"></el-option> |
|||
<el-option label="二配" value="R0001"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> --> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<!-- <el-button type="text" @click="dialogFormVisible = false" |
|||
>取消</el-button |
|||
> --> |
|||
<el-button @click="resetForm('formCount')">重置</el-button> |
|||
<el-button v-loading="formLoading" type="primary" @click="save" |
|||
>确认</el-button |
|||
> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination |
|||
import permission from "@/directive/permission/index.js"; |
|||
import { downloadFile } from "@/utils/crmindex.js"; |
|||
import CRMTableHead from "../../components/CRMTableHead"; |
|||
import moment from "moment"; |
|||
const cityOptions = [ |
|||
{ id: 0, name: "未结" }, |
|||
{ id: 1, name: "部分结算" }, |
|||
{ id: 2, name: "已结" }, |
|||
/* { id: 3, name: "预批量" }, */ |
|||
]; |
|||
|
|||
export default { |
|||
name: "IssuedUnsettled", |
|||
components: { Pagination, CRMTableHead }, |
|||
directives: { permission }, |
|||
|
|||
data() { |
|||
return { |
|||
crmType: "backJob", |
|||
checkedCities: [0], |
|||
cities: cityOptions, |
|||
selectValue: "", |
|||
selectNameValue: "", |
|||
radio: "0", //结算状态:0未结 1部分结算 |
|||
versionList: [], |
|||
// 是否显示详细弹出层 |
|||
openView: false, |
|||
versionValue: "", |
|||
formTitle: "", |
|||
timer: null, //定时器名称 |
|||
//当前位置 |
|||
activeIndex: 1, |
|||
//默认显示基本信息 |
|||
activeName: "first", |
|||
//步骤条步数 |
|||
stepList: [ |
|||
{ |
|||
title: "等待执行", |
|||
icon: "el-icon-sort", |
|||
}, |
|||
{ |
|||
title: "执行中", |
|||
icon: "el-icon-refresh", |
|||
}, |
|||
{ |
|||
title: "执行完成", |
|||
icon: "el-icon-check", |
|||
}, |
|||
], |
|||
customerInfos: "", |
|||
searchContent: "", // 输入内容 |
|||
form: {}, |
|||
formCount: { |
|||
name: "未结算对比", |
|||
datetime5: "", |
|||
datetime7: "", |
|||
state: [0], |
|||
}, |
|||
list: null, |
|||
totalCount: 0, |
|||
listLoading: true, |
|||
formLoading: false, |
|||
// 高级搜索 |
|||
filterObj: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
listExportQuery: { |
|||
//version: "", |
|||
//customerCode: "TH", |
|||
state: "", |
|||
begin: "", |
|||
end: "", |
|||
}, |
|||
listQuery: { |
|||
taskId: "", |
|||
name: "", |
|||
}, |
|||
page: 1, |
|||
dialogFormVisible: false, |
|||
multipleSelection: [], |
|||
tableHeight: document.documentElement.clientHeight - 260, |
|||
isEdit: false, |
|||
menuCateMap: [ |
|||
{ label: "导出", value: "导出", cssName: "warning" }, |
|||
{ label: "消息", value: "消息", cssName: "info" }, |
|||
], |
|||
stateNameCateMap: [ |
|||
{ label: "执行完成(任务成功)", value: "Succeeded", cssName: "success" }, |
|||
{ label: "执行中...", value: "Processing", cssName: "primary" }, |
|||
{ label: "执行完成(任务失败)", value: "Failed", cssName: "danger" }, |
|||
{ label: "等待执行", value: "Scheduled", cssName: "primary" }, |
|||
], |
|||
}; |
|||
}, |
|||
mounted() { |
|||
var self = this; |
|||
window.onresize = function () { |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
self.tableHeight = offsetHei - 190; |
|||
}; |
|||
this.timer = setInterval(() => { |
|||
this.listQuery.taskId = ""; |
|||
this.listQuery.stateName = ""; |
|||
setTimeout(this.getList, 0); |
|||
}, 1000 * 30); //30秒刷新一次页面 |
|||
// 通过$once来监听定时器,在beforeDestroy钩子可以被清除。 |
|||
this.$once("hook:beforeDestroy", () => { |
|||
clearInterval(timer); |
|||
}); |
|||
}, |
|||
created() { |
|||
this.getAllVersionList(); |
|||
this.getList(); |
|||
}, |
|||
beforeDestroy() { |
|||
clearInterval(this.timer); |
|||
this.timer = null; |
|||
}, |
|||
computed: { |
|||
/* 主表头 */ |
|||
getDefaultField() { |
|||
var tempsTabs = []; |
|||
|
|||
tempsTabs.push({ |
|||
label: "单据流水号", |
|||
prop: "taskId", |
|||
width: 85, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "模块名称", |
|||
prop: "name", |
|||
width: 170, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "创建人", |
|||
prop: "email", |
|||
width: 110, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "创建时间", |
|||
prop: "createdAt", |
|||
width: 150, |
|||
}); |
|||
// tempsTabs.push({ |
|||
// label: "操作名称", |
|||
// prop: "actionName", |
|||
// width: 120, |
|||
// }); |
|||
// tempsTabs.push({ |
|||
// label: "状态", |
|||
// prop: "stateName", |
|||
// width: 100, |
|||
// }); |
|||
return tempsTabs; |
|||
}, |
|||
}, |
|||
methods: { |
|||
handleCheckedCitiesChange(value) { |
|||
alert(value); |
|||
}, |
|||
/* 导出功能 */ |
|||
handleDownloadExport() { |
|||
if (this.versionValue === "") { |
|||
this.$message.error("请选择版本"); |
|||
return false; |
|||
} |
|||
this.listLoading = true; |
|||
this.listExportQuery.version = this.version; |
|||
console.log("导出条件:" + JSON.stringify(this.listExportQuery)); |
|||
this.$axios |
|||
.posts( |
|||
"/api/settleaccount/ReportMakeService/SettleKanBan-WithCode", |
|||
this.listExportQuery |
|||
) |
|||
.then((res) => { |
|||
let taskid = res; |
|||
if (Number.isInteger(taskid)) { |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "任务生成成功!任务号:" + taskid, |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} |
|||
this.getList(); |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
getAllVersionList() { |
|||
this.$axios |
|||
.posts("/api/settleaccount/CentralizedControl/openlist") |
|||
.then((response) => { |
|||
this.versionList = []; |
|||
response.forEach((element) => { |
|||
let options = {}; |
|||
options.value = element.version; |
|||
options.label = element.version; |
|||
this.versionList.push(options); |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
checkedListChange(index) |
|||
{ |
|||
if(this.formCount.state.length === 0) |
|||
{ |
|||
this.formCount.state.push(this.cities[index].id); |
|||
} |
|||
}, |
|||
/* 重置 */ |
|||
resetForm(formName) { |
|||
//this.formCount = {}; |
|||
this.formCount.datetime5 = ""; |
|||
this.formCount.datetime7 = ""; |
|||
this.formCount.state = [0]; |
|||
}, |
|||
save() { |
|||
this.$refs.formCount.validate((valid) => { |
|||
if (valid) { |
|||
console.log("参数:" + JSON.stringify(this.formCount)); |
|||
this.formLoading = true; |
|||
this.listExportQuery.version = this.formCount.versionValue; |
|||
// this.listExportQuery.begin = this.formCount.datetime5[0]; |
|||
// this.listExportQuery.end = this.formCount.datetime5[1]; |
|||
// this.listExportQuery.state = this.formCount.state.join(','); |
|||
console.log("导出条件:" + JSON.stringify(this.listExportQuery)); |
|||
this.$axios |
|||
.gets( |
|||
"/api/settleaccount/ReportMakeService/SettleKanBan-WithCode", |
|||
this.listExportQuery |
|||
) |
|||
.then((res) => { |
|||
let taskid = res; |
|||
if (Number.isInteger(taskid)) { |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "任务生成成功!任务号:" + taskid, |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} |
|||
this.getList(); |
|||
this.formLoading = false; |
|||
this.dialogFormVisible = false; |
|||
}) |
|||
.catch(() => { |
|||
this.formLoading = false; |
|||
this.dialogFormVisible = false; |
|||
}); |
|||
} |
|||
}); |
|||
}, |
|||
handleCreate() { |
|||
this.$nextTick(() => { |
|||
this.$refs["formCount"].resetFields(); |
|||
}); |
|||
this.formTitle = "报表统计"; |
|||
this.isEdit = false; |
|||
this.form = {}; |
|||
this.dialogFormVisible = true; |
|||
}, |
|||
filterHandler(value, row, column) { |
|||
const property = column["property"]; |
|||
return row[property] === value; |
|||
}, |
|||
/* 任务详细信息 */ |
|||
handleView(row) { |
|||
this.listQuery.taskId = row.taskId; |
|||
this.$axios |
|||
.posts("/api/settleaccount/Job/list", this.listQuery) |
|||
.then((response) => { |
|||
this.form = response[0]; |
|||
switch (response[0].stateName) { |
|||
case "Succeeded": |
|||
case "Failed": |
|||
this.activeIndex = 3; |
|||
break; |
|||
case "Processing": |
|||
this.activeIndex = 2; |
|||
break; |
|||
case "Enqueued": |
|||
this.activeIndex = 1; |
|||
break; |
|||
} |
|||
this.openView = true; |
|||
}); |
|||
}, |
|||
/* 刷新 */ |
|||
refresh() { |
|||
this.list = []; |
|||
this.listQuery.taskId = ""; |
|||
this.listQuery.name = ""; |
|||
this.getList(); |
|||
}, |
|||
// 监听筛选项的变化 |
|||
filterChange(filterObj) { |
|||
console.log(filterObj.actionName); |
|||
if (filterObj.actionName.length > 0) { |
|||
console.log("点击筛选"); |
|||
} else { |
|||
console.log("点击重置"); |
|||
} |
|||
}, |
|||
/* 导出类型的文件 */ |
|||
downloadErrData(param) { |
|||
this.listLoading = true; |
|||
let fileNameOfProject = param; |
|||
this.$axios |
|||
.BolbGets( |
|||
"/api/settleaccount/getblobfile/download/" + fileNameOfProject |
|||
) |
|||
.then((response) => { |
|||
if (fileNameOfProject.indexOf("_") != -1) { |
|||
let downName = |
|||
fileNameOfProject.slice(0, fileNameOfProject.lastIndexOf("_")) + |
|||
fileNameOfProject.slice(fileNameOfProject.lastIndexOf(".")); |
|||
downloadFile(response, downName); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出中...", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} else { |
|||
downloadFile(response, fileNameOfProject); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出中...", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} |
|||
this.listLoading = false; |
|||
}) |
|||
.catch((error) => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
/* 刷新列表 */ |
|||
handleHandle(data) { |
|||
if (data.type !== "edit") { |
|||
this.getList(); |
|||
} |
|||
}, |
|||
/* 格式化字段 */ |
|||
fieldFormatter(row, column) { |
|||
if (column.property === "stateName") { |
|||
return { |
|||
Succeeded: "执行完成(成功)", |
|||
Processing: "执行中...", |
|||
Failed: "执行完成(失败)", |
|||
Enqueued: "等待执行", |
|||
}[row[column.property]]; |
|||
} |
|||
if (column.property == "createdAt") { |
|||
var date = row[column.property]; |
|||
if (date == undefined) { |
|||
return ""; |
|||
} |
|||
return moment(date).format("YYYY-MM-DD HH:mm:ss"); |
|||
} |
|||
return row[column.property] || "--"; |
|||
}, |
|||
handleDownload(row) { |
|||
if (row.stateName == "Succeeded") { |
|||
this.downloadErrData(row.downFileName); |
|||
} else if (row.stateName == "Failed") { |
|||
this.downloadErrData(row.error); |
|||
} |
|||
}, |
|||
getList() { |
|||
this.listLoading = true; |
|||
//导入界面中超链接过来的参数 |
|||
this.listQuery.name = "未结算对比"; |
|||
this.$axios |
|||
.posts("/api/settleaccount/Job/list", this.listQuery) |
|||
.then((response) => { |
|||
this.list = response; |
|||
setTimeout(() => { |
|||
//大数据量加载时 |
|||
this.listLoading = false; |
|||
}, 500); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
// fetchData(id) { |
|||
// //循环动态,取客户名称 |
|||
// this.$axios |
|||
// .gets("/api/settleaccount/MaterialRelationship/" + id) |
|||
// .then((response) => { |
|||
// this.form = response; |
|||
// }); |
|||
// }, |
|||
resetQuery() {}, |
|||
/** 通过回调控制style */ |
|||
cellStyle({ row, column, rowIndex, columnIndex }) { |
|||
var item = this.list[rowIndex]; |
|||
if (column.property === "stateName") { |
|||
if (item.stateName === "Succeeded") { |
|||
return { color: "#71d87f", cursor: "pointer" }; |
|||
} else if (item.stateName === "Processing") { |
|||
return { color: "#d87171", cursor: "pointer" }; |
|||
} else if (item.stateName === "Failed") { |
|||
return { color: "#ff5640", cursor: "pointer" }; |
|||
} |
|||
} |
|||
return { textAlign: "left" }; |
|||
//} |
|||
}, |
|||
headerRowStyle({ row, column, rowIndex, columnIndex }) { |
|||
if (column.property === "stateName") { |
|||
return { textAlign: "center" }; |
|||
} |
|||
return { textAlign: "center" }; |
|||
}, |
|||
handleRowClick(row, column, event) { |
|||
this.$refs.multipleTable.clearSelection(); |
|||
this.$refs.multipleTable.toggleRowSelection(row); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "../../styles/crmtable.scss"; |
|||
@import "../../styles/steps.scss"; |
|||
|
|||
/deep/ .el-checkbox input:focus{ |
|||
outline:none !important; |
|||
border-color: gray; |
|||
border: 0px; |
|||
box-shadow: none !important; |
|||
} |
|||
|
|||
</style> |
@ -0,0 +1,835 @@ |
|||
<!--大众备件结算明细--> |
|||
<template> |
|||
<div class="cr-body-content"> |
|||
<!--功能栏--> |
|||
<!-- 搜索 --> |
|||
<div style="float: left"> |
|||
<flexbox class="content-header"> |
|||
<el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="primary" |
|||
icon="el-icon-plus" |
|||
@click="handleCreate" |
|||
>统计 |
|||
</el-button> |
|||
</flexbox> |
|||
</div> |
|||
<!-- 刷新 --> |
|||
<div style="float: right"> |
|||
<flexbox class="content-header"> |
|||
<el-tooltip |
|||
class="item" |
|||
effect="dark" |
|||
content="手动刷新" |
|||
placement="top" |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
circle |
|||
icon="el-icon-refresh" |
|||
@click="refresh()" |
|||
/> |
|||
</el-tooltip> |
|||
|
|||
<span style="margin-left: 10px; color: #ff5640; float: right" |
|||
>说明:每间隔30秒进行自动刷新!</span |
|||
> |
|||
</flexbox> |
|||
</div> |
|||
|
|||
<!--主页面表格渲染--> |
|||
<el-table |
|||
ref="multipleTable" |
|||
v-loading="listLoading" |
|||
element-loading-text="拼命加载中..." |
|||
element-loading-spinner="el-icon-loading" |
|||
class="cr-table" |
|||
:data="list" |
|||
:height="tableHeight" |
|||
:cell-style="cellStyle" |
|||
size="small" |
|||
stripe |
|||
border |
|||
highlight-current-row |
|||
style="width: 100%" |
|||
@row-click="handleRowClick" |
|||
@filter-change="filterChange" |
|||
> |
|||
<el-table-column |
|||
v-for="(item, index) in getDefaultField" |
|||
:key="index" |
|||
:prop="item.prop" |
|||
:label="item.label" |
|||
:min-width="item.width" |
|||
:formatter="fieldFormatter" |
|||
sortable |
|||
show-overflow-tooltip |
|||
:gutter="0" |
|||
> |
|||
<template slot="header" slot-scope="scope"> |
|||
{{ scope.column.label }} |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<!-- 操作名称 --> |
|||
<el-table-column |
|||
prop="actionName" |
|||
label="操作名称(单击箭头过滤)" |
|||
width="165" |
|||
column-key="actionName" |
|||
:filters="[ |
|||
{ text: '导出', value: '导出' }, |
|||
{ text: '消息', value: '消息' }, |
|||
]" |
|||
filter-placement="bottom-end" |
|||
:filter-method="filterHandler" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div align="center"> |
|||
<el-tag |
|||
v-for="(item, index) in menuCateMap" |
|||
v-show="scope.row.actionName == item.value" |
|||
:key="index" |
|||
:type="item.cssName" |
|||
> |
|||
{{ item.label }} |
|||
</el-tag> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<!-- 状态 --> |
|||
<el-table-column |
|||
prop="stateName" |
|||
label="状态(单击箭头过滤)" |
|||
width="165" |
|||
column-key="stateName" |
|||
align="center" |
|||
:filters="[ |
|||
{ text: '执行完成(任务成功)', value: 'Succeeded' }, |
|||
{ text: '执行完成(任务失败)', value: 'Failed' }, |
|||
{ text: '执行中', value: 'Processing' }, |
|||
{ text: '等待执行', value: 'Scheduled' }, |
|||
]" |
|||
filter-placement="bottom-end" |
|||
:filter-method="filterHandler" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-tag |
|||
v-for="(item, index) in stateNameCateMap" |
|||
v-show="scope.row.stateName == item.value" |
|||
:key="index" |
|||
:type="item.cssName" |
|||
> |
|||
{{ item.label }} |
|||
</el-tag> |
|||
</template> |
|||
</el-table-column> |
|||
<!-- 操作 --> |
|||
<el-table-column label="操作" align="center" width="250"> |
|||
<template slot-scope="scope"> |
|||
<div align="center"> |
|||
<!-- <el-button |
|||
v-if="scope.row.actionName == '导出'" |
|||
size="mini" |
|||
type="text" |
|||
@click="handleDownload(scope.row)" |
|||
icon="el-icon-edit" |
|||
>下载</el-button |
|||
> --> |
|||
<el-button |
|||
v-if=" |
|||
scope.row.actionName == '导出' && |
|||
scope.row.stateName == 'Succeeded' && |
|||
scope.row.downFileName != '' |
|||
" |
|||
size="mini" |
|||
type="text" |
|||
@click="handleDownload(scope.row)" |
|||
icon="el-icon-edit" |
|||
>下载</el-button |
|||
> |
|||
<el-button |
|||
v-if=" |
|||
scope.row.actionName == '导出' && |
|||
scope.row.error != '' && |
|||
scope.row.stateName == 'Succeeded' |
|||
" |
|||
size="mini" |
|||
type="text" |
|||
@click="handleDownload(scope.row)" |
|||
icon="el-icon-edit" |
|||
>检验失败,下载</el-button |
|||
> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"--> |
|||
<div class="table-footer"> |
|||
<pagination |
|||
v-show="totalCount > 0" |
|||
:total="totalCount" |
|||
:page.sync="page" |
|||
:limit.sync="listQuery.MaxResultCount" |
|||
@pagination="getList" |
|||
/> |
|||
</div> |
|||
|
|||
<!-- 任务日志详细 --> |
|||
<el-dialog |
|||
title="任务详细" |
|||
:visible.sync="openView" |
|||
width="700px" |
|||
append-to-body |
|||
> |
|||
<el-form ref="form" :model="form" label-width="120px" size="mini"> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div class="overall"> |
|||
<!-- 步骤条 --> |
|||
<div class="steps-box"> |
|||
<ul class="steps"> |
|||
<li |
|||
v-for="(item, index) in stepList" |
|||
:key="index" |
|||
:class="{ active: activeIndex - 1 === index }" |
|||
> |
|||
<p :class="{ li_active: activeIndex > index }"> |
|||
<i :class="item.icon"></i> |
|||
</p> |
|||
<div |
|||
class="text" |
|||
:class="{ li_active: activeIndex > index }" |
|||
> |
|||
{{ item.title }} |
|||
</div> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
<!-- 步骤条对应内容 --> |
|||
<div class="Article-content"> |
|||
<el-tabs v-model="activeName"> |
|||
<el-tab-pane label="基本信息" name="first"> |
|||
<div class="dialog-body"> |
|||
<div |
|||
class="content" |
|||
v-for="(item, index) in stepList" |
|||
:key="index" |
|||
v-show="activeIndex == index + 1" |
|||
> |
|||
<div> |
|||
<el-card style="height: 300px; margin: 2px"> |
|||
<div |
|||
v-if="activeIndex == 1" |
|||
slot="header" |
|||
class="clearfix" |
|||
> |
|||
<span>当前状态:等待执行</span> |
|||
</div> |
|||
<div |
|||
v-else-if="activeIndex == 2" |
|||
slot="header" |
|||
class="clearfix" |
|||
> |
|||
<span>当前状态:执行中...</span> |
|||
</div> |
|||
<div |
|||
v-else-if="activeIndex == 3" |
|||
slot="header" |
|||
class="clearfix" |
|||
> |
|||
<div id="chatarea"> |
|||
<div |
|||
style="display: inline; color: #71d87f" |
|||
v-if="form.stateName == 'Succeeded'" |
|||
> |
|||
执行结果:执行成功 |
|||
</div> |
|||
<div |
|||
style="display: inline; color: #ff5640" |
|||
v-else-if="form.stateName == 'Failed'" |
|||
> |
|||
执行结果:执行失败 |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div> |
|||
<el-col :span="12"> |
|||
<el-form-item label="模块名称:">{{ |
|||
form.name |
|||
}}</el-form-item> |
|||
<el-form-item label="操作名称:">{{ |
|||
form.actionName |
|||
}}</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="创建人:">{{ |
|||
form.creator |
|||
}}</el-form-item> |
|||
<el-form-item label="创建时间:"> |
|||
<el-date-picker |
|||
value-format="yyyy-MM-dd hh:mm:ss" |
|||
format="yyyy-MM-dd hh:mm:ss" |
|||
v-model="form.createdAt" |
|||
type="date" |
|||
class="picker" |
|||
disabled |
|||
></el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="24"> |
|||
<el-form-item |
|||
label="异常信息:" |
|||
style="color: #ff5640" |
|||
v-if="form.stateName == 'Failed'" |
|||
> |
|||
<el-button |
|||
class="result-info__btn--err" |
|||
type="text" |
|||
@click="downloadErrData(form.error)" |
|||
>下载错误数据</el-button |
|||
> |
|||
</el-form-item> |
|||
<el-form-item |
|||
label="生成数据:" |
|||
style="color: #ff5640" |
|||
v-else-if=" |
|||
form.stateName == 'Succeeded' && |
|||
form.actionName == '导出' |
|||
" |
|||
> |
|||
<el-button |
|||
class="result-info__btn--err" |
|||
type="text" |
|||
@click="downloadErrData(form.downFileName)" |
|||
>下载生成数据</el-button |
|||
> |
|||
</el-form-item> |
|||
</el-col> |
|||
</div> |
|||
</el-card> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</div> |
|||
</div> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="openView = false">关 闭</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
|
|||
<!--统计功能表单渲染--> |
|||
<el-dialog |
|||
:visible.sync="dialogFormVisible" |
|||
:close-on-click-modal="false" |
|||
:title="formTitle" |
|||
append-to-body |
|||
width="550px" |
|||
> |
|||
<el-form ref="formCount" :inline="true" :model="formCount" size="mini"> |
|||
<el-row> |
|||
<el-col :md="4" :xs="24"> |
|||
<el-form-item label="选择版本" required /> |
|||
</el-col> |
|||
<el-col :md="20" :xs="24" style="margin-left: -80px"> |
|||
<el-form-item prop="versionValue"> |
|||
<el-select |
|||
v-model="formCount.versionValue" |
|||
size="medium" |
|||
clearable |
|||
style="width: 188px; margin-right: 15px" |
|||
placeholder="请选择" |
|||
> |
|||
<el-option |
|||
v-for="item in versionList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<!-- <el-row> |
|||
<el-col :md="4" :xs="24"> |
|||
<el-form-item label="适用功能" required /> |
|||
</el-col> |
|||
<el-col :md="20" :xs="24" style="margin-left: -80px"> |
|||
<el-form-item prop="customerCode"> |
|||
<el-select |
|||
v-model="formCount.customerCode" |
|||
size="medium" |
|||
clearable |
|||
style="width: 188px; margin-right: 15px" |
|||
placeholder="请选择" |
|||
> |
|||
<el-option label="结算" value="R0003"></el-option> |
|||
<el-option label="二配" value="R0001"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> --> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<!-- <el-button type="text" @click="dialogFormVisible = false" |
|||
>取消</el-button |
|||
> --> |
|||
<el-button @click="resetForm('formCount')">重置</el-button> |
|||
<el-button v-loading="formLoading" type="primary" @click="save" |
|||
>确认</el-button |
|||
> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination |
|||
import permission from "@/directive/permission/index.js"; |
|||
import { downloadFile } from "@/utils/crmindex.js"; |
|||
import CRMTableHead from "../../components/CRMTableHead"; |
|||
import moment from "moment"; |
|||
const cityOptions = [ |
|||
{ id: 0, name: "未结" }, |
|||
{ id: 1, name: "部分结算" }, |
|||
{ id: 2, name: "已结" }, |
|||
/* { id: 3, name: "预批量" }, */ |
|||
]; |
|||
|
|||
export default { |
|||
name: "IssuedUnsettled", |
|||
components: { Pagination, CRMTableHead }, |
|||
directives: { permission }, |
|||
|
|||
data() { |
|||
return { |
|||
crmType: "backJob", |
|||
checkedCities: [0], |
|||
cities: cityOptions, |
|||
selectValue: "", |
|||
selectNameValue: "", |
|||
radio: "0", //结算状态:0未结 1部分结算 |
|||
versionList: [], |
|||
// 是否显示详细弹出层 |
|||
openView: false, |
|||
versionValue: "", |
|||
formTitle: "", |
|||
timer: null, //定时器名称 |
|||
//当前位置 |
|||
activeIndex: 1, |
|||
//默认显示基本信息 |
|||
activeName: "first", |
|||
//步骤条步数 |
|||
stepList: [ |
|||
{ |
|||
title: "等待执行", |
|||
icon: "el-icon-sort", |
|||
}, |
|||
{ |
|||
title: "执行中", |
|||
icon: "el-icon-refresh", |
|||
}, |
|||
{ |
|||
title: "执行完成", |
|||
icon: "el-icon-check", |
|||
}, |
|||
], |
|||
customerInfos: "", |
|||
searchContent: "", // 输入内容 |
|||
form: {}, |
|||
formCount: { |
|||
name: "未结算对比", |
|||
datetime5: "", |
|||
datetime7: "", |
|||
state: [0], |
|||
}, |
|||
list: null, |
|||
totalCount: 0, |
|||
listLoading: true, |
|||
formLoading: false, |
|||
// 高级搜索 |
|||
filterObj: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
listExportQuery: { |
|||
//version: "", |
|||
//customerCode: "TH", |
|||
state: "", |
|||
begin: "", |
|||
end: "", |
|||
}, |
|||
listQuery: { |
|||
taskId: "", |
|||
name: "", |
|||
}, |
|||
page: 1, |
|||
dialogFormVisible: false, |
|||
multipleSelection: [], |
|||
tableHeight: document.documentElement.clientHeight - 260, |
|||
isEdit: false, |
|||
menuCateMap: [ |
|||
{ label: "导出", value: "导出", cssName: "warning" }, |
|||
{ label: "消息", value: "消息", cssName: "info" }, |
|||
], |
|||
stateNameCateMap: [ |
|||
{ label: "执行完成(任务成功)", value: "Succeeded", cssName: "success" }, |
|||
{ label: "执行中...", value: "Processing", cssName: "primary" }, |
|||
{ label: "执行完成(任务失败)", value: "Failed", cssName: "danger" }, |
|||
{ label: "等待执行", value: "Scheduled", cssName: "primary" }, |
|||
], |
|||
}; |
|||
}, |
|||
mounted() { |
|||
var self = this; |
|||
window.onresize = function () { |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
self.tableHeight = offsetHei - 190; |
|||
}; |
|||
this.timer = setInterval(() => { |
|||
this.listQuery.taskId = ""; |
|||
this.listQuery.stateName = ""; |
|||
setTimeout(this.getList, 0); |
|||
}, 1000 * 30); //30秒刷新一次页面 |
|||
// 通过$once来监听定时器,在beforeDestroy钩子可以被清除。 |
|||
this.$once("hook:beforeDestroy", () => { |
|||
clearInterval(timer); |
|||
}); |
|||
}, |
|||
created() { |
|||
this.getAllVersionList(); |
|||
this.getList(); |
|||
}, |
|||
beforeDestroy() { |
|||
clearInterval(this.timer); |
|||
this.timer = null; |
|||
}, |
|||
computed: { |
|||
/* 主表头 */ |
|||
getDefaultField() { |
|||
var tempsTabs = []; |
|||
|
|||
tempsTabs.push({ |
|||
label: "单据流水号", |
|||
prop: "taskId", |
|||
width: 85, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "模块名称", |
|||
prop: "name", |
|||
width: 170, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "创建人", |
|||
prop: "email", |
|||
width: 110, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "创建时间", |
|||
prop: "createdAt", |
|||
width: 150, |
|||
}); |
|||
// tempsTabs.push({ |
|||
// label: "操作名称", |
|||
// prop: "actionName", |
|||
// width: 120, |
|||
// }); |
|||
// tempsTabs.push({ |
|||
// label: "状态", |
|||
// prop: "stateName", |
|||
// width: 100, |
|||
// }); |
|||
return tempsTabs; |
|||
}, |
|||
}, |
|||
methods: { |
|||
handleCheckedCitiesChange(value) { |
|||
alert(value); |
|||
}, |
|||
/* 导出功能 */ |
|||
handleDownloadExport() { |
|||
if (this.versionValue === "") { |
|||
this.$message.error("请选择版本"); |
|||
return false; |
|||
} |
|||
this.listLoading = true; |
|||
this.listExportQuery.version = this.version; |
|||
console.log("导出条件:" + JSON.stringify(this.listExportQuery)); |
|||
this.$axios |
|||
.posts( |
|||
"/api/settleaccount/ReportMakeService/SettlSparePartExport", |
|||
this.listExportQuery |
|||
) |
|||
.then((res) => { |
|||
let taskid = res; |
|||
if (Number.isInteger(taskid)) { |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "任务生成成功!任务号:" + taskid, |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} |
|||
this.getList(); |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
getAllVersionList() { |
|||
this.$axios |
|||
.posts("/api/settleaccount/CentralizedControl/openlist") |
|||
.then((response) => { |
|||
this.versionList = []; |
|||
response.forEach((element) => { |
|||
let options = {}; |
|||
options.value = element.version; |
|||
options.label = element.version; |
|||
this.versionList.push(options); |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
checkedListChange(index) { |
|||
if (this.formCount.state.length === 0) { |
|||
this.formCount.state.push(this.cities[index].id); |
|||
} |
|||
}, |
|||
/* 重置 */ |
|||
resetForm(formName) { |
|||
//this.formCount = {}; |
|||
this.formCount.datetime5 = ""; |
|||
this.formCount.datetime7 = ""; |
|||
this.formCount.state = [0]; |
|||
}, |
|||
save() { |
|||
this.$refs.formCount.validate((valid) => { |
|||
if (valid) { |
|||
console.log("参数:" + JSON.stringify(this.formCount)); |
|||
this.formLoading = true; |
|||
this.listExportQuery.version = this.formCount.versionValue; |
|||
// this.listExportQuery.begin = this.formCount.datetime5[0]; |
|||
// this.listExportQuery.end = this.formCount.datetime5[1]; |
|||
// this.listExportQuery.state = this.formCount.state.join(','); |
|||
|
|||
console.log("导出条件:" + JSON.stringify(this.listExportQuery)); |
|||
this.$axios |
|||
.gets( |
|||
"/api/settleaccount/ReportMakeService/SettlSparePartExport", |
|||
this.listExportQuery |
|||
) |
|||
.then((res) => { |
|||
let taskid = res; |
|||
if (Number.isInteger(taskid)) { |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "任务生成成功!任务号:" + taskid, |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} |
|||
this.getList(); |
|||
this.formLoading = false; |
|||
this.dialogFormVisible = false; |
|||
}) |
|||
.catch(() => { |
|||
this.formLoading = false; |
|||
this.dialogFormVisible = false; |
|||
}); |
|||
} |
|||
}); |
|||
}, |
|||
handleCreate() { |
|||
this.$nextTick(() => { |
|||
this.$refs["formCount"].resetFields(); |
|||
}); |
|||
this.formTitle = "报表统计"; |
|||
this.isEdit = false; |
|||
this.form = {}; |
|||
this.dialogFormVisible = true; |
|||
}, |
|||
filterHandler(value, row, column) { |
|||
const property = column["property"]; |
|||
return row[property] === value; |
|||
}, |
|||
/* 任务详细信息 */ |
|||
handleView(row) { |
|||
this.listQuery.taskId = row.taskId; |
|||
this.$axios |
|||
.posts("/api/settleaccount/Job/list", this.listQuery) |
|||
.then((response) => { |
|||
this.form = response[0]; |
|||
switch (response[0].stateName) { |
|||
case "Succeeded": |
|||
case "Failed": |
|||
this.activeIndex = 3; |
|||
break; |
|||
case "Processing": |
|||
this.activeIndex = 2; |
|||
break; |
|||
case "Enqueued": |
|||
this.activeIndex = 1; |
|||
break; |
|||
} |
|||
this.openView = true; |
|||
}); |
|||
}, |
|||
/* 刷新 */ |
|||
refresh() { |
|||
this.list = []; |
|||
this.listQuery.taskId = ""; |
|||
this.listQuery.name = ""; |
|||
this.getList(); |
|||
}, |
|||
// 监听筛选项的变化 |
|||
filterChange(filterObj) { |
|||
console.log(filterObj.actionName); |
|||
if (filterObj.actionName.length > 0) { |
|||
console.log("点击筛选"); |
|||
} else { |
|||
console.log("点击重置"); |
|||
} |
|||
}, |
|||
/* 导出类型的文件 */ |
|||
downloadErrData(param) { |
|||
this.listLoading = true; |
|||
let fileNameOfProject = param; |
|||
this.$axios |
|||
.BolbGets( |
|||
"/api/settleaccount/getblobfile/download/" + fileNameOfProject |
|||
) |
|||
.then((response) => { |
|||
if (fileNameOfProject.indexOf("_") != -1) { |
|||
let downName = |
|||
fileNameOfProject.slice(0, fileNameOfProject.lastIndexOf("_")) + |
|||
fileNameOfProject.slice(fileNameOfProject.lastIndexOf(".")); |
|||
downloadFile(response, downName); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出中...", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} else { |
|||
downloadFile(response, fileNameOfProject); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出中...", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} |
|||
this.listLoading = false; |
|||
}) |
|||
.catch((error) => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
/* 刷新列表 */ |
|||
handleHandle(data) { |
|||
if (data.type !== "edit") { |
|||
this.getList(); |
|||
} |
|||
}, |
|||
/* 格式化字段 */ |
|||
fieldFormatter(row, column) { |
|||
if (column.property === "stateName") { |
|||
return { |
|||
Succeeded: "执行完成(成功)", |
|||
Processing: "执行中...", |
|||
Failed: "执行完成(失败)", |
|||
Enqueued: "等待执行", |
|||
}[row[column.property]]; |
|||
} |
|||
if (column.property == "createdAt") { |
|||
var date = row[column.property]; |
|||
if (date == undefined) { |
|||
return ""; |
|||
} |
|||
return moment(date).format("YYYY-MM-DD HH:mm:ss"); |
|||
} |
|||
return row[column.property] || "--"; |
|||
}, |
|||
handleDownload(row) { |
|||
if (row.stateName == "Succeeded") { |
|||
this.downloadErrData(row.downFileName); |
|||
} else if (row.stateName == "Failed") { |
|||
this.downloadErrData(row.error); |
|||
} |
|||
}, |
|||
getList() { |
|||
this.listLoading = true; |
|||
//导入界面中超链接过来的参数 |
|||
this.listQuery.name = "未结算对比"; |
|||
this.$axios |
|||
.posts("/api/settleaccount/Job/list", this.listQuery) |
|||
.then((response) => { |
|||
this.list = response; |
|||
setTimeout(() => { |
|||
//大数据量加载时 |
|||
this.listLoading = false; |
|||
}, 500); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
// fetchData(id) { |
|||
// //循环动态,取客户名称 |
|||
// this.$axios |
|||
// .gets("/api/settleaccount/MaterialRelationship/" + id) |
|||
// .then((response) => { |
|||
// this.form = response; |
|||
// }); |
|||
// }, |
|||
resetQuery() {}, |
|||
/** 通过回调控制style */ |
|||
cellStyle({ row, column, rowIndex, columnIndex }) { |
|||
var item = this.list[rowIndex]; |
|||
if (column.property === "stateName") { |
|||
if (item.stateName === "Succeeded") { |
|||
return { color: "#71d87f", cursor: "pointer" }; |
|||
} else if (item.stateName === "Processing") { |
|||
return { color: "#d87171", cursor: "pointer" }; |
|||
} else if (item.stateName === "Failed") { |
|||
return { color: "#ff5640", cursor: "pointer" }; |
|||
} |
|||
} |
|||
return { textAlign: "left" }; |
|||
//} |
|||
}, |
|||
headerRowStyle({ row, column, rowIndex, columnIndex }) { |
|||
if (column.property === "stateName") { |
|||
return { textAlign: "center" }; |
|||
} |
|||
return { textAlign: "center" }; |
|||
}, |
|||
handleRowClick(row, column, event) { |
|||
this.$refs.multipleTable.clearSelection(); |
|||
this.$refs.multipleTable.toggleRowSelection(row); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "../../styles/crmtable.scss"; |
|||
@import "../../styles/steps.scss"; |
|||
|
|||
/deep/ .el-checkbox input:focus { |
|||
outline: none !important; |
|||
border-color: gray; |
|||
border: 0px; |
|||
box-shadow: none !important; |
|||
} |
|||
</style> |
@ -0,0 +1,611 @@ |
|||
<!--大众看板发货功能--> |
|||
<template> |
|||
<div class="cr-body-content"> |
|||
<flexbox class="content-header"> |
|||
<XhJSSelect |
|||
:options="versionList" |
|||
style="width: 200px" |
|||
class="search-container" |
|||
@value-change="selectValue" |
|||
></XhJSSelect> |
|||
<!-- <el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="warning" |
|||
icon="el-icon-upload2" |
|||
@click="handleImportExcel()" |
|||
>导入文件(Excel) |
|||
</el-button> |
|||
<el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="primary" |
|||
icon="el-icon-download" |
|||
@click="handleDownload()" |
|||
>导出Excel |
|||
</el-button> --> |
|||
|
|||
<el-input |
|||
v-model="searchContent" |
|||
clearable |
|||
size="small" |
|||
placeholder="按照零件号搜索..." |
|||
style="width: 200px" |
|||
class="search-container" |
|||
@keyup.enter.native="handleFilter" |
|||
/> |
|||
<el-button |
|||
size="mini" |
|||
type="success" |
|||
icon="el-icon-search" |
|||
@click="handleFilter" |
|||
>搜索 |
|||
</el-button> |
|||
<!--表格头组件,filter查询--> |
|||
<c-r-m-table-head |
|||
ref="crmTableHead" |
|||
:crm-type="crmType" |
|||
@handle="handleHandle" |
|||
@filter="handleFilters" |
|||
> |
|||
</c-r-m-table-head> |
|||
<el-dropdown size="small" class="filter-item" style="margin-left:15px;font-weight:bold" @command="handleCommand"> |
|||
<span class="el-dropdown-link"> |
|||
导出数据<i class="el-icon-arrow-down el-icon--right"></i> |
|||
</span> |
|||
<el-dropdown-menu slot="dropdown"> |
|||
<el-dropdown-item command="excel" icon="el-icon-plus" |
|||
>导出Excel</el-dropdown-item |
|||
> |
|||
<el-dropdown-item command="csv" icon="el-icon-circle-plus" |
|||
>导出Csv</el-dropdown-item |
|||
> |
|||
</el-dropdown-menu> |
|||
</el-dropdown> |
|||
</flexbox> |
|||
<!--表格渲染--> |
|||
<el-table |
|||
ref="multipleTable" |
|||
v-loading.fullscreen.lock="listLoading" |
|||
element-loading-text="拼命加载中..." |
|||
element-loading-spinner="el-icon-loading" |
|||
class="cr-table" |
|||
:data="list" |
|||
:height="tableHeight" |
|||
:cell-style="cellStyle" |
|||
:header-cell-style="headerRowStyle" |
|||
size="small" |
|||
stripe |
|||
border |
|||
highlight-current-row |
|||
style="width: 100%" |
|||
@sort-change="sortChange" |
|||
@selection-change="handleSelectionChange" |
|||
@row-click="handleRowClick" |
|||
> |
|||
<!-- <el-table-column type="selection" width="44px"></el-table-column> --> |
|||
<el-table-column |
|||
label="版本" |
|||
prop="version" |
|||
sortable="custom" |
|||
align="center" |
|||
width="100px" |
|||
fixed |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-tooltip :content="scope.row.version" placement="top"> |
|||
<span class="link-type">{{ scope.row.version }}</span> |
|||
</el-tooltip> |
|||
</template> |
|||
</el-table-column> |
|||
<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" |
|||
show-overflow-tooltip |
|||
:gutter="0" |
|||
> |
|||
<template slot="header" slot-scope="scope"> |
|||
{{ scope.column.label }} |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<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" |
|||
:crmType="crmType" |
|||
@close="importExcelData" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination |
|||
import permission from "@/directive/permission/index.js"; |
|||
import importExcel from "@/components/ImportExcel-base"; |
|||
import CRMTableHead from "../../../components/CRMTableHead"; |
|||
import moment from "moment"; |
|||
import Lockr from "lockr"; |
|||
import { downloadFile } from "@/utils/crmindex.js"; |
|||
import XhJSSelect from "@/components/CreateCom/Xh-JS-Select-Label.vue"; |
|||
|
|||
export default { |
|||
name: "WMSVWKanBan", |
|||
components: { Pagination, CRMTableHead, importExcel, XhJSSelect }, |
|||
directives: { permission }, |
|||
filters: { |
|||
IsCustomerSignFilter(status) { |
|||
//翻译是否签字 |
|||
const statusMap = { |
|||
true: "是", |
|||
false: "否", |
|||
}; |
|||
return statusMap[status]; |
|||
}, |
|||
}, |
|||
props: { |
|||
customerInfos: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
crmType: "WMSKanBan", |
|||
versionValue: "", |
|||
versionList: [], //版本列表 |
|||
rules: { |
|||
//前端定义的规则,后端也有验证 |
|||
erpMaterialCode: [ |
|||
{ required: true, message: "必须输入!", trigger: "blur" }, |
|||
], |
|||
}, |
|||
searchContent: "", // 输入内容 |
|||
customerInfo: { |
|||
settleAccountId: "", |
|||
}, |
|||
form: { |
|||
dicDetailID: "", |
|||
customerId: "", |
|||
projectId: "", |
|||
}, |
|||
list: null, |
|||
totalCount: 0, |
|||
listLoading: true, |
|||
formLoading: false, |
|||
// 高级搜索 |
|||
filterObj: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
listVersionQuery: { |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
}, |
|||
listQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "Enabled", |
|||
action: 0, |
|||
value: "true", |
|||
}, //默认查询可用的 |
|||
], |
|||
//OrgID:"", |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
version: "", |
|||
site: "TH", |
|||
fileType: 0, |
|||
userId: "00000000-0000-0000-0000-000000000000", |
|||
}, |
|||
listExportQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "Enabled", |
|||
action: 0, |
|||
value: "true", |
|||
}, //默认查询可用的 |
|||
], |
|||
//OrgID:"", |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
version: "", |
|||
fileType: 0, |
|||
userId: "", |
|||
}, |
|||
page: 1, |
|||
dialogFormVisible: false, |
|||
multipleSelection: [], |
|||
formTitle: "", |
|||
drawer: false, |
|||
showExcelImport: false, |
|||
tableHeight: document.documentElement.clientHeight - 260, |
|||
isEdit: false, |
|||
}; |
|||
}, |
|||
mounted() { |
|||
var self = this; |
|||
window.onresize = function () { |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
self.tableHeight = offsetHei - 260; |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getVersionInfo(); |
|||
if (this.versionList == []) { |
|||
this.getList(); |
|||
} |
|||
}, |
|||
computed: { |
|||
/** 列表字段 */ |
|||
getDefaultField() { |
|||
var tempsTabs = []; |
|||
tempsTabs.push({ label: "看板条码号", prop: "kanban", width: 200 }); |
|||
tempsTabs.push({ label: "入库关联号", prop: "relation", width: 200 }); |
|||
tempsTabs.push({ label: "工厂", prop: "factory", width: 120 }); |
|||
tempsTabs.push({ label: "零件号", prop: "materialCode", width: 220 }); |
|||
tempsTabs.push({ label: "零件类型", prop: "partType", width: 100 }); |
|||
tempsTabs.push({ |
|||
label: "R3入库时间", |
|||
prop: "settleInputDate", |
|||
width: 150, |
|||
formType: "datetime", |
|||
}); |
|||
tempsTabs.push({ label: "供应商编码", prop: "supplierCode", width: 140 }); |
|||
tempsTabs.push({ label: "数量", prop: "qty", width: 90 }); |
|||
tempsTabs.push({ label: "批次", prop: "batch", width: 100 }); |
|||
|
|||
tempsTabs.push({ label: "入库结算标识", prop: "flag", width: 150 }); |
|||
tempsTabs.push({ |
|||
label: "结算日期", |
|||
prop: "settleDate", |
|||
width: 150, |
|||
formType: "datetime", |
|||
}); |
|||
tempsTabs.push({ label: "结算状态", prop: "state", width: 150 }); |
|||
|
|||
return tempsTabs; |
|||
}, |
|||
MoreTypes() { |
|||
var moreTypes = []; |
|||
moreTypes.push({ type: "updateFis", name: "更新FIS结算数据" }); |
|||
//moreTypes.push({ type: "enter", name: "新按钮" }); |
|||
return moreTypes; |
|||
}, |
|||
}, |
|||
methods: { |
|||
handleCommand(command) { |
|||
if (this.versionValue === "") { |
|||
this.$message.error("请先选择版本!"); |
|||
return; |
|||
} |
|||
switch (command) { |
|||
case "excel": |
|||
this.listQuery.fileType = 1; //0是csv,1是excel |
|||
break; |
|||
case "csv": |
|||
this.listQuery.fileType = 0; //0是csv,1是excel |
|||
break; |
|||
default: |
|||
//这里是没有找到对应的值处理 |
|||
break; |
|||
} |
|||
this.listLoading = true; |
|||
if (this.versionValue === "") { |
|||
this.$message.error("必需选择版本!"); |
|||
this.listLoading = false; |
|||
return; |
|||
} |
|||
if (this.versionValue != "") { |
|||
this.listQuery.version = this.versionValue; |
|||
} |
|||
console.log("大众看板导出:" + JSON.stringify(this.listQuery)); |
|||
this.$axios |
|||
.posts("/api/settleaccount/WMSVWKanBan/Export", this.listQuery) |
|||
.then((res) => { |
|||
let fileNameOfProject = res; |
|||
this.$axios |
|||
.BolbGets( |
|||
"/api/settleaccount/getblobfile/download/" + fileNameOfProject |
|||
) |
|||
.then((response) => { |
|||
if (fileNameOfProject.indexOf("_") != -1) { |
|||
let downName = |
|||
fileNameOfProject.slice( |
|||
0, |
|||
fileNameOfProject.lastIndexOf("_") |
|||
) + |
|||
fileNameOfProject.slice(fileNameOfProject.lastIndexOf(".")); |
|||
downloadFile(response, downName); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} else { |
|||
downloadFile(response, fileNameOfProject); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} |
|||
this.listLoading = false; |
|||
}); |
|||
}); |
|||
}, |
|||
//导出功能 |
|||
async handleDownload() { |
|||
this.listLoading = true; |
|||
if (this.versionValue === "") { |
|||
this.$message.error("必需选择版本!"); |
|||
this.listLoading = false; |
|||
return; |
|||
} |
|||
if (this.versionValue != "") { |
|||
this.listQuery.version = this.versionValue; |
|||
} |
|||
console.log("大众看板导出:" + JSON.stringify(this.listQuery)); |
|||
this.$axios |
|||
.posts("/api/settleaccount/WMSVWKanBan/Export", this.listQuery) |
|||
.then((res) => { |
|||
let fileNameOfProject = res; |
|||
this.$axios |
|||
.BolbGets( |
|||
"/api/settleaccount/getblobfile/download/" + fileNameOfProject |
|||
) |
|||
.then((response) => { |
|||
if (fileNameOfProject.indexOf("_") != -1) { |
|||
let downName = |
|||
fileNameOfProject.slice( |
|||
0, |
|||
fileNameOfProject.lastIndexOf("_") |
|||
) + |
|||
fileNameOfProject.slice(fileNameOfProject.lastIndexOf(".")); |
|||
downloadFile(response, downName); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} else { |
|||
downloadFile(response, fileNameOfProject); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} |
|||
this.listLoading = false; |
|||
}); |
|||
}); |
|||
}, |
|||
selectValue(params) { |
|||
//版本下拉选择 |
|||
this.versionValue = params.value; |
|||
this.getList(); |
|||
}, |
|||
selectOptionsChange(item) { |
|||
this.getList(); |
|||
}, |
|||
getVersionInfo() { |
|||
//取版本列表信息 |
|||
//this.listLoading = true; |
|||
this.listQuery.SkipCount = (this.page - 1) * 1000; |
|||
this.$axios |
|||
.posts("/api/settleaccount/WMSVWKanBan/listVersion", this.listQuery) |
|||
.then((response) => { |
|||
this.versionList = []; |
|||
response.items.forEach((element) => { |
|||
let options = {}; |
|||
options.value = element.id; |
|||
options.label = element.version; |
|||
this.versionList.push(options); |
|||
}); |
|||
if (JSON.stringify(this.versionList) != "[]") { |
|||
//因版本下拉有默认值,所以详表要自动绑定子表数据 |
|||
this.versionValue = this.versionList[0].label; |
|||
this.getList(); |
|||
} |
|||
this.listLoading = false; |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
handleImportExcel() { |
|||
//导入 |
|||
this.showExcelImport = true; |
|||
this.$refs.importexcel.handleImportExcelClick(); |
|||
}, |
|||
/** 刷新列表 */ |
|||
handleHandle(data) { |
|||
if (data.type !== "edit") { |
|||
this.getList(); |
|||
} |
|||
}, |
|||
/** 格式化字段 */ |
|||
fieldFormatter(row, column) { |
|||
// if (column.property === "state") { |
|||
// return { 0: "其他", 2: "已结" }[row[column.property]]; |
|||
// } |
|||
if ( |
|||
column.property == "settleInputDate" || |
|||
column.property == "settleDate" |
|||
) { |
|||
var date = row[column.property]; |
|||
if (date == undefined) { |
|||
return ""; |
|||
} |
|||
return moment(date).format("YYYY-MM-DD HH:mm:ss"); |
|||
} |
|||
return row[column.property] || "--"; |
|||
}, |
|||
importExcelData() { |
|||
this.getVersionInfo(); |
|||
this.listLoading = false; |
|||
//关闭导入窗体时调用 |
|||
this.showExcelImport = false; |
|||
}, |
|||
|
|||
getList() { |
|||
this.listLoading = true; |
|||
this.listQuery.SkipCount = (this.page - 1) * 10; |
|||
if (this.versionValue != "") { |
|||
this.listQuery.version = this.versionValue; |
|||
} |
|||
console.log("列表查询条件:" + JSON.stringify(this.listQuery)); |
|||
this.$axios |
|||
.posts("/api/settleaccount/WMSVWKanBan/list", this.listQuery) |
|||
.then((response) => { |
|||
this.list = response.items; |
|||
this.totalCount = response.totalCount; |
|||
setTimeout(() => { |
|||
//大数据量加载时 |
|||
this.listLoading = false; |
|||
}, 500); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
fetchData(id) { |
|||
//循环动态 |
|||
this.$axios.gets("/api/settleaccount/WMSVWKanBan/" + id).then((response) => { |
|||
this.form = response; |
|||
}); |
|||
}, |
|||
/** 筛选操作 */ |
|||
handleFilter() { |
|||
this.page = 1; |
|||
this.getList(); |
|||
this.listQuery.Filters = []; |
|||
if (this.searchContent != "") { |
|||
var column = "materialCode"; |
|||
let filter = { |
|||
logic: 0, |
|||
column: column, |
|||
action: 0, |
|||
value: this.searchContent, |
|||
}; |
|||
this.listQuery.Filters.push(filter); |
|||
} |
|||
this.getList(); |
|||
}, |
|||
/** 多项筛选操作 */ |
|||
/** 筛选操作 */ |
|||
handleFilters(data) { |
|||
if (data === null) { |
|||
this.listQuery.Filters = []; |
|||
this.getList(); //查询所有 |
|||
} else { |
|||
this.filterObj = data; |
|||
console.log("筛选" + JSON.stringify(data)); |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
var removeHeight = Object.keys(this.filterObj).length > 0 ? 310 : 240; |
|||
this.tableHeight = offsetHei - removeHeight; |
|||
this.currentPage = 1; |
|||
let Filter = []; |
|||
data.forEach((item) => { |
|||
let filter = {}; |
|||
if (item.formType === "datetime" || item.formType === "datetime") { |
|||
//日期类型的过滤条件是 (datetime >= a and datetime <=b) |
|||
filter["Column"] = item.fieldName; |
|||
filter["Logic"] = 0; |
|||
filter["Value"] = item.value[0]; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
|
|||
if (item.value[1] != null) { |
|||
filter["Value"] = item.value[1]; |
|||
filter["Action"] = 5; |
|||
Filter.push(filter); |
|||
} |
|||
} else { |
|||
filter["Column"] = item.fieldName; |
|||
filter["Value"] = item.value; |
|||
filter["Logic"] = 0; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
} |
|||
}); |
|||
console.log("筛选条件" + JSON.stringify(Filter)); |
|||
this.listQuery.Filters = Filter; |
|||
this.getList(); |
|||
} |
|||
}, |
|||
resetQuery() {}, |
|||
sortChange(data) { |
|||
const { prop, order } = data; |
|||
if (!prop || !order) { |
|||
this.handleFilter(); |
|||
return; |
|||
} |
|||
this.listQuery.Sorting = prop + " " + order; |
|||
console.log(this.listQuery.Sorting); |
|||
this.handleFilter(); |
|||
}, |
|||
handleSelectionChange(val) { |
|||
this.multipleSelection = val; |
|||
}, |
|||
/** 通过回调控制style */ |
|||
cellStyle({ row, column, rowIndex, columnIndex }) { |
|||
// if (column.property === "qty") { |
|||
// return { textAlign: "right" }; |
|||
// } else { |
|||
// return { textAlign: "left" }; |
|||
// } |
|||
return { textAlign: "left" }; |
|||
}, |
|||
/** 通过回调控制表头style */ |
|||
headerRowStyle({ row, column, rowIndex, columnIndex }) { |
|||
if (column.property === "qty") { |
|||
return { textAlign: "right", background: "#FAFAFA" }; |
|||
} else { |
|||
return { textAlign: "left", background: "#FAFAFA" }; |
|||
} |
|||
}, |
|||
handleRowClick(row, column, event) { |
|||
this.$refs.multipleTable.clearSelection(); |
|||
this.$refs.multipleTable.toggleRowSelection(row); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "../../../styles/crmtable.scss"; |
|||
</style> |
|||
<style lang="scss"> |
|||
.el-table .cell.el-tooltip { |
|||
white-space: pre-wrap; |
|||
} |
|||
</style> |
|||
|
|||
|
@ -0,0 +1,594 @@ |
|||
<!--大众备件发货功能--> |
|||
<template> |
|||
<div class="cr-body-content"> |
|||
<flexbox class="content-header"> |
|||
<XhJSSelect |
|||
:options="versionList" |
|||
style="width: 200px" |
|||
class="search-container" |
|||
@value-change="selectValue" |
|||
></XhJSSelect> |
|||
<!--<el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="warning" |
|||
icon="el-icon-upload2" |
|||
@click="handleImportExcel()" |
|||
>导入文件(Excel) |
|||
</el-button> |
|||
<el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="primary" |
|||
icon="el-icon-download" |
|||
@click="handleDownload()" |
|||
>导出Excel |
|||
</el-button> --> |
|||
|
|||
<el-input |
|||
v-model="searchContent" |
|||
clearable |
|||
size="small" |
|||
placeholder="按照零件号搜索..." |
|||
style="width: 200px" |
|||
class="search-container" |
|||
@keyup.enter.native="handleFilter" |
|||
/> |
|||
<el-button |
|||
size="mini" |
|||
type="success" |
|||
icon="el-icon-search" |
|||
@click="handleFilter" |
|||
>搜索 |
|||
</el-button> |
|||
<!--表格头组件,filter查询--> |
|||
<c-r-m-table-head |
|||
ref="crmTableHead" |
|||
:crm-type="crmType" |
|||
@handle="handleHandle" |
|||
@filter="handleFilters" |
|||
> |
|||
</c-r-m-table-head> |
|||
<el-dropdown |
|||
size="small" |
|||
class="filter-item" |
|||
style="margin-left: 15px; font-weight: bold" |
|||
@command="handleCommand" |
|||
> |
|||
<span class="el-dropdown-link"> |
|||
导出数据<i class="el-icon-arrow-down el-icon--right"></i> |
|||
</span> |
|||
<el-dropdown-menu slot="dropdown"> |
|||
<el-dropdown-item command="excel" icon="el-icon-plus" |
|||
>导出Excel</el-dropdown-item |
|||
> |
|||
<el-dropdown-item command="csv" icon="el-icon-circle-plus" |
|||
>导出Csv</el-dropdown-item |
|||
> |
|||
</el-dropdown-menu> |
|||
</el-dropdown> |
|||
</flexbox> |
|||
<!--表格渲染--> |
|||
<el-table |
|||
ref="multipleTable" |
|||
v-loading.fullscreen.lock="listLoading" |
|||
element-loading-text="拼命加载中..." |
|||
element-loading-spinner="el-icon-loading" |
|||
class="cr-table" |
|||
:data="list" |
|||
:height="tableHeight" |
|||
:cell-style="cellStyle" |
|||
:header-cell-style="headerRowStyle" |
|||
size="small" |
|||
stripe |
|||
border |
|||
highlight-current-row |
|||
style="width: 100%" |
|||
@sort-change="sortChange" |
|||
@selection-change="handleSelectionChange" |
|||
@row-click="handleRowClick" |
|||
> |
|||
<!-- <el-table-column type="selection" width="44px"></el-table-column> --> |
|||
<el-table-column |
|||
label="版本" |
|||
prop="version" |
|||
sortable="custom" |
|||
align="center" |
|||
width="100px" |
|||
fixed |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-tooltip :content="scope.row.version" placement="top"> |
|||
<span class="link-type">{{ scope.row.version }}</span> |
|||
</el-tooltip> |
|||
</template> |
|||
</el-table-column> |
|||
<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" |
|||
show-overflow-tooltip |
|||
:gutter="0" |
|||
> |
|||
<template slot="header" slot-scope="scope"> |
|||
{{ scope.column.label }} |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<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" |
|||
:crmType="crmType" |
|||
@close="importExcelData" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination |
|||
import permission from "@/directive/permission/index.js"; |
|||
//import importExcel from "@/components/ImportExcel-base"; |
|||
import CRMTableHead from "../../../components/CRMTableHead"; |
|||
import moment from "moment"; |
|||
import Lockr from "lockr"; |
|||
import { downloadFile } from "@/utils/crmindex.js"; |
|||
import XhJSSelect from "@/components/CreateCom/Xh-JS-Select-Label.vue"; |
|||
|
|||
export default { |
|||
name: "WMSSparePart", |
|||
components: { Pagination, CRMTableHead, XhJSSelect }, |
|||
directives: { permission }, |
|||
filters: { |
|||
IsCustomerSignFilter(status) { |
|||
//翻译是否签字 |
|||
const statusMap = { |
|||
true: "是", |
|||
false: "否", |
|||
}; |
|||
return statusMap[status]; |
|||
}, |
|||
}, |
|||
props: { |
|||
customerInfos: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
crmType: "wmsSparePart", |
|||
versionValue: "", |
|||
versionList: [], //版本列表 |
|||
rules: { |
|||
//前端定义的规则,后端也有验证 |
|||
erpMaterialCode: [ |
|||
{ required: true, message: "必须输入!", trigger: "blur" }, |
|||
], |
|||
}, |
|||
searchContent: "", // 输入内容 |
|||
customerInfo: { |
|||
settleAccountId: "", |
|||
}, |
|||
form: { |
|||
dicDetailID: "", |
|||
customerId: "", |
|||
projectId: "", |
|||
}, |
|||
list: null, |
|||
totalCount: 0, |
|||
listLoading: true, |
|||
formLoading: false, |
|||
// 高级搜索 |
|||
filterObj: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
listVersionQuery: { |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
}, |
|||
listQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "Enabled", |
|||
action: 0, |
|||
value: "true", |
|||
}, //默认查询可用的 |
|||
], |
|||
//OrgID:"", |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
version: "", |
|||
site: "TH", |
|||
userId: "00000000-0000-0000-0000-000000000000", |
|||
}, |
|||
listExportQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "Enabled", |
|||
action: 0, |
|||
value: "true", |
|||
}, //默认查询可用的 |
|||
], |
|||
//OrgID:"", |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
version: "", |
|||
fileType: 0, |
|||
userId: "", |
|||
}, |
|||
page: 1, |
|||
dialogFormVisible: false, |
|||
multipleSelection: [], |
|||
formTitle: "", |
|||
drawer: false, |
|||
showExcelImport: false, |
|||
tableHeight: document.documentElement.clientHeight - 260, |
|||
isEdit: false, |
|||
}; |
|||
}, |
|||
mounted() { |
|||
var self = this; |
|||
window.onresize = function () { |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
self.tableHeight = offsetHei - 260; |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getVersionInfo(); |
|||
if (this.versionList == []) { |
|||
this.getList(); |
|||
} |
|||
}, |
|||
computed: { |
|||
/** 列表字段 */ |
|||
getDefaultField() { |
|||
var tempsTabs = []; |
|||
tempsTabs.push({ label: "行号", prop: "lineNumber", width: 100 }); |
|||
tempsTabs.push({ label: "采购类型", prop: "purchaseType", width: 150 }); |
|||
tempsTabs.push({ |
|||
label: "采购订单号", |
|||
prop: "purchaseOrderNo", |
|||
width: 220, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "采购订单行项目", |
|||
prop: "purchaseOrderNoItem", |
|||
width: 170, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "采购订单文本", |
|||
prop: "purchaseOrderNoText", |
|||
width: 170, |
|||
}); |
|||
tempsTabs.push({ label: "收货数量", prop: "receiptQty", width: 120 }); |
|||
tempsTabs.push({ label: "开票数量", prop: "invoicedQty", width: 120 }); |
|||
tempsTabs.push({ label: "不含税金额", prop: "amountNoTax", width: 150 }); |
|||
tempsTabs.push({ |
|||
label: "采购价格不含税", |
|||
prop: "purchasePriceNoTax", |
|||
width: 200, |
|||
}); |
|||
tempsTabs.push({ label: "科目号", prop: "accountNum", width: 150 }); |
|||
tempsTabs.push({ label: "物料代码", prop: "materialCode", width: 180 }); |
|||
tempsTabs.push({ label: "物料描述", prop: "materialDesc", width: 250 }); |
|||
tempsTabs.push({ |
|||
label: "日期", |
|||
prop: "spareDate", |
|||
width: 150, |
|||
formType: "datetime", |
|||
}); |
|||
|
|||
tempsTabs.push({ |
|||
label: "交货单号", |
|||
prop: "deliveryOrderNo", |
|||
width: 150, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "交货行号", |
|||
prop: "deliveryLineNum", |
|||
width: 150, |
|||
}); |
|||
tempsTabs.push({ label: "批次号", prop: "batchNo", width: 150 }); |
|||
tempsTabs.push({ label: "税率", prop: "taxRate", width: 100 }); |
|||
tempsTabs.push({ label: "税码", prop: "taxCode", width: 110 }); |
|||
tempsTabs.push({ |
|||
label: "德国发票号", |
|||
prop: "germanInvoiceNo", |
|||
width: 150, |
|||
}); |
|||
tempsTabs.push({ label: "工厂", prop: "factory", width: 150 }); |
|||
tempsTabs.push({ label: "工厂名称", prop: "factoryName", width: 150 }); |
|||
return tempsTabs; |
|||
}, |
|||
}, |
|||
methods: { |
|||
handleCommand(command) { |
|||
if (this.versionValue === "") { |
|||
this.$message.error("请先选择版本!"); |
|||
return; |
|||
} |
|||
switch (command) { |
|||
case "excel": |
|||
this.listQuery.fileType = 1; //0是csv,1是excel |
|||
break; |
|||
case "csv": |
|||
this.listQuery.fileType = 0; //0是csv,1是excel |
|||
break; |
|||
default: |
|||
//这里是没有找到对应的值处理 |
|||
break; |
|||
} |
|||
this.listLoading = true; |
|||
if (this.versionValue === "") { |
|||
this.$message.error("必需选择版本!"); |
|||
this.listLoading = false; |
|||
return; |
|||
} |
|||
if (this.versionValue != "") { |
|||
this.listQuery.version = this.versionValue; |
|||
} |
|||
console.log("大众看板导出:" + JSON.stringify(this.listQuery)); |
|||
this.$axios |
|||
.posts("/api/settleaccount/WMSSparePart/Export", this.listQuery) |
|||
.then((res) => { |
|||
let fileNameOfProject = res; |
|||
this.$axios |
|||
.BolbGets( |
|||
"/api/settleaccount/getblobfile/download/" + fileNameOfProject |
|||
) |
|||
.then((response) => { |
|||
if (fileNameOfProject.indexOf("_") != -1) { |
|||
let downName = |
|||
fileNameOfProject.slice( |
|||
0, |
|||
fileNameOfProject.lastIndexOf("_") |
|||
) + |
|||
fileNameOfProject.slice(fileNameOfProject.lastIndexOf(".")); |
|||
downloadFile(response, downName); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} else { |
|||
downloadFile(response, fileNameOfProject); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} |
|||
this.listLoading = false; |
|||
}); |
|||
}); |
|||
}, |
|||
selectValue(params) { |
|||
//版本下拉选择 |
|||
this.versionValue = params.value; |
|||
this.getList(); |
|||
}, |
|||
selectOptionsChange(item) { |
|||
this.getList(); |
|||
}, |
|||
getVersionInfo() { |
|||
//取版本列表信息 |
|||
//this.listLoading = true; |
|||
this.listQuery.SkipCount = (this.page - 1) * 1000; |
|||
this.$axios |
|||
.posts("/api/settleaccount/WMSSparePart/listVersion", this.listQuery) |
|||
.then((response) => { |
|||
this.versionList = []; |
|||
response.items.forEach((element) => { |
|||
let options = {}; |
|||
options.value = element.id; |
|||
options.label = element.version; |
|||
this.versionList.push(options); |
|||
}); |
|||
if (JSON.stringify(this.versionList) != "[]") { |
|||
//因版本下拉有默认值,所以详表要自动绑定子表数据 |
|||
this.versionValue = this.versionList[0].label; |
|||
this.getList(); |
|||
} |
|||
this.listLoading = false; |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
handleImportExcel() { |
|||
//导入 |
|||
this.showExcelImport = true; |
|||
this.$refs.importexcel.handleImportExcelClick(); |
|||
}, |
|||
/** 刷新列表 */ |
|||
handleHandle(data) { |
|||
if (data.type !== "edit") { |
|||
this.getList(); |
|||
} |
|||
}, |
|||
/** 格式化字段 */ |
|||
fieldFormatter(row, column) { |
|||
// if (column.property === "state") { |
|||
// return { 0: "其他", 2: "已结" }[row[column.property]]; |
|||
// } |
|||
if ( |
|||
column.property == "settleInputDate" || |
|||
column.property == "settleDate" |
|||
) { |
|||
var date = row[column.property]; |
|||
if (date == undefined) { |
|||
return ""; |
|||
} |
|||
return moment(date).format("YYYY-MM-DD HH:mm:ss"); |
|||
} |
|||
return row[column.property] || "--"; |
|||
}, |
|||
importExcelData() { |
|||
this.getVersionInfo(); |
|||
this.listLoading = false; |
|||
//关闭导入窗体时调用 |
|||
this.showExcelImport = false; |
|||
}, |
|||
|
|||
getList() { |
|||
this.listLoading = true; |
|||
this.listQuery.SkipCount = (this.page - 1) * 10; |
|||
if (this.versionValue != "") { |
|||
this.listQuery.version = this.versionValue; |
|||
} |
|||
console.log("列表查询条件:" + JSON.stringify(this.listQuery)); |
|||
this.$axios |
|||
.posts("/api/settleaccount/WMSSparePart/list", this.listQuery) |
|||
.then((response) => { |
|||
this.list = response.items; |
|||
this.totalCount = response.totalCount; |
|||
setTimeout(() => { |
|||
//大数据量加载时 |
|||
this.listLoading = false; |
|||
}, 500); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
fetchData(id) { |
|||
//循环动态 |
|||
this.$axios |
|||
.gets("/api/settleaccount/WMSSparePart/" + id) |
|||
.then((response) => { |
|||
this.form = response; |
|||
}); |
|||
}, |
|||
/** 筛选操作 */ |
|||
handleFilter() { |
|||
this.page = 1; |
|||
this.getList(); |
|||
this.listQuery.Filters = []; |
|||
if (this.searchContent != "") { |
|||
var column = "materialCode"; |
|||
let filter = { |
|||
logic: 0, |
|||
column: column, |
|||
action: 0, |
|||
value: this.searchContent, |
|||
}; |
|||
this.listQuery.Filters.push(filter); |
|||
} |
|||
this.getList(); |
|||
}, |
|||
/** 多项筛选操作 */ |
|||
/** 筛选操作 */ |
|||
handleFilters(data) { |
|||
if (data === null) { |
|||
this.listQuery.Filters = []; |
|||
this.getList(); //查询所有 |
|||
} else { |
|||
this.filterObj = data; |
|||
console.log("筛选" + JSON.stringify(data)); |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
var removeHeight = Object.keys(this.filterObj).length > 0 ? 310 : 240; |
|||
this.tableHeight = offsetHei - removeHeight; |
|||
this.currentPage = 1; |
|||
let Filter = []; |
|||
data.forEach((item) => { |
|||
let filter = {}; |
|||
if (item.formType === "datetime" || item.formType === "datetime") { |
|||
//日期类型的过滤条件是 (datetime >= a and datetime <=b) |
|||
filter["Column"] = item.fieldName; |
|||
filter["Logic"] = 0; |
|||
filter["Value"] = item.value[0]; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
|
|||
if (item.value[1] != null) { |
|||
filter["Value"] = item.value[1]; |
|||
filter["Action"] = 5; |
|||
Filter.push(filter); |
|||
} |
|||
} else { |
|||
filter["Column"] = item.fieldName; |
|||
filter["Value"] = item.value; |
|||
filter["Logic"] = 0; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
} |
|||
}); |
|||
console.log("筛选条件" + JSON.stringify(Filter)); |
|||
this.listQuery.Filters = Filter; |
|||
this.getList(); |
|||
} |
|||
}, |
|||
resetQuery() {}, |
|||
sortChange(data) { |
|||
const { prop, order } = data; |
|||
if (!prop || !order) { |
|||
this.handleFilter(); |
|||
return; |
|||
} |
|||
this.listQuery.Sorting = prop + " " + order; |
|||
console.log(this.listQuery.Sorting); |
|||
this.handleFilter(); |
|||
}, |
|||
handleSelectionChange(val) { |
|||
this.multipleSelection = val; |
|||
}, |
|||
/** 通过回调控制style */ |
|||
cellStyle({ row, column, rowIndex, columnIndex }) { |
|||
// if (column.property === "qty") { |
|||
// return { textAlign: "right" }; |
|||
// } else { |
|||
// return { textAlign: "left" }; |
|||
// } |
|||
return { textAlign: "left" }; |
|||
}, |
|||
/** 通过回调控制表头style */ |
|||
headerRowStyle({ row, column, rowIndex, columnIndex }) { |
|||
if (column.property === "qty") { |
|||
return { textAlign: "right", background: "#FAFAFA" }; |
|||
} else { |
|||
return { textAlign: "left", background: "#FAFAFA" }; |
|||
} |
|||
}, |
|||
handleRowClick(row, column, event) { |
|||
this.$refs.multipleTable.clearSelection(); |
|||
this.$refs.multipleTable.toggleRowSelection(row); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "../../../styles/crmtable.scss"; |
|||
</style> |
|||
<style lang="scss"> |
|||
.el-table .cell.el-tooltip { |
|||
white-space: pre-wrap; |
|||
} |
|||
</style> |
|||
|
|||
|
Loading…
Reference in new issue