Browse Source

新bom任务界面和红旗未结加上是否过滤版本

branch_ccpg_220107
44673626 3 years ago
parent
commit
cedbb47635
  1. 10
      vue/src/router/modules/vw_menu.js
  2. 839
      vue/src/views/ux/billManage/BomDiffPrice/index.vue
  3. 19
      vue/src/views/ux/vw/dataInput/hq_unsettle_report/index.vue

10
vue/src/router/modules/vw_menu.js

@ -216,6 +216,16 @@ const vwMenudataRouter = {
roles: ['SettleAccount.Reports'],//控制页面角色(可以设置多个角色) roles: ['SettleAccount.Reports'],//控制页面角色(可以设置多个角色)
icon: '工厂' icon: '工厂'
} }
},
{
path: '/bom-diffPrice',
component: () => import('@/views/ux/billManage/BomDiffPrice'),
name: 'BomDiffPrice',//命名路由
meta: {
title: 'Bom定价差异明细',
roles: ['SettleAccount.Reports'],//控制页面角色(可以设置多个角色)
icon: '看板'
}
} }
] ]

839
vue/src/views/ux/billManage/BomDiffPrice/index.vue

@ -0,0 +1,839 @@
<!--大众备件结算核对-->
<template>
<div class="cr-body-content">
<!--功能栏-->
<div style="float: left">
<flexbox class="content-header">
<JobSelectVerson
:options="JobVersionList"
style="width: 150px; margin-left: -10px"
class="search-container"
@value-change="JobVersionValue"
></JobSelectVerson>
<el-button
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
>统计
</el-button>
<el-button
class="filter-item"
type="danger"
icon="el-icon-delete"
size="mini"
@click="handleDelete()"
>删除(支持批量)</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"
>说明每间隔3分钟进行自动刷新</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"
@selection-change="handleSelectionChange"
@filter-change="filterChange"
@cell-dblclick="dblhandleCurrentChange"
>
<el-table-column type="selection" width="44px"></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
show-overflow-tooltip
:gutter="0"
>
<template slot="header" slot-scope="scope">
{{ scope.column.label }}
</template>
</el-table-column>
<!-- 在线编辑说明字段 -->
<el-table-column label="说明" width="400" align="center">
<template slot-scope="scope">
<el-input
ref="inputRef"
v-if="scope.row.isEditCell"
v-model="scope.row.remark"
class="el-input"
v-focus
@blur="cellBlur(scope.row, scope.column)"
/>
<span v-else>{{ scope.row.remark }}</span>
<el-button
style="margin-left: 5px"
v-if="scope.row.isEditCell"
type="success"
icon="el-icon-check"
size="small"
circle
@click="submitName(scope.row)"
></el-button>
<el-button
v-show="scope.row.isEditCell"
class="cancel-btn"
size="mini"
icon="el-icon-refresh"
type="warning"
@click.native.prevent="handleCancel(scope.row)"
>
cancel
</el-button>
</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 == '导出' &&
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
:visible.sync="dialogFormVisible"
:close-on-click-modal="false"
:title="formTitle"
append-to-body
width="680px"
>
<el-form
ref="formCount"
:inline="true"
:rules="rules"
: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-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";
import JobSelectVerson from "@/components/CreateCom/Job-Select.vue";
export default {
name: "BomDiffPrice",
components: { Pagination, CRMTableHead, JobSelectVerson },
directives: { permission },
data() {
return {
crmType: "backJob",
rules: {
versionValue: [
{ required: true, message: "必须输入!", trigger: "change" },
],
},
datetime5: [],
JobVersionList: [],
datetime7: [],
checkedCities: [0],
selectValue: "",
selectNameValue: "",
radio: "0", //0 1
versionList: [],
materialGroupList: [],
getmaterialGroupValue: "",
//
openView: false,
versionValue: "",
materialGroupValue: "",
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: {},
formNoBill: {},
formCount: {
// name: "",
// settledate: "",
// materialCode: "",
// sapMaterialCode: "",
// chassisNumber: "",
// kennCode: "",
version: undefined,
},
list: null,
totalCount: 0,
listLoading: true,
formLoading: false,
formNoBillLoading: false,
//
filterObj: {
type: Object,
default: () => {
return {};
},
},
listExportQuery: {
version: "",
begin: undefined,
end: undefined,
},
listNoBillExportQuery: {
version: "",
},
listQuery: {
taskId: "",
name: "",
},
listBillQuery: {
version: "",
guids: [],
},
page: 1,
dialogFormVisible: false,
dialogFormNoBillVisible: 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 * 180); //30
// $oncebeforeDestroy
this.$once("hook:beforeDestroy", () => {
clearInterval(timer);
});
//this.disabledDateCp5();
},
created() {
this.getAllVersionList();
this.getList();
this.getJobVersionInfo();
},
beforeDestroy() {
clearInterval(this.timer);
this.timer = null;
},
computed: {
/* 主表头 */
getDefaultField() {
var tempsTabs = [];
tempsTabs.push({
label: "版本号",
prop: "type",
width: 120,
});
tempsTabs.push({
label: "单据流水号",
prop: "taskId",
width: 140,
});
// 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: "fileName",
width: 350,
});
return tempsTabs;
},
},
methods: {
dblhandleCurrentChange(row, column, cell, event) {
if (column.label === "说明") {
row.isEditCell = true;
this.$set(row, "isEditCell", true);
this.$nextTick(() => {
// elementautofocus
//this.$refs.inputRef.focus();
this.$refs["inputRef"].focus();
});
}
this.list = this.list.filter((item) => {
return item;
});
},
//
cellBlur(row, column) {
row.isEditCell = false;
this.$set(row, "isEditCell", false);
},
// 线
submitName(row) {
let getguid = row.id;
let getremark = row.remark;
this.$axios
.gets("/api/settleaccount/Job/updateRemark", {
p_id: getguid,
remark: getremark,
})
.then((response) => {
if (response == true) {
this.$notify({
title: "成功",
message: "更新成功",
type: "success",
duration: 2000,
});
this.getList();
}
})
.catch(() => {
this.listLoading = false;
});
},
//
handleCancel(row) {
row.isEditCell = false;
//row.stockQty = row.originalstockQty;
this.$set(row, "isEditCell", false);
// this.$message({
// message: "",
// type: "warning",
// });
this.getList();
},
getdateValCp5(val) {
this.cp5endTime = val;
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
handleDelete(row) {
this.isEdit = false;
if (this.multipleSelection.length == 0) {
this.$message({
message: "至少选择一行!",
type: "warning",
});
return;
} else {
var getbillNum = "";
//
this.multipleSelection.forEach((element) => {
let state = element.fileName;
if (state != "" && state != "已确认") {
this.isEdit = true;
getbillNum += state + ",";
}
});
}
if (this.isEdit == true) {
this.$message({
message:
"已经生成出库单的不能删除!单号:" +
getbillNum.substr(0, getbillNum.length - 1),
type: "warning",
});
return;
} else {
var params = [];
let myalert = ""; //使
if (row) {
//
params.push(row.id);
myalert = row.name;
} else {
//
this.multipleSelection.forEach((element) => {
let id = element.id;
params.push(id);
});
myalert = "选中项";
}
this.$confirm("是否删除" + myalert + "?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$axios
.posts("/api/settleaccount/Job/delete", params)
.then((response) => {
const index = this.list.indexOf(row);
this.$notify({
title: "成功",
message: "删除成功",
type: "success",
duration: 2000,
});
this.getList();
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消操作",
});
});
}
},
//
JobVersionValue(params) {
//
this.JobversionValue = params.value;
this.getList();
},
getJobVersionInfo() {
//
//this.listLoading = true;
this.listQuery.SkipCount = (this.page - 1) * 1000;
this.$axios
.posts("/api/settleaccount/Job/versionlist", this.listQuery)
.then((response) => {
let res = response.reverse(); //
this.JobVersionList = [];
res.forEach((element, index) => {
let options = {};
options.value = element;
options.label = element;
this.JobVersionList.push(options);
});
if (JSON.stringify(this.JobVersionList) != "[]") {
//
this.JobversionValue = this.JobVersionList[0].value;
this.JobversionValueVerson = this.JobVersionList[0].label;
this.getList();
}
})
.catch(() => {
//this.listLoading = false;
});
},
handleCheckedCitiesChange(value) {
alert(value);
},
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;
});
},
/* 重置 */
resetForm(formName) {
this.formCount = {};
this.datetime5 = [];
},
resetNoBillForm(formName) {
this.formNoBill = {};
},
save() {
this.$refs.formCount.validate((valid) => {
if (valid) {
this.formLoading = true;
this.listExportQuery.version = this.formCount.versionValue; //
console.log(
"Bom定价差异明细-导出条件:" + JSON.stringify(this.listExportQuery)
);
this.$axios
.gets(
"/api/settleaccount/ReportMakeService/BomDiffPrice-Make",
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() {
if (this.$refs["formCount"] !== undefined) {
this.$refs["formCount"].resetFields();
}
this.formTitle = "报表统计";
this.isEdit = false;
this.formCount = {};
this.datetime5 = [];
this.startTime = "";
this.endTime = "";
this.cp5startTime = "";
this.cp5endTime = "";
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 = "Bom定价差异明细";
this.listQuery.type = this.JobversionValue;
this.$axios
.posts("/api/settleaccount/Job/list", this.listQuery)
.then((response) => {
this.list = response;
//
this.list.forEach((element) => {
element["isEditCell"] = false;
});
setTimeout(() => {
//
this.listLoading = false;
}, 500);
})
.catch(() => {
this.listLoading = false;
});
},
resetQuery() {},
/** 通过回调控制style */
cellStyle({ row, column, rowIndex, columnIndex }) {
var item = this.list[rowIndex];
if (column.property === "fileName") {
if (item.fileName === "已确认") {
return { color: "#13CE66", cursor: "pointer", fontWeight: 700 };
} else {
return { color: "#FFBA00", cursor: "pointer", fontWeight: 800 };
}
}
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>

19
vue/src/views/ux/vw/dataInput/hq_unsettle_report/index.vue

@ -218,9 +218,9 @@
> >
<el-row> <el-row>
<el-col :md="4" :xs="24"> <el-col :md="4" :xs="24">
<el-form-item label="选择版本" required /> <el-form-item label="当期版本" required />
</el-col> </el-col>
<el-col :md="20" :xs="24" style="margin-left: -80px"> <el-col :md="16" :xs="24" style="margin-left: -80px">
<el-form-item prop="versionValue"> <el-form-item prop="versionValue">
<el-select <el-select
v-model="formCount.versionValue" v-model="formCount.versionValue"
@ -238,7 +238,13 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="4" :xs="24">
<el-checkbox style="margin-left: -120px" v-model="checked"
>是否过滤掉当期结算数据</el-checkbox
>
</el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :md="4" :xs="24"> <el-col :md="4" :xs="24">
<el-form-item label="交货日期" /> <el-form-item label="交货日期" />
@ -345,6 +351,7 @@ export default {
{ required: true, message: "必须输入!", trigger: "change" }, { required: true, message: "必须输入!", trigger: "change" },
], ],
}, },
checked: true,
showModal: false, showModal: false,
pickerOptionsCp5: { pickerOptionsCp5: {
disabledDate: (time) => { disabledDate: (time) => {
@ -442,6 +449,7 @@ export default {
warehouseDesc: undefined, warehouseDesc: undefined,
acceptNo: undefined, acceptNo: undefined,
kanban: undefined, kanban: undefined,
isContainVersion: undefined,
}, },
dataKenCode: "", dataKenCode: "",
datachassisNumber: "", datachassisNumber: "",
@ -546,7 +554,6 @@ export default {
width: 150, width: 150,
}); });
return tempsTabs; return tempsTabs;
}, },
}, },
@ -905,6 +912,12 @@ export default {
this.listExportQuery.sapCode = this.formCount.sapCode; //3 this.listExportQuery.sapCode = this.formCount.sapCode; //3
} }
if (this.checked == true) {
this.listExportQuery.isContainVersion = "0";
} else {
this.listExportQuery.isContainVersion = "1";
}
this.listExportQuery.begin = this.startTime this.listExportQuery.begin = this.startTime
? this.startTime ? this.startTime
: undefined; : undefined;

Loading…
Cancel
Save