Browse Source

前端导入功能

branch_ccpg_220107
44673626 3 years ago
parent
commit
43ed84f956
  1. 12
      vue/src/components/ImportExcel-base/index.vue
  2. 19
      vue/src/components/ImportExcel-vw/index.vue
  3. 28
      vue/src/router/modules/vwFisData.js
  4. 8
      vue/src/views/login/index.vue
  5. 213
      vue/src/views/ux/basedata/Invoice/index.vue
  6. 591
      vue/src/views/ux/vw/dataInput/ScrapClaims/index.vue
  7. 641
      vue/src/views/ux/vw/dataInput/SparePart/index.vue
  8. 2
      vue/src/views/ux/vw/dataInput/r3-open/index.vue
  9. 610
      vue/src/views/ux/vw/dataInput/vwKanBan/index.vue
  10. 191
      vue/static/tableFieldForSearch.json

12
vue/src/components/ImportExcel-base/index.vue

@ -53,7 +53,6 @@
:value="item.value" :value="item.value"
></el-option> ></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
<div class="sections"> <div class="sections">
@ -298,6 +297,11 @@ export default {
crmTypeName() { crmTypeName() {
return ( return (
{ {
invoice: "大众发票汇总",
vWKanBan: "大众看板结算明细",
scrapClaims: "CP7报废和索赔",
sparePart: "大众备件结算明细",
bomdatabase: "产品结构BOM", bomdatabase: "产品结构BOM",
prebatch: "预批量", prebatch: "预批量",
secondaryPriceRatio: "二配结算价格比例", secondaryPriceRatio: "二配结算价格比例",
@ -319,6 +323,11 @@ export default {
getWebApi() { getWebApi() {
return ( return (
{ {
invoice: "/api/settleaccount/Invoices/ExcelImport", //
vWKanBan: "/api/settleaccount/VWKanBan/ExcelImport", //
scrapClaims: "/api/settleaccount/ScrapClaims/ExcelImport", //CP7
sparePart: "/api/settleaccount/SparePart/ExcelImport", //
bomdatabase: "/api/settleaccount/bom/ExcelImport", bomdatabase: "/api/settleaccount/bom/ExcelImport",
prebatch: "/api/settleaccount/Prebatch/ExcelImport", prebatch: "/api/settleaccount/Prebatch/ExcelImport",
secondaryPriceRatio: secondaryPriceRatio:
@ -347,6 +356,7 @@ export default {
// //
return ( return (
{ {
invoice: "大众发票汇总导入.xlsx",
bomdatabase: "产品结构Bom导入模板.xlsx", bomdatabase: "产品结构Bom导入模板.xlsx",
secondaryPriceRatio: "二配价格比例导入模板.xlsx", secondaryPriceRatio: "二配价格比例导入模板.xlsx",
factory: "工厂设置模板.xlsx", factory: "工厂设置模板.xlsx",

19
vue/src/components/ImportExcel-vw/index.vue

@ -545,25 +545,6 @@ export default {
",请在后台作业监控界面中查看进度!"; ",请在后台作业监控界面中查看进度!";
this.stepsActive = 4; this.stepsActive = 4;
} }
// if (res === "Success") {
// if (this.isLt2M === "1" && this.isFileType === "1") {
// this.$notify({
// title: "",
// message: "",
// type: "success",
// duration: 2000,
// });
// this.stepList[1].status = "finish";
// this.resultData.successMessage = "";
// this.stepsActive = 4;
// }
// } else {
// this.stepList[0].status = "wait";
// this.resultData.errTemplate = res; //
// this.resultData.errSize = 1; //0
// this.resultData.successMessage = "";
// this.stepsActive = 3;
// }
console.log(this.stepsActive); console.log(this.stepsActive);
this.$emit("status", "finish"); this.$emit("status", "finish");
// this.$nextTick(() => { // this.$nextTick(() => {

28
vue/src/router/modules/vwFisData.js

@ -2,9 +2,9 @@
import Layout from '@/layout' import Layout from '@/layout'
const vwFisDataRouter = { const vwFisDataRouter = {
path: '/jskp', path: '/pg',
component: Layout, component: Layout,
redirect: 'jskp', redirect: 'pg',
name: '业务数据', name: '业务数据',
//hidden: true, //hidden: true,
meta: { meta: {
@ -18,7 +18,7 @@ const vwFisDataRouter = {
children: [ children: [
{ {
path: '/settleAccount', path: '/settleAccount',
component: () => import('@/views/ux/vw/dataInput/r3'), component: () => import('@/views/ux/vw/dataInput/r3-open'),
name: 'SettleAccount',//命名路由 name: 'SettleAccount',//命名路由
meta: { meta: {
title: 'FIS未结算数据导入', title: 'FIS未结算数据导入',
@ -28,7 +28,7 @@ const vwFisDataRouter = {
}, },
{ {
path: '/settleAccount-finish', path: '/settleAccount-finish',
component: () => import('@/views/ux/vw/dataInput/r3-open'), component: () => import('@/views/ux/vw/dataInput/r3'),
name: 'SettleAccount',//命名路由 name: 'SettleAccount',//命名路由
meta: { meta: {
title: 'FIS已结算数据导入', title: 'FIS已结算数据导入',
@ -47,19 +47,19 @@ const vwFisDataRouter = {
} }
}, },
{ {
path: 'itemInvoicePrice', path: 'kanBan',
component: () => import('@/views/ux/vw/dataInput/itemInvoicePrice/index'), component: () => import('@/views/ux/vw/dataInput/vwKanBan/index'),
name: 'ItemInvoicePrice',//命名路由 name: 'VWKanBan',//命名路由
meta: { meta: {
title: '看板结算明细导入', title: '看板结算明细导入',
roles: ['SettleAccount.ItemInvoicePrices'], //roles: ['SettleAccount.ItemInvoicePrices'],
icon: '发运' icon: '发运'
} }
}, },
{ {
path: '/fis', path: '/scrapClaims',
component: () => import('@/views/ux/vw/dataInput/fis'), component: () => import('@/views/ux/vw/dataInput/ScrapClaims'),
name: 'FIS', name: 'ScrapClaims',
meta: { meta: {
title: 'CP7报废和索赔导入', title: 'CP7报废和索赔导入',
roles: ['SettleAccount.FISs'], roles: ['SettleAccount.FISs'],
@ -68,9 +68,9 @@ const vwFisDataRouter = {
}, },
{ {
path: '/SettlementCrossReference', path: '/SparePart',
component: () => import('@/views/ux/vw/dataInput/SettlementCrossReference'), component: () => import('@/views/ux/vw/dataInput/SparePart'),
name: 'SettlementCrossReference',//命名路由 name: 'SparePart',//命名路由
meta: { meta: {
title: '大众备件结算明细导入', title: '大众备件结算明细导入',
roles: ['SettleAccount.Boms'],//控制页面角色(可以设置多个角色) roles: ['SettleAccount.Boms'],//控制页面角色(可以设置多个角色)

8
vue/src/views/login/index.vue

@ -1,11 +1,11 @@
<template> <template>
<div class="wrapper"> <div class="wrapper">
<div class="left"> <div class="left">
<<<<<<< .mine
<div class="container"><span class="one">SAS/JIT-长春派格汽车塑料技术有限公司结算管理系统</span><span class="two"></span></div> <div class="container"><span class="one">SAS/JIT-长春派格汽车塑料技术有限公司结算管理系统</span><span class="two"></span></div>
=======
<div class="container"><span class="one">闻荫科技-长春派格结算管理系统</span><span class="two"></span></div> <!-- <div class="container"><span class="one">闻荫科技-长春派格结算管理系统</span><span class="two"></span></div> -->
>>>>>>> .theirs
<div class="left-pic"/> <div class="left-pic"/>
<div class=""> <div class="">
<div class="copyright"> <div class="copyright">

213
vue/src/views/ux/basedata/Invoice/index.vue

@ -16,14 +16,32 @@
@click="handleImportExcel()" @click="handleImportExcel()"
>导入文件Excel >导入文件Excel
</el-button> </el-button>
<el-button <!-- <el-button
class="filter-item" class="filter-item"
size="mini" size="mini"
type="info" type="primary"
icon="el-icon-download" icon="el-icon-download"
@click="handleDownload()" @click="handleDownload()"
>导出Excel >导出Excel
</el-button> </el-button> -->
<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>
<el-input <el-input
v-model="searchContent" v-model="searchContent"
clearable clearable
@ -123,7 +141,7 @@
<script> <script>
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import permission from "@/directive/permission/index.js"; import permission from "@/directive/permission/index.js";
import importExcel from "@/components/ImportExcel-invoice"; import importExcel from "@/components/ImportExcel-base";
import CRMTableHead from "../../components/CRMTableHead"; import CRMTableHead from "../../components/CRMTableHead";
import moment from "moment"; import moment from "moment";
import Lockr from "lockr"; import Lockr from "lockr";
@ -247,30 +265,14 @@ export default {
getDefaultField() { getDefaultField() {
var tempsTabs = []; var tempsTabs = [];
tempsTabs.push({ label: "工厂", prop: "factory", width: 150 }); tempsTabs.push({ label: "工厂", prop: "factory", width: 150 });
tempsTabs.push({ label: "物料凭证", prop: "textCode", width: 150 });
tempsTabs.push({ label: "物料号", prop: "materialCode", width: 150 }); tempsTabs.push({ label: "物料号", prop: "materialCode", width: 150 });
tempsTabs.push({ tempsTabs.push({
label: "物料描述", label: "零件名称",
prop: "materialDesc", prop: "materialDesc",
width: 280, width: 280,
}); });
tempsTabs.push({
label: "入库日期",
prop: "date",
width: 150,
formType: "datetime",
});
tempsTabs.push({ label: "数量", prop: "qty", width: 100 }); tempsTabs.push({ label: "数量", prop: "qty", width: 100 });
tempsTabs.push({ label: "金额", prop: "amt", width: 120 }); tempsTabs.push({ label: "金额", prop: "amt", width: 120 });
tempsTabs.push({ label: "货币", prop: "number", width: 120 });
tempsTabs.push({ label: "工厂名称", prop: "accounting", width: 120 });
tempsTabs.push({
label: "过账日期",
prop: "accountDate",
width: 150,
formType: "datetime",
});
return tempsTabs; return tempsTabs;
}, },
MoreTypes() { MoreTypes() {
@ -281,6 +283,116 @@ export default {
}, },
}, },
methods: { methods: {
handleCommand(command) {
if (this.versionValue === "") {
this.$message.error("请先选择版本!");
return;
}
switch (command) {
case "excel":
this.listQuery.fileType = 1; //0csv,1excel
break;
case "csv":
this.listQuery.fileType = 0; //0csv,1excel
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/Invoices/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/Invoices/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) { selectValue(params) {
// //
this.versionValue = params.value; this.versionValue = params.value;
@ -310,7 +422,7 @@ export default {
} }
}) })
.catch(() => { .catch(() => {
//this.listLoading = false; this.listLoading = false;
}); });
}, },
handleImportExcel() { handleImportExcel() {
@ -329,14 +441,6 @@ export default {
if (column.property === "state") { if (column.property === "state") {
return { 0: "其他", 2: "已结" }[row[column.property]]; return { 0: "其他", 2: "已结" }[row[column.property]];
} }
if (column.property == "accountDate" || column.property == "date") {
var date = row[column.property];
if (date == undefined) {
return "";
}
//return moment(date).format("YYYY-MM-DD HH:mm:ss");
return moment(date).format("YYYY-MM-DD");
}
return row[column.property] || "--"; return row[column.property] || "--";
}, },
importExcelData() { importExcelData() {
@ -345,54 +449,7 @@ export default {
// //
this.showExcelImport = false; this.showExcelImport = 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/Invoices/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;
});
});
},
getList() { getList() {
this.listLoading = true; this.listLoading = true;
this.listQuery.SkipCount = (this.page - 1) * 10; this.listQuery.SkipCount = (this.page - 1) * 10;

591
vue/src/views/ux/vw/dataInput/ScrapClaims/index.vue

@ -0,0 +1,591 @@
<!--CP7和索赔导入功能-->
<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-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>
<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>
</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: "ScrapClaims",
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: "scrapClaims",
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: "type", width: 170 });
tempsTabs.push({ label: "零件号", prop: "materialCode", width: 220 });
tempsTabs.push({ label: "零件名称", prop: "materialDesc", width: 220 });
tempsTabs.push({ label: "数量", prop: "qty", width: 100 });
tempsTabs.push({ label: "金额", prop: "amt", width: 100 });
return tempsTabs;
},
},
methods: {
handleCommand(command) {
if (this.versionValue === "") {
this.$message.error("请先选择版本!");
return;
}
switch (command) {
case "excel":
this.listQuery.fileType = 1; //0csv,1excel
break;
case "csv":
this.listQuery.fileType = 0; //0csv,1excel
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("CP7报废与索赔导出:" + JSON.stringify(this.listQuery));
this.$axios
.posts("/api/settleaccount/ScrapClaims/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/ScrapClaims/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/ScrapClaims/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/ScrapClaims/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/ScrapClaims/" + 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>

641
vue/src/views/ux/vw/dataInput/SparePart/index.vue

@ -0,0 +1,641 @@
<!--大众备件导入功能-->
<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-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>
<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>
</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: "SparePart",
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: "sparePart",
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; //0csv,1excel
break;
case "csv":
this.listQuery.fileType = 0; //0csv,1excel
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/SparePart/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/SparePart/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/SparePart/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/SparePart/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/SparePart/" + 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>

2
vue/src/views/ux/vw/dataInput/r3-open/index.vue

@ -183,7 +183,7 @@ export default {
}, },
data() { data() {
return { return {
crmType: "UnSettleAccount", crmType: "unSettleAccount",
versionValue: "", versionValue: "",
versionValueVerson: "", versionValueVerson: "",
versionList: [], // versionList: [], //

610
vue/src/views/ux/vw/dataInput/vwKanBan/index.vue

@ -0,0 +1,610 @@
<!--大众看板导入功能-->
<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-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>
<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>
</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: "VWKanBan",
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: "vWKanBan",
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; //0csv,1excel
break;
case "csv":
this.listQuery.fileType = 0; //0csv,1excel
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/VWKanBan/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/VWKanBan/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/VWKanBan/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/VWKanBan/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/VWKanBan/" + 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>

191
vue/static/tableFieldForSearch.json

@ -2461,5 +2461,196 @@
"setting": [] "setting": []
} }
] ]
},
"vWKanBan": {
"id": "36",
"data": [
{
"fieldId": 1,
"formType": "text",
"name": "看板条码号",
"type": 1,
"value": "",
"fieldType": 1,
"fieldName": "kanban",
"setting": []
},
{
"fieldId": 2,
"formType": "text",
"name": "工厂",
"type": 1,
"value": "",
"fieldType": 1,
"fieldName": "factory",
"setting": []
},
{
"fieldId": 3,
"formType": "text",
"name": "零件号",
"type": 1,
"value": "",
"fieldType": 1,
"fieldName": "materialCode",
"setting": []
},
{
"fieldId": 4,
"formType": "text",
"name": "零件类型",
"type": 1,
"value": "",
"fieldType": 1,
"fieldName": "partType",
"setting": []
},
{
"fieldId": 5,
"formType": "text",
"name": "供应商编码",
"type": 1,
"value": "",
"fieldType": 1,
"fieldName": "supplierCode",
"setting": []
},
{
"fieldId": 6,
"formType": "text",
"name": "入库结算标识",
"type": 1,
"value": "",
"fieldType": 1,
"fieldName": "flag",
"setting": []
},
{
"fieldId": 15,
"formType": "text",
"name": "结算状态",
"type": 1,
"value": "",
"fieldType": 1,
"fieldName": "state",
"setting": []
}
]
},
"scrapClaims": {
"id": "36",
"data": [
{
"fieldId": 2,
"formType": "select",
"isNull": 0,
"name": "类型(报废和索赔)",
"options": "",
"type": 3,
"value": "",
"fieldType": 0,
"fieldName": "type",
"setting": [
"CP7报废,CP7报废",
"索赔,索赔"
]
},
{
"fieldId": 3,
"formType": "text",
"name": "零件号",
"type": 1,
"value": "",
"fieldType": 1,
"fieldName": "materialCode",
"setting": []
},
{
"fieldId": 5,
"formType": "text",
"name": "零件名称",
"type": 1,
"value": "",
"fieldType": 1,
"fieldName": "materialDesc",
"setting": []
}
]
},
"sparePart": {
"id": "36",
"data": [
{
"fieldId": 3,
"formType": "text",
"name": "采购类型",
"type": 1,
"value": "",
"fieldType": 1,
"fieldName": "purchaseType",
"setting": []
},
{
"fieldId": 5,
"formType": "text",
"name": "采购订单号",
"type": 1,
"value": "",
"fieldType": 1,
"fieldName": "purchaseOrderNo",
"setting": []
},
{
"fieldId": 5,
"formType": "text",
"name": "物料代码",
"type": 1,
"value": "",
"fieldType": 1,
"fieldName": "materialCode",
"setting": []
},
{
"fieldId": 5,
"formType": "text",
"name": "交货单号",
"type": 1,
"value": "",
"fieldType": 1,
"fieldName": "deliveryOrderNo",
"setting": []
},
{
"fieldId": 5,
"formType": "text",
"name": "批次号",
"type": 1,
"value": "",
"fieldType": 1,
"fieldName": "batchNo",
"setting": []
},
{
"fieldId": 5,
"formType": "text",
"name": "工厂",
"type": 1,
"value": "",
"fieldType": 1,
"fieldName": "factory",
"setting": []
},
{
"fieldId": 5,
"formType": "text",
"name": "工厂名称",
"type": 1,
"value": "",
"fieldType": 1,
"fieldName": "factoryName",
"setting": []
}
]
} }
} }
Loading…
Cancel
Save