Commit f4bcfba6 authored by 仇晓婷's avatar 仇晓婷

yangsshi

parent 006fbe8a
@import "./custom.less";
@import "./iview-reset.less";
html body {
min-width: 1240px;
color: @body-color;
......@@ -879,7 +880,7 @@ textarea::-webkit-input-placeholder {
display: none;
}
// 纵横树的样式
// 树的样式
.zh-tree {
// position: relative;
display: block;
......@@ -888,8 +889,8 @@ textarea::-webkit-input-placeholder {
transform: translateX(0);
transition: all .2s;
box-sizing: border-box;
border: #E4E6ED solid 1px;
background: #fff;
border: @left-boder-color solid 1px;
background: @left-tree-bg;
padding: 0px 10px 20px 10px;
margin-top: 10px;
......@@ -899,7 +900,7 @@ textarea::-webkit-input-placeholder {
line-height: 45px;
text-align: left;
font-weight: 600;
border-bottom: #e4e6ed solid 1px;
border-bottom: @left-tree-header-boder-color solid 1px;
}
.zh-box {
......@@ -925,9 +926,9 @@ textarea::-webkit-input-placeholder {
box-sizing: border-box;
transition: all .2s;
background: #fff;
background: @right-bg;
// border-radius:3px;
padding: 0px 10px 10px 0px;
padding: 10px;
margin-top: 10px;
// box-shadow: 0 0 5px rgba(0, 0, 0, .15);
}
......@@ -1038,12 +1039,12 @@ textarea::-webkit-input-placeholder {
}
.divIco:hover {
background: #F5F6FA;
background: @right-icon-color-hover;
}
.icoListInfo {
font-weight: bold;
color: #515A6E;
color: @right-icon-color;
font-size: 24px;
}
......@@ -1397,7 +1398,7 @@ html [type=button] {
}
.content {
background: white;
background: @layout-content-bg-color;
padding: 0 0 0 10px;
//position: absolute;
left: 250px;
......@@ -1462,9 +1463,9 @@ html [type=button] {
}
.menu_side {
background: #fff !important;
// background: #fff !important;
margin: 5px 0 0 0 !important;
border: 1px solid #dcdee2 !important;
// border: 1px solid #dcdee2 !important;
}
.show_menu {
......
//定义变量
//@import './themes/deepBlank.less';
// @import './themes/green.less';
@import './themes/default.less';
@import './themes/default.less';
......@@ -95,35 +95,6 @@
background-color: @primary-color;
}
.ivu-page-item-active {
background-color: @primary-color;
color: white;
}
.ivu-page-item-active:hover {
background-color: @primary-color;
// background-color: #d7e8fb;
a {
color: white !important;
}
}
.ivu-page-item-active>a {
color: white
}
.ivu-page-item-active>a:hover {
color: white
}
.ivu-page li:hover {
color: white
}
.ivu-page-item-active:hover a {
color: #fff;
}
.ivu-input-search {
cursor: pointer;
......@@ -231,26 +202,6 @@
background-color: @primary-color;
}
//鼠标经过table hover及选择行后的背景色
.ivu-table-row-hover td {
background: #EFF8F7 !important;
}
.ivu-table-row-highlight td {
background-color: #EFF8F7 !important;
}
.ivu-dropdown-rel:hover {
.ivu-btn-text {
background-color: @primary-color;
}
}
//表格字体颜色
.ivu-table {
color: @table-color !important;
}
//校验不通过下面提示红色小字
.ivu-form-item-error-tip {
......@@ -451,6 +402,10 @@
.ivu-tree-title {
color: @tree-title-color !important;
span {
color: @tree-title-color !important;
}
}
.ivu-btn-group>.ivu-btn {
......@@ -458,3 +413,130 @@
opacity: 0.8;
background: @group-btn-bg-color;
}
.ivu-layout {
height: 100%;
background: @layout-content-bg-color !important;
}
//分页
.ivu-page-item-active {
background-color: @page-active-bg !important;
color: white;
}
.ivu-page-item-active:hover {
background-color: @page-active-color-hover;
// background-color: #d7e8fb;
a {
color: white !important;
}
}
.ivu-page-item-active>a {
color: white
}
.ivu-page-item-active>a:hover {
color: white
}
.ivu-page li:hover {
color: white
}
.ivu-page-item-active:hover a {
color: #fff;
}
.ivu-page-prev,
.ivu-page-next {
background: @page-bg !important;
}
.ivu-page-item {
background: @page-bg !important;
}
.ivu-page.mini .ivu-page-options-elevator input {
background: @page-bg;
border: 1px solid @page-bg;
color: @page-color;
opacity: 0.7;
}
.ivu-select-selected-value {
color: @page-color;
opacity: 0.7;
}
//表格
.ivu-table-header thead tr th {
background: @table-header-bg !important; //f5f6fa
border: 1px solid @table-header-border !important;
}
.ivu-table-body {
background-color: @table-body-bg;
}
.ivu-table td {
background-color: @table-body-bg !important;
}
.tableCommon tr td {
background-color: @tableCommon-bg;
border: 1px solid @tableCommon-boder !important;
}
.ivu-table:before {
//表格下边框线
background-color: @table-boder !important;
}
.ivu-table-border:after {
//表格右边框线
background-color: @table-boder !important;
}
.ivu-table-wrapper-with-border {
//表格上,左边框线
// border: 1px solid @table-boder !important;
}
//鼠标经过table hover及选择行后的背景色
.ivu-table-row-hover td {
background: @table-row-hover !important;
}
.ivu-table-row-highlight td {
background-color: @table-row-hover !important;
}
.ivu-dropdown-rel:hover {
.ivu-btn-text {
background-color: @primary-color;
}
}
//表格字体颜色
.ivu-table {
color: @table-color !important;
}
// e8eaec
// EFF8F7
......@@ -55,6 +55,7 @@
//表单的颜色
@form-color: #fff;
@form-footer-color: #fff;
......@@ -72,7 +73,34 @@
//左侧列表
@left-tree-bg: #2F2F57;
@left-tree-header-bg-color: #2F2F57;
@left-tree-header-boder-color: #106FFE;
@left-tree-header-color: #fff;
@tree-title-color: #fff;
@group-btn-bg-color:#2F2F57;
@group-btn-color:#F5F6FA;
\ No newline at end of file
@group-btn-bg-color: #2F2F57;
@group-btn-color: #F5F6FA;
@left-boder-color: #2F2F57;
//右侧
@right-header-bg: #2F2F57;
@right-bg: #2F2F57;
@right-icon-color: #fff;
@right-icon-color-hover: #106FFE;
//分页
@page-active-bg: #222341;
@page-active-color-hover: #fff;
@page-bg: #222341;
@page-color:#fff;
//表格
@table-header-bg:#106FFE;
@table-header-border:#106FFE;
@table-body-bg:#222341;
@tableCommon-bg:#222341;
@tableCommon-boder:#222341;
@table-boder:#222341;
@table-row-hover:#2F2F57;
\ No newline at end of file
......@@ -12,11 +12,12 @@
@layout-header: #515A6E;
@layout-tabs: #f5f7f9;
@layout-tabs-close: #515A6E;
@layout-tabs-bg-close:#fff;
@layout-tabs-bg-close: #fff;
@tabs-bg-tag: #fff;
//bady颜色
@layout-content-bg-color: #fff;
@card-bg: #fff;
@body-color: #515a6e;
@border-color: #dcdfe6;
......@@ -58,9 +59,9 @@
//表单的颜色
@form-color: #515a6e;
@form-footer-color: #fff;
@form-divider-boder-color:#e8eaec;
@input-bg-color:#fff;
@input-boder-color:#dcdee2;
@form-divider-boder-color: #e8eaec;
@input-bg-color: #fff;
@input-boder-color: #dcdee2;
......@@ -71,9 +72,34 @@
//左侧列表
@left-tree-bg:#fff;
@left-tree-bg: #fff;
@left-tree-header-bg-color: #f5f6fa;
@left-tree-header-boder-color: #fff;
@left-tree-header-color: #515a6e;
@tree-title-color:#515a6e;
@group-btn-bg-color:#fff;
@group-btn-color:#515a6e;
\ No newline at end of file
@tree-title-color: #515a6e;
@group-btn-bg-color: #fff;
@group-btn-color: #515a6e;
@left-boder-color: #dcdee2;
//右侧
@right-header-bg: #fff;
@right-bg: #fff;
@right-icon-color: #515A6E;
@right-icon-color-hover: #F5F6FA;
//分页
@page-active-bg: #fff;
@page-active-color-hover: #515A6E;
@page-bg: #fff;
@page-color: #515A6E;
//表格
@table-header-bg: #e8eaec;
@table-header-border: #e8eaec;
@table-body-bg: #fff;
@tableCommon-bg: #fff;
@tableCommon-boder: #fff;
@table-boder: #e8eaec;
@table-row-hover: #EFF8F7;
......@@ -12,7 +12,7 @@
@layout-header: #515A6E;
@layout-tabs: #f5f7f9;
@layout-tabs-close: #515A6E;
@layout-tabs-bg-close:#fff;
@layout-tabs-bg-close: #fff;
@tabs-bg-tag: #fff;
//bady颜色
......@@ -57,9 +57,9 @@
//表单的颜色
@form-color: #515a6e;
@form-footer-color: #fff;
@form-divider-boder-color:#e8eaec;
@input-bg-color:#fff;
@input-boder-color:#dcdee2;
@form-divider-boder-color: #e8eaec;
@input-bg-color: #fff;
@input-boder-color: #dcdee2;
......@@ -70,9 +70,35 @@
//左侧列表
@left-tree-bg:#fff;
@left-tree-bg: #fff;
@left-tree-header-bg-color: #f5f6fa;
@left-tree-header-boder-color: #fff;
@left-tree-header-color: #515a6e;
@tree-title-color:#515a6e;
@group-btn-bg-color:#fff;
@group-btn-color:#515a6e;
\ No newline at end of file
@tree-title-color: #515a6e;
@group-btn-bg-color: #fff;
@group-btn-color: #515a6e;
@left-boder-color: #dcdee2;
//右侧
@right-header-bg: #fff;
@right-bg: #fff;
@right-icon-color: #515A6E;
@right-icon-color-hover: #F5F6FA;
//分页
@page-active-bg: #fff;
@page-active-color-hover: #515A6E;
@page-bg: #fff;
@page-color: #515A6E;
//表格
@table-header-bg: #e8eaec;
@table-header-border: #e8eaec;
@table-body-bg: #fff;
@tableCommon-bg: #fff;
@tableCommon-boder: #fff;
@table-boder: #e8eaec;
@table-row-hover: #EFF8F7;
<template>
<Table
:loading="loading"
border
highlight-row
ref="table"
:columns="tcolumn"
......
<template>
<div class="table-content">
<div class="table-content">
<div class="table-tools" v-if="tool">
<div class="table-search">
<slot name="easySearch" v-if="easy">
<Form inline>
<FormItem>
<Input search enter-button :placeholder="placeholder" @on-search="easySearch" v-width="300" v-model="keys" />
</FormItem>
<FormItem>
<Button v-if="high" @click="modalSearch=true" type="text">
<Icon type="md-search" />高级
</Button>
</FormItem>
</Form>
</slot>
</div>
<div class="table-search">
<slot name="easySearch" v-if="easy">
<Form inline>
<FormItem>
<Input
search
enter-button
:placeholder="placeholder"
@on-search="easySearch"
v-width="300"
v-model="keys"
/>
</FormItem>
<FormItem>
<Button v-if="high" @click="modalSearch=true" type="text">
<Icon type="md-search" />高级
</Button>
</FormItem>
</Form>
</slot>
</div>
<div class="searchBack">
<slot name="searchBack"></slot>
</div>
<div class="btns">
<slot name="buttons"></slot>
<Button @click="export2Excel" v-if="exportTitle.length>0">
导出
</Button>
<Button v-if="set&&type=='table'" @click="config=!config">
<Icon type="md-build" title="列设置" />
</Button>
</div>
<div class="searchBack">
<slot name="searchBack"></slot>
</div>
<div class="btns">
<slot name="buttons"></slot>
<Button @click="export2Excel" v-if="exportTitle.length>0">导出</Button>
<Button v-if="set&&type=='table'" @click="config=!config">
<Icon type="md-build" title="列设置" />
</Button>
</div>
</div>
<div class="table-main" ref="main">
<Row v-if="type=='card'" :gutter="40">
<Col :span="span" v-for="(row,i) in list" :key="i">
<slot name="card" :row="row">
<span>{{row.id}}</span>
</slot>
</Col>
</Row>
<Table v-else :border="border" :columns="columnsNow" :data="list" :height="tableHeight" :draggable="draggable" ref="table" class="tableCommon" @on-expand="expand" @on-drag-drop="onDragDrop" @on-selection-change="selectionChange" @on-select="onSelect" @on-select-all="allChange" :row-key="rowKey"></Table>
<Row v-if="type=='card'" :gutter="40">
<Col :span="span" v-for="(row,i) in list" :key="i">
<slot name="card" :row="row">
<span>{{row.id}}</span>
</slot>
</Col>
</Row>
<Table
v-else
:border="border"
:columns="columnsNow"
:data="list"
:height="tableHeight"
:draggable="draggable"
ref="table"
class="tableCommon"
@on-expand="expand"
@on-drag-drop="onDragDrop"
@on-selection-change="selectionChange"
@on-select="onSelect"
@on-select-all="allChange"
:row-key="rowKey"
stripe
></Table>
</div>
<div class="table-footer">
<slot name="footer"></slot>
<Page v-if="page" :total="search.total" :current="search.page" class="fr" show-total size="small" show-elevator show-sizer :page-size="search.pageSize" :page-size-opts="pageSizeOpts" @on-change="pageChange" @on-page-size-change="pageSizeChange" />
<slot name="footer"></slot>
<Page
v-if="page"
:total="search.total"
:current="search.page"
class="fr"
show-total
size="small"
show-elevator
show-sizer
:page-size="search.pageSize"
:page-size-opts="pageSizeOpts"
@on-change="pageChange"
@on-page-size-change="pageSizeChange"
/>
</div>
<Modal v-if="high" v-model="modalSearch" title="高级搜索" draggable width="800" ref="search">
<slot name="searchForm"></slot>
<div slot="footer">
<Button @click="modalSearch=false" style="margin-left:20px;">取消</Button>
<Button @click="complexSearch" type="primary" style="margin-left:10px;">查询</Button>
</div>
<slot name="searchForm"></slot>
<div slot="footer">
<Button @click="modalSearch=false" style="margin-left:20px;">取消</Button>
<Button @click="complexSearch" type="primary" style="margin-left:10px;">查询</Button>
</div>
</Modal>
<Drawer title="列设置" v-if="set" v-model="config" :scrollable="true" placement="left" :mask="false">
<div slot="header">
列设置
<a @click="undoConfig" class="ml50">
<Icon type="md-refresh" title="恢复初始设置" />
</a>
</div>
<ul class="table-columns">
<li v-for="(li,index) in columnsCur" :key="index" v-dragging="{ item: li, list: columnsCur, group: 'li' }">
<label @click="columnChange(li,index)" :class="{dis:li.hide}">
<Icon :type="li.hide?'md-eye-off':'md-eye'" size="16" class="mr10" />
<span>{{li.title}}</span>
</label>
<Icon type="ios-move" class="move" size="18" />
</li>
</ul>
<Drawer
title="列设置"
v-if="set"
v-model="config"
:scrollable="true"
placement="left"
:mask="false"
>
<div slot="header">
列设置
<a @click="undoConfig" class="ml50">
<Icon type="md-refresh" title="恢复初始设置" />
</a>
</div>
<ul class="table-columns">
<li
v-for="(li,index) in columnsCur"
:key="index"
v-dragging="{ item: li, list: columnsCur, group: 'li' }"
>
<label @click="columnChange(li,index)" :class="{dis:li.hide}">
<Icon :type="li.hide?'md-eye-off':'md-eye'" size="16" class="mr10" />
<span>{{li.title}}</span>
</label>
<Icon type="ios-move" class="move" size="18" />
</li>
</ul>
</Drawer>
<FooterToolbar v-if="batch" v-show="footerToolbar" class="ftball">
<div class="tip">已选{{selectItems.length}}</div>
<slot name="batch"></slot>
<Button @click="cancelBatch">取消</Button>
<div class="tip">已选{{selectItems.length}}</div>
<slot name="batch"></slot>
<Button @click="cancelBatch">取消</Button>
</FooterToolbar>
</div>
</div>
</template>
<script>
export default {
name: "DataGrid",
data() {
name: "DataGrid",
data() {
return {
keys: "",
selectItems: [],
footerToolbar: false,
modalSearch: false,
search: {
pageIndex: 1,
pageSize: 20,
conditions: [],
},
searchConditions: this.search,
pageSizeOpts: [20, 50, 100],
tableHeight: 0,
firstY: 0,
config: false,
list: [],
columnsCur: [],
configLoad: false,
userConfig: null, //用户页面配置信息。,
// userId: 1
userId: this.$store.state.userInfo.userId,
treeData: [], //物料数据
codeRuleData: [], //物料编码
routingHeaderData: [], //工艺规程
};
},
props: {
border: {
//是否显示边框
type: Boolean,
default: true,
},
batch: {
//是否批量操作
type: Boolean,
default: true,
},
format: {
type: Function,
default: null,
},
initsearch: {
type: Function,
default: null,
},
lazy: {
//懒加载设置,设置为真时候,默认不加载数据。
type: Boolean,
default: false,
},
placeholder: {
type: String,
default: "请输入关键字",
},
height: {
type: Number,
default: 0,
},
tool: {
//是否显示工具栏
type: Boolean,
default: true,
},
easy: {
//是否显示简单搜索
type: Boolean,
default: true,
},
high: {
//是否显示高级搜索
type: Boolean,
default: true,
},
draggable: {
//是否可以拖拽
type: Boolean,
default: false,
},
set: {
//是否显示列设置
type: Boolean,
default: true,
},
page: {
//是否分页
type: Boolean,
default: true,
},
data: {
// 当作table使用,直接显示数据
type: Array,
default: function () {
return [];
},
},
columns: {
//要显示的字段
type: Array,
default: [],
},
action: {
//接口地址
type: String,
default: "",
},
conditions: {
//查询条件
type: Object,
default: function () {
return {
keys: "",
selectItems: [],
footerToolbar: false,
modalSearch: false,
search: {
pageIndex: 1,
pageSize: 20,
conditions: [],
},
searchConditions: this.search,
pageSizeOpts: [20, 50, 100],
tableHeight: 0,
firstY: 0,
config: false,
list: [],
columnsCur: [],
configLoad: false,
userConfig: null, //用户页面配置信息。,
// userId: 1
userId: this.$store.state.userInfo.userId,
treeData: [], //物料数据
codeRuleData: [], //物料编码
routingHeaderData: [], //工艺规程
keys: {
op: "name",
value: "",
default: true,
},
};
},
},
props: {
border: {
//是否显示边框
type: Boolean,
default: true,
},
batch: {
//是否批量操作
type: Boolean,
default: true,
},
format: {
type: Function,
default: null,
},
initsearch: {
type: Function,
default: null,
},
lazy: {
//懒加载设置,设置为真时候,默认不加载数据。
type: Boolean,
default: false,
},
placeholder: {
type: String,
default: "请输入关键字",
},
height: {
type: Number,
default: 0,
},
tool: {
//是否显示工具栏
type: Boolean,
default: true,
},
easy: {
//是否显示简单搜索
type: Boolean,
default: true,
},
high: {
//是否显示高级搜索
type: Boolean,
default: true,
},
draggable: {
//是否可以拖拽
type: Boolean,
default: false,
},
set: {
//是否显示列设置
type: Boolean,
default: true,
},
page: {
//是否分页
type: Boolean,
default: true,
},
data: {
// 当作table使用,直接显示数据
type: Array,
default: function () {
return [];
},
},
columns: {
//要显示的字段
type: Array,
default: [],
},
action: {
//接口地址
type: String,
default: "",
},
conditions: {
//查询条件
type: Object,
default: function () {
return {
keys: {
op: "name",
value: "",
default: true
},
};
},
},
type: {
type: String,
default: "table",
validator: function (value) {
// 这个值必须匹配下列字符串中的一个
return ["table", "card", "list"].indexOf(value) !== -1;
},
},
span: {
//栅格数
type: Number,
default: 24,
},
//table控件children子数据控制功能
rowKey: {
type: [String, Number],
},
gutter: {
//间距
type: Number,
default: 40,
},
exportTitle: {
type: String,
default: "",
}
type: {
type: String,
default: "table",
validator: function (value) {
// 这个值必须匹配下列字符串中的一个
return ["table", "card", "list"].indexOf(value) !== -1;
},
},
span: {
//栅格数
type: Number,
default: 24,
},
created() {
this.columns.forEach((u) => {
if (!u.hide) {
u.hide = false;
//table控件children子数据控制功能
rowKey: {
type: [String, Number],
},
gutter: {
//间距
type: Number,
default: 40,
},
exportTitle: {
type: String,
default: "",
},
},
created() {
this.columns.forEach((u) => {
if (!u.hide) {
u.hide = false;
}
});
this.columnsCur = this.$u.clone(this.columns);
},
mounted() {
if (this.data && this.data.length > 0) {
this.list = this.data;
return;
}
this.keys = "";
this.intY();
if (this.lazy == true) {
return;
}
if (this.userId > 0 && this.set) {
this.loadUserConfig();
} else {
this.easySearch();
}
if (this.height === 0) {
this.$nextTick(() => {
this.tableHeight = this.$refs.main.offsetHeight;
if (this.tableHeight < 300) {
this.tableHeight =
window.screen.availHeight - this.$refs.main.offsetTop - 200;
}
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
if (this.$refs.main && this.$refs.main.offsetHeight) {
this.tableHeight = this.$refs.main.offsetHeight;
if (this.tableHeight < 300) {
this.tableHeight =
window.screen.availHeight - this.$refs.main.offsetTop - 150;
}
}
})();
};
});
} else {
this.tableHeight = this.height;
}
//注册拖拽事件。
this.$dragging.$on("dragend", (e) => {
this.saveUserconfig();
});
//物料加载类型数据
this.getTreeData();
this.getcodeRuleData();
this.getRoutingHeaderData();
},
methods: {
//数据加载
load() {
if (this.action) {
//条件初始化处理。
if (this.initsearch) {
this.initsearch(this.search);
}
this.$api.post(this.action, this.search).then((r) => {
if (this.format) {
this.list = this.format(r.result.items);
} else {
this.list = r.result.items;
}
this.search.total = r.result.totalCount || r.result.count;
});
this.columnsCur = this.$u.clone(this.columns);
}
},
mounted() {
if (this.data && this.data.length > 0) {
this.list = this.data;
return;
}
this.keys = "";
this.intY();
if (this.lazy == true) {
return;
columnInit() {
if (this.userConfig) {
var curColumns = [];
var config = JSON.parse(this.userConfig.content);
if (config.length == this.columnsCur.length) {
config.map((u) => {
var item = this.columnsCur.filter((c) => {
return c.key == u.key;
});
if (item[0]) {
item[0].hide = u.hide;
curColumns.push(item[0]);
}
});
this.columnsCur = curColumns;
}
if (this.userId > 0 && this.set) {
this.loadUserConfig();
} else {
}
},
loadUserConfig() {
var query = {
conditions: [
{
fieldName: "creatorUserId",
fieldValue: this.userId,
conditionalType: "Equal",
},
{
fieldName: "component",
fieldValue: "Grid",
conditionalType: "Equal",
},
{
fieldName: "page",
fieldValue: window.location.pathname,
conditionalType: "Equal",
},
],
pageSize: 1,
};
this.$api.post(`${window.systemUrl}/config/list`, query).then((r) => {
if (r.success) {
if (r.result.length == 1) {
this.userConfig = r.result[0];
this.columnInit();
}
if (!this.configLoad) {
this.easySearch();
}
this.configLoad = true;
}
if (this.height === 0) {
this.$nextTick(() => {
this.tableHeight = this.$refs.main.offsetHeight;
if (this.tableHeight < 300) {
this.tableHeight =
window.screen.availHeight - this.$refs.main.offsetTop - 200;
}
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
if (this.$refs.main && this.$refs.main.offsetHeight) {
this.tableHeight = this.$refs.main.offsetHeight;
if (this.tableHeight < 300) {
this.tableHeight =
window.screen.availHeight - this.$refs.main.offsetTop - 150;
}
}
})();
};
});
} else {
this.tableHeight = this.height;
}
//注册拖拽事件。
this.$dragging.$on("dragend", (e) => {
this.saveUserconfig();
});
},
saveUserconfig() {
let url = `${window.systemUrl}/config/update`;
var content = [];
this.columnsCur.map((u) => {
content.push({
key: u.key,
hide: u.hide,
});
});
if (!this.userConfig) {
url = `${window.systemUrl}/config/create`;
var data = {
page: window.location.pathname,
component: "Grid",
key: this.$u.guid(),
content: JSON.stringify(content),
};
this.$api.post(url, data).then((r) => {
this.loadUserConfig();
});
//物料加载类型数据
this.getTreeData();
this.getcodeRuleData();
this.getRoutingHeaderData();
},
methods: {
//数据加载
load() {
if (this.action) {
//条件初始化处理。
if (this.initsearch) {
this.initsearch(this.search);
} else {
this.userConfig.content = JSON.stringify(content);
this.$api.post(url, this.userConfig);
}
},
//展开
expand(row, status) {
this.$emit("on-expand", row, status);
},
//拖拽
onDragDrop(a, b) {
this.$emit("on-drag-drop", a, b);
},
easySearch() {
if (
this.conditions &&
this.conditions.keys &&
this.conditions.keys.default
) {
//判断没有传入条件的用默认的查询
this.conditions.keys.value = this.keys;
}
this.reload(this.conditions);
},
undoConfig() {
//列设置恢复初始化
this.columnsCur = this.$u.clone(this.columns);
this.saveUserconfig();
},
complexSearch() {
var search = this.$refs.search.$children.filter((u) => {
return u.condition;
});
if (search) {
var conditions = search[0].condition;
this.reload(conditions);
}
},
reload(conditions) {
var where = [];
this.searchConditions = conditions;
if (conditions) {
Object.keys(conditions).forEach((u) => {
let v = conditions[u].value;
let op = conditions[u].op;
if (!this.$u.isNull(v)) {
if (op == "Range" && Array.isArray(v)) {
let times = [];
v.map((u) => {
if (!this.$u.isNull(u)) {
times.push(this.$u.toTime(u));
}
this.$api.post(this.action, this.search).then((r) => {
if (this.format) {
this.list = this.format(r.result.items);
} else {
this.list = r.result.items;
}
this.search.total = r.result.totalCount || r.result.count;
});
});
v = times.join(",");
} else if (op.indexOf("In") > -1 && Array.isArray(v)) {
v = v.join(",");
}
},
columnInit() {
if (this.userConfig) {
var curColumns = [];
var config = JSON.parse(this.userConfig.content);
if (config.length == this.columnsCur.length) {
config.map((u) => {
var item = this.columnsCur.filter((c) => {
return c.key == u.key;
});
if (item[0]) {
item[0].hide = u.hide;
curColumns.push(item[0]);
}
});
this.columnsCur = curColumns;
}
if (!this.$u.isNull(v)) {
where.push({
fieldName: u,
fieldValue: v,
conditionalType: op,
});
}
},
loadUserConfig() {
var query = {
conditions: [{
fieldName: "creatorUserId",
fieldValue: this.userId,
conditionalType: "Equal",
},
{
fieldName: "component",
fieldValue: "Grid",
conditionalType: "Equal",
},
{
fieldName: "page",
fieldValue: window.location.pathname,
conditionalType: "Equal",
},
],
pageSize: 1,
};
this.$api.post(`${window.systemUrl}/config/list`, query).then((r) => {
if (r.success) {
if (r.result.length == 1) {
this.userConfig = r.result[0];
this.columnInit();
}
if (!this.configLoad) {
this.easySearch();
}
this.configLoad = true;
}
});
}
this.search.pageIndex = 1;
this.search.conditions = where;
this.load();
},
pageChange(page) {
this.search.page = page;
this.search.pageIndex = page;
this.load();
},
pageSizeChange(size) {
this.search.pageSize = size;
this.search.pageIndex = 1;
this.load();
},
columnChange(item, i) {
item.hide = !item.hide;
this.$set(this.columnsCur, item, i);
this.saveUserconfig();
},
selectionChange(items) {
this.$emit("on-selection-change", items);
this.selectItems = items;
this.footerToolbar = items.length > 0;
},
onSelect(rows, row) {
this.$emit("on-change", rows, row);
},
allChange(items) {
this.$emit("all-change", items);
},
intY() {
if (this.$refs.table != undefined) {
this.firstY = this.$refs.table.$el.getBoundingClientRect().top;
}
},
selectAll(status) {
this.$refs.table.selectAll(status);
},
//批量取消
cancelBatch() {
this.footerToolbar = false;
this.$refs.table.selectAll(false);
},
//导出excel
export2Excel() {
//当前显示数据
var where = [];
var conditions = this.searchConditions;
if (conditions) {
Object.keys(conditions).forEach((u) => {
let v = conditions[u].value;
let op = conditions[u].op;
if (!this.$u.isNull(v)) {
if (op == "Range") {
let times = [];
v.map((u) => {
if (!this.$u.isNull(u)) {
times.push(this.$u.toTime(u));
}
});
},
saveUserconfig() {
let url = `${window.systemUrl}/config/update`;
var content = [];
this.columnsCur.map((u) => {
content.push({
key: u.key,
hide: u.hide,
});
});
if (!this.userConfig) {
url = `${window.systemUrl}/config/create`;
var data = {
page: window.location.pathname,
component: "Grid",
key: this.$u.guid(),
content: JSON.stringify(content),
};
this.$api.post(url, data).then((r) => {
this.loadUserConfig();
});
} else {
this.userConfig.content = JSON.stringify(content);
this.$api.post(url, this.userConfig);
});
v = times.join(",");
} else if (op.indexOf("In") > -1 && Array.isArray(v)) {
v = v.join(",");
}
},
//展开
expand(row, status) {
this.$emit("on-expand", row, status);
},
//拖拽
onDragDrop(a, b) {
this.$emit("on-drag-drop", a, b);
},
easySearch() {
if (
this.conditions &&
this.conditions.keys &&
this.conditions.keys.default
) {
//判断没有传入条件的用默认的查询
this.conditions.keys.value = this.keys;
if (!this.$u.isNull(v)) {
where.push({
fieldName: u,
fieldValue: v,
conditionalType: op,
});
}
this.reload(this.conditions);
},
undoConfig() {
//列设置恢复初始化
this.columnsCur = this.$u.clone(this.columns);
this.saveUserconfig();
},
complexSearch() {
var search = this.$refs.search.$children.filter((u) => {
return u.condition;
});
if (search) {
var conditions = search[0].condition;
this.reload(conditions);
}
});
}
let searchs = {
pageIndex: 1,
conditions: where,
pageSize: 1000,
};
this.$api.post(this.action, searchs).then((r) => {
let list = [];
list = r.result.items;
const tHeader = []; // 设置Excel的表格第一行的标题
const filterVal = []; //list里对象的属性
var tempCol = [];
var tempCol1 = []; //存放物料相关表头
var tempCol2 = []; //存放工艺规程相关表头
var columnsCur = this.$u.clone(this.columnsCur); //导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur.forEach((el) => {
if (
(el.hide && el.import) ||
(!el.hide &&
el.key != "action" &&
el.type != "selection" &&
el.key != "ico")
) {
if (el.code) {
tempCol.push({
key: el.key,
code: el.code,
}); //临时存放code数据字典的字段及对应的数据字典code
}
},
reload(conditions) {
var where = [];
this.searchConditions = conditions
if (conditions) {
Object.keys(conditions).forEach((u) => {
let v = conditions[u].value;
let op = conditions[u].op;
if (!this.$u.isNull(v)) {
if (op == "Range" && Array.isArray(v)) {
let times = [];
v.map((u) => {
if (!this.$u.isNull(u)) {
times.push(this.$u.toTime(u));
}
});
v = times.join(",");
} else if (op.indexOf("In") > -1 && Array.isArray(v)) {
v = v.join(",");
}
if (!this.$u.isNull(v)) {
where.push({
fieldName: u,
fieldValue: v,
conditionalType: op,
});
}
}
});
if (el.materialKey) {
tempCol1.push({
key: el.key,
code: el.materialKey,
}); //临时存放物料管理大类和子类列表
}
this.search.pageIndex = 1;
this.search.conditions = where;
this.load();
},
pageChange(page) {
this.search.page = page;
this.search.pageIndex = page;
this.load();
},
pageSizeChange(size) {
this.search.pageSize = size;
this.search.pageIndex = 1;
this.load();
},
columnChange(item, i) {
item.hide = !item.hide;
this.$set(this.columnsCur, item, i);
this.saveUserconfig();
},
selectionChange(items) {
this.$emit("on-selection-change", items);
this.selectItems = items;
this.footerToolbar = items.length > 0;
},
onSelect(rows, row) {
this.$emit("on-change", rows, row);
},
allChange(items) {
this.$emit("all-change", items);
},
intY() {
if (this.$refs.table != undefined) {
this.firstY = this.$refs.table.$el.getBoundingClientRect().top;
if (el.techKey) {
tempCol2.push({
key: el.key,
code: el.techKey,
}); //临时存放工艺规程相关转换
}
},
selectAll(status) {
this.$refs.table.selectAll(status);
},
//批量取消
cancelBatch() {
this.footerToolbar = false;
this.$refs.table.selectAll(false);
},
//导出excel
export2Excel() {
//当前显示数据
var where = [];
var conditions = this.searchConditions;
if (conditions) {
Object.keys(conditions).forEach((u) => {
let v = conditions[u].value;
let op = conditions[u].op;
if (!this.$u.isNull(v)) {
if (op == "Range") {
let times = [];
v.map((u) => {
if (!this.$u.isNull(u)) {
times.push(this.$u.toTime(u));
}
});
v = times.join(",");
} else if (op.indexOf("In") > -1 && Array.isArray(v)) {
v = v.join(",");
}
if (!this.$u.isNull(v)) {
where.push({
fieldName: u,
fieldValue: v,
conditionalType: op,
});
}
}
});
tHeader.push(el.title);
filterVal.push(el.key);
}
});
list.forEach((e) => {
//给导出数据增加数据字典对应的name
tempCol.forEach((ele) => {
e[ele.key] = this.$u.dirName(
this.$store.getters.dictionaryByKey(ele.code),
e[ele.key]
);
});
//导出数据增加对应的物料管理信息 code: 1【rootCategoryId 大类】 2【categoryId 大类】 3【codeRuleId 编码名称】
tempCol1.forEach((elcol1) => {
if (elcol1.code == 1) {
e[elcol1.key] = this.getType1(e[elcol1.key]);
} else if (elcol1.code == 2) {
e[elcol1.key] = this.getType2(e[elcol1.key]);
} else if (elcol1.code == 3) {
e[elcol1.key] = this.getType3(e[elcol1.key]);
}
let searchs = {
pageIndex: 1,
conditions: where,
pageSize: 1000
});
//导出工艺规程相关转换表头信息
tempCol2.forEach((elcol2) => {
if (elcol2.code == 1) {
e[elcol2.key] = this.getRoutingHeaderName(e[elcol2.key]);
}
this.$api.post(this.action, searchs).then((r) => {
let list = []
list = r.result.items;
const tHeader = []; // 设置Excel的表格第一行的标题
const filterVal = []; //list里对象的属性
var tempCol = [];
var tempCol1 = []; //存放物料相关表头
var tempCol2 = []; //存放工艺规程相关表头
var columnsCur = this.$u.clone(this.columnsCur); //导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur.forEach((el) => {
if ((el.hide && el.import) || (!el.hide && el.key != "action" && el.type != "selection" && el.key != "ico")) {
if (el.code) {
tempCol.push({
key: el.key,
code: el.code
}); //临时存放code数据字典的字段及对应的数据字典code
}
if (el.materialKey) {
tempCol1.push({
key: el.key,
code: el.materialKey
}); //临时存放物料管理大类和子类列表
}
if (el.techKey) {
tempCol2.push({
key: el.key,
code: el.techKey
}); //临时存放工艺规程相关转换
}
tHeader.push(el.title);
filterVal.push(el.key);
}
});
list.forEach((e) => {
//给导出数据增加数据字典对应的name
tempCol.forEach((ele) => {
e[ele.key] = this.$u.dirName(
this.$store.getters.dictionaryByKey(ele.code),
e[ele.key]
);
});
//导出数据增加对应的物料管理信息 code: 1【rootCategoryId 大类】 2【categoryId 大类】 3【codeRuleId 编码名称】
tempCol1.forEach((elcol1) => {
if (elcol1.code == 1) {
e[elcol1.key] = this.getType1(e[elcol1.key])
} else if (elcol1.code == 2) {
e[elcol1.key] = this.getType2(e[elcol1.key])
} else if (elcol1.code == 3) {
e[elcol1.key] = this.getType3(e[elcol1.key])
}
});
//导出工艺规程相关转换表头信息
tempCol2.forEach((elcol2) => {
if (elcol2.code == 1) {
e[elcol2.key] = this.getRoutingHeaderName(e[elcol2.key])
}
});
});
});
});
let nowDate = this.$u.getNowTime(); //年月日时分秒yyyyMMddhhmmss
//获取导出数据结束
this.$u.outExcel(this.exportTitle +
"(" + nowDate + ")",
tHeader,
filterVal,
list
);
});
},
//物料大类和子类的解析start
getTreeData() {
let data = {
conditions: []
};
this.$api.post(`${material}/category/list`, data).then((r) => {
this.treeData = r.result
});
},
getType1(val) {
let tempTreeList = this.$u.clone(this.treeData)
let rootName = ""
tempTreeList.forEach(ele => {
if (ele.upId == 0 && ele.id == val) {
rootName = ele.name
}
})
return rootName
},
getType2(val) {
let tempTreeList = this.$u.clone(this.treeData)
let childrenName = ""
tempTreeList.forEach(ele => {
if (ele.upId > 0 && ele.id == val) {
childrenName = ele.name
}
})
return childrenName
},
//获取编码名称
getcodeRuleData() {
let data = {
conditions: []
};
this.$api.post(`${material}/coderule/paged`, data).then((r) => {
if (r.success) {
this.codeRuleData = r.result.items || []
}
});
},
getType3(val) {
let codeRuleDataList = this.$u.clone(this.codeRuleData)
let codeRuleName = ""
codeRuleDataList.forEach(ele => {
if (ele.id == val) {
codeRuleName = ele.name
}
})
return codeRuleName
},
//物料大类和子类的解析end
//工艺规程的解析start
//获取工艺规程名称
getRoutingHeaderData() {
let data = {
conditions: []
};
this.$api.post(`${technologyUrl}routingheader/list`, data).then((r) => {
if (r.success) {
this.routingHeaderData = r.result || []
}
});
},
getRoutingHeaderName(val) {
let routingHeaderDataList = this.$u.clone(this.routingHeaderData)
let routingHeaderName = ""
routingHeaderDataList.forEach(ele => {
if (ele.id == val) {
routingHeaderName = ele.name
}
})
return routingHeaderName
},
//工艺规程的解析end
},
computed: {
columnsNow() {
var cols = this.columnsCur.filter((u) => {
if (u.code) {
u.render = (h, params) => {
let values = u.key;
let type = "text";
if (u.category) {
type = u.category;
}
return h("state", {
props: {
code: u.code,
type: type,
value: params.row[values] + "",
},
});
};
}
if (u.type == "user") {
u.render = (h, params) => {
let values = u.key;
if (params.row[values]) {
return h("User", {
props: {
value: params.row[values],
},
});
}
};
}
if (u.type == "workShopName") {
u.render = (h, params) => {
let values = u.key;
if (params.row[values]) {
return h("WorkShopName", {
props: {
value: params.row[values],
},
});
}
};
}
if (u.type == "date" || u.type == "dateTime") {
u.render = (h, params) => {
let values = u.key;
return h("DTSpan", {
props: {
type: u.type,
value: params.row[values],
},
});
};
}
return !u.hide;
let nowDate = this.$u.getNowTime(); //年月日时分秒yyyyMMddhhmmss
//获取导出数据结束
this.$u.outExcel(
this.exportTitle + "(" + nowDate + ")",
tHeader,
filterVal,
list
);
});
},
//物料大类和子类的解析start
getTreeData() {
let data = {
conditions: [],
};
this.$api.post(`${material}/category/list`, data).then((r) => {
this.treeData = r.result;
});
},
getType1(val) {
let tempTreeList = this.$u.clone(this.treeData);
let rootName = "";
tempTreeList.forEach((ele) => {
if (ele.upId == 0 && ele.id == val) {
rootName = ele.name;
}
});
return rootName;
},
getType2(val) {
let tempTreeList = this.$u.clone(this.treeData);
let childrenName = "";
tempTreeList.forEach((ele) => {
if (ele.upId > 0 && ele.id == val) {
childrenName = ele.name;
}
});
return childrenName;
},
//获取编码名称
getcodeRuleData() {
let data = {
conditions: [],
};
this.$api.post(`${material}/coderule/paged`, data).then((r) => {
if (r.success) {
this.codeRuleData = r.result.items || [];
}
});
},
getType3(val) {
let codeRuleDataList = this.$u.clone(this.codeRuleData);
let codeRuleName = "";
codeRuleDataList.forEach((ele) => {
if (ele.id == val) {
codeRuleName = ele.name;
}
});
return codeRuleName;
},
//物料大类和子类的解析end
//工艺规程的解析start
//获取工艺规程名称
getRoutingHeaderData() {
let data = {
conditions: [],
};
this.$api.post(`${technologyUrl}routingheader/list`, data).then((r) => {
if (r.success) {
this.routingHeaderData = r.result || [];
}
});
},
getRoutingHeaderName(val) {
let routingHeaderDataList = this.$u.clone(this.routingHeaderData);
let routingHeaderName = "";
routingHeaderDataList.forEach((ele) => {
if (ele.id == val) {
routingHeaderName = ele.name;
}
});
return routingHeaderName;
},
//工艺规程的解析end
},
computed: {
columnsNow() {
var cols = this.columnsCur.filter((u) => {
if (u.code) {
u.render = (h, params) => {
let values = u.key;
let type = "text";
if (u.category) {
type = u.category;
}
return h("state", {
props: {
code: u.code,
type: type,
value: params.row[values] + "",
},
});
return cols;
},
},
watch: {
"data"() {
this.list = this.data;
},
height() {
this.tableHeight = this.height;
},
"columns"() {
this.columns.forEach((u) => {
if (!u.hide) {
u.hide = false;
}
};
}
if (u.type == "user") {
u.render = (h, params) => {
let values = u.key;
if (params.row[values]) {
return h("User", {
props: {
value: params.row[values],
},
});
}
};
}
if (u.type == "workShopName") {
u.render = (h, params) => {
let values = u.key;
if (params.row[values]) {
return h("WorkShopName", {
props: {
value: params.row[values],
},
});
}
};
}
if (u.type == "date" || u.type == "dateTime") {
u.render = (h, params) => {
let values = u.key;
return h("DTSpan", {
props: {
type: u.type,
value: params.row[values],
},
});
this.columnsCur = this.$u.clone(this.columns);
},
};
}
return !u.hide;
});
return cols;
},
},
watch: {
data() {
this.list = this.data;
},
height() {
this.tableHeight = this.height;
},
columns() {
this.columns.forEach((u) => {
if (!u.hide) {
u.hide = false;
}
});
this.columnsCur = this.$u.clone(this.columns);
},
},
};
</script>
<style lang="less">
@import "../../assets/css/custom.less";
.table-content {
position: relative;
height: 100%;
display: flex;
flex-direction: column;
position: relative;
height: 100%;
display: flex;
flex-direction: column;
.tip {
display: inline;
}
.tip {
display: inline;
}
form {
display: inline-block;
form {
display: inline-block;
.ivu-form-item {
margin: 0;
vertical-align: middle;
}
.ivu-form-item {
margin: 0;
vertical-align: middle;
}
}
.table-main {
width: 100%;
text-align: left;
padding: 0;
display: block;
overflow-y: auto;
flex-grow: 1;
.table-main {
width: 100%;
text-align: left;
padding: 0;
display: block;
overflow-y: auto;
flex-grow: 1;
tr td .ivu-table-cell {
padding: 0 5px;
}
overflow-x: hidden;
tr td .ivu-table-cell {
padding: 0 5px;
}
.table-tools {
display: flex;
line-height: 50px;
.table-search {
flex-grow: 1;
}
overflow-x: hidden;
}
.btns {
min-width: 200px;
text-align: right;
}
.table-tools {
display: flex;
line-height: 50px;
background: @right-header-bg;
.table-search {
flex-grow: 1;
}
.table-footer {
line-height: 45px;
.btns {
min-width: 200px;
text-align: right;
}
}
.ivu-footer-toolbar {
text-align: left;
background: rgba(0, 0, 0, 0.7);
color: #fff;
}
.table-footer {
line-height: 45px;
}
.ivu-footer-toolbar {
text-align: left;
background: rgba(0, 0, 0, 0.7);
color: #fff;
}
}
.table-columns {
max-height: calc(100% - 50px);
overflow: auto;
max-height: calc(100% - 50px);
overflow: auto;
li {
list-style: none;
line-height: 40px;
cursor: move;
border-bottom: 1px dotted #249e91;
color: #249e91;
li {
list-style: none;
line-height: 40px;
cursor: move;
border-bottom: 1px dotted #249e91;
color: #249e91;
span {
cursor: pointer;
}
span {
cursor: pointer;
}
.mr10 {
cursor: pointer;
}
.mr10 {
cursor: pointer;
}
.move {
float: right;
margin: 10px 10px 0 0;
cursor: move;
}
.move {
float: right;
margin: 10px 10px 0 0;
cursor: move;
}
.dis {
color: #aaa;
}
.dis {
color: #aaa;
}
}
}
.searchBack {
display: inline;
margin-left: 20px;
display: inline;
margin-left: 20px;
button {
margin-left: 10px;
}
button {
margin-left: 10px;
}
a {
margin-left: 20px;
color: #2680eb;
}
a {
margin-left: 20px;
color: #2680eb;
}
a:hover {
color: #249e91;
}
a:hover {
color: #249e91;
}
}
</style>
......@@ -475,6 +475,7 @@ export default {
</script>
<style lang="less" scoped>
@import "../../assets/css/custom.less";
//position: relative;
// height: 100%;
.tableCommon {
......@@ -497,6 +498,7 @@ export default {
.table-tools {
line-height: 40px;
background: @right-header-bg;
.table-search {
float: left;
line-height: 40px;
......
<template>
<Modal v-model="ImportModal" :title="modalTitles" fullscreen footer-hide @on-cancel="cancelModal">
<Modal v-model="ImportModal" :title="modalTitles" fullscreen footer-hide @on-cancel="cancelModal">
<div class="table-content">
<div class="table-tools">
<div class="table-search">
<Form inline>
<FormItem>
<div style="height:34px;overflow: hidden;padding:0;width:120px">
<Upload action :before-upload="beforeUpload" ref="uploadfile" :format="formatList">
<Button icon="ios-cloud-upload-outline">上传文件</Button>
</Upload>
</div>
</FormItem>
<FormItem>
<Button type="primary" @click="openInfoModal" :disabled="btnIm">导入</Button>
</FormItem>
</Form>
</div>
<div class="btns">
<Form inline>
<FormItem>
<RadioGroup v-model="excelType" type="button" @on-change="changeExcel" size="small">
<Tooltip content="文件数据">
<Radio label="0">
<Icon type="ios-list-box-outline" />
</Radio>
</Tooltip>
<Tooltip content="粘贴Excel数据">
<Radio label="1">
<Icon type="ios-copy" />
</Radio>
</Tooltip>
</RadioGroup>
</FormItem>
</Form>
</div>
<div class="table-tools">
<div class="table-search">
<Form inline>
<FormItem>
<div style="height:34px;overflow: hidden;padding:0;width:120px">
<Upload action :before-upload="beforeUpload" ref="uploadfile" :format="formatList">
<Button icon="ios-cloud-upload-outline">上传文件</Button>
</Upload>
</div>
</FormItem>
<FormItem>
<Button type="primary" @click="openInfoModal" :disabled="btnIm">导入</Button>
</FormItem>
</Form>
</div>
<div class="btns">
<Form inline>
<FormItem>
<RadioGroup v-model="excelType" type="button" @on-change="changeExcel" size="small">
<Tooltip content="文件数据">
<Radio label="0">
<Icon type="ios-list-box-outline" />
</Radio>
</Tooltip>
<Tooltip content="粘贴Excel数据">
<Radio label="1">
<Icon type="ios-copy" />
</Radio>
</Tooltip>
</RadioGroup>
</FormItem>
</Form>
</div>
<div class="table-main" ref="main">
<Table :border="true" :columns="columnsImport" :data="excelData" :height="tdHeightExcel" :no-data-text="noDataText" ref="table" class="tableCommon" v-if="tableImport"></Table>
<component :is="detailExcel" ref="comExcel" @on-datalength="datalength" />
</div>
<div class="table-main" ref="main">
<Table
:border="true"
:columns="columnsImport"
:data="excelData"
:height="tdHeightExcel"
:no-data-text="noDataText"
ref="table"
class="tableCommon"
v-if="tableImport"
></Table>
<component :is="detailExcel" ref="comExcel" @on-datalength="datalength" />
</div>
<FooterToolbar v-if="sheetNames.length>1&&tableImport">
<Form inline>
<FormItem>
<Tabs :animated="false" :value="0" @on-click="sheetClick">
<TabPane :label="item" v-for="(item,index) in sheetNames" :key="index"></TabPane>
</Tabs>
</FormItem>
</Form>
</FooterToolbar>
<Modal v-model="infoModal" :title="modalTitles" fullscreen>
<DataGrid
:tool="false"
:page="false"
:columns="colsIm"
:data="dataIm"
:height="tdHeightExcel+30"
ref="dataImport"
></DataGrid>
<div slot="footer">
<Button @click="infoModal=false">关闭</Button>
<Button type="primary" @click="importOk" v-show="imBtn">确定导入</Button>
</div>
<FooterToolbar v-if="sheetNames.length>1&&tableImport">
<Form inline>
<FormItem>
<Tabs :animated="false" :value="0" @on-click="sheetClick">
<TabPane :label="item" v-for="(item,index) in sheetNames" :key="index"></TabPane>
</Tabs>
</FormItem>
</Form>
</FooterToolbar>
<Modal v-model="infoModal" :title="modalTitles" fullscreen>
<DataGrid :tool="false" :page="false" :columns="colsIm" :data="dataIm" :height="tdHeightExcel+30" ref="dataImport"></DataGrid>
<div slot="footer">
<Button @click="infoModal=false">关闭</Button>
<Button type="primary" @click="importOk" v-show="imBtn">确定导入</Button>
</div>
</Modal>
</Modal>
</div>
</Modal>
</Modal>
</template>
<script>
import XLSX from "xlsx";
import {
Switch
} from "view-design";
import { Switch } from "view-design";
export default {
name: "Edit",
data() {
return {
tabVal: 0,
infoModal: false,
entity: {},
downUrl: fileUrlDown,
fileUrlPath: "",
disabled: false,
detailExcel: null,
tableImport: true,
tdHeightExcel: "",
excelData: [],
excelDataBack: [], //临时存储原始数据
formatList: ["xlsx"],
columnsImport: [],
departArr: [], //部门list
sheetNames: [], //excel的表明
workBook: {},
openDatas: [],
dataType: 0,
//new
colsIm: [],
dataIm: [],
excelType: '0',
btnIm: true,
titleInfo: '',
noDataText: '暂无数据',
imBtn: true,
columnsIm: this.columns,
ImportModal: this.open,
batchImportUrl: '',
modalTitles: '导入',
};
name: "Edit",
data() {
return {
tabVal: 0,
infoModal: false,
entity: {},
downUrl: fileUrlDown,
fileUrlPath: "",
disabled: false,
detailExcel: null,
tableImport: true,
tdHeightExcel: "",
excelData: [],
excelDataBack: [], //临时存储原始数据
formatList: ["xlsx"],
columnsImport: [],
departArr: [], //部门list
sheetNames: [], //excel的表明
workBook: {},
openDatas: [],
dataType: 0,
//new
colsIm: [],
dataIm: [],
excelType: "0",
btnIm: true,
titleInfo: "",
noDataText: "暂无数据",
imBtn: true,
columnsIm: this.columns,
ImportModal: this.open,
batchImportUrl: "",
modalTitles: "导入",
};
},
props: {
eid: Number,
data: {
// 当作table使用,直接显示数据
type: Array,
default: function () {
return [];
},
},
props: {
eid: Number,
data: {
// 当作table使用,直接显示数据
type: Array,
default: function () {
return [];
},
},
columns: {
//要显示的字段
type: Array,
default: [],
},
open: {
type: Boolean,
default: false
},
modalTitle: {
type: String,
default: ""
}
columns: {
//要显示的字段
type: Array,
default: [],
},
created() {
this.tdHeightExcel = window.innerHeight - 180;
//导出对列表头进行预加载start
this.$api.get(`${systemUrl}/Department/GetDepartments`).then((r) => {
this.departArr = r.result.items;
});
//导出对列表头进行预加载end
open: {
type: Boolean,
default: false,
},
mounted() {
//if (this.eid > 0) {
// this.load(this.eid);
//}
this.modalTitles = "导入到【" + this.modalTitle + "】"
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.tdHeightExcel = window.screenHeight - 180;
})();
};
modalTitle: {
type: String,
default: "",
},
methods: {
//重新处理colum
loadColum(columns) {
let tempCol = this.$u.clone(columns);
tempCol.forEach((ele, index) => {
if (ele.key == "action" || ele.type == "selection" || ele.key == "ico") {
ele.hide = true;
}
});
this.colsIm = tempCol;
this.colsIm.unshift({
type: 'index',
width: 80,
align: 'right',
title: '序号'
}, {
key: "ico",
title: " ",
align: "center",
width: 60,
render: (h, params) => {
return h("div", {
class: ""
}, [
h(params.row.ico ? "op" : "", {
attrs: {
icon: "ios-alert",
type: "icon",
title: "数据不合法",
color: "#ff9900"
}
}),
]);
},
})
//处理原始数据和表头进行对应
let temCol = this.$u.clone(this.colsIm); //原始数据表头
let temColPage = this.$u.clone(columns); //需要显示的页面的表头
//let temData = this.$u.clone(this.excelDataBack); //原始数据
let temData = []; //原始数据
if (this.excelType == "0") {
temData = this.$u.clone(this.excelDataBack)
} else {
temData = this.$u.clone(this.$refs.comExcel.excelData)
}
let arrTitleUse = []; ////使用数据字典的字段
temColPage.forEach((elCode) => {
if (elCode.code) {
arrTitleUse.push({
key: elCode.key,
code: elCode.code,
});
}
});
let useData = []; //重新组织list列表数据
temData.forEach((elData, index) => {
let objTm = {};
temCol.forEach((elTitle) => {
objTm[elTitle.key] = elData[elTitle.title];
});
useData.push(objTm);
});
//对列表里的部门及数据字典项进行处理
useData.forEach(eles => {
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if (
[(eles.departmentTitle &&
eles.departmentTitle != "") || (eles.departmentName &&
eles.departmentName != "")] &&
(!eles.departmentId || eles.departmentId == "")
) {
this.departArr.forEach((e) => {
if ((eles.departmentTitle && eles.departmentTitle == e.name) || (eles.departmentName && eles.departmentName == e.name)) {
eles.departmentId = e.id;
}
});
} else if (
//如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle
eles.departmentId &&
eles.departmentId + "" != "" &&
(!eles.departmentTitle || eles.departmentTitle == "") && (!eles.departmentName || eles.departmentName == "")
) {
this.departArr.forEach((e) => {
if (eles.departmentId && eles.departmentId == e.id) {
eles.departmentTitle = e.name;
eles.departmentName = e.name;
}
});
}
},
created() {
this.tdHeightExcel = window.innerHeight - 180;
//导出对列表头进行预加载start
this.$api.get(`${systemUrl}/Department/GetDepartments`).then((r) => {
this.departArr = r.result.items;
});
arrTitleUse.forEach((elem) => {
if (eles[elem.key] && eles[elem.key] != "" && eles[elem.key] != null) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
eles[elem.key] = this.$u.dirCode(
this.$store.getters.dictionaryByKey(elem.code),
eles[elem.key]
);
}
});
})
this.dataIm = useData;
let tempData = this.$u.clone(this.dataIm);
this.$emit("on-get-data", tempData)
//导出对列表头进行预加载end
},
mounted() {
//if (this.eid > 0) {
// this.load(this.eid);
//}
this.modalTitles = "导入到【" + this.modalTitle + "】";
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.tdHeightExcel = window.screenHeight - 180;
})();
};
},
methods: {
//重新处理colum
loadColum(columns) {
let tempCol = this.$u.clone(columns);
tempCol.forEach((ele, index) => {
if (
ele.key == "action" ||
ele.type == "selection" ||
ele.key == "ico"
) {
ele.hide = true;
}
});
this.colsIm = tempCol;
this.colsIm.unshift(
{
type: "index",
width: 80,
align: "right",
title: "序号",
},
{
key: "ico",
title: " ",
align: "center",
width: 60,
render: (h, params) => {
return h(
"div",
{
class: "",
},
[
h(params.row.ico ? "op" : "", {
attrs: {
icon: "ios-alert",
type: "icon",
title: "数据不合法",
color: "#ff9900",
},
}),
]
);
},
}
);
//处理原始数据和表头进行对应
let temCol = this.$u.clone(this.colsIm); //原始数据表头
let temColPage = this.$u.clone(columns); //需要显示的页面的表头
//let temData = this.$u.clone(this.excelDataBack); //原始数据
let temData = []; //原始数据
if (this.excelType == "0") {
temData = this.$u.clone(this.excelDataBack);
} else {
temData = this.$u.clone(this.$refs.comExcel.excelData);
}
let arrTitleUse = []; ////使用数据字典的字段
temColPage.forEach((elCode) => {
if (elCode.code) {
arrTitleUse.push({
key: elCode.key,
code: elCode.code,
});
}
});
let useData = []; //重新组织list列表数据
temData.forEach((elData, index) => {
let objTm = {};
temCol.forEach((elTitle) => {
objTm[elTitle.key] = elData[elTitle.title];
});
useData.push(objTm);
});
//导入excel文件
//对列表里的部门及数据字典项进行处理
useData.forEach((eles) => {
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if (
[
(eles.departmentTitle && eles.departmentTitle != "") ||
(eles.departmentName && eles.departmentName != ""),
] &&
(!eles.departmentId || eles.departmentId == "")
) {
this.departArr.forEach((e) => {
if (
(eles.departmentTitle && eles.departmentTitle == e.name) ||
(eles.departmentName && eles.departmentName == e.name)
) {
eles.departmentId = e.id;
}
});
} else if (
//如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle
eles.departmentId &&
eles.departmentId + "" != "" &&
(!eles.departmentTitle || eles.departmentTitle == "") &&
(!eles.departmentName || eles.departmentName == "")
) {
this.departArr.forEach((e) => {
if (eles.departmentId && eles.departmentId == e.id) {
eles.departmentTitle = e.name;
eles.departmentName = e.name;
}
});
}
async beforeUpload(file) {
//初始化
this.sheetNames = [];
this.workBook = {};
this.$refs.uploadfile.clearFiles(); //清除上一次上传文件列表
//上传成功后的读取到excel信息
this.workBook = await this.$u.readXLSX(file);
this.sheetNames = this.workBook.SheetNames; //execel里的表明
this.btnIm = false;
this.dealSheet(0); //默认显示第一个表
return false;
},
//对上传的excel表信息进行处理,不对表头进行处理
dealSheet(index) {
this.dataType = 1;
this.columnsImport = [];
this.excelData = [];
this.excelDataBack = [];
const sheet2JSONOpts = {
defval: "", //给defval赋值为空的字符串
};
var csv = XLSX.utils.sheet_to_csv(
this.workBook.Sheets[this.workBook.SheetNames[index]],
sheet2JSONOpts
arrTitleUse.forEach((elem) => {
if (
eles[elem.key] &&
eles[elem.key] != "" &&
eles[elem.key] != null
) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
eles[elem.key] = this.$u.dirCode(
this.$store.getters.dictionaryByKey(elem.code),
eles[elem.key]
);
}
});
});
this.dataIm = useData;
let tempData = this.$u.clone(this.dataIm);
this.$emit("on-get-data", tempData);
},
var lines = csv.split("\n"); //第一行标题
var headers = lines[0].split(",");
var headersNow = [];
headersNow.push({
type: 'index',
width: 80,
align: 'right',
title: '序号'
})
headers.forEach((elHead) => {
let headObj = {};
headObj.title = elHead;
headObj.key = elHead;
headersNow.push(headObj);
});
this.columnsImport = headersNow;
var result = [];
for (var i = 1; i < lines.length - 1; i++) {
var obj = {};
var currentline = lines[i].split(",");
for (var j = 0; j < headers.length; j++) {
obj[headers[j]] = currentline[j];
}
result.push(obj);
}
this.excelData = result;
this.excelDataBack = result;
this.changeExcel(0)
},
//切换sheet表重新加载
sheetClick(val) {
this.tabVal = val
this.dealSheet(val);
//导入excel文件
},
handleClose() {
this.$emit("on-close");
},
cancelExcel() {
this.excelData = [];
this.excelDataBack = [];
this.$refs.uploadfile.clearFiles();
let parms = {
status: 1,
id: this.eid
}
//导入中心列表数据状态更新
this.$emit("on-close");
},
async beforeUpload(file) {
//初始化
this.sheetNames = [];
this.workBook = {};
this.$refs.uploadfile.clearFiles(); //清除上一次上传文件列表
//上传成功后的读取到excel信息
this.workBook = await this.$u.readXLSX(file);
this.sheetNames = this.workBook.SheetNames; //execel里的表明
this.btnIm = false;
this.dealSheet(0); //默认显示第一个表
return false;
},
//对上传的excel表信息进行处理,不对表头进行处理
dealSheet(index) {
this.dataType = 1;
this.columnsImport = [];
this.excelData = [];
this.excelDataBack = [];
const sheet2JSONOpts = {
defval: "", //给defval赋值为空的字符串
};
var csv = XLSX.utils.sheet_to_csv(
this.workBook.Sheets[this.workBook.SheetNames[index]],
sheet2JSONOpts
);
//打开导入数据格式化后的窗口
openInfoModal() {
if ((this.excelType == '0' && this.excelData.length > 0) || (this.excelType == '1' && this.$refs.comExcel.excelData.length > 0)) {
this.imBtn = true;
this.loadColum(this.columnsIm);
this.titleInfo = "批量导入";
this.infoModal = true;
} else {
this.imBtn = false;
this.$Message.error("没有可导入的数据!")
}
},
//确定导入按钮操作
importOk() {
let imData = [];
let imDataError = []
this.dataIm.forEach(ele => {
if (!ele.ico) {
imData.push(ele)
} else {
imDataError.push(ele)
}
})
this.$api.post(this.batchImportUrl, {
list: imData
}).then((r) => {
if (r.success) {
this.$Message.success("批量导入成功" + imData.length + "条数据")
this.dataIm = imDataError
this.$emit("on-ok")
} else {
this.$Message.error("批量导入失败")
}
}).catch(err => {
this.$Message.error("数据异常!");
});;
},
//切换列表和excel按钮
changeExcel(val) {
if (val == 1) {
this.tableImport = false
this.detailExcel = () => import("./detailExcel");
this.excelType = '1';
this.btnIm = true
} else {
this.detailExcel = null;
this.tableImport = true;
this.excelType = '0';
if (this.excelData.length > 0) {
this.btnIm = false
} else {
this.btnIm = true
}
}
var lines = csv.split("\n"); //第一行标题
var headers = lines[0].split(",");
var headersNow = [];
headersNow.push({
type: "index",
width: 80,
align: "right",
title: "序号",
});
headers.forEach((elHead) => {
let headObj = {};
headObj.title = elHead;
headObj.key = elHead;
headersNow.push(headObj);
});
this.columnsImport = headersNow;
var result = [];
for (var i = 1; i < lines.length - 1; i++) {
var obj = {};
var currentline = lines[i].split(",");
for (var j = 0; j < headers.length; j++) {
obj[headers[j]] = currentline[j];
}
result.push(obj);
}
this.excelData = result;
this.excelDataBack = result;
this.changeExcel(0);
},
//切换sheet表重新加载
sheetClick(val) {
this.tabVal = val;
this.dealSheet(val);
},
handleClose() {
this.$emit("on-close");
},
cancelExcel() {
this.excelData = [];
this.excelDataBack = [];
this.$refs.uploadfile.clearFiles();
let parms = {
status: 1,
id: this.eid,
};
//导入中心列表数据状态更新
this.$emit("on-close");
},
},
datalength(val) {
if (val > 0) {
this.btnIm = false
}
},
cancelModal() {
this.$emit('on-cancel')
},
//主页面里第二次处理数据
deelData(url, columns, formatList) {
this.dataIm = formatList
this.batchImportUrl = url
},
l(key) {
key = "user" + "." + key;
return this.$t(key);
},
//打开导入数据格式化后的窗口
openInfoModal() {
if (
(this.excelType == "0" && this.excelData.length > 0) ||
(this.excelType == "1" && this.$refs.comExcel.excelData.length > 0)
) {
this.imBtn = true;
this.loadColum(this.columnsIm);
this.titleInfo = "批量导入";
this.infoModal = true;
} else {
this.imBtn = false;
this.$Message.error("没有可导入的数据!");
}
},
watch: {
"columns"() {
this.columns.forEach((u) => {
if (!u.hide) {
u.hide = false;
}
});
this.colsIm = this.$u.clone(this.columns);
this.columnsIm = this.$u.clone(this.columns)
},
open(v) {
this.ImportModal = v
},
modalTitle(v) {
this.modalTitles = "导入到【" + v + "】"
},
//确定导入按钮操作
importOk() {
let imData = [];
let imDataError = [];
this.dataIm.forEach((ele) => {
if (!ele.ico) {
imData.push(ele);
} else {
imDataError.push(ele);
}
});
this.$api
.post(this.batchImportUrl, {
list: imData,
})
.then((r) => {
if (r.success) {
this.$Message.success("批量导入成功" + imData.length + "条数据");
this.dataIm = imDataError;
this.$emit("on-ok");
} else {
this.$Message.error("批量导入失败");
}
})
.catch((err) => {
this.$Message.error("数据异常!");
});
},
//切换列表和excel按钮
changeExcel(val) {
if (val == 1) {
this.tableImport = false;
this.detailExcel = () => import("./detailExcel");
this.excelType = "1";
this.btnIm = true;
} else {
this.detailExcel = null;
this.tableImport = true;
this.excelType = "0";
if (this.excelData.length > 0) {
this.btnIm = false;
} else {
this.btnIm = true;
}
}
},
datalength(val) {
if (val > 0) {
this.btnIm = false;
}
},
cancelModal() {
this.$emit("on-cancel");
},
//主页面里第二次处理数据
deelData(url, columns, formatList) {
this.dataIm = formatList;
this.batchImportUrl = url;
},
l(key) {
key = "user" + "." + key;
return this.$t(key);
},
},
watch: {
columns() {
this.columns.forEach((u) => {
if (!u.hide) {
u.hide = false;
}
});
this.colsIm = this.$u.clone(this.columns);
this.columnsIm = this.$u.clone(this.columns);
},
open(v) {
this.ImportModal = v;
},
modalTitle(v) {
this.modalTitles = "导入到【" + v + "】";
},
},
};
</script>
<style lang="less">
@import "../../../assets/css/custom.less";
.table-content {
position: relative;
height: 100%;
display: flex;
flex-direction: column;
position: relative;
height: 100%;
display: flex;
flex-direction: column;
.tip {
display: inline;
}
.tip {
display: inline;
}
form {
display: inline-block;
form {
display: inline-block;
.ivu-form-item {
margin: 0;
vertical-align: middle;
}
.ivu-form-item {
margin: 0;
vertical-align: middle;
}
}
.table-main {
width: 100%;
text-align: left;
padding: 0;
display: block;
overflow-y: auto;
flex-grow: 1;
tr td .ivu-table-cell {
padding: 0 5px;
}
.table-main {
width: 100%;
text-align: left;
padding: 0;
display: block;
overflow-y: auto;
flex-grow: 1;
overflow-x: hidden;
tr td .ivu-table-cell {
padding: 0 5px;
}
.table-tools {
display: flex;
line-height: 50px;
.table-search {
flex-grow: 1;
}
overflow-x: hidden;
}
.btns {
min-width: 200px;
text-align: right;
}
.table-tools {
display: flex;
line-height: 50px;
background: @right-header-bg;
.table-search {
flex-grow: 1;
}
.btns {
min-width: 200px;
text-align: right;
}
}
}
</style>
......@@ -135,23 +135,23 @@
</div>
</template>
<script>
import TableExpand from './expand'
import TableExpand from "./expand";
export default {
name: 'treeGrid',
name: "treeGrid",
components: { TableExpand },
props: {
columns: Array,
items: {
type: Array,
default() {
return []
}
return [];
},
},
iconName: false
iconName: false,
},
data() {
return {
color: '#19be6b',
color: "#19be6b",
initItems: [], // 处理后数据数组
cloneColumns: [], // 处理后的表头数据
checkGroup: [], // 复选框数组
......@@ -159,116 +159,116 @@ export default {
screenWidth: document.body.clientWidth, // 自适应宽
tdsWidth: 0, // td总宽
timer: false, // 控制监听时长
dataLength: 0 // 树形数据长度
}
dataLength: 0, // 树形数据长度
};
},
computed: {
tableWidth() {
return this.tdsWidth > this.screenWidth && this.screenWidth > 0
? `${this.screenWidth}px`
: '100%'
}
: "100%";
},
},
watch: {
screenWidth(val) {
if (!this.timer) {
this.screenWidth = val
this.timer = true
this.screenWidth = val;
this.timer = true;
setTimeout(() => {
this.timer = false
}, 400)
this.timer = false;
}, 400);
}
},
items() {
if (this.items) {
this.initItems = []
this.dataLength = this.Length(this.items)
this.initData(this.deepCopy(this.items), 1, null)
this.checkGroup = this.renderCheck(this.items)
this.initItems = [];
this.dataLength = this.Length(this.items);
this.initData(this.deepCopy(this.items), 1, null);
this.checkGroup = this.renderCheck(this.items);
if (this.checkGroup.length == this.dataLength) {
this.checks = true
this.checks = true;
} else {
this.checks = false
this.checks = false;
}
}
},
columns: {
handler() {
this.cloneColumns = this.makeColumns()
this.cloneColumns = this.makeColumns();
},
deep: true
deep: true,
},
checkGroup(data) {
this.checkAllGroupChange(data)
}
this.checkAllGroupChange(data);
},
},
mounted() {
if (this.items) {
this.dataLength = this.Length(this.items)
this.initData(this.deepCopy(this.items), 1, null)
this.cloneColumns = this.makeColumns()
this.checkGroup = this.renderCheck(this.items)
this.dataLength = this.Length(this.items);
this.initData(this.deepCopy(this.items), 1, null);
this.cloneColumns = this.makeColumns();
this.checkGroup = this.renderCheck(this.items);
if (this.checkGroup.length == this.dataLength) {
this.checks = true
this.checks = true;
} else {
this.checks = false
this.checks = false;
}
}
// 绑定onresize事件 监听屏幕变化设置宽
this.$nextTick(() => {
this.screenWidth = document.body.clientWidth
})
this.screenWidth = document.body.clientWidth;
});
window.onresize = () =>
(() => {
window.screenWidth = document.body.clientWidth
this.screenWidth = window.screenWidth
})()
window.screenWidth = document.body.clientWidth;
this.screenWidth = window.screenWidth;
})();
},
methods: {
// 有无多选框折叠位置优化
iconRow() {
for (let i = 0, len = this.columns.length; i < len; i++) {
if (this.columns[i].type == 'selection') {
return 1
if (this.columns[i].type == "selection") {
return 1;
}
}
return 0
return 0;
},
// 设置td宽度,td的align
tdStyle(column) {
const style = {}
const style = {};
if (column.align) {
style['text-align'] = column.align
style["text-align"] = column.align;
}
if (column.width) {
style['width'] = `${column.width}px`
style["width"] = `${column.width}px`;
}
return style
return style;
},
// 排序事件
handleSort(index, type) {
this.cloneColumns.forEach((col) => (col._sortType = 'normal'))
this.cloneColumns.forEach((col) => (col._sortType = "normal"));
if (this.cloneColumns[index]._sortType === type) {
this.cloneColumns[index]._sortType = 'normal'
this.cloneColumns[index]._sortType = "normal";
} else {
this.cloneColumns[index]._sortType = type
this.cloneColumns[index]._sortType = type;
}
this.$emit(
'on-sort-change',
"on-sort-change",
this.cloneColumns[index].key,
this.cloneColumns[index]._sortType
)
);
},
// 点击某一行事件
RowClick(data, event, index, text) {
// this.iconName = true;
const result = this.makeData(data)
this.$emit('on-row-click', result, event, index, text)
const result = this.makeData(data);
this.$emit("on-row-click", result, event, index, text);
},
//点击图标
RowClickIcon(event, index, text) {
this.$emit('on-icon-click', event, index, text)
this.$emit("on-icon-click", event, index, text);
},
//修改排序
updataOrderNum(data, event, index, text) {
......@@ -276,9 +276,9 @@ export default {
// console.log(event.orderNum + "nnnnnnnn");
var data = {
id: event.id,
orderNum: event.orderNum
}
this.updata(data)
orderNum: event.orderNum,
};
this.updata(data);
},
//修改颜色
updataColor(data, event, index, text) {
......@@ -286,144 +286,144 @@ export default {
//console.log(event.color + "nnnnnnnn");
var data = {
id: event.id,
color: event.color
}
this.updata(data)
color: event.color,
};
this.updata(data);
},
//修改单个字段
updata(data) {
this.$http.dic
.dicUpdate(data)
.then((res) => {
this.$Message.success(res.msg)
this.$parent.getInfo()
this.$Message.success(res.msg);
this.$parent.getInfo();
})
.catch((error) => {
this.$Message.error(error.msg)
})
this.$Message.error(error.msg);
});
},
// 点击事件 返回数据处理
makeData(data) {
const t = this.type(data)
let o
if (t === 'array') {
o = []
} else if (t === 'object') {
o = {}
const t = this.type(data);
let o;
if (t === "array") {
o = [];
} else if (t === "object") {
o = {};
} else {
return data
return data;
}
if (t === 'array') {
if (t === "array") {
for (let i = 0; i < data.length; i++) {
o.push(this.makeData(data[i]))
o.push(this.makeData(data[i]));
}
} else if (t === 'object') {
} else if (t === "object") {
for (const i in data) {
if (
i != 'spaceHtml' &&
i != 'parent' &&
i != 'level' &&
i != 'expanded' &&
i != 'isShow' &&
i != 'load'
i != "spaceHtml" &&
i != "parent" &&
i != "level" &&
i != "expanded" &&
i != "isShow" &&
i != "load"
) {
o[i] = this.makeData(data[i])
o[i] = this.makeData(data[i]);
}
}
}
return o
return o;
},
// 处理表头数据
makeColumns() {
const columns = this.deepCopy(this.columns)
this.tdsWidth = 0
const columns = this.deepCopy(this.columns);
this.tdsWidth = 0;
columns.forEach((column, index) => {
column._index = index
column._width = column.width ? column.width : ''
column._sortType = 'normal'
this.tdsWidth += column.width ? parseFloat(column.width) : 0
})
return columns
column._index = index;
column._width = column.width ? column.width : "";
column._sortType = "normal";
this.tdsWidth += column.width ? parseFloat(column.width) : 0;
});
return columns;
},
// 数据处理 增加自定义属性监听
initData(items, level, parent) {
// this.initItems = []
let spaceHtml = ''
let spaceHtml = "";
for (let i = 1; i < level; i++) {
spaceHtml +=
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class='ms-tree-space'></i>"
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class='ms-tree-space'></i>";
}
items.forEach((item, index) => {
item = Object.assign({}, item, {
parent,
level,
spaceHtml
})
if (typeof item.expanded === 'undefined') {
spaceHtml,
});
if (typeof item.expanded === "undefined") {
item = Object.assign({}, item, {
expanded: true
})
expanded: true,
});
}
if (typeof item.show === 'undefined') {
if (typeof item.show === "undefined") {
item = Object.assign({}, item, {
isShow: true
})
isShow: true,
});
}
if (typeof item.isChecked === 'undefined') {
if (typeof item.isChecked === "undefined") {
item = Object.assign({}, item, {
isChecked: false
})
isChecked: false,
});
}
item = Object.assign({}, item, {
load: !!item.expanded
})
this.initItems.push(item)
load: !!item.expanded,
});
this.initItems.push(item);
if (item.children && item.expanded) {
this.initData(item.children, level + 1, item)
this.initData(item.children, level + 1, item);
}
items.splice(index, 1, item)
})
items.splice(index, 1, item);
});
},
// 隐藏显示
show(item) {
return (
item.level == 1 || (item.parent && item.parent.expanded && item.isShow)
)
);
},
toggle(index, item) {
const level = item.level + 1
let spaceHtml = ''
const level = item.level + 1;
let spaceHtml = "";
for (let i = 1; i < level; i++) {
spaceHtml += "<i class='ms-tree-space'></i>"
spaceHtml += "<i class='ms-tree-space'></i>";
}
if (item.children) {
if (item.expanded) {
item.expanded = !item.expanded
this.close(index, item)
item.expanded = !item.expanded;
this.close(index, item);
} else {
item.expanded = !item.expanded
item.expanded = !item.expanded;
if (item.load) {
this.open(index, item)
this.open(index, item);
} else {
item.load = true
item.load = true;
item.children.forEach((child, childIndex) => {
this.initItems.splice(index + childIndex + 1, 0, child)
this.initItems.splice(index + childIndex + 1, 0, child);
// 设置监听属性
this.$set(this.initItems[index + childIndex + 1], 'parent', item)
this.$set(this.initItems[index + childIndex + 1], 'level', level)
this.$set(this.initItems[index + childIndex + 1], "parent", item);
this.$set(this.initItems[index + childIndex + 1], "level", level);
this.$set(
this.initItems[index + childIndex + 1],
'spaceHtml',
"spaceHtml",
spaceHtml
)
this.$set(this.initItems[index + childIndex + 1], 'isShow', true)
);
this.$set(this.initItems[index + childIndex + 1], "isShow", true);
this.$set(
this.initItems[index + childIndex + 1],
'expanded',
"expanded",
false
)
})
);
});
}
}
}
......@@ -431,42 +431,42 @@ export default {
open(index, item) {
if (item.children) {
item.children.forEach((child, childIndex) => {
child.isShow = true
child.isShow = true;
if (child.children && child.expanded) {
this.open(index + childIndex + 1, child)
this.open(index + childIndex + 1, child);
}
})
});
}
},
close(index, item) {
if (item.children) {
item.children.forEach((child, childIndex) => {
child.isShow = false
child.expanded = false
child.isShow = false;
child.expanded = false;
if (child.children) {
this.close(index + childIndex + 1, child)
this.close(index + childIndex + 1, child);
}
})
});
}
},
// 点击check勾选框,判断是否有children节点 如果有就一并勾选
handleCheckClick(data, event, index) {
data.isChecked = !data.isChecked
const arr = data.children
data.isChecked = !data.isChecked;
const arr = data.children;
if (arr) {
if (data.isChecked) {
this.checkGroup.push(data.id)
this.checkGroup.push(data.id);
for (let i = 0; i < arr.length; i++) {
this.checkGroup.push(arr[i].id)
this.checkGroup.push(arr[i].id);
}
} else {
for (let i = 0; i < this.checkGroup.length; i++) {
if (this.checkGroup[i] == data.id) {
this.checkGroup.splice(i, 1)
this.checkGroup.splice(i, 1);
}
for (let j = 0; j < arr.length; j++) {
if (this.checkGroup[i] == arr[j].id) {
this.checkGroup.splice(i, 1)
this.checkGroup.splice(i, 1);
}
}
}
......@@ -475,136 +475,138 @@ export default {
},
// checkbox 全选 选择事件
handleCheckAll() {
this.checks = !this.checks
this.checks = !this.checks;
if (this.checks) {
this.checkGroup = this.getArray(
this.checkGroup.concat(this.All(this.items))
)
);
} else {
this.checkGroup = []
this.checkGroup = [];
}
// this.$emit('on-selection-change', this.checkGroup)
},
// 数组去重
getArray(a) {
const hash = {}
const len = a.length
const result = []
const hash = {};
const len = a.length;
const result = [];
for (let i = 0; i < len; i++) {
if (!hash[a[i]]) {
hash[a[i]] = true
result.push(a[i])
hash[a[i]] = true;
result.push(a[i]);
}
}
return result
return result;
},
checkAllGroupChange(data) {
if (this.dataLength > 0 && data.length === this.dataLength) {
this.checks = true
this.checks = true;
} else {
this.checks = false
this.checks = false;
}
this.$emit('on-selection-change', this.checkGroup)
this.$emit("on-selection-change", this.checkGroup);
},
All(data) {
let arr = []
let arr = [];
data.forEach((item) => {
arr.push(item.id)
arr.push(item.id);
if (item.children && item.children.length > 0) {
arr = arr.concat(this.All(item.children))
arr = arr.concat(this.All(item.children));
}
})
return arr
});
return arr;
},
// 返回树形数据长度
Length(data) {
let { length } = data
let { length } = data;
data.forEach((child) => {
if (child.children) {
length += this.Length(child.children)
length += this.Length(child.children);
}
})
return length
});
return length;
},
// 返回表头
renderHeader(column, $index) {
if ('renderHeader' in this.columns[$index]) {
return this.columns[$index].renderHeader(column, $index)
if ("renderHeader" in this.columns[$index]) {
return this.columns[$index].renderHeader(column, $index);
}
return column.title || '#'
return column.title || "#";
},
// 返回内容
renderBody(row, column, index) {
return row[column.key]
return row[column.key];
},
// 默认选中
renderCheck(data) {
let arr = []
let arr = [];
data.forEach((item) => {
if (item._checked) {
arr.push(item.id)
arr.push(item.id);
}
if (item.children && item.children.length > 0) {
arr = arr.concat(this.renderCheck(item.children))
arr = arr.concat(this.renderCheck(item.children));
}
})
return arr
});
return arr;
},
// 深度拷贝函数
deepCopy(data) {
const t = this.type(data)
let o
let i
let ni
if (t === 'array') {
o = []
} else if (t === 'object') {
o = {}
const t = this.type(data);
let o;
let i;
let ni;
if (t === "array") {
o = [];
} else if (t === "object") {
o = {};
} else {
return data
return data;
}
if (t === 'array') {
if (t === "array") {
for (i = 0, ni = data.length; i < ni; i++) {
o.push(this.deepCopy(data[i]))
o.push(this.deepCopy(data[i]));
}
return o
return o;
}
if (t === 'object') {
if (t === "object") {
for (i in data) {
o[i] = this.deepCopy(data[i])
o[i] = this.deepCopy(data[i]);
}
return o
return o;
}
},
type(obj) {
const { toString } = Object.prototype
const { toString } = Object.prototype;
const map = {
'[object Boolean]': 'boolean',
'[object Number]': 'number',
'[object String]': 'string',
'[object Function]': 'function',
'[object Array]': 'array',
'[object Date]': 'date',
'[object RegExp]': 'regExp',
'[object Undefined]': 'undefined',
'[object Null]': 'null',
'[object Object]': 'object'
}
return map[toString.call(obj)]
}
"[object Boolean]": "boolean",
"[object Number]": "number",
"[object String]": "string",
"[object Function]": "function",
"[object Array]": "array",
"[object Date]": "date",
"[object RegExp]": "regExp",
"[object Undefined]": "undefined",
"[object Null]": "null",
"[object Object]": "object",
};
return map[toString.call(obj)];
},
},
beforeDestroy() {
window.onresize = null
}
}
window.onresize = null;
},
};
</script>
<style lang="less">
@import "../../../assets/css/custom.less";
.treeTbale {
overflow: 0 auto;
width: 100% !important;
.table-tools {
line-height: 40px;
background: @right-header-bg;
.table-search {
float: left;
line-height: 40px;
......@@ -619,14 +621,14 @@ export default {
}
}
.icon-set {
font-size: 17px;
margin-left: 5px;
display: inline-block;
}
font-size: 17px;
margin-left: 5px;
display: inline-block;
}
.icon-set .ivu-icon {
cursor: pointer;
}
.icon-set .ivu-icon {
cursor: pointer;
}
table {
border-spacing: 0;
border-collapse: collapse;
......
@import "../../../assets/css/custom.less";
.results {
font-family: Microsoft YaHei;
.ivu-layout-sider {
background: rgba(255, 255, 255, 1);
background:@layout-content-bg-color;
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 88vh;
......@@ -22,7 +23,7 @@
h4 {
height: 45px;
line-height: 45px;
border-bottom: 1px solid #e4e6ed;
border-bottom: 1px solid @left-tree-header-boder-color;
margin-bottom: 15px;
padding-left: 10px;
......@@ -64,15 +65,16 @@
.ivu-layout-content {
margin-left: 5px;
background: rgba(255, 255, 255, 1);
background: @right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 88vh;
overflow: auto;
position: relative;
position: relative;
.i-row {
height: 45px;
line-height: 45px;
border-bottom: 1px solid #e4e6ed;
border-bottom: 1px solid @left-tree-header-boder-color;
margin-bottom: 15px;
padding-left: 10px;
......@@ -102,7 +104,7 @@ position: relative;
.btn {
position: absolute;
top:7px;
top: 7px;
right: 15px;
}
}
......
......@@ -12,7 +12,7 @@
<a class="row_more fr" @click="toivew">更多</a>
</p>
<div class="row_card_body">
<Table border :columns="columns1" :data="data1"></Table>
<Table :columns="columns1" :data="data1"></Table>
</div>
</div>
</div>
......
......@@ -54,7 +54,7 @@
</Col>
</Row>
</Form>
<Table border :columns="columns" :data="data"></Table>
<Table :columns="columns" :data="data"></Table>
<div class="page-v">
<Page :total="4" size="small" show-elevator show-sizer show-total :page-size="20" />
</div>
......
......@@ -36,7 +36,7 @@
</Col>
</Row>
</Form>
<Table border :columns="columns" :data="data"></Table>
<Table :columns="columns" :data="data"></Table>
<div class="page-v">
<Page :total="5" size="small" show-elevator show-sizer show-total :page-size="20" />
</div>
......
......@@ -39,7 +39,7 @@
</Col>
</Row>
</Form>
<Table border :columns="columns" :data="data"></Table>
<Table :columns="columns" :data="data"></Table>
<div class="page-v">
<Page :total="14" size="small" show-elevator show-sizer show-total :page-size="20" />
</div>
......
......@@ -48,7 +48,7 @@
</Col>
</Row>
</Form>
<Table border :columns="columns" :data="data"></Table>
<Table :columns="columns" :data="data"></Table>
<div class="page-v">
<Page :total="11" size="small" show-elevator show-sizer show-total :page-size="20" />
</div>
......
......@@ -48,7 +48,7 @@
</Col>
</Row>
</Form>
<Table border :columns="columns" :data="data"></Table>
<Table :columns="columns" :data="data"></Table>
<div class="page-v">
<Page :total="11" size="small" show-elevator show-sizer show-total :page-size="20" />
</div>
......
......@@ -53,7 +53,7 @@
</Col>
</Row>
</Form>
<Table border :columns="columns" :data="data"></Table>
<Table :columns="columns" :data="data"></Table>
<div class="page-v">
<Page :total="10" size="small" show-elevator show-sizer show-total :page-size="20" />
</div>
......
......@@ -39,7 +39,7 @@
</Col>
</Row>
</Form>
<Table border :columns="columns" :data="data"></Table>
<Table :columns="columns" :data="data"></Table>
<div class="page-v">
<Page :total="6" size="small" show-elevator show-sizer show-total :page-size="20" />
</div>
......
......@@ -12,7 +12,7 @@
</Col>
<Col :span="16">
<div class="table-b">
<Table border :columns="columns1" :data="data1" height="260"></Table>
<Table :columns="columns1" :data="data1" height="260"></Table>
</div>
</Col>
</Row>
......
......@@ -14,7 +14,7 @@
</div>
<div class="table">
<Table stripe ref="table" border :columns="moviecolumn" :data="moviedata" class="tableCommon"></Table>
<Table stripe ref="table" :columns="moviecolumn" :data="moviedata" class="tableCommon"></Table>
<Page
:total="datatotal"
:current="pageindex"
......
......@@ -81,7 +81,7 @@
</Col>
</Row>
</Form>
<Table stripe ref="table" border :columns="column1" :data="data1" class="tableCommon">
<Table stripe ref="table" :columns="column1" :data="data1" class="tableCommon">
<template slot-scope="{ row,index }" slot="title">
<state code="plan.dispatch.pauseCause" type="text" :value="row.pausecause_id"></state>
</template>
......
......@@ -12,7 +12,7 @@
/>
</div>
<div class="table">
<Table stripe ref="table" border :columns="moviecolumn" :data="moviedata" class="tableCommon"></Table>
<Table stripe ref="table" :columns="moviecolumn" :data="moviedata" class="tableCommon"></Table>
</div>
</div>
</template>
......
......@@ -12,7 +12,7 @@
/>
</div>
<div >
<Table stripe ref="table" border :columns="moviecolumn" :data="moviedata" class="tableCommon"></Table>
<Table stripe ref="table" :columns="moviecolumn" :data="moviedata" class="tableCommon"></Table>
</div>
</div>
</template>
......
......@@ -27,7 +27,7 @@
<Button type="primary" :disabled="ishavzj" @click="SendCheckRecord()" class="title_btn ml10">送检记录</Button>
</div>
<div class="table01">
<Table ref="table" border class="tableCommon" :height="taHeight" :columns="recordcolumn" :data="recorddata">
<Table ref="table" class="tableCommon" :height="taHeight" :columns="recordcolumn" :data="recorddata">
<template slot-scope="{ row,index }" slot="selffillin">
<template v-if="row.selfchecklist.fillinstatus==0||productobj.productstatus==4">
<Checkbox
......
......@@ -25,7 +25,7 @@
<Button type="primary" @click="save()" class="title_btn ml10" v-noClick>汇报</Button>
</div>
<div class="table01">
<Table stripe ref="table" border :columns="moviecolumn" :height="taHeight" :data="data1" class="tableCommon">
<Table stripe ref="table" :columns="moviecolumn" :height="taHeight" :data="data1" class="tableCommon">
<template slot-scope="{ row,index }" slot="hg">
<template v-if="row.status==0">
<template v-if="row.productstatus1==0">
......
<template>
<div class="new_box">
<Table stripe ref="table" border :columns="moviecolumn" :data="moviedata" class="tableCommon"></Table>
<Table stripe ref="table" :columns="moviecolumn" :data="moviedata" class="tableCommon"></Table>
<Page
:total="datatotal"
:current="pageindex"
......
<template>
<div class="table-contentProcess">
<div class="table-contentProcess">
<div class="table-tools">
<div class="table-search">
<Form inline>
<FormItem>
<span>导入到</span>
</FormItem>
<FormItem>
<dictionary code="import.im.page" style="width:160px" @on-change="pageChange" v-model="pageType"></dictionary>
</FormItem>
<FormItem>
<Button type="primary" @click="openInfoModal" :disabled="btnIm">导入</Button>
</FormItem>
<FormItem>
<div style="height:34px;overflow: hidden;padding:0">
<Upload action :before-upload="beforeUpload" ref="uploadfile" :format="formatList">
<Button icon="ios-cloud-upload-outline" @click="resetParms">重新上传</Button>
</Upload>
</div>
</FormItem>
</Form>
</div>
<div class="btns">
<Form inline>
<FormItem>
<Tooltip content="下载文件">
<a @click="downFile" tooltip="1111">
<Icon type="md-download" />{{entity.file}}
</a>
</Tooltip>
</FormItem>
<FormItem>
<Tooltip content="预览文件">
<a class="ml10 mr10" @click="resetTable">
<Icon type="md-eye" />预览
</a>
</Tooltip>
</FormItem>
<FormItem>
<RadioGroup v-model="excelType" type="button" @on-change="changeExcel" size="small">
<Tooltip content="文件数据">
<Radio label="0">
<Icon type="ios-list-box-outline" />
</Radio>
</Tooltip>
<Tooltip content="粘贴Excel数据">
<Radio label="1">
<Icon type="ios-copy" />
</Radio>
</Tooltip>
</RadioGroup>
</FormItem>
</Form>
</div>
<div class="table-search">
<Form inline>
<FormItem>
<span>导入到</span>
</FormItem>
<FormItem>
<dictionary
code="import.im.page"
style="width:160px"
@on-change="pageChange"
v-model="pageType"
></dictionary>
</FormItem>
<FormItem>
<Button type="primary" @click="openInfoModal" :disabled="btnIm">导入</Button>
</FormItem>
<FormItem>
<div style="height:34px;overflow: hidden;padding:0">
<Upload action :before-upload="beforeUpload" ref="uploadfile" :format="formatList">
<Button icon="ios-cloud-upload-outline" @click="resetParms">重新上传</Button>
</Upload>
</div>
</FormItem>
</Form>
</div>
<div class="btns">
<Form inline>
<FormItem>
<Tooltip content="下载文件">
<a @click="downFile" tooltip="1111">
<Icon type="md-download" />
{{entity.file}}
</a>
</Tooltip>
</FormItem>
<FormItem>
<Tooltip content="预览文件">
<a class="ml10 mr10" @click="resetTable">
<Icon type="md-eye" />预览
</a>
</Tooltip>
</FormItem>
<FormItem>
<RadioGroup v-model="excelType" type="button" @on-change="changeExcel" size="small">
<Tooltip content="文件数据">
<Radio label="0">
<Icon type="ios-list-box-outline" />
</Radio>
</Tooltip>
<Tooltip content="粘贴Excel数据">
<Radio label="1">
<Icon type="ios-copy" />
</Radio>
</Tooltip>
</RadioGroup>
</FormItem>
</Form>
</div>
</div>
<div class="table-main" ref="main">
<Table :border="true" :columns="columnsImport" :data="excelData" :height="tdHeightExcel" :no-data-text="noDataText" ref="table" class="tableCommon" v-if="tableImport"></Table>
<component :is="detailExcel" ref="comExcel" @on-datalength="datalength" />
<Table
:border="true"
:columns="columnsImport"
:data="excelData"
:height="tdHeightExcel"
:no-data-text="noDataText"
ref="table"
class="tableCommon"
v-if="tableImport"
></Table>
<component :is="detailExcel" ref="comExcel" @on-datalength="datalength" />
</div>
<FooterToolbar v-if="sheetNames.length>1&&tableImport">
<Form inline>
<FormItem>
<Tabs :animated="false" :value="0" @on-click="sheetClick">
<TabPane :label="item" v-for="(item,index) in sheetNames" :key="index"></TabPane>
</Tabs>
</FormItem>
</Form>
<Form inline>
<FormItem>
<Tabs :animated="false" :value="0" @on-click="sheetClick">
<TabPane :label="item" v-for="(item,index) in sheetNames" :key="index"></TabPane>
</Tabs>
</FormItem>
</Form>
</FooterToolbar>
<Modal v-model="infoModal" :title="titleInfo" fullscreen>
<DataGrid :tool="false" :page="false" :columns="colsIm" :data="dataIm" :height="tdHeightExcel+30" ref="dataImport"></DataGrid>
<div slot="footer">
<Button @click="infoModal=false">关闭</Button>
<Button type="primary" @click="importOk" v-show="imBtn">确定导入</Button>
</div>
<DataGrid
:tool="false"
:page="false"
:columns="colsIm"
:data="dataIm"
:height="tdHeightExcel+30"
ref="dataImport"
></DataGrid>
<div slot="footer">
<Button @click="infoModal=false">关闭</Button>
<Button type="primary" @click="importOk" v-show="imBtn">确定导入</Button>
</div>
</Modal>
</div>
</div>
</template>
<script>
import Api from "./api";
import BaseColums from "./baseColums";
import XLSX from "xlsx";
import {
Switch
} from "view-design";
import { Switch } from "view-design";
export default {
name: "Edit",
data() {
return {
pageType: undefined,
tabVal: 0,
infoModal: false,
entity: {},
downUrl: fileUrlDown,
fileUrlPath: "",
disabled: false,
detailExcel: null,
tableImport: true,
tdHeightExcel: "",
excelData: [],
excelDataBack: [], //临时存储原始数据
formatList: ["xlsx"],
columnsImport: [],
departArr: [], //部门list
sheetNames: [], //excel的表明
workBook: {},
openDatas: [],
dataType: 0,
//new
colsIm: [],
dataIm: [],
excelType: '0',
btnIm: true,
listLength: 0,
titleInfo: '',
noDataText: '暂无数据',
imBtn: true,
//物料管理
treeData: [], //物料管理左侧类别树
codeRuleData: [], //物料编码等信息
routingHeaderData: [], //工艺规程列表信息
};
},
props: {
eid: Number,
},
created() {
this.tdHeightExcel = window.innerHeight - 180;
//导出对列表头进行预加载start
this.$api.get(`${systemUrl}/Department/GetDepartments`).then((r) => {
this.departArr = r.result.items;
});
//导出对列表头进行预加载end
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
//物料加载类型数据
this.getTreeData();
this.getcodeRuleData();
//获取工艺规程信息
this.getRoutingHeaderData();
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.tdHeightExcel = window.screenHeight - 180;
})();
};
},
methods: {
load(v) {
Api.get({
id: v,
}).then((r) => {
this.entity = r.result || {};
});
this.dataType = 0;
this.sheetNames = [];
this.excelData = [];
this.excelDataBack = [];
Api.openExcel({
id: v,
}).then((res) => {
if (res.success) {
this.openDatas = res.result || [];
this.dealOpenTable(0);
//获取excel sheetname
if (res.result.length > 0) {
res.result.forEach((el) => {
this.sheetNames.push(el.title);
});
}
}
}).catch(e => {
this.noDataText = "文件无法解析,建议下载原文件后转换为Excel文件格式重新上传!"
})
name: "Edit",
data() {
return {
pageType: undefined,
tabVal: 0,
infoModal: false,
entity: {},
downUrl: fileUrlDown,
fileUrlPath: "",
disabled: false,
detailExcel: null,
tableImport: true,
tdHeightExcel: "",
excelData: [],
excelDataBack: [], //临时存储原始数据
formatList: ["xlsx"],
columnsImport: [],
departArr: [], //部门list
sheetNames: [], //excel的表明
workBook: {},
openDatas: [],
dataType: 0,
//new
colsIm: [],
dataIm: [],
excelType: "0",
btnIm: true,
listLength: 0,
titleInfo: "",
noDataText: "暂无数据",
imBtn: true,
//物料管理
treeData: [], //物料管理左侧类别树
codeRuleData: [], //物料编码等信息
routingHeaderData: [], //工艺规程列表信息
};
},
props: {
eid: Number,
},
created() {
this.tdHeightExcel = window.innerHeight - 180;
//导出对列表头进行预加载start
this.$api.get(`${systemUrl}/Department/GetDepartments`).then((r) => {
this.departArr = r.result.items;
});
},
//加载原文件列表
dealOpenTable(val) {
this.excelData = this.openDatas[val].dataTable;
this.excelDataBack = this.openDatas[val].dataTable;
this.listLength = this.excelData.length
var tempCos = Object.keys(this.openDatas[val].dataTable[0]); //获取列表标题
this.columnsImport = [];
var headersNow = [];
headersNow.push({
type: 'index',
width: 80,
align: 'right',
title: '序号'
})
tempCos.forEach((el) => {
let headObj = {};
headObj.title = el;
headObj.key = el;
headersNow.push(headObj);
});
this.columnsImport = headersNow;
},
//重新处理colum
loadColum(columns) {
let tempCol = this.$u.clone(columns);
tempCol.unshift({
type: 'index',
width: 80,
align: 'right',
title: '序号'
})
tempCol.forEach((ele, index) => {
if (ele.key == "action") {
ele.hide = true;
}
});
this.colsIm = tempCol;
//处理原始数据和表头进行对应
let temCol = this.$u.clone(this.colsIm); //原始数据表头
let temColPage = this.$u.clone(columns); //需要显示的页面的表头
//let temData = this.$u.clone(this.excelDataBack); //原始数据
let temData = []; //原始数据
if (this.excelType == "0") {
temData = this.$u.clone(this.excelDataBack)
} else {
temData = this.$u.clone(this.$refs.comExcel.excelData)
}
let arrTitleUse = []; //使用数据字典的字段
let arrTitleUse1 = []; //使用物料编码的字段
temColPage.forEach((elCode) => {
if (elCode.code) {
arrTitleUse.push({
key: elCode.key,
code: elCode.code,
});
}
if (elCode.materialKey) { //临时存放物料管理大类和子类列表
arrTitleUse1.push({
key: elCode.key,
code: elCode.materialKey
});
}
});
let useData = []; //重新组织list列表数据
temData.forEach((elData, index) => {
let objTm = {};
temCol.forEach((elTitle) => {
objTm[elTitle.key] = elData[elTitle.title];
});
useData.push(objTm);
});
//对列表里的部门及数据字典项进行处理
useData.forEach(eles => {
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if (
[(eles.departmentTitle &&
eles.departmentTitle != "") || (eles.departmentName &&
eles.departmentName != "")] &&
(!eles.departmentId || eles.departmentId == "")
) {
this.departArr.forEach((e) => {
if ((eles.departmentTitle && eles.departmentTitle == e.name) || (eles.departmentName && eles.departmentName == e.name)) {
eles.departmentId = e.id;
}
});
} else if (
//如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle
eles.departmentId &&
eles.departmentId + "" != "" &&
(!eles.departmentTitle || eles.departmentTitle == "") && (!eles.departmentName || eles.departmentName == "")
) {
this.departArr.forEach((e) => {
if (eles.departmentId && eles.departmentId == e.id) {
eles.departmentTitle = e.name;
eles.departmentName = e.name;
}
});
}
arrTitleUse.forEach((elem) => {
if (eles[elem.key] && eles[elem.key] != "" && eles[elem.key] != null) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
eles[elem.key] = this.$u.dirCode(
this.$store.getters.dictionaryByKey(elem.code),
eles[elem.key]
);
}
});
})
this.dataIm = useData;
},
//下载原excel文件
downFile() {
let truePath = this.entity.path;
if (truePath.length > 2) {
if (
truePath.substring(0, 7).toLowerCase() == "http://" ||
truePath.substring(0, 8).toLowerCase() == "https://"
) {
window.open(truePath, "_blank");
} else {
this.fileUrlPath = this.downUrl + this.entity.path;
window.open(this.fileUrlPath, "_blank");
}
}
},
//导入excel文件
//打开传时初始化
resetParms() {
this.pageType = undefined;
this.tdHeightExcel = window.innerHeight - 180;
},
async beforeUpload(file) {
//初始化
this.sheetNames = [];
this.workBook = {};
this.$refs.uploadfile.clearFiles(); //清除上一次上传文件列表
//上传成功后的读取到excel信息
this.workBook = await this.$u.readXLSX(file);
this.sheetNames = this.workBook.SheetNames; //execel里的表明
this.dealSheet(0); //默认显示第一个表
return false;
},
//对上传的excel表信息进行处理,不对表头进行处理
dealSheet(index) {
this.dataType = 1;
this.columnsImport = [];
this.excelData = [];
this.excelDataBack = [];
const sheet2JSONOpts = {
defval: "", //给defval赋值为空的字符串
};
var csv = XLSX.utils.sheet_to_csv(
this.workBook.Sheets[this.workBook.SheetNames[index]],
sheet2JSONOpts
);
//导出对列表头进行预加载end
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
//物料加载类型数据
this.getTreeData();
this.getcodeRuleData();
//获取工艺规程信息
this.getRoutingHeaderData();
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.tdHeightExcel = window.screenHeight - 180;
})();
};
},
methods: {
load(v) {
Api.get({
id: v,
}).then((r) => {
this.entity = r.result || {};
});
this.dataType = 0;
this.sheetNames = [];
this.excelData = [];
this.excelDataBack = [];
var lines = csv.split("\n"); //第一行标题
var headers = lines[0].split(",");
var headersNow = [];
headersNow.push({
type: 'index',
width: 80,
align: 'right',
title: '序号'
})
headers.forEach((elHead) => {
let headObj = {};
headObj.title = elHead;
headObj.key = elHead;
headersNow.push(headObj);
});
this.columnsImport = headersNow;
var result = [];
for (var i = 1; i < lines.length - 1; i++) {
var obj = {};
var currentline = lines[i].split(",");
for (var j = 0; j < headers.length; j++) {
obj[headers[j]] = currentline[j];
}
result.push(obj);
}
this.excelData = result;
this.excelDataBack = result;
this.changeExcel(0)
},
//切换sheet表重新加载
sheetClick(val) {
this.tabVal = val
if (this.dataType == 0) {
this.dealOpenTable(val);
} else {
this.dealSheet(val);
}
if (this.pageType != undefined) {
this.pageChange(this.pageType)
}
},
//选择导入的模块 0:用户管理
pageChange(val) {
this.btnIm = false
if (val == undefined) {
this.btnIm = true
} else {
this.btnIm = false
Api.openExcel({
id: v,
})
.then((res) => {
if (res.success) {
this.openDatas = res.result || [];
this.dealOpenTable(0);
//获取excel sheetname
if (res.result.length > 0) {
res.result.forEach((el) => {
this.sheetNames.push(el.title);
});
}
}
})
.catch((e) => {
this.noDataText =
"文件无法解析,建议下载原文件后转换为Excel文件格式重新上传!";
});
},
//加载原文件列表
dealOpenTable(val) {
this.excelData = this.openDatas[val].dataTable;
this.excelDataBack = this.openDatas[val].dataTable;
this.listLength = this.excelData.length;
var tempCos = Object.keys(this.openDatas[val].dataTable[0]); //获取列表标题
this.columnsImport = [];
var headersNow = [];
headersNow.push({
type: "index",
width: 80,
align: "right",
title: "序号",
});
tempCos.forEach((el) => {
let headObj = {};
headObj.title = el;
headObj.key = el;
headersNow.push(headObj);
});
this.columnsImport = headersNow;
},
//重新处理colum
loadColum(columns) {
let tempCol = this.$u.clone(columns);
tempCol.unshift({
type: "index",
width: 80,
align: "right",
title: "序号",
});
tempCol.forEach((ele, index) => {
if (ele.key == "action") {
ele.hide = true;
}
});
this.colsIm = tempCol;
},
handleClose() {
this.$emit("on-close");
},
cancelExcel() {
this.excelData = [];
this.excelDataBack = [];
this.$refs.uploadfile.clearFiles();
let parms = {
status: 1,
id: this.eid
}
//导入中心列表数据状态更新
Api.updateimportstatus(parms).then(res => {
if (res.success) {
this.$emit("on-ok");
}
})
this.$emit("on-close");
},
//处理原始数据和表头进行对应
let temCol = this.$u.clone(this.colsIm); //原始数据表头
let temColPage = this.$u.clone(columns); //需要显示的页面的表头
//let temData = this.$u.clone(this.excelDataBack); //原始数据
let temData = []; //原始数据
if (this.excelType == "0") {
temData = this.$u.clone(this.excelDataBack);
} else {
temData = this.$u.clone(this.$refs.comExcel.excelData);
}
let arrTitleUse = []; //使用数据字典的字段
let arrTitleUse1 = []; //使用物料编码的字段
temColPage.forEach((elCode) => {
if (elCode.code) {
arrTitleUse.push({
key: elCode.key,
code: elCode.code,
});
}
if (elCode.materialKey) {
//临时存放物料管理大类和子类列表
arrTitleUse1.push({
key: elCode.key,
code: elCode.materialKey,
});
}
});
let useData = []; //重新组织list列表数据
temData.forEach((elData, index) => {
let objTm = {};
temCol.forEach((elTitle) => {
objTm[elTitle.key] = elData[elTitle.title];
});
useData.push(objTm);
});
//重新加载excel
resetTable() {
this.pageType = undefined;
this.load(this.eid);
this.tdHeightExcel = window.innerHeight - 180;
if (this.excelType == 1) {
this.changeExcel(0)
}
},
//打开导入数据格式化后的窗口
openInfoModal() {
if (this.excelData.length > 0 && this.pageType != undefined) {
this.imBtn = true;
switch (this.pageType) {
case 0:
this.loadColum(BaseColums.columns0());
break;
case 1:
this.loadColum(BaseColums.columns1());
break;
case 2:
this.loadColum(BaseColums.columns2());
break;
case 3:
this.loadColum(BaseColums.columns3());
break;
case 4:
this.loadColum(BaseColums.columns4());
break;
case 5:
this.loadColum(BaseColums.columns5());
break;
case 6:
this.loadColum(BaseColums.columns6());
break;
default:
this.loadColum(BaseColums.columns0());
}
this.titleInfo = "批量导入到 【" + this.$u.dirName(
this.$store.getters.dictionaryByKey("import.im.page"),
this.pageType
) + "】 模块"
this.infoModal = true
} else {
this.imBtn = true;
if (this.excelData.length == 0) {
this.$Message.error("表【" + this.sheetNames[this.tabVal] + "】没有可导入的数据!")
} else if (this.pageType == undefined) {
this.$Message.error("请选择需要批量导入到的模块!")
}
//对列表里的部门及数据字典项进行处理
useData.forEach((eles) => {
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if (
[
(eles.departmentTitle && eles.departmentTitle != "") ||
(eles.departmentName && eles.departmentName != ""),
] &&
(!eles.departmentId || eles.departmentId == "")
) {
this.departArr.forEach((e) => {
if (
(eles.departmentTitle && eles.departmentTitle == e.name) ||
(eles.departmentName && eles.departmentName == e.name)
) {
eles.departmentId = e.id;
}
},
//导入按钮操作
importOk() {
switch (this.pageType) {
case 0:
this.importUser();
break;
case 2:
this.importResource();
break;
case 3:
this.importMateriel();
break;
case 4:
this.importRountingHeader();
break;
case 5:
this.importRountingBom();
break;
case 6:
this.importProductMix();
break;
default:
//this.loadColum(this.columns1);
});
} else if (
//如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle
eles.departmentId &&
eles.departmentId + "" != "" &&
(!eles.departmentTitle || eles.departmentTitle == "") &&
(!eles.departmentName || eles.departmentName == "")
) {
this.departArr.forEach((e) => {
if (eles.departmentId && eles.departmentId == e.id) {
eles.departmentTitle = e.name;
eles.departmentName = e.name;
}
},
//批量导入用户
importUser() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
userName: ele.userName,
cardNo: ele.cardNo,
gender: ele.gender,
birthday: ele.birthday,
degreeId: ele.degreeId,
departmentId: ele.departmentId,
status: ele.status,
phone: ele.phone,
email: ele.email,
licensedToWork: ele.licensedToWork,
positionId: ele.positionId,
titleId: ele.titleId,
departmentTitle: ele.departmentTitle,
};
if (ele.userName && ele.userName != '' && ele.cardNo && ele.cardNo != '' && ele.departmentId && ele.departmentId != '' && ele.phone && ele.phone != '') {
tempList.push(obj);
}
});
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
} else {
let parms = {
list: tempList,
};
let url = `${systemUrl}/userimportservice/import`
this.$api.post(url, parms).then((res) => {
if (res.success) {
this.$Message.success("成功批量导入用户管理成功模块 " + tempList.length + " 条数据");
this.imBtn = false;
this.cancelExcel();
} else {
this.$Message.error("批量导入用户管理失败!");
}
});
}
arrTitleUse.forEach((elem) => {
if (
eles[elem.key] &&
eles[elem.key] != "" &&
eles[elem.key] != null
) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
eles[elem.key] = this.$u.dirCode(
this.$store.getters.dictionaryByKey(elem.code),
eles[elem.key]
);
}
});
});
this.dataIm = useData;
},
//下载原excel文件
downFile() {
let truePath = this.entity.path;
if (truePath.length > 2) {
if (
truePath.substring(0, 7).toLowerCase() == "http://" ||
truePath.substring(0, 8).toLowerCase() == "https://"
) {
window.open(truePath, "_blank");
} else {
this.fileUrlPath = this.downUrl + this.entity.path;
window.open(this.fileUrlPath, "_blank");
}
}
},
//导入excel文件
//打开传时初始化
resetParms() {
this.pageType = undefined;
this.tdHeightExcel = window.innerHeight - 180;
},
async beforeUpload(file) {
//初始化
this.sheetNames = [];
this.workBook = {};
this.$refs.uploadfile.clearFiles(); //清除上一次上传文件列表
//上传成功后的读取到excel信息
this.workBook = await this.$u.readXLSX(file);
this.sheetNames = this.workBook.SheetNames; //execel里的表明
this.dealSheet(0); //默认显示第一个表
return false;
},
//对上传的excel表信息进行处理,不对表头进行处理
dealSheet(index) {
this.dataType = 1;
this.columnsImport = [];
this.excelData = [];
this.excelDataBack = [];
const sheet2JSONOpts = {
defval: "", //给defval赋值为空的字符串
};
var csv = XLSX.utils.sheet_to_csv(
this.workBook.Sheets[this.workBook.SheetNames[index]],
sheet2JSONOpts
);
},
//批量插入制造资源
importResource() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
nameOfResource: ele.nameOfResource ? ele.nameOfResource : "",
resourceCode: ele.resourceCode ? ele.resourceCode : "",
code: ele.code ? ele.code : "",
totalNum: ele.totalNum ? ele.totalNum : 0,
storeTitle: ele.storeTitle ? ele.storeTitle : "",
storeId: ele.storeId ? ele.storeId : null,
state: 1,
numberAvailable: ele.numberAvailable ? ele.numberAvailable : 0,
json: {},
};
if (ele.nameOfResource &&
ele.nameOfResource != "" &&
ele.code &&
ele.code != "" &&
ele.resourceCode &&
ele.resourceCode != "") {
tempList.push(obj);
}
var lines = csv.split("\n"); //第一行标题
var headers = lines[0].split(",");
var headersNow = [];
headersNow.push({
type: "index",
width: 80,
align: "right",
title: "序号",
});
headers.forEach((elHead) => {
let headObj = {};
headObj.title = elHead;
headObj.key = elHead;
headersNow.push(headObj);
});
this.columnsImport = headersNow;
var result = [];
for (var i = 1; i < lines.length - 1; i++) {
var obj = {};
var currentline = lines[i].split(",");
for (var j = 0; j < headers.length; j++) {
obj[headers[j]] = currentline[j];
}
result.push(obj);
}
this.excelData = result;
this.excelDataBack = result;
this.changeExcel(0);
},
//切换sheet表重新加载
sheetClick(val) {
this.tabVal = val;
if (this.dataType == 0) {
this.dealOpenTable(val);
} else {
this.dealSheet(val);
}
if (this.pageType != undefined) {
this.pageChange(this.pageType);
}
},
//选择导入的模块 0:用户管理
pageChange(val) {
this.btnIm = false;
if (val == undefined) {
this.btnIm = true;
} else {
this.btnIm = false;
}
},
handleClose() {
this.$emit("on-close");
},
cancelExcel() {
this.excelData = [];
this.excelDataBack = [];
this.$refs.uploadfile.clearFiles();
let parms = {
status: 1,
id: this.eid,
};
//导入中心列表数据状态更新
Api.updateimportstatus(parms).then((res) => {
if (res.success) {
this.$emit("on-ok");
}
});
this.$emit("on-close");
},
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
//重新加载excel
resetTable() {
this.pageType = undefined;
this.load(this.eid);
this.tdHeightExcel = window.innerHeight - 180;
if (this.excelType == 1) {
this.changeExcel(0);
}
},
//打开导入数据格式化后的窗口
openInfoModal() {
if (this.excelData.length > 0 && this.pageType != undefined) {
this.imBtn = true;
switch (this.pageType) {
case 0:
this.loadColum(BaseColums.columns0());
break;
case 1:
this.loadColum(BaseColums.columns1());
break;
case 2:
this.loadColum(BaseColums.columns2());
break;
case 3:
this.loadColum(BaseColums.columns3());
break;
case 4:
this.loadColum(BaseColums.columns4());
break;
case 5:
this.loadColum(BaseColums.columns5());
break;
case 6:
this.loadColum(BaseColums.columns6());
break;
default:
this.loadColum(BaseColums.columns0());
}
this.titleInfo =
"批量导入到 【" +
this.$u.dirName(
this.$store.getters.dictionaryByKey("import.im.page"),
this.pageType
) +
"】 模块";
this.infoModal = true;
} else {
this.imBtn = true;
if (this.excelData.length == 0) {
this.$Message.error(
"表【" + this.sheetNames[this.tabVal] + "】没有可导入的数据!"
);
} else if (this.pageType == undefined) {
this.$Message.error("请选择需要批量导入到的模块!");
}
}
},
//导入按钮操作
importOk() {
switch (this.pageType) {
case 0:
this.importUser();
break;
case 2:
this.importResource();
break;
case 3:
this.importMateriel();
break;
case 4:
this.importRountingHeader();
break;
case 5:
this.importRountingBom();
break;
case 6:
this.importProductMix();
break;
default:
//this.loadColum(this.columns1);
}
},
//批量导入用户
importUser() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
userName: ele.userName,
cardNo: ele.cardNo,
gender: ele.gender,
birthday: ele.birthday,
degreeId: ele.degreeId,
departmentId: ele.departmentId,
status: ele.status,
phone: ele.phone,
email: ele.email,
licensedToWork: ele.licensedToWork,
positionId: ele.positionId,
titleId: ele.titleId,
departmentTitle: ele.departmentTitle,
};
if (
ele.userName &&
ele.userName != "" &&
ele.cardNo &&
ele.cardNo != "" &&
ele.departmentId &&
ele.departmentId != "" &&
ele.phone &&
ele.phone != ""
) {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
} else {
let parms = {
list: tempList,
};
let url = `${systemUrl}/userimportservice/import`;
this.$api.post(url, parms).then((res) => {
if (res.success) {
this.$Message.success(
"成功批量导入用户管理成功模块 " + tempList.length + " 条数据"
);
this.imBtn = false;
this.cancelExcel();
} else {
this.$Message.error("批量导入用户管理失败!");
}
});
}
},
//批量插入制造资源
importResource() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
nameOfResource: ele.nameOfResource ? ele.nameOfResource : "",
resourceCode: ele.resourceCode ? ele.resourceCode : "",
code: ele.code ? ele.code : "",
totalNum: ele.totalNum ? ele.totalNum : 0,
storeTitle: ele.storeTitle ? ele.storeTitle : "",
storeId: ele.storeId ? ele.storeId : null,
state: 1,
numberAvailable: ele.numberAvailable ? ele.numberAvailable : 0,
json: {},
};
if (
ele.nameOfResource &&
ele.nameOfResource != "" &&
ele.code &&
ele.code != "" &&
ele.resourceCode &&
ele.resourceCode != ""
) {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
} else {
let parms = {
list: tempList,
};
let url = `${resourceUrl}/resourceimportservice/import`;
this.$api
.post(url, parms)
.then((r) => {
if (r.success) {
this.$Message.success(
"成功批量导入制造资源成功模块 " + tempList.length + " 条数据"
);
this.imBtn = false;
this.cancelExcel();
} else {
let parms = {
list: tempList,
};
let url = `${resourceUrl}/resourceimportservice/import`
this.$api.post(url, parms).then((r) => {
if (r.success) {
this.$Message.success("成功批量导入制造资源成功模块 " + tempList.length + " 条数据");
this.imBtn = false;
this.cancelExcel();
} else {
this.$Message.error("批量导入失败")
}
}).catch(err => {
this.$Message.error("数据异常!");
});
this.$Message.error("批量导入失败");
}
},
//插入物料管理start
importMateriel() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
name: ele.name ? ele.name : '',
version: ele.version ? Number(ele.version) : '',
drawing: ele.drawing ? ele.drawing : '',
description: ele.description ? ele.description : "",
code: 0,
status: ele.status ? Number(ele.status) : '',
customProperties: {},
categoryId: this.getType2(ele.categoryId) ? this.getType2(ele.categoryId) : 1, //左侧树点击的id
rootCategoryId: this.getType1(ele.rootCategoryId) ? this.getType1(ele.rootCategoryId) : 1, //左侧树点击的数据的最顶层id
codeRuleId: this.getType3(ele.codeRuleId) ? this.getType3(ele.codeRuleId) : 1, //类别编码名称
codeRuleType: ele.codeRuleType ? Number(ele.codeRuleType) : 1 //类别codeType
};
if (ele.codeRuleId && this.getType3(ele.codeRuleId) != "" && ele.codeRuleType && ele.codeRuleType != "" && ele.codeRuleType != null && ele.rootCategoryId && this.getType1(ele.rootCategoryId) != "" && ele.name && ele.name != "") {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
})
.catch((err) => {
this.$Message.error("数据异常!");
});
}
},
//插入物料管理start
importMateriel() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
name: ele.name ? ele.name : "",
version: ele.version ? Number(ele.version) : "",
drawing: ele.drawing ? ele.drawing : "",
description: ele.description ? ele.description : "",
code: 0,
status: ele.status ? Number(ele.status) : "",
customProperties: {},
categoryId: this.getType2(ele.categoryId)
? this.getType2(ele.categoryId)
: 1, //左侧树点击的id
rootCategoryId: this.getType1(ele.rootCategoryId)
? this.getType1(ele.rootCategoryId)
: 1, //左侧树点击的数据的最顶层id
codeRuleId: this.getType3(ele.codeRuleId)
? this.getType3(ele.codeRuleId)
: 1, //类别编码名称
codeRuleType: ele.codeRuleType ? Number(ele.codeRuleType) : 1, //类别codeType
};
if (
ele.codeRuleId &&
this.getType3(ele.codeRuleId) != "" &&
ele.codeRuleType &&
ele.codeRuleType != "" &&
ele.codeRuleType != null &&
ele.rootCategoryId &&
this.getType1(ele.rootCategoryId) != "" &&
ele.name &&
ele.name != ""
) {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
} else {
let parms = {
list: tempList,
};
let url = `${material}/materialimportservice/import`;
this.$api
.post(url, parms)
.then((r) => {
if (r.success) {
this.$Message.success(
"成功批量导入物料管理模块 " + tempList.length + " 条数据"
);
this.imBtn = false;
this.cancelExcel();
} else {
let parms = {
list: tempList,
};
let url = `${material}/materialimportservice/import`
this.$api.post(url, parms).then((r) => {
if (r.success) {
this.$Message.success("成功批量导入物料管理模块 " + tempList.length + " 条数据");
this.imBtn = false;
this.cancelExcel();
} else {
this.$Message.error("批量导入失败")
}
}).catch(err => {
this.$Message.error("数据异常!");
});
}
},
//物料大类和子类的解析start
getTreeData() {
let data = {
conditions: []
};
this.$api.post(`${material}/category/list`, data).then((r) => {
if (r.success) {
this.treeData = r.result || []
}
});
},
getType1(val) {
let tempTreeList = this.$u.clone(this.treeData)
let rootId = ""
if (val && val != "" && val != null) {
tempTreeList.forEach(ele => {
if (ele.upId == 0 && ele.name == val) {
rootId = ele.id
}
})
}
return rootId
},
getType2(val) {
let tempTreeList = this.$u.clone(this.treeData)
let childrenId = ""
if (val && val != "" && val != null) {
tempTreeList.forEach(ele => {
if (ele.upId > 0 && ele.name == val) {
childrenId = ele.id
}
})
}
return childrenId
},
//物料大类和子类的解析end
//获取编码名称等start
getcodeRuleData() {
let data = {
conditions: []
};
this.$api.post(`${material}/coderule/paged`, data).then((r) => {
if (r.success) {
this.codeRuleData = r.result.items || []
}
});
},
getType3(val) {
let codeRuleDataList = this.$u.clone(this.codeRuleData)
let codeRuleId = ""
if (val && val != "" && val != null) {
codeRuleDataList.forEach(ele => {
if (ele.name == val) {
codeRuleId = ele.id
}
})
this.$Message.error("批量导入失败");
}
return codeRuleId
},
//获取编码名称等end
//插入物料管理end
//插入工艺规程 及工艺相关start
importRountingHeader() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
classId: null,
unicode: "",
name: ele.name ? ele.name : '',
code: ele.code ? ele.code : '',
productId: ele.productId ? ele.productId : '', //?
productName: ele.productName ? ele.productName : "", //?
productBomId: ele.productBomId ? ele.productBomId : "", //?
drawingNo: ele.drawingNo ? ele.drawingNo : "", //?
version: "",
versionid: ele.versionid ? ele.versionid : "",
author: null,
departmentId: ele.departmentId ? ele.departmentId : null, //?
departmentName: ele.departmentName ? ele.departmentName : "", //?
isMain: 1,
upId: null,
upDetailId: null,
routingType: ele.routingType ? ele.routingType : null,
status: 0,
approvalStatus: 4, //?
remark: "",
approvalStatusRemark: "",
auditUserId1: "",
auditUserId2: "",
platesnum: null,
versionnotes: "",
isSendPpm: 1,
fileId: "",
phase: ele.phase ? ele.phase : null,
isEffect: ele.isEffect ? ele.isEffect : 1
};
if (ele.name && ele.name != '') {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
})
.catch((err) => {
this.$Message.error("数据异常!");
});
}
},
//物料大类和子类的解析start
getTreeData() {
let data = {
conditions: [],
};
this.$api.post(`${material}/category/list`, data).then((r) => {
if (r.success) {
this.treeData = r.result || [];
}
});
},
getType1(val) {
let tempTreeList = this.$u.clone(this.treeData);
let rootId = "";
if (val && val != "" && val != null) {
tempTreeList.forEach((ele) => {
if (ele.upId == 0 && ele.name == val) {
rootId = ele.id;
}
});
}
return rootId;
},
getType2(val) {
let tempTreeList = this.$u.clone(this.treeData);
let childrenId = "";
if (val && val != "" && val != null) {
tempTreeList.forEach((ele) => {
if (ele.upId > 0 && ele.name == val) {
childrenId = ele.id;
}
});
}
return childrenId;
},
//物料大类和子类的解析end
//获取编码名称等start
getcodeRuleData() {
let data = {
conditions: [],
};
this.$api.post(`${material}/coderule/paged`, data).then((r) => {
if (r.success) {
this.codeRuleData = r.result.items || [];
}
});
},
getType3(val) {
let codeRuleDataList = this.$u.clone(this.codeRuleData);
let codeRuleId = "";
if (val && val != "" && val != null) {
codeRuleDataList.forEach((ele) => {
if (ele.name == val) {
codeRuleId = ele.id;
}
});
}
return codeRuleId;
},
//获取编码名称等end
//插入物料管理end
//插入工艺规程 及工艺相关start
importRountingHeader() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
classId: null,
unicode: "",
name: ele.name ? ele.name : "",
code: ele.code ? ele.code : "",
productId: ele.productId ? ele.productId : "", //?
productName: ele.productName ? ele.productName : "", //?
productBomId: ele.productBomId ? ele.productBomId : "", //?
drawingNo: ele.drawingNo ? ele.drawingNo : "", //?
version: "",
versionid: ele.versionid ? ele.versionid : "",
author: null,
departmentId: ele.departmentId ? ele.departmentId : null, //?
departmentName: ele.departmentName ? ele.departmentName : "", //?
isMain: 1,
upId: null,
upDetailId: null,
routingType: ele.routingType ? ele.routingType : null,
status: 0,
approvalStatus: 4, //?
remark: "",
approvalStatusRemark: "",
auditUserId1: "",
auditUserId2: "",
platesnum: null,
versionnotes: "",
isSendPpm: 1,
fileId: "",
phase: ele.phase ? ele.phase : null,
isEffect: ele.isEffect ? ele.isEffect : 1,
};
if (ele.name && ele.name != "") {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
} else {
let parms = {
list: tempList,
};
let url = `${technologyUrl}routingheaderimportservice/import`;
this.$api
.post(url, parms)
.then((r) => {
if (r.success) {
this.$Message.success(
"成功批量导入工艺规程模块 " + tempList.length + " 条数据"
);
this.imBtn = false;
this.cancelExcel();
} else {
let parms = {
list: tempList,
};
let url = `${technologyUrl}routingheaderimportservice/import`
this.$api.post(url, parms).then((r) => {
if (r.success) {
this.$Message.success("成功批量导入工艺规程模块 " + tempList.length + " 条数据");
this.imBtn = false;
this.cancelExcel();
} else {
this.$Message.error("批量导入失败")
}
}).catch(err => {
this.$Message.error("数据异常!");
});
this.$Message.error("批量导入失败");
}
},
//导入工艺bom
importRountingBom() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
routingHeaderId: Number(this.getRoutingHeaderId(ele.routingHeaderId)),
routingDetailId: ele.routingDetailId ? Number(ele.routingDetailId) : null,
routingDetailNo: ele.routingDetailNo ? Number(ele.routingDetailNo) : null,
routingDetailName: ele.routingDetailName ? ele.routingDetailName : '',
routingStepId: 0,
quantity: ele.quantity ? Number(ele.quantity) : 0,
materialId: ele.materialId ? ele.materialId : '',
materialType: ele.materialType ? Number(ele.materialType) : '',
materialNumber: ele.materialNumber ? ele.materialNumber : '',
nameMaterial: ele.nameMaterial ? ele.nameMaterial : '',
brand: ele.brand ? ele.brand : '',
specifications: ele.specifications ? ele.specifications : '',
xhgg: ele.xhgg ? ele.xhgg : '',
texture: ele.texture ? ele.texture : '',
procurementStandards: ele.procurementStandards ? ele.procurementStandards : '',
qualityGrade: ele.qualityGrade ? ele.qualityGrade : '',
state: null,
extend: "",
remark: "",
drawNum: ele.drawNum ? ele.drawNum : ''
};
if (ele.routingDetailId && ele.routingDetailId != null) {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
})
.catch((err) => {
this.$Message.error("数据异常!");
});
}
},
//导入工艺bom
importRountingBom() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
routingHeaderId: Number(this.getRoutingHeaderId(ele.routingHeaderId)),
routingDetailId: ele.routingDetailId
? Number(ele.routingDetailId)
: null,
routingDetailNo: ele.routingDetailNo
? Number(ele.routingDetailNo)
: null,
routingDetailName: ele.routingDetailName ? ele.routingDetailName : "",
routingStepId: 0,
quantity: ele.quantity ? Number(ele.quantity) : 0,
materialId: ele.materialId ? ele.materialId : "",
materialType: ele.materialType ? Number(ele.materialType) : "",
materialNumber: ele.materialNumber ? ele.materialNumber : "",
nameMaterial: ele.nameMaterial ? ele.nameMaterial : "",
brand: ele.brand ? ele.brand : "",
specifications: ele.specifications ? ele.specifications : "",
xhgg: ele.xhgg ? ele.xhgg : "",
texture: ele.texture ? ele.texture : "",
procurementStandards: ele.procurementStandards
? ele.procurementStandards
: "",
qualityGrade: ele.qualityGrade ? ele.qualityGrade : "",
state: null,
extend: "",
remark: "",
drawNum: ele.drawNum ? ele.drawNum : "",
};
if (ele.routingDetailId && ele.routingDetailId != null) {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
} else {
let parms = {
list: tempList,
};
let url = `${technologyUrl}productinfoimportservice/import`;
this.$api
.post(url, parms)
.then((r) => {
if (r.success) {
this.$Message.success(
"成功批量导入工艺Bom模块 " + tempList.length + " 条数据"
);
this.imBtn = false;
this.cancelExcel();
} else {
let parms = {
list: tempList,
};
let url = `${technologyUrl}productinfoimportservice/import`
this.$api.post(url, parms).then((r) => {
if (r.success) {
this.$Message.success("成功批量导入工艺Bom模块 " + tempList.length + " 条数据");
this.imBtn = false;
this.cancelExcel();
} else {
this.$Message.error("批量导入失败")
}
}).catch(err => {
this.$Message.error("数据异常!");
});
this.$Message.error("批量导入失败");
}
})
.catch((err) => {
this.$Message.error("数据异常!");
});
}
},
//获取工艺规程列表
getRoutingHeaderData() {
let url = `${technologyUrl}routingheader/list`;
let data = {
conditions: [],
};
},
//获取工艺规程列表
getRoutingHeaderData() {
let url = `${technologyUrl}routingheader/list`;
let data = {
conditions: []
};
this.$api.post(url, data).then((r) => {
if (r.success) {
this.routingHeaderData = r.result || []
}
});
},
//根据工艺规程ID获得name
getRoutingHeaderId(val) {
let routingHeaderDataList = this.$u.clone(this.routingHeaderData)
let routingHeaderId = 0
routingHeaderDataList.forEach(ele => {
if (ele.name == val) {
routingHeaderId = ele.id
}
})
return routingHeaderId
},
//插入工艺规程 及工艺相关end
//插入产品管理start
importProductMix() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
mmcode: ele.mmcode ? ele.mmcode : '',
drawingNo: ele.drawingNo ? ele.drawingNo : '',
name: ele.name ? ele.name : '',
type: ele.type ? ele.type : 1,
madeCompany: ele.madeCompany ? ele.madeCompany : null,
madeCompanyTitle: ele.madeCompanyTitle ? ele.madeCompanyTitle : "",
version: ele.version ? ele.version : 0,
productUrl: "",
productUrlList: "",
levelId: ele.levelId ? ele.levelId : null,
levelTitle: ele.levelTitle ? ele.levelTitle : "",
materialId: ele.materialId ? ele.materialId : "",
};
if (ele.name && ele.name != '') {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
} else {
let parms = {
list: tempList,
};
let url = `${technologyUrl}productinfoimportservice/import`;
this.$api.post(url, parms).then((r) => {
if (r.success) {
this.$Message.success("成功批量导入产品管理模块 " + tempList.length + " 条数据");
this.imBtn = false;
this.cancelExcel();
} else {
this.$Message.error("批量导入失败")
}
}).catch(err => {
this.$Message.error("数据异常!");
});
}
},
//插入产品管理end
//切换列表和excel按钮
changeExcel(val) {
if (val == 1) {
this.tableImport = false
this.detailExcel = () => import("./detailExcel");
this.pageType = undefined
this.excelType = '1';
this.$api.post(url, data).then((r) => {
if (r.success) {
this.routingHeaderData = r.result || [];
}
});
},
//根据工艺规程ID获得name
getRoutingHeaderId(val) {
let routingHeaderDataList = this.$u.clone(this.routingHeaderData);
let routingHeaderId = 0;
routingHeaderDataList.forEach((ele) => {
if (ele.name == val) {
routingHeaderId = ele.id;
}
});
return routingHeaderId;
},
//插入工艺规程 及工艺相关end
//插入产品管理start
importProductMix() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
mmcode: ele.mmcode ? ele.mmcode : "",
drawingNo: ele.drawingNo ? ele.drawingNo : "",
name: ele.name ? ele.name : "",
type: ele.type ? ele.type : 1,
madeCompany: ele.madeCompany ? ele.madeCompany : null,
madeCompanyTitle: ele.madeCompanyTitle ? ele.madeCompanyTitle : "",
version: ele.version ? ele.version : 0,
productUrl: "",
productUrlList: "",
levelId: ele.levelId ? ele.levelId : null,
levelTitle: ele.levelTitle ? ele.levelTitle : "",
materialId: ele.materialId ? ele.materialId : "",
};
if (ele.name && ele.name != "") {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
} else {
let parms = {
list: tempList,
};
let url = `${technologyUrl}productinfoimportservice/import`;
this.$api
.post(url, parms)
.then((r) => {
if (r.success) {
this.$Message.success(
"成功批量导入产品管理模块 " + tempList.length + " 条数据"
);
this.imBtn = false;
this.cancelExcel();
} else {
this.detailExcel = null;
this.tableImport = true;
this.pageType = undefined
this.excelType = '0';
this.listLength = this.excelData.length;
this.$Message.error("批量导入失败");
}
},
datalength(val) {
this.listLength = val
},
})
.catch((err) => {
this.$Message.error("数据异常!");
});
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
},
//插入产品管理end
//切换列表和excel按钮
changeExcel(val) {
if (val == 1) {
this.tableImport = false;
this.detailExcel = () => import("./detailExcel");
this.pageType = undefined;
this.excelType = "1";
} else {
this.detailExcel = null;
this.tableImport = true;
this.pageType = undefined;
this.excelType = "0";
this.listLength = this.excelData.length;
}
},
datalength(val) {
this.listLength = val;
},
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
},
},
};
</script>
<style lang="less">
@import "../../assets/css/custom.less";
.table-contentProcess {
position: relative;
height: 100%;
display: flex;
flex-direction: column;
position: relative;
height: 100%;
display: flex;
flex-direction: column;
.tip {
display: inline;
}
.tip {
display: inline;
}
form {
display: inline-block;
form {
display: inline-block;
.ivu-form-item {
margin: 0;
vertical-align: middle;
}
.ivu-form-item {
margin: 0;
vertical-align: middle;
}
}
.table-main {
width: 100%;
text-align: left;
padding: 0;
display: block;
overflow-y: auto;
flex-grow: 1;
.table-main {
width: 100%;
text-align: left;
padding: 0;
display: block;
overflow-y: auto;
flex-grow: 1;
tr td .ivu-table-cell {
padding: 0 5px;
}
overflow-x: hidden;
tr td .ivu-table-cell {
padding: 0 5px;
}
.table-tools {
display: flex;
line-height: 50px;
.table-search {
flex-grow: 1;
}
overflow-x: hidden;
}
.btns {
min-width: 200px;
text-align: right;
}
.table-tools {
display: flex;
line-height: 50px;
background: @right-header-bg;
.table-search {
flex-grow: 1;
}
.table-footer {
line-height: 45px;
background: #f5f5f5;
.btns {
min-width: 200px;
text-align: right;
}
}
.ivu-footer-toolbar {
text-align: left;
.table-footer {
line-height: 45px;
background: #f5f5f5;
}
// background: #f5f5f5;
.ivu-footer-toolbar-right {
float: left;
}
.ivu-footer-toolbar {
text-align: left;
// background: #f5f5f5;
.ivu-footer-toolbar-right {
float: left;
}
}
}
</style>
<template>
<div class="content">
<TablePaste hide-table :input-props="inputProps" @on-success="handleSuccess" @on-error="handleError" v-show="showTablePaste" />
<DataGrid border :height="tdHeightExcel" :columns="columnsImport" :data="excelData" :page="false" :set="false">
<DataGrid :height="tdHeightExcel" :columns="columnsImport" :data="excelData" :page="false" :set="false">
<template slot="easySearch">
<Form inline>
<FormItem>
......
......@@ -319,7 +319,7 @@ export default {
.full {
margin-top: 0;
.content {
margin-top: 10px;
margin-top: 6px;
.ivu-icon-ios-add:before {
content: "\f341";
}
......
......@@ -30,7 +30,7 @@
</Col>
<Col :span="24">
<h4>扩展属性</h4>
<Table border :columns="columns" :data="checkList">
<Table :columns="columns" :data="checkList">
<template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div>
<Input
......
......@@ -379,7 +379,7 @@ export default {
font-family: Microsoft YaHei;
.ivu-layout-sider {
background: rgba(255, 255, 255, 1);
background: @layout-content-bg-color;
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 87vh;
......@@ -452,7 +452,7 @@ export default {
.ivu-layout-content {
// margin-left: 5px;
background: rgba(255, 255, 255, 1);
background: @right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto;
padding: 10px;
......
......@@ -45,7 +45,7 @@
</div>
</div>
<div v-show="showTable">
<Table border :columns="columns" :data="data1" :height="820"></Table>
<Table :columns="columns" :data="data1" :height="820"></Table>
<!-- <DataGrid :columns="columns" ref="grid" :action="action" :tool="false" :height="750" :conditions="easySearch"></DataGrid> -->
</div>
</Content>
......
......@@ -48,7 +48,7 @@
<Icon type="ios-arrow-forward" size="24" />
</a>
</div>
<Content :class="!showMenu?'con_bord':''">
<Content :class="!showMenu?'con_bord':''" class="content">
<MasterData ref="dataTable" :nodeInfo="nodeInfo" @on-ok="ok" />
</Content>
</Layout>
......@@ -296,7 +296,7 @@ export default {
font-family: Microsoft YaHei;
.ivu-layout-sider {
background: rgba(255, 255, 255, 1);
background:@layout-content-bg-color;
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 88vh;
......@@ -369,7 +369,7 @@ export default {
.ivu-layout-content {
// margin-left: 5px;
background: rgba(255, 255, 255, 1);
background:@right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto;
padding: 10px;
......
<template>
<div style="width:100%;margin:0 auto">
<Table border :columns="columns1" :data="dataList" class="tableCommon" :height="tbHeight"></Table>
<Table :columns="columns1" :data="dataList" class="tableCommon" :height="tbHeight"></Table>
<div style="width100%;margin:40px auto">
<Row>
<Process ref="userProcess" schemaIdVal="123327da-42b3-41f6-b785-cf933f137a95" />
......
......@@ -21,7 +21,7 @@
<Button type="primary" @click="easySearch">查询</Button>
</Col>
</Row>
<Table border :columns="columns" :data="list" class="tableCommon mb10" height="300">
<Table :columns="columns" :data="list" class="tableCommon mb10" height="300">
<template slot-scope="{ row, index }" slot="remainingAmount1">
<InputNumber v-model="row.remainingAmount1" @on-change="inputOrderCat(row,index)" min="0"></InputNumber>
</template>
......
......@@ -21,7 +21,7 @@
<Button type="primary" @click="easySearch">查询</Button>
</Col>
</Row>
<Table border :columns="columns" :data="list" class="tableCommon mb10" height="300">
<Table :columns="columns" :data="list" class="tableCommon mb10" height="300">
<template slot-scope="{ row, index }" slot="remainingAmount1">
<InputNumber v-model="row.remainingAmount1" @on-change="inputOrderCat(row,index)" min="0"></InputNumber>
</template>
......
......@@ -21,7 +21,7 @@
<Button type="primary" @click="easySearch">查询</Button>
</Col>
</Row>
<Table border :columns="columns" :data="list" class="tableCommon mb10" height="300">
<Table :columns="columns" :data="list" class="tableCommon mb10" height="300">
<template slot-scope="{ row, index }" slot="remainingAmount1">
<InputNumber v-model="row.remainingAmount1" @on-change="inputOrderCat(row,index)" min="0"></InputNumber>
</template>
......
......@@ -431,6 +431,7 @@ export default {
</script>
<style lang="less">
// @import "../../../assets/css/custom.less";
.table-content {
position: relative;
// height: 100%;
......@@ -454,6 +455,7 @@ export default {
.table-tools {
line-height: 40px;
// background: @right-header-bg;
.table-search {
float: left;
line-height: 40px;
......
......@@ -21,12 +21,15 @@
</div>
</div>
<Table
:border="border" :columns="columnsNow"
:data="list" :height="tableHeight"
ref="table" class="tableCommon"
:border="border"
:columns="columnsNow"
:data="list"
:height="tableHeight"
ref="table"
class="tableCommon"
@on-expand="expand"
@on-selection-change="selectionChange">
</Table>
@on-selection-change="selectionChange"
></Table>
<div class="table-footer">
<div>
<slot name="footer"></slot>
......@@ -61,11 +64,12 @@
placement="left"
:mask="false"
>
<div slot="header">
列设置
<a @click="undoConfig" class="ml50">
<Icon type="md-refresh" title="恢复初始设置"/></a>
</div>
<div slot="header">
列设置
<a @click="undoConfig" class="ml50">
<Icon type="md-refresh" title="恢复初始设置" />
</a>
</div>
<ul class="table-columns">
<li
v-for="(li,index) in columnsCur"
......@@ -87,12 +91,12 @@
export default {
data() {
return {
keys: '',
keys: "",
modalSearch: false,
search: {
pageIndex: 1,
pageSize: 20,
conditions: []
conditions: [],
},
pageSizeOpts: [20, 50, 100],
tableHeight: 0,
......@@ -100,325 +104,337 @@ export default {
config: false,
list: [],
columnsCur: [],
configLoad:false,
configLoad: false,
userConfig: null, //用户页面配置信息。,
userId: this.$store.state.userInfo.userId
}
userId: this.$store.state.userInfo.userId,
};
},
props: {
datalist:{
datalist: {
type: Array,
default:[]
default: [],
},
total:{
total: {
type: Number,
default:0
default: 0,
},
border: {
//是否显示边框
type: Boolean,
default: true
default: true,
},
placeholder: {
type: String,
default: '请输入关键字'
default: "请输入关键字",
},
height: {
type: Number,
default: 0
default: 0,
},
tool: {
//是否显示工具栏
type: Boolean,
default: true
default: true,
},
easy: {
//是否显示简单搜索
type: Boolean,
default: true
default: true,
},
high: {
//是否显示高级搜索
type: Boolean,
default: true
default: true,
},
set: {
//是否显示列设置
type: Boolean,
default: true
default: true,
},
page: {
//是否分页
type: Boolean,
default: true
default: true,
},
data: {
// 当作table使用,直接显示数据
type: Array,
default: function() {
return []
}
default: function () {
return [];
},
},
columns: {
//要显示的字段
type: Array,
default: []
default: [],
},
action: {
//接口地址
type: String,
default: ''
default: "",
},
conditions: {
//查询条件
type: Object,
default: function() {
default: function () {
return {
keys: { op: 'name', value: '', default: true }
}
}
}
keys: { op: "name", value: "", default: true },
};
},
},
},
created() {
this.columns.forEach((u) => {
if (!u.hide) {
u.hide = false
u.hide = false;
}
})
this.columnsCur = this.$u.clone(this.columns)
console.warn(this.columnsCur)
});
this.columnsCur = this.$u.clone(this.columns);
console.warn(this.columnsCur);
},
mounted() {
this.keys = ''
this.intY()
this.keys = "";
this.intY();
this.loadUserConfig();
if (this.height === 0) {
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight
this.tableHeight = window.screenHeight - this.firstY - 60
})()
}
window.screenHeight = window.innerHeight;
this.tableHeight = window.screenHeight - this.firstY - 60;
})();
};
} else {
this.tableHeight = this.height
this.tableHeight = this.height;
}
//注册拖拽事件。
this.$dragging.$on('dragend', (e) => {
this.$dragging.$on("dragend", (e) => {
// console.log("dragend",e);
this.saveUserconfig()
})
this.saveUserconfig();
});
},
methods: {
//数据加载
load() {
if (this.height == 0) {
this.tableHeight = window.innerHeight - this.firstY - 60
this.tableHeight = window.innerHeight - this.firstY - 60;
}
if (this.action) {
this.$api.post(this.action, this.search).then((r) => {
this.list = r.result.items
this.search.total = r.result.totalCount
})
}else{
this.list = this.datalist
this.search.total = this.total
this.list = r.result.items;
this.search.total = r.result.totalCount;
});
} else {
this.list = this.datalist;
this.search.total = this.total;
}
},
columnInit(){
if(this.userConfig){
var curColumns=[];
var config=JSON.parse(this.userConfig.content);
columnInit() {
if (this.userConfig) {
var curColumns = [];
var config = JSON.parse(this.userConfig.content);
// console.warn("2:列比对",config)
if(config.length==this.columnsCur.length){
config.map(u=>{
var item=this.columnsCur.filter(c=>{
return c.key==u.key;
if (config.length == this.columnsCur.length) {
config.map((u) => {
var item = this.columnsCur.filter((c) => {
return c.key == u.key;
});
if(item[0]){
item[0].hide=u.hide;
if (item[0]) {
item[0].hide = u.hide;
curColumns.push(item[0]);
}
});
// console.warn("3:初始化列")
this.columnsCur=curColumns;
this.columnsCur = curColumns;
}
}
},
loadUserConfig() {
var query = {
conditions: [
{fieldName:"creatorUserId",fieldValue:this.userId,conditionalType: "Equal"},
{fieldName:"component",fieldValue:"Grid",conditionalType: "Equal"},
{fieldName:"page",fieldValue:window.location.pathname,conditionalType: "Equal"}
]
,
pageSize: 1
}
{
fieldName: "creatorUserId",
fieldValue: this.userId,
conditionalType: "Equal",
},
{
fieldName: "component",
fieldValue: "Grid",
conditionalType: "Equal",
},
{
fieldName: "page",
fieldValue: window.location.pathname,
conditionalType: "Equal",
},
],
pageSize: 1,
};
this.$api.post(`${window.systemUrl}/config/list`, query).then((r) => {
if (r.success) {
if (r.result.length == 1) {
this.userConfig = r.result[0]
this.userConfig = r.result[0];
// console.warn("1:加载用户配置")
this.columnInit();
}
if(!this.configLoad){
this.easySearch();
if (!this.configLoad) {
this.easySearch();
}
this.configLoad=true;
this.configLoad = true;
}
})
});
},
saveUserconfig() {
let url = `${window.systemUrl}/config/update`;
var content=[];
this.columnsCur.map(u=>{
var content = [];
this.columnsCur.map((u) => {
content.push({
key:u.key,
hide:u.hide
})
})
key: u.key,
hide: u.hide,
});
});
if (!this.userConfig) {
url = `${window.systemUrl}/config/create`
url = `${window.systemUrl}/config/create`;
var data = {
page: window.location.pathname,
component: 'Grid',
component: "Grid",
key: this.$u.guid(),
content: JSON.stringify(content)
}
this.$api.post(url,data).then(r=>{
this.loadUserConfig()
content: JSON.stringify(content),
};
this.$api.post(url, data).then((r) => {
this.loadUserConfig();
});
}else{
this.userConfig.content=JSON.stringify(content);
this.$api.post(url,this.userConfig)
} else {
this.userConfig.content = JSON.stringify(content);
this.$api.post(url, this.userConfig);
}
},
//展开
expand(row, status) {
this.$emit('on-expand', row, status)
this.$emit("on-expand", row, status);
},
easySearch() {
if (this.conditions && this.conditions.keys.default) {
//判断没有传入条件的用默认的查询
this.conditions.keys.value = this.keys
this.conditions.keys.value = this.keys;
}
this.reload(this.conditions)
this.reload(this.conditions);
},
undoConfig(){
undoConfig() {
//列设置恢复初始化
this.columnsCur = this.$u.clone(this.columns);
this.saveUserconfig();
},
complexSearch() {
var search = this.$refs.search.$children.filter((u) => {
return u.condition
})
return u.condition;
});
if (search) {
var conditions = search[0].condition
this.reload(conditions)
var conditions = search[0].condition;
this.reload(conditions);
}
},
reload(conditions) {
var where = []
var where = [];
if (conditions) {
Object.keys(conditions).forEach((u) => {
let v = conditions[u].value
let op = conditions[u].op
let v = conditions[u].value;
let op = conditions[u].op;
if (!this.$u.isNull(v)) {
if (op == 'Range') {
let times = []
if (op == "Range") {
let times = [];
v.map((u) => {
if (!this.$u.isNull(u)) {
times.push(this.$u.toTime(u))
times.push(this.$u.toTime(u));
}
})
v = times.join(',')
} else if (op.indexOf('In') > -1) {
v = v.join(',')
});
v = times.join(",");
} else if (op.indexOf("In") > -1) {
v = v.join(",");
}
if (!this.$u.isNull(v)) {
where.push({
fieldName: u,
fieldValue: v,
conditionalType: op
})
conditionalType: op,
});
}
}
})
});
}
this.search.pageIndex = 1
this.search.conditions = where
this.load()
this.search.pageIndex = 1;
this.search.conditions = where;
this.load();
},
pageChange(page) {
this.search.page = page
this.search.pageIndex = page
this.load()
this.search.page = page;
this.search.pageIndex = page;
this.load();
},
pageSizeChange(size) {
this.search.pageSize = size
this.search.pageIndex = 1
this.load()
this.search.pageSize = size;
this.search.pageIndex = 1;
this.load();
},
columnChange(item, i) {
item.hide = !item.hide;
this.$set(this.columnsCur,item,i);
this.$set(this.columnsCur, item, i);
this.saveUserconfig();
},
selectionChange(items) {
this.$emit('on-selection-change', items)
this.$emit("on-selection-change", items);
},
intY() {
this.firstY = this.$refs.table.$el.getBoundingClientRect().top
}
this.firstY = this.$refs.table.$el.getBoundingClientRect().top;
},
},
computed: {
columnsNow() {
var cols = this.columnsCur.filter((u) => {
if (u.code) {
u.render = (h, params) => {
let values = u.key
return h('state', {
let values = u.key;
return h("state", {
props: {
code: u.code,
type: 'text',
value: params.row[values] + ''
}
})
}
type: "text",
value: params.row[values] + "",
},
});
};
}
if (u.type == 'user') {
if (u.type == "user") {
u.render = (h, params) => {
let values = u.key
return h('User', {
let values = u.key;
return h("User", {
props: {
value: params.row[values]
}
})
}
value: params.row[values],
},
});
};
}
if (u.type == 'date' || u.type == 'dateTime') {
if (u.type == "date" || u.type == "dateTime") {
u.render = (h, params) => {
let values = u.key
return h('DTSpan', {
let values = u.key;
return h("DTSpan", {
props: {
type: u.type,
value: params.row[values]
}
})
}
value: params.row[values],
},
});
};
}
return !u.hide
})
return cols
}
}
}
return !u.hide;
});
return cols;
},
},
};
</script>
<style lang="less">
@import "../../../assets/css/custom.less";
.table-content {
position: relative;
// height: 100%;
......@@ -436,12 +452,13 @@ export default {
font-size: 14px;
padding: 0 2px;
}
.tableCommon tr td .ivu-table-cell {
padding:0 5px;
}
.tableCommon tr td .ivu-table-cell {
padding: 0 5px;
}
.table-tools {
line-height: 40px;
background: @right-header-bg;
.table-search {
float: left;
line-height: 40px;
......
......@@ -106,7 +106,7 @@
<div class="ml10">
<Tabs v-model="currTab" @on-click="clickTab">
<TabPane label="五二九纵" name="name1">
<Table border highlight-row ref="table1" :columns="column1" :data="data1"></Table>
<Table highlight-row ref="table1" :columns="column1" :data="data1"></Table>
</TabPane>
<TabPane label="五二九横" name="name2">五二九横</TabPane>
<TabPane label="五二九预" name="name3">五二九预</TabPane>
......
......@@ -22,7 +22,7 @@
</div>
</div>
<div class="table-boxs">
<Table border :columns="columns" :data="data" size="small"></Table>
<Table :columns="columns" :data="data" size="small"></Table>
</div>
<div class="shenpi">
<label>审批人:</label>
......
......@@ -29,7 +29,7 @@
</Row>
</Form>
<div class="kuang-boxi">
<Table border :columns="columns" :data="gmData" size="small">
<Table :columns="columns" :data="gmData" size="small">
<template slot-scope="{ row, index }" slot="slot1">
<InputNumber v-model="row.materialWeight" :min="0" @on-blur="show1(row,index)" />
</template>
......
......@@ -71,7 +71,7 @@
</div>
</div>
<div class="table-boxs">
<Table border :columns="columns" :data="childData.result" size="small"></Table>
<Table :columns="columns" :data="childData.result" size="small"></Table>
</div>
<div class="zong-ji">
<div class="xiao-ji">总计</div>
......
......@@ -29,7 +29,7 @@
</Row>
</Form>
<div class="kuang-boxi">
<Table border :columns="columns" :data="gmData" size="small">
<Table :columns="columns" :data="gmData" size="small">
<template slot-scope="{ row, index }" slot="slot1">
<Input v-model="row.materialWeight" placeholder="请输入" @on-blur="show1(row, index)" />
</template>
......
......@@ -71,7 +71,7 @@
</div>
</div>
<div class="table-boxs">
<Table border :columns="columns" :data="childData.result" size="small"></Table>
<Table :columns="columns" :data="childData.result" size="small"></Table>
</div>
<div class="zong-ji">
<div class="xiao-ji">总计</div>
......
......@@ -10,7 +10,7 @@
footer-hide
>
<div class="kuang-boxi">
<Table border :columns="columns" :data="data" size="small">
<Table :columns="columns" :data="data" size="small">
<template slot-scope="{ row, index }" slot="slot1">
<Input v-model="row.name9" placeholder="请输入" @on-change="showPrinting(row,index)" />
</template>
......@@ -59,11 +59,11 @@
import GenerateQuotation from "../components/generateQuotation.vue"; //生成报价单弹框
export default {
components: {
GenerateQuotation
GenerateQuotation,
},
name: "",
props: {
bjData: Array
bjData: Array,
},
data() {
return {
......@@ -76,13 +76,13 @@ export default {
title: "序号",
type: "index",
width: 50,
align: "center"
align: "center",
},
{
title: "订单编号",
key: "name",
align: "center",
minWidth: 120
minWidth: 120,
},
// {
// title: '图号',
......@@ -94,41 +94,41 @@ export default {
title: "产品名称",
key: "name2",
align: "center",
minWidth: 80
minWidth: 80,
},
{
title: "规格",
key: "name4",
align: "center",
minWidth: 80
minWidth: 80,
},
{
title: "材料牌号",
key: "name5",
align: "center",
minWidth: 80,
slot: "slot6"
slot: "slot6",
},
{
title: "材料重量",
key: "name6",
align: "center",
minWidth: 80,
slot: "slot7"
slot: "slot7",
},
{
title: "材料单价",
key: "name7",
align: "center",
minWidth: 80,
slot: "slot8"
slot: "slot8",
},
{
title: "材料费/件(元)",
key: "name8",
align: "center",
minWidth: 70
minWidth: 70,
},
{
title: "3D打印费",
......@@ -146,19 +146,19 @@ export default {
h("Input", {
props: {
value: "1600",
placeholder: "请输入"
placeholder: "请输入",
},
on: {
"on-change": value => {
"on-change": (value) => {
console.log(value);
}
}
},
},
}),
h("span", " /H")
h("span", " /H"),
]);
}
}
]
},
},
],
},
{
title: "后处理费",
......@@ -176,19 +176,19 @@ export default {
h("Input", {
props: {
value: "200",
placeholder: "请输入"
placeholder: "请输入",
},
on: {
"on-change": value => {
"on-change": (value) => {
console.log(value);
}
}
},
},
}),
h("span", " /H")
h("span", " /H"),
]);
}
}
]
},
},
],
},
{
title: "线切割费",
......@@ -206,25 +206,25 @@ export default {
h("Input", {
props: {
value: "100",
placeholder: "请输入"
placeholder: "请输入",
},
on: {
"on-change": value => {
"on-change": (value) => {
console.log(value);
}
}
},
},
}),
h("span", " /H")
h("span", " /H"),
]);
}
}
]
},
},
],
},
{
title: "加工费单价",
key: "name12",
align: "center",
minWidth: 60
minWidth: 60,
},
{
......@@ -232,39 +232,39 @@ export default {
key: "name13",
align: "center",
minWidth: 80,
slot: "slot4"
slot: "slot4",
},
{
title: "单价",
key: "name14",
align: "center",
minWidth: 60
minWidth: 60,
},
{
title: "数量",
key: "name3",
align: "center",
minWidth: 70
minWidth: 70,
},
{
title: "热处理",
key: "name15",
align: "center",
minWidth: 80,
slot: "slot5"
slot: "slot5",
},
{
title: "合计",
key: "name16",
align: "center",
minWidth: 80
minWidth: 80,
},
{
title: "调度",
key: "name17",
align: "center",
minWidth: 60
}
minWidth: 60,
},
],
data: [
{
......@@ -285,7 +285,7 @@ export default {
name14: "",
name15: "",
name16: "",
name17: "小明"
name17: "小明",
},
{
name: "a1233",
......@@ -305,7 +305,7 @@ export default {
name14: "",
name15: "",
name16: "",
name17: "小明"
name17: "小明",
},
{
name: "a1233",
......@@ -325,9 +325,9 @@ export default {
name14: "",
name15: "",
name16: "",
name17: "小明"
}
]
name17: "小明",
},
],
};
},
mounted() {},
......@@ -369,10 +369,10 @@ export default {
return (row.name16 =
parseInt(row.name14) * parseInt(row.name3) + parseInt(row.name15)); //合计=单价*数量+热处理
},
cancel() {
this.$emit('update')
}
}
cancel() {
this.$emit("update");
},
},
};
</script>
<style lang="less" scoped>
......
......@@ -3,7 +3,7 @@
<Sider hide-trigger v-if="showMenu" class="menu_side" width="300">
<StoreTree @on-hide="onHide" @on-select="productSearch" />
</Sider>
<Icon type="icon iconfont icondaochu" size="24" />
<!-- <Icon type="icon iconfont icondaochu" size="24" /> -->
<div v-if="!showMenu" class="show_menu">
<a class="menu_play fr" @click="showMenuFn" title="展开">
<Icon type="ios-arrow-forward" size="24" />
......@@ -621,8 +621,7 @@ export default {
margin-top: 0;
.content {
margin-top: 10px;
padding-top: 10px;
margin-top: 6px;
.ivu-icon-ios-add:before {
content: "\f341";
......
......@@ -59,7 +59,7 @@ export default {
font-family: Microsoft YaHei;
.ivu-layout-sider {
background: rgba(255, 255, 255, 1);
background:@layout-content-bg-color;
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 89vh;
......@@ -98,7 +98,7 @@ export default {
}
.ivu-layout-content {
// margin-left: 5px;
background: rgba(255, 255, 255, 1);
background: @right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto;
padding: 10px;
......
......@@ -227,8 +227,9 @@ export default {
};
</script>
<style lang="less">
@import "../../../../assets/css/custom.less";
.ivu-layout-sider {
background: rgba(255, 255, 255, 1);
background: @layout-content-bg-color;
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
......
......@@ -157,8 +157,9 @@ export default {
};
</script>
<style lang="less">
@import "../../../../assets/css/custom.less";
.ivu-layout-sider {
background: rgba(255, 255, 255, 1);
background:@layout-content-bg-color;
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
......
......@@ -139,8 +139,9 @@ export default {
};
</script>
<style lang="less">
@import "../../../../assets/css/custom.less";
.ivu-layout-sider {
background: rgba(255, 255, 255, 1);
background:@layout-content-bg-color;
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
......
......@@ -226,8 +226,9 @@ export default {
};
</script>
<style lang="less">
@import "../../../../assets/css/custom.less";
.ivu-layout-sider {
background: rgba(255, 255, 255, 1);
background: @layout-content-bg-color;
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
......
......@@ -238,11 +238,12 @@ export default {
};
</script>
<style lang="less">
@import "../../../assets/css/custom.less";
.product-mix {
font-family: Microsoft YaHei;
padding-top: 3px;
.ivu-layout-sider {
background: rgba(255, 255, 255, 1);
background: @layout-content-bg-color;
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 89vh;
......@@ -250,7 +251,7 @@ export default {
}
.ivu-layout-content {
// margin-left: 5px;
background: rgba(255, 255, 255, 1);
background:@right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto;
padding: 10px;
......
......@@ -301,6 +301,7 @@ export default {
};
</script>
<style lang="less">
@import "../../../assets/css/custom.less";
.set {
font-family: Microsoft YaHei;
padding-top: 3px;
......@@ -309,8 +310,9 @@ export default {
width: 100%;
// display: flex;
// display: -webkit-flex;
background: @layout-content-bg-color;
.ivu-layout-sider {
background: rgba(255, 255, 255, 1);
background: @layout-content-bg-color;
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 89vh;
......@@ -318,7 +320,7 @@ export default {
}
.ivu-layout-content {
// margin-left: 5px;
background: rgba(255, 255, 255, 1);
background: @right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto;
padding: 10px;
......
.menu_side{
background: #fff;
margin: 5px 0 0 0;
border: 1px solid #dcdee2
@import "../../assets/css/custom.less";
.menu_side {
background: @left-tree-bg;
margin: 5px 0 0 0;
border: 1px solid @left-boder-color;
}
.side_tree{
background: #ffffff;
width: 300px;
border: 1px solid #ddd;
.tree_tit{
background: #F5F6FA;
height: 50px;
line-height: 50px;
font-size: 14px;
color: #515A6E;
.menu_play{
width: 30px;
height: 50px;
line-height: 50px;
text-align: center;
color: #646464;
}
.side_tree {
background: #ffffff;
width: 300px;
border: 1px solid #ddd;
.tree_tit {
background: #F5F6FA;
height: 50px;
line-height: 50px;
font-size: 14px;
color: #515A6E;
.menu_play {
width: 30px;
height: 50px;
line-height: 50px;
text-align: center;
color: #646464;
}
.tree_left{
padding: 8px 15px;
.ivu-tree{
// height: ;
}
}
.tree_left {
padding: 8px 15px;
.ivu-tree {
// height: ;
}
}
}
.show_menu{
.show_menu {
width: 30px;
height: 30px;
position: fixed;
top: 100px;
left: 0;
z-index: 9;
.menu_play {
width: 30px;
height: 30px;
position: fixed;
top: 100px;
left: 0;
z-index: 9;
.menu_play{
width: 30px;
height: 30px;
line-height: 34px;
font-size: 14px;
text-align: center;
color: #515A6E;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
background: #ffffff;
box-shadow: #ccc 2px 2px 4px 1px;
}
.menu_play:hover{
background-color: #2d8cf0;
color: white;
}
line-height: 34px;
font-size: 14px;
text-align: center;
color: #515A6E;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
background: #ffffff;
box-shadow: #ccc 2px 2px 4px 1px;
}
.menu_play:hover {
background-color: #2d8cf0;
color: white;
}
}
.tech_body{
margin: 5px 5px 5px 20px;
padding: 2px 18px;
box-shadow: #98929294 2px 1px 5px 1px;
.tech_body {
margin: 5px 5px 5px 20px;
padding: 2px 18px;
box-shadow: #98929294 2px 1px 5px 1px;
}
.tech_body02{
margin: 5px;
padding: 2px 18px;
box-shadow: #98929294 2px 1px 5px 1px;
.tech_body02 {
margin: 5px;
padding: 2px 18px;
box-shadow: #98929294 2px 1px 5px 1px;
}
.product-layout .i-layout-content {
padding: 4px 10px!important;
padding: 4px 10px !important;
}
.setdetail_body{
// padding: 0 20px;
.ivu-layout-header{
height: 0;
.setdetail_body {
// padding: 0 20px;
.ivu-layout-header {
height: 0;
}
.ivu-menu-horizontal {
height: 40px;
line-height: 40px;
.ivu-menu-item {
width: 115px;
text-align: center;
}
.ivu-menu-horizontal{
height: 40px;
line-height: 40px;
.ivu-menu-item{
width: 115px;
text-align: center;
}
a.ivu-menu-item-active::before{
content: "";
display: block;
border-width: 5px 6px 0;
border-style: solid;
border-color: #2d8cf0 transparent transparent;
width: 0;
height: 0;
position: absolute;
bottom: -6px;
left: 43%;
}
a.ivu-menu-item-active::after{
content: "";
display: block;
border-width: 4px 4px 0;
border-style: solid;
border-color: #fff transparent transparent;
width: 0;
height: 0;
position: absolute;
bottom: -4px;
left: 44%;
}
a.ivu-menu-item-active::before {
content: "";
display: block;
border-width: 5px 6px 0;
border-style: solid;
border-color: #2d8cf0 transparent transparent;
width: 0;
height: 0;
position: absolute;
bottom: -6px;
left: 43%;
}
a.ivu-menu-item-active::after {
content: "";
display: block;
border-width: 4px 4px 0;
border-style: solid;
border-color: #fff transparent transparent;
width: 0;
height: 0;
position: absolute;
bottom: -4px;
left: 44%;
}
}
}
.lay100 {
height: calc(100vh - 105px);
background-color: #F5F6FA;
.con{
padding: 5px 5px 0px 10px;
.h100{
overflow-y: auto;
}
height: calc(100vh - 105px);
background-color: #F5F6FA;
.con {
padding: 5px 5px 0px 10px;
.h100 {
overflow-y: auto;
}
}
}
\ No newline at end of file
}
@import "../../../assets/css/custom.less";
.ivu-layout-sider{
width: 240px!important;
max-width: 240px!important;
flex: 0 0 240px!important;
}
.ivu-layout,.ivu-layout-sider{
background: #fff;
background: @layout-content-bg-color;
}
.ivu-menu-vertical.ivu-menu-light:after {
display: none;
......
......@@ -1085,9 +1085,9 @@ html [type=button] {
box-shadow: #c7c7c7 1px 2px 7px 3px;
}
.menu_side {
background: #fff !important;
/* background: #fff !important; */
margin: 5px 0 0 0 !important;
border: 1px solid #dcdee2 !important;
/* border: 1px solid #dcdee2 !important; */
}
.show_menu {
width: 30px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment