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

yangsshi

parent 006fbe8a
@import "./custom.less"; @import "./custom.less";
@import "./iview-reset.less"; @import "./iview-reset.less";
html body { html body {
min-width: 1240px; min-width: 1240px;
color: @body-color; color: @body-color;
...@@ -879,7 +880,7 @@ textarea::-webkit-input-placeholder { ...@@ -879,7 +880,7 @@ textarea::-webkit-input-placeholder {
display: none; display: none;
} }
// 纵横树的样式 // 树的样式
.zh-tree { .zh-tree {
// position: relative; // position: relative;
display: block; display: block;
...@@ -888,8 +889,8 @@ textarea::-webkit-input-placeholder { ...@@ -888,8 +889,8 @@ textarea::-webkit-input-placeholder {
transform: translateX(0); transform: translateX(0);
transition: all .2s; transition: all .2s;
box-sizing: border-box; box-sizing: border-box;
border: #E4E6ED solid 1px; border: @left-boder-color solid 1px;
background: #fff; background: @left-tree-bg;
padding: 0px 10px 20px 10px; padding: 0px 10px 20px 10px;
margin-top: 10px; margin-top: 10px;
...@@ -899,7 +900,7 @@ textarea::-webkit-input-placeholder { ...@@ -899,7 +900,7 @@ textarea::-webkit-input-placeholder {
line-height: 45px; line-height: 45px;
text-align: left; text-align: left;
font-weight: 600; font-weight: 600;
border-bottom: #e4e6ed solid 1px; border-bottom: @left-tree-header-boder-color solid 1px;
} }
.zh-box { .zh-box {
...@@ -925,9 +926,9 @@ textarea::-webkit-input-placeholder { ...@@ -925,9 +926,9 @@ textarea::-webkit-input-placeholder {
box-sizing: border-box; box-sizing: border-box;
transition: all .2s; transition: all .2s;
background: #fff; background: @right-bg;
// border-radius:3px; // border-radius:3px;
padding: 0px 10px 10px 0px; padding: 10px;
margin-top: 10px; margin-top: 10px;
// box-shadow: 0 0 5px rgba(0, 0, 0, .15); // box-shadow: 0 0 5px rgba(0, 0, 0, .15);
} }
...@@ -1038,12 +1039,12 @@ textarea::-webkit-input-placeholder { ...@@ -1038,12 +1039,12 @@ textarea::-webkit-input-placeholder {
} }
.divIco:hover { .divIco:hover {
background: #F5F6FA; background: @right-icon-color-hover;
} }
.icoListInfo { .icoListInfo {
font-weight: bold; font-weight: bold;
color: #515A6E; color: @right-icon-color;
font-size: 24px; font-size: 24px;
} }
...@@ -1397,7 +1398,7 @@ html [type=button] { ...@@ -1397,7 +1398,7 @@ html [type=button] {
} }
.content { .content {
background: white; background: @layout-content-bg-color;
padding: 0 0 0 10px; padding: 0 0 0 10px;
//position: absolute; //position: absolute;
left: 250px; left: 250px;
...@@ -1462,9 +1463,9 @@ html [type=button] { ...@@ -1462,9 +1463,9 @@ html [type=button] {
} }
.menu_side { .menu_side {
background: #fff !important; // background: #fff !important;
margin: 5px 0 0 0 !important; margin: 5px 0 0 0 !important;
border: 1px solid #dcdee2 !important; // border: 1px solid #dcdee2 !important;
} }
.show_menu { .show_menu {
......
//定义变量 //定义变量
//@import './themes/deepBlank.less'; //@import './themes/deepBlank.less';
// @import './themes/green.less'; // @import './themes/green.less';
@import './themes/default.less'; @import './themes/default.less';
...@@ -95,35 +95,6 @@ ...@@ -95,35 +95,6 @@
background-color: @primary-color; 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 { .ivu-input-search {
cursor: pointer; cursor: pointer;
...@@ -231,26 +202,6 @@ ...@@ -231,26 +202,6 @@
background-color: @primary-color; 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 { .ivu-form-item-error-tip {
...@@ -451,6 +402,10 @@ ...@@ -451,6 +402,10 @@
.ivu-tree-title { .ivu-tree-title {
color: @tree-title-color !important; color: @tree-title-color !important;
span {
color: @tree-title-color !important;
}
} }
.ivu-btn-group>.ivu-btn { .ivu-btn-group>.ivu-btn {
...@@ -458,3 +413,130 @@ ...@@ -458,3 +413,130 @@
opacity: 0.8; opacity: 0.8;
background: @group-btn-bg-color; 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 @@ ...@@ -55,6 +55,7 @@
//表单的颜色 //表单的颜色
@form-color: #fff; @form-color: #fff;
@form-footer-color: #fff; @form-footer-color: #fff;
...@@ -72,7 +73,34 @@ ...@@ -72,7 +73,34 @@
//左侧列表 //左侧列表
@left-tree-bg: #2F2F57; @left-tree-bg: #2F2F57;
@left-tree-header-bg-color: #2F2F57; @left-tree-header-bg-color: #2F2F57;
@left-tree-header-boder-color: #106FFE;
@left-tree-header-color: #fff; @left-tree-header-color: #fff;
@tree-title-color: #fff; @tree-title-color: #fff;
@group-btn-bg-color:#2F2F57; @group-btn-bg-color: #2F2F57;
@group-btn-color:#F5F6FA; @group-btn-color: #F5F6FA;
\ No newline at end of file @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 @@ ...@@ -12,11 +12,12 @@
@layout-header: #515A6E; @layout-header: #515A6E;
@layout-tabs: #f5f7f9; @layout-tabs: #f5f7f9;
@layout-tabs-close: #515A6E; @layout-tabs-close: #515A6E;
@layout-tabs-bg-close:#fff; @layout-tabs-bg-close: #fff;
@tabs-bg-tag: #fff; @tabs-bg-tag: #fff;
//bady颜色 //bady颜色
@layout-content-bg-color: #fff; @layout-content-bg-color: #fff;
@card-bg: #fff; @card-bg: #fff;
@body-color: #515a6e; @body-color: #515a6e;
@border-color: #dcdfe6; @border-color: #dcdfe6;
...@@ -58,9 +59,9 @@ ...@@ -58,9 +59,9 @@
//表单的颜色 //表单的颜色
@form-color: #515a6e; @form-color: #515a6e;
@form-footer-color: #fff; @form-footer-color: #fff;
@form-divider-boder-color:#e8eaec; @form-divider-boder-color: #e8eaec;
@input-bg-color:#fff; @input-bg-color: #fff;
@input-boder-color:#dcdee2; @input-boder-color: #dcdee2;
...@@ -71,9 +72,34 @@ ...@@ -71,9 +72,34 @@
//左侧列表 //左侧列表
@left-tree-bg:#fff; @left-tree-bg: #fff;
@left-tree-header-bg-color: #f5f6fa; @left-tree-header-bg-color: #f5f6fa;
@left-tree-header-boder-color: #fff;
@left-tree-header-color: #515a6e; @left-tree-header-color: #515a6e;
@tree-title-color:#515a6e; @tree-title-color: #515a6e;
@group-btn-bg-color:#fff; @group-btn-bg-color: #fff;
@group-btn-color:#515a6e; @group-btn-color: #515a6e;
\ No newline at end of file @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 @@ ...@@ -12,7 +12,7 @@
@layout-header: #515A6E; @layout-header: #515A6E;
@layout-tabs: #f5f7f9; @layout-tabs: #f5f7f9;
@layout-tabs-close: #515A6E; @layout-tabs-close: #515A6E;
@layout-tabs-bg-close:#fff; @layout-tabs-bg-close: #fff;
@tabs-bg-tag: #fff; @tabs-bg-tag: #fff;
//bady颜色 //bady颜色
...@@ -57,9 +57,9 @@ ...@@ -57,9 +57,9 @@
//表单的颜色 //表单的颜色
@form-color: #515a6e; @form-color: #515a6e;
@form-footer-color: #fff; @form-footer-color: #fff;
@form-divider-boder-color:#e8eaec; @form-divider-boder-color: #e8eaec;
@input-bg-color:#fff; @input-bg-color: #fff;
@input-boder-color:#dcdee2; @input-boder-color: #dcdee2;
...@@ -70,9 +70,35 @@ ...@@ -70,9 +70,35 @@
//左侧列表 //左侧列表
@left-tree-bg:#fff; @left-tree-bg: #fff;
@left-tree-header-bg-color: #f5f6fa; @left-tree-header-bg-color: #f5f6fa;
@left-tree-header-boder-color: #fff;
@left-tree-header-color: #515a6e; @left-tree-header-color: #515a6e;
@tree-title-color:#515a6e; @tree-title-color: #515a6e;
@group-btn-bg-color:#fff; @group-btn-bg-color: #fff;
@group-btn-color:#515a6e; @group-btn-color: #515a6e;
\ No newline at end of file @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> <template>
<Table <Table
:loading="loading" :loading="loading"
border
highlight-row highlight-row
ref="table" ref="table"
:columns="tcolumn" :columns="tcolumn"
......
<template> <template>
<div class="table-content"> <div class="table-content">
<div class="table-tools" v-if="tool"> <div class="table-tools" v-if="tool">
<div class="table-search"> <div class="table-search">
<slot name="easySearch" v-if="easy"> <slot name="easySearch" v-if="easy">
<Form inline> <Form inline>
<FormItem> <FormItem>
<Input search enter-button :placeholder="placeholder" @on-search="easySearch" v-width="300" v-model="keys" /> <Input
search
enter-button
:placeholder="placeholder"
@on-search="easySearch"
v-width="300"
v-model="keys"
/>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button v-if="high" @click="modalSearch=true" type="text"> <Button v-if="high" @click="modalSearch=true" type="text">
...@@ -21,9 +28,7 @@ ...@@ -21,9 +28,7 @@
</div> </div>
<div class="btns"> <div class="btns">
<slot name="buttons"></slot> <slot name="buttons"></slot>
<Button @click="export2Excel" v-if="exportTitle.length>0"> <Button @click="export2Excel" v-if="exportTitle.length>0">导出</Button>
导出
</Button>
<Button v-if="set&&type=='table'" @click="config=!config"> <Button v-if="set&&type=='table'" @click="config=!config">
<Icon type="md-build" title="列设置" /> <Icon type="md-build" title="列设置" />
</Button> </Button>
...@@ -37,11 +42,40 @@ ...@@ -37,11 +42,40 @@
</slot> </slot>
</Col> </Col>
</Row> </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> <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>
<div class="table-footer"> <div class="table-footer">
<slot name="footer"></slot> <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" /> <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> </div>
<Modal v-if="high" v-model="modalSearch" title="高级搜索" draggable width="800" ref="search"> <Modal v-if="high" v-model="modalSearch" title="高级搜索" draggable width="800" ref="search">
<slot name="searchForm"></slot> <slot name="searchForm"></slot>
...@@ -50,7 +84,14 @@ ...@@ -50,7 +84,14 @@
<Button @click="complexSearch" type="primary" style="margin-left:10px;">查询</Button> <Button @click="complexSearch" type="primary" style="margin-left:10px;">查询</Button>
</div> </div>
</Modal> </Modal>
<Drawer title="列设置" v-if="set" v-model="config" :scrollable="true" placement="left" :mask="false"> <Drawer
title="列设置"
v-if="set"
v-model="config"
:scrollable="true"
placement="left"
:mask="false"
>
<div slot="header"> <div slot="header">
列设置 列设置
<a @click="undoConfig" class="ml50"> <a @click="undoConfig" class="ml50">
...@@ -58,7 +99,11 @@ ...@@ -58,7 +99,11 @@
</a> </a>
</div> </div>
<ul class="table-columns"> <ul class="table-columns">
<li v-for="(li,index) in columnsCur" :key="index" v-dragging="{ item: li, list: columnsCur, group: 'li' }"> <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}"> <label @click="columnChange(li,index)" :class="{dis:li.hide}">
<Icon :type="li.hide?'md-eye-off':'md-eye'" size="16" class="mr10" /> <Icon :type="li.hide?'md-eye-off':'md-eye'" size="16" class="mr10" />
<span>{{li.title}}</span> <span>{{li.title}}</span>
...@@ -73,7 +118,7 @@ ...@@ -73,7 +118,7 @@
<slot name="batch"></slot> <slot name="batch"></slot>
<Button @click="cancelBatch">取消</Button> <Button @click="cancelBatch">取消</Button>
</FooterToolbar> </FooterToolbar>
</div> </div>
</template> </template>
<script> <script>
...@@ -193,7 +238,7 @@ export default { ...@@ -193,7 +238,7 @@ export default {
keys: { keys: {
op: "name", op: "name",
value: "", value: "",
default: true default: true,
}, },
}; };
}, },
...@@ -223,7 +268,7 @@ export default { ...@@ -223,7 +268,7 @@ export default {
exportTitle: { exportTitle: {
type: String, type: String,
default: "", default: "",
} },
}, },
created() { created() {
this.columns.forEach((u) => { this.columns.forEach((u) => {
...@@ -318,7 +363,8 @@ export default { ...@@ -318,7 +363,8 @@ export default {
}, },
loadUserConfig() { loadUserConfig() {
var query = { var query = {
conditions: [{ conditions: [
{
fieldName: "creatorUserId", fieldName: "creatorUserId",
fieldValue: this.userId, fieldValue: this.userId,
conditionalType: "Equal", conditionalType: "Equal",
...@@ -409,7 +455,7 @@ export default { ...@@ -409,7 +455,7 @@ export default {
}, },
reload(conditions) { reload(conditions) {
var where = []; var where = [];
this.searchConditions = conditions this.searchConditions = conditions;
if (conditions) { if (conditions) {
Object.keys(conditions).forEach((u) => { Object.keys(conditions).forEach((u) => {
let v = conditions[u].value; let v = conditions[u].value;
...@@ -514,10 +560,10 @@ export default { ...@@ -514,10 +560,10 @@ export default {
let searchs = { let searchs = {
pageIndex: 1, pageIndex: 1,
conditions: where, conditions: where,
pageSize: 1000 pageSize: 1000,
} };
this.$api.post(this.action, searchs).then((r) => { this.$api.post(this.action, searchs).then((r) => {
let list = [] let list = [];
list = r.result.items; list = r.result.items;
const tHeader = []; // 设置Excel的表格第一行的标题 const tHeader = []; // 设置Excel的表格第一行的标题
const filterVal = []; //list里对象的属性 const filterVal = []; //list里对象的属性
...@@ -526,23 +572,29 @@ export default { ...@@ -526,23 +572,29 @@ export default {
var tempCol2 = []; //存放工艺规程相关表头 var tempCol2 = []; //存放工艺规程相关表头
var columnsCur = this.$u.clone(this.columnsCur); //导出列标题信息griddata this.$refs.grid.columnsCur var columnsCur = this.$u.clone(this.columnsCur); //导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur.forEach((el) => { columnsCur.forEach((el) => {
if ((el.hide && el.import) || (!el.hide && el.key != "action" && el.type != "selection" && el.key != "ico")) { if (
(el.hide && el.import) ||
(!el.hide &&
el.key != "action" &&
el.type != "selection" &&
el.key != "ico")
) {
if (el.code) { if (el.code) {
tempCol.push({ tempCol.push({
key: el.key, key: el.key,
code: el.code code: el.code,
}); //临时存放code数据字典的字段及对应的数据字典code }); //临时存放code数据字典的字段及对应的数据字典code
} }
if (el.materialKey) { if (el.materialKey) {
tempCol1.push({ tempCol1.push({
key: el.key, key: el.key,
code: el.materialKey code: el.materialKey,
}); //临时存放物料管理大类和子类列表 }); //临时存放物料管理大类和子类列表
} }
if (el.techKey) { if (el.techKey) {
tempCol2.push({ tempCol2.push({
key: el.key, key: el.key,
code: el.techKey code: el.techKey,
}); //临时存放工艺规程相关转换 }); //临时存放工艺规程相关转换
} }
...@@ -561,26 +613,25 @@ export default { ...@@ -561,26 +613,25 @@ export default {
//导出数据增加对应的物料管理信息 code: 1【rootCategoryId 大类】 2【categoryId 大类】 3【codeRuleId 编码名称】 //导出数据增加对应的物料管理信息 code: 1【rootCategoryId 大类】 2【categoryId 大类】 3【codeRuleId 编码名称】
tempCol1.forEach((elcol1) => { tempCol1.forEach((elcol1) => {
if (elcol1.code == 1) { if (elcol1.code == 1) {
e[elcol1.key] = this.getType1(e[elcol1.key]) e[elcol1.key] = this.getType1(e[elcol1.key]);
} else if (elcol1.code == 2) { } else if (elcol1.code == 2) {
e[elcol1.key] = this.getType2(e[elcol1.key]) e[elcol1.key] = this.getType2(e[elcol1.key]);
} else if (elcol1.code == 3) { } else if (elcol1.code == 3) {
e[elcol1.key] = this.getType3(e[elcol1.key]) e[elcol1.key] = this.getType3(e[elcol1.key]);
} }
}); });
//导出工艺规程相关转换表头信息 //导出工艺规程相关转换表头信息
tempCol2.forEach((elcol2) => { tempCol2.forEach((elcol2) => {
if (elcol2.code == 1) { if (elcol2.code == 1) {
e[elcol2.key] = this.getRoutingHeaderName(e[elcol2.key]) e[elcol2.key] = this.getRoutingHeaderName(e[elcol2.key]);
} }
}); });
}); });
let nowDate = this.$u.getNowTime(); //年月日时分秒yyyyMMddhhmmss let nowDate = this.$u.getNowTime(); //年月日时分秒yyyyMMddhhmmss
//获取导出数据结束 //获取导出数据结束
this.$u.outExcel(this.exportTitle + this.$u.outExcel(
"(" + nowDate + ")", this.exportTitle + "(" + nowDate + ")",
tHeader, tHeader,
filterVal, filterVal,
list list
...@@ -590,75 +641,75 @@ export default { ...@@ -590,75 +641,75 @@ export default {
//物料大类和子类的解析start //物料大类和子类的解析start
getTreeData() { getTreeData() {
let data = { let data = {
conditions: [] conditions: [],
}; };
this.$api.post(`${material}/category/list`, data).then((r) => { this.$api.post(`${material}/category/list`, data).then((r) => {
this.treeData = r.result this.treeData = r.result;
}); });
}, },
getType1(val) { getType1(val) {
let tempTreeList = this.$u.clone(this.treeData) let tempTreeList = this.$u.clone(this.treeData);
let rootName = "" let rootName = "";
tempTreeList.forEach(ele => { tempTreeList.forEach((ele) => {
if (ele.upId == 0 && ele.id == val) { if (ele.upId == 0 && ele.id == val) {
rootName = ele.name rootName = ele.name;
} }
}) });
return rootName return rootName;
}, },
getType2(val) { getType2(val) {
let tempTreeList = this.$u.clone(this.treeData) let tempTreeList = this.$u.clone(this.treeData);
let childrenName = "" let childrenName = "";
tempTreeList.forEach(ele => { tempTreeList.forEach((ele) => {
if (ele.upId > 0 && ele.id == val) { if (ele.upId > 0 && ele.id == val) {
childrenName = ele.name childrenName = ele.name;
} }
}) });
return childrenName return childrenName;
}, },
//获取编码名称 //获取编码名称
getcodeRuleData() { getcodeRuleData() {
let data = { let data = {
conditions: [] conditions: [],
}; };
this.$api.post(`${material}/coderule/paged`, data).then((r) => { this.$api.post(`${material}/coderule/paged`, data).then((r) => {
if (r.success) { if (r.success) {
this.codeRuleData = r.result.items || [] this.codeRuleData = r.result.items || [];
} }
}); });
}, },
getType3(val) { getType3(val) {
let codeRuleDataList = this.$u.clone(this.codeRuleData) let codeRuleDataList = this.$u.clone(this.codeRuleData);
let codeRuleName = "" let codeRuleName = "";
codeRuleDataList.forEach(ele => { codeRuleDataList.forEach((ele) => {
if (ele.id == val) { if (ele.id == val) {
codeRuleName = ele.name codeRuleName = ele.name;
} }
}) });
return codeRuleName return codeRuleName;
}, },
//物料大类和子类的解析end //物料大类和子类的解析end
//工艺规程的解析start //工艺规程的解析start
//获取工艺规程名称 //获取工艺规程名称
getRoutingHeaderData() { getRoutingHeaderData() {
let data = { let data = {
conditions: [] conditions: [],
}; };
this.$api.post(`${technologyUrl}routingheader/list`, data).then((r) => { this.$api.post(`${technologyUrl}routingheader/list`, data).then((r) => {
if (r.success) { if (r.success) {
this.routingHeaderData = r.result || [] this.routingHeaderData = r.result || [];
} }
}); });
}, },
getRoutingHeaderName(val) { getRoutingHeaderName(val) {
let routingHeaderDataList = this.$u.clone(this.routingHeaderData) let routingHeaderDataList = this.$u.clone(this.routingHeaderData);
let routingHeaderName = "" let routingHeaderName = "";
routingHeaderDataList.forEach(ele => { routingHeaderDataList.forEach((ele) => {
if (ele.id == val) { if (ele.id == val) {
routingHeaderName = ele.name routingHeaderName = ele.name;
} }
}) });
return routingHeaderName return routingHeaderName;
}, },
//工艺规程的解析end //工艺规程的解析end
}, },
...@@ -722,13 +773,13 @@ export default { ...@@ -722,13 +773,13 @@ export default {
}, },
}, },
watch: { watch: {
"data"() { data() {
this.list = this.data; this.list = this.data;
}, },
height() { height() {
this.tableHeight = this.height; this.tableHeight = this.height;
}, },
"columns"() { columns() {
this.columns.forEach((u) => { this.columns.forEach((u) => {
if (!u.hide) { if (!u.hide) {
u.hide = false; u.hide = false;
...@@ -741,6 +792,7 @@ export default { ...@@ -741,6 +792,7 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import "../../assets/css/custom.less";
.table-content { .table-content {
position: relative; position: relative;
height: 100%; height: 100%;
...@@ -778,7 +830,7 @@ export default { ...@@ -778,7 +830,7 @@ export default {
.table-tools { .table-tools {
display: flex; display: flex;
line-height: 50px; line-height: 50px;
background: @right-header-bg;
.table-search { .table-search {
flex-grow: 1; flex-grow: 1;
} }
......
...@@ -475,6 +475,7 @@ export default { ...@@ -475,6 +475,7 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import "../../assets/css/custom.less";
//position: relative; //position: relative;
// height: 100%; // height: 100%;
.tableCommon { .tableCommon {
...@@ -497,6 +498,7 @@ export default { ...@@ -497,6 +498,7 @@ export default {
.table-tools { .table-tools {
line-height: 40px; line-height: 40px;
background: @right-header-bg;
.table-search { .table-search {
float: left; float: left;
line-height: 40px; line-height: 40px;
......
<template> <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-content">
<div class="table-tools"> <div class="table-tools">
<div class="table-search"> <div class="table-search">
<Form inline> <Form inline>
...@@ -15,7 +14,6 @@ ...@@ -15,7 +14,6 @@
<FormItem> <FormItem>
<Button type="primary" @click="openInfoModal" :disabled="btnIm">导入</Button> <Button type="primary" @click="openInfoModal" :disabled="btnIm">导入</Button>
</FormItem> </FormItem>
</Form> </Form>
</div> </div>
<div class="btns"> <div class="btns">
...@@ -38,7 +36,16 @@ ...@@ -38,7 +36,16 @@
</div> </div>
</div> </div>
<div class="table-main" ref="main"> <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> <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" /> <component :is="detailExcel" ref="comExcel" @on-datalength="datalength" />
</div> </div>
<FooterToolbar v-if="sheetNames.length>1&&tableImport"> <FooterToolbar v-if="sheetNames.length>1&&tableImport">
...@@ -51,21 +58,26 @@ ...@@ -51,21 +58,26 @@
</Form> </Form>
</FooterToolbar> </FooterToolbar>
<Modal v-model="infoModal" :title="modalTitles" fullscreen> <Modal v-model="infoModal" :title="modalTitles" fullscreen>
<DataGrid :tool="false" :page="false" :columns="colsIm" :data="dataIm" :height="tdHeightExcel+30" ref="dataImport"></DataGrid> <DataGrid
:tool="false"
:page="false"
:columns="colsIm"
:data="dataIm"
:height="tdHeightExcel+30"
ref="dataImport"
></DataGrid>
<div slot="footer"> <div slot="footer">
<Button @click="infoModal=false">关闭</Button> <Button @click="infoModal=false">关闭</Button>
<Button type="primary" @click="importOk" v-show="imBtn">确定导入</Button> <Button type="primary" @click="importOk" v-show="imBtn">确定导入</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
</Modal> </Modal>
</template> </template>
<script> <script>
import XLSX from "xlsx"; import XLSX from "xlsx";
import { import { Switch } from "view-design";
Switch
} from "view-design";
export default { export default {
name: "Edit", name: "Edit",
data() { data() {
...@@ -91,15 +103,15 @@ export default { ...@@ -91,15 +103,15 @@ export default {
//new //new
colsIm: [], colsIm: [],
dataIm: [], dataIm: [],
excelType: '0', excelType: "0",
btnIm: true, btnIm: true,
titleInfo: '', titleInfo: "",
noDataText: '暂无数据', noDataText: "暂无数据",
imBtn: true, imBtn: true,
columnsIm: this.columns, columnsIm: this.columns,
ImportModal: this.open, ImportModal: this.open,
batchImportUrl: '', batchImportUrl: "",
modalTitles: '导入', modalTitles: "导入",
}; };
}, },
props: { props: {
...@@ -118,12 +130,12 @@ export default { ...@@ -118,12 +130,12 @@ export default {
}, },
open: { open: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
modalTitle: { modalTitle: {
type: String, type: String,
default: "" default: "",
} },
}, },
created() { created() {
this.tdHeightExcel = window.innerHeight - 180; this.tdHeightExcel = window.innerHeight - 180;
...@@ -138,13 +150,12 @@ export default { ...@@ -138,13 +150,12 @@ export default {
//if (this.eid > 0) { //if (this.eid > 0) {
// this.load(this.eid); // this.load(this.eid);
//} //}
this.modalTitles = "导入到【" + this.modalTitle + "】" this.modalTitles = "导入到【" + this.modalTitle + "】";
window.onresize = () => { window.onresize = () => {
///浏览器窗口大小变化 ///浏览器窗口大小变化
return (() => { return (() => {
window.screenHeight = window.innerHeight; window.screenHeight = window.innerHeight;
this.tdHeightExcel = window.screenHeight - 180; this.tdHeightExcel = window.screenHeight - 180;
})(); })();
}; };
}, },
...@@ -153,45 +164,56 @@ export default { ...@@ -153,45 +164,56 @@ export default {
loadColum(columns) { loadColum(columns) {
let tempCol = this.$u.clone(columns); let tempCol = this.$u.clone(columns);
tempCol.forEach((ele, index) => { tempCol.forEach((ele, index) => {
if (ele.key == "action" || ele.type == "selection" || ele.key == "ico") { if (
ele.key == "action" ||
ele.type == "selection" ||
ele.key == "ico"
) {
ele.hide = true; ele.hide = true;
} }
}); });
this.colsIm = tempCol; this.colsIm = tempCol;
this.colsIm.unshift({ this.colsIm.unshift(
type: 'index', {
type: "index",
width: 80, width: 80,
align: 'right', align: "right",
title: '序号' title: "序号",
}, { },
{
key: "ico", key: "ico",
title: " ", title: " ",
align: "center", align: "center",
width: 60, width: 60,
render: (h, params) => { render: (h, params) => {
return h("div", { return h(
class: "" "div",
}, [ {
class: "",
},
[
h(params.row.ico ? "op" : "", { h(params.row.ico ? "op" : "", {
attrs: { attrs: {
icon: "ios-alert", icon: "ios-alert",
type: "icon", type: "icon",
title: "数据不合法", title: "数据不合法",
color: "#ff9900" color: "#ff9900",
} },
}), }),
]); ]
);
}, },
}) }
);
//处理原始数据和表头进行对应 //处理原始数据和表头进行对应
let temCol = this.$u.clone(this.colsIm); //原始数据表头 let temCol = this.$u.clone(this.colsIm); //原始数据表头
let temColPage = this.$u.clone(columns); //需要显示的页面的表头 let temColPage = this.$u.clone(columns); //需要显示的页面的表头
//let temData = this.$u.clone(this.excelDataBack); //原始数据 //let temData = this.$u.clone(this.excelDataBack); //原始数据
let temData = []; //原始数据 let temData = []; //原始数据
if (this.excelType == "0") { if (this.excelType == "0") {
temData = this.$u.clone(this.excelDataBack) temData = this.$u.clone(this.excelDataBack);
} else { } else {
temData = this.$u.clone(this.$refs.comExcel.excelData) temData = this.$u.clone(this.$refs.comExcel.excelData);
} }
let arrTitleUse = []; ////使用数据字典的字段 let arrTitleUse = []; ////使用数据字典的字段
temColPage.forEach((elCode) => { temColPage.forEach((elCode) => {
...@@ -212,16 +234,20 @@ export default { ...@@ -212,16 +234,20 @@ export default {
}); });
//对列表里的部门及数据字典项进行处理 //对列表里的部门及数据字典项进行处理
useData.forEach(eles => { useData.forEach((eles) => {
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id //如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if ( if (
[(eles.departmentTitle && [
eles.departmentTitle != "") || (eles.departmentName && (eles.departmentTitle && eles.departmentTitle != "") ||
eles.departmentName != "")] && (eles.departmentName && eles.departmentName != ""),
] &&
(!eles.departmentId || eles.departmentId == "") (!eles.departmentId || eles.departmentId == "")
) { ) {
this.departArr.forEach((e) => { this.departArr.forEach((e) => {
if ((eles.departmentTitle && eles.departmentTitle == e.name) || (eles.departmentName && eles.departmentName == e.name)) { if (
(eles.departmentTitle && eles.departmentTitle == e.name) ||
(eles.departmentName && eles.departmentName == e.name)
) {
eles.departmentId = e.id; eles.departmentId = e.id;
} }
}); });
...@@ -229,7 +255,8 @@ export default { ...@@ -229,7 +255,8 @@ export default {
//如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle //如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle
eles.departmentId && eles.departmentId &&
eles.departmentId + "" != "" && eles.departmentId + "" != "" &&
(!eles.departmentTitle || eles.departmentTitle == "") && (!eles.departmentName || eles.departmentName == "") (!eles.departmentTitle || eles.departmentTitle == "") &&
(!eles.departmentName || eles.departmentName == "")
) { ) {
this.departArr.forEach((e) => { this.departArr.forEach((e) => {
if (eles.departmentId && eles.departmentId == e.id) { if (eles.departmentId && eles.departmentId == e.id) {
...@@ -240,7 +267,11 @@ export default { ...@@ -240,7 +267,11 @@ export default {
} }
arrTitleUse.forEach((elem) => { arrTitleUse.forEach((elem) => {
if (eles[elem.key] && eles[elem.key] != "" && eles[elem.key] != null) { if (
eles[elem.key] &&
eles[elem.key] != "" &&
eles[elem.key] != null
) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值 //如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
eles[elem.key] = this.$u.dirCode( eles[elem.key] = this.$u.dirCode(
this.$store.getters.dictionaryByKey(elem.code), this.$store.getters.dictionaryByKey(elem.code),
...@@ -248,11 +279,10 @@ export default { ...@@ -248,11 +279,10 @@ export default {
); );
} }
}); });
});
})
this.dataIm = useData; this.dataIm = useData;
let tempData = this.$u.clone(this.dataIm); let tempData = this.$u.clone(this.dataIm);
this.$emit("on-get-data", tempData) this.$emit("on-get-data", tempData);
}, },
//导入excel文件 //导入excel文件
...@@ -287,11 +317,11 @@ export default { ...@@ -287,11 +317,11 @@ export default {
var headers = lines[0].split(","); var headers = lines[0].split(",");
var headersNow = []; var headersNow = [];
headersNow.push({ headersNow.push({
type: 'index', type: "index",
width: 80, width: 80,
align: 'right', align: "right",
title: '序号' title: "序号",
}) });
headers.forEach((elHead) => { headers.forEach((elHead) => {
let headObj = {}; let headObj = {};
headObj.title = elHead; headObj.title = elHead;
...@@ -310,13 +340,12 @@ export default { ...@@ -310,13 +340,12 @@ export default {
} }
this.excelData = result; this.excelData = result;
this.excelDataBack = result; this.excelDataBack = result;
this.changeExcel(0) this.changeExcel(0);
}, },
//切换sheet表重新加载 //切换sheet表重新加载
sheetClick(val) { sheetClick(val) {
this.tabVal = val this.tabVal = val;
this.dealSheet(val); this.dealSheet(val);
}, },
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
...@@ -327,80 +356,85 @@ export default { ...@@ -327,80 +356,85 @@ export default {
this.$refs.uploadfile.clearFiles(); this.$refs.uploadfile.clearFiles();
let parms = { let parms = {
status: 1, status: 1,
id: this.eid id: this.eid,
} };
//导入中心列表数据状态更新 //导入中心列表数据状态更新
this.$emit("on-close"); this.$emit("on-close");
}, },
//打开导入数据格式化后的窗口 //打开导入数据格式化后的窗口
openInfoModal() { openInfoModal() {
if ((this.excelType == '0' && this.excelData.length > 0) || (this.excelType == '1' && this.$refs.comExcel.excelData.length > 0)) { if (
(this.excelType == "0" && this.excelData.length > 0) ||
(this.excelType == "1" && this.$refs.comExcel.excelData.length > 0)
) {
this.imBtn = true; this.imBtn = true;
this.loadColum(this.columnsIm); this.loadColum(this.columnsIm);
this.titleInfo = "批量导入"; this.titleInfo = "批量导入";
this.infoModal = true; this.infoModal = true;
} else { } else {
this.imBtn = false; this.imBtn = false;
this.$Message.error("没有可导入的数据!") this.$Message.error("没有可导入的数据!");
} }
}, },
//确定导入按钮操作 //确定导入按钮操作
importOk() { importOk() {
let imData = []; let imData = [];
let imDataError = [] let imDataError = [];
this.dataIm.forEach(ele => { this.dataIm.forEach((ele) => {
if (!ele.ico) { if (!ele.ico) {
imData.push(ele) imData.push(ele);
} else { } else {
imDataError.push(ele) imDataError.push(ele);
} }
});
this.$api
.post(this.batchImportUrl, {
list: imData,
}) })
this.$api.post(this.batchImportUrl, { .then((r) => {
list: imData
}).then((r) => {
if (r.success) { if (r.success) {
this.$Message.success("批量导入成功" + imData.length + "条数据") this.$Message.success("批量导入成功" + imData.length + "条数据");
this.dataIm = imDataError this.dataIm = imDataError;
this.$emit("on-ok") this.$emit("on-ok");
} else { } else {
this.$Message.error("批量导入失败") this.$Message.error("批量导入失败");
} }
}).catch(err => { })
.catch((err) => {
this.$Message.error("数据异常!"); this.$Message.error("数据异常!");
});; });
}, },
//切换列表和excel按钮 //切换列表和excel按钮
changeExcel(val) { changeExcel(val) {
if (val == 1) { if (val == 1) {
this.tableImport = false this.tableImport = false;
this.detailExcel = () => import("./detailExcel"); this.detailExcel = () => import("./detailExcel");
this.excelType = '1'; this.excelType = "1";
this.btnIm = true this.btnIm = true;
} else { } else {
this.detailExcel = null; this.detailExcel = null;
this.tableImport = true; this.tableImport = true;
this.excelType = '0'; this.excelType = "0";
if (this.excelData.length > 0) { if (this.excelData.length > 0) {
this.btnIm = false this.btnIm = false;
} else { } else {
this.btnIm = true this.btnIm = true;
} }
} }
}, },
datalength(val) { datalength(val) {
if (val > 0) { if (val > 0) {
this.btnIm = false this.btnIm = false;
} }
}, },
cancelModal() { cancelModal() {
this.$emit('on-cancel') this.$emit("on-cancel");
}, },
//主页面里第二次处理数据 //主页面里第二次处理数据
deelData(url, columns, formatList) { deelData(url, columns, formatList) {
this.dataIm = formatList this.dataIm = formatList;
this.batchImportUrl = url this.batchImportUrl = url;
}, },
l(key) { l(key) {
key = "user" + "." + key; key = "user" + "." + key;
...@@ -408,26 +442,27 @@ export default { ...@@ -408,26 +442,27 @@ export default {
}, },
}, },
watch: { watch: {
"columns"() { columns() {
this.columns.forEach((u) => { this.columns.forEach((u) => {
if (!u.hide) { if (!u.hide) {
u.hide = false; u.hide = false;
} }
}); });
this.colsIm = this.$u.clone(this.columns); this.colsIm = this.$u.clone(this.columns);
this.columnsIm = this.$u.clone(this.columns) this.columnsIm = this.$u.clone(this.columns);
}, },
open(v) { open(v) {
this.ImportModal = v this.ImportModal = v;
}, },
modalTitle(v) { modalTitle(v) {
this.modalTitles = "导入到【" + v + "】" this.modalTitles = "导入到【" + v + "】";
}, },
}, },
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../assets/css/custom.less";
.table-content { .table-content {
position: relative; position: relative;
height: 100%; height: 100%;
...@@ -465,7 +500,7 @@ export default { ...@@ -465,7 +500,7 @@ export default {
.table-tools { .table-tools {
display: flex; display: flex;
line-height: 50px; line-height: 50px;
background: @right-header-bg;
.table-search { .table-search {
flex-grow: 1; flex-grow: 1;
} }
...@@ -475,6 +510,5 @@ export default { ...@@ -475,6 +510,5 @@ export default {
text-align: right; text-align: right;
} }
} }
} }
</style> </style>
...@@ -135,23 +135,23 @@ ...@@ -135,23 +135,23 @@
</div> </div>
</template> </template>
<script> <script>
import TableExpand from './expand' import TableExpand from "./expand";
export default { export default {
name: 'treeGrid', name: "treeGrid",
components: { TableExpand }, components: { TableExpand },
props: { props: {
columns: Array, columns: Array,
items: { items: {
type: Array, type: Array,
default() { default() {
return [] return [];
} },
}, },
iconName: false iconName: false,
}, },
data() { data() {
return { return {
color: '#19be6b', color: "#19be6b",
initItems: [], // 处理后数据数组 initItems: [], // 处理后数据数组
cloneColumns: [], // 处理后的表头数据 cloneColumns: [], // 处理后的表头数据
checkGroup: [], // 复选框数组 checkGroup: [], // 复选框数组
...@@ -159,116 +159,116 @@ export default { ...@@ -159,116 +159,116 @@ export default {
screenWidth: document.body.clientWidth, // 自适应宽 screenWidth: document.body.clientWidth, // 自适应宽
tdsWidth: 0, // td总宽 tdsWidth: 0, // td总宽
timer: false, // 控制监听时长 timer: false, // 控制监听时长
dataLength: 0 // 树形数据长度 dataLength: 0, // 树形数据长度
} };
}, },
computed: { computed: {
tableWidth() { tableWidth() {
return this.tdsWidth > this.screenWidth && this.screenWidth > 0 return this.tdsWidth > this.screenWidth && this.screenWidth > 0
? `${this.screenWidth}px` ? `${this.screenWidth}px`
: '100%' : "100%";
} },
}, },
watch: { watch: {
screenWidth(val) { screenWidth(val) {
if (!this.timer) { if (!this.timer) {
this.screenWidth = val this.screenWidth = val;
this.timer = true this.timer = true;
setTimeout(() => { setTimeout(() => {
this.timer = false this.timer = false;
}, 400) }, 400);
} }
}, },
items() { items() {
if (this.items) { if (this.items) {
this.initItems = [] this.initItems = [];
this.dataLength = this.Length(this.items) this.dataLength = this.Length(this.items);
this.initData(this.deepCopy(this.items), 1, null) this.initData(this.deepCopy(this.items), 1, null);
this.checkGroup = this.renderCheck(this.items) this.checkGroup = this.renderCheck(this.items);
if (this.checkGroup.length == this.dataLength) { if (this.checkGroup.length == this.dataLength) {
this.checks = true this.checks = true;
} else { } else {
this.checks = false this.checks = false;
} }
} }
}, },
columns: { columns: {
handler() { handler() {
this.cloneColumns = this.makeColumns() this.cloneColumns = this.makeColumns();
}, },
deep: true deep: true,
}, },
checkGroup(data) { checkGroup(data) {
this.checkAllGroupChange(data) this.checkAllGroupChange(data);
} },
}, },
mounted() { mounted() {
if (this.items) { if (this.items) {
this.dataLength = this.Length(this.items) this.dataLength = this.Length(this.items);
this.initData(this.deepCopy(this.items), 1, null) this.initData(this.deepCopy(this.items), 1, null);
this.cloneColumns = this.makeColumns() this.cloneColumns = this.makeColumns();
this.checkGroup = this.renderCheck(this.items) this.checkGroup = this.renderCheck(this.items);
if (this.checkGroup.length == this.dataLength) { if (this.checkGroup.length == this.dataLength) {
this.checks = true this.checks = true;
} else { } else {
this.checks = false this.checks = false;
} }
} }
// 绑定onresize事件 监听屏幕变化设置宽 // 绑定onresize事件 监听屏幕变化设置宽
this.$nextTick(() => { this.$nextTick(() => {
this.screenWidth = document.body.clientWidth this.screenWidth = document.body.clientWidth;
}) });
window.onresize = () => window.onresize = () =>
(() => { (() => {
window.screenWidth = document.body.clientWidth window.screenWidth = document.body.clientWidth;
this.screenWidth = window.screenWidth this.screenWidth = window.screenWidth;
})() })();
}, },
methods: { methods: {
// 有无多选框折叠位置优化 // 有无多选框折叠位置优化
iconRow() { iconRow() {
for (let i = 0, len = this.columns.length; i < len; i++) { for (let i = 0, len = this.columns.length; i < len; i++) {
if (this.columns[i].type == 'selection') { if (this.columns[i].type == "selection") {
return 1 return 1;
} }
} }
return 0 return 0;
}, },
// 设置td宽度,td的align // 设置td宽度,td的align
tdStyle(column) { tdStyle(column) {
const style = {} const style = {};
if (column.align) { if (column.align) {
style['text-align'] = column.align style["text-align"] = column.align;
} }
if (column.width) { if (column.width) {
style['width'] = `${column.width}px` style["width"] = `${column.width}px`;
} }
return style return style;
}, },
// 排序事件 // 排序事件
handleSort(index, type) { handleSort(index, type) {
this.cloneColumns.forEach((col) => (col._sortType = 'normal')) this.cloneColumns.forEach((col) => (col._sortType = "normal"));
if (this.cloneColumns[index]._sortType === type) { if (this.cloneColumns[index]._sortType === type) {
this.cloneColumns[index]._sortType = 'normal' this.cloneColumns[index]._sortType = "normal";
} else { } else {
this.cloneColumns[index]._sortType = type this.cloneColumns[index]._sortType = type;
} }
this.$emit( this.$emit(
'on-sort-change', "on-sort-change",
this.cloneColumns[index].key, this.cloneColumns[index].key,
this.cloneColumns[index]._sortType this.cloneColumns[index]._sortType
) );
}, },
// 点击某一行事件 // 点击某一行事件
RowClick(data, event, index, text) { RowClick(data, event, index, text) {
// this.iconName = true; // this.iconName = true;
const result = this.makeData(data) const result = this.makeData(data);
this.$emit('on-row-click', result, event, index, text) this.$emit("on-row-click", result, event, index, text);
}, },
//点击图标 //点击图标
RowClickIcon(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) { updataOrderNum(data, event, index, text) {
...@@ -276,9 +276,9 @@ export default { ...@@ -276,9 +276,9 @@ export default {
// console.log(event.orderNum + "nnnnnnnn"); // console.log(event.orderNum + "nnnnnnnn");
var data = { var data = {
id: event.id, id: event.id,
orderNum: event.orderNum orderNum: event.orderNum,
} };
this.updata(data) this.updata(data);
}, },
//修改颜色 //修改颜色
updataColor(data, event, index, text) { updataColor(data, event, index, text) {
...@@ -286,144 +286,144 @@ export default { ...@@ -286,144 +286,144 @@ export default {
//console.log(event.color + "nnnnnnnn"); //console.log(event.color + "nnnnnnnn");
var data = { var data = {
id: event.id, id: event.id,
color: event.color color: event.color,
} };
this.updata(data) this.updata(data);
}, },
//修改单个字段 //修改单个字段
updata(data) { updata(data) {
this.$http.dic this.$http.dic
.dicUpdate(data) .dicUpdate(data)
.then((res) => { .then((res) => {
this.$Message.success(res.msg) this.$Message.success(res.msg);
this.$parent.getInfo() this.$parent.getInfo();
}) })
.catch((error) => { .catch((error) => {
this.$Message.error(error.msg) this.$Message.error(error.msg);
}) });
}, },
// 点击事件 返回数据处理 // 点击事件 返回数据处理
makeData(data) { makeData(data) {
const t = this.type(data) const t = this.type(data);
let o let o;
if (t === 'array') { if (t === "array") {
o = [] o = [];
} else if (t === 'object') { } else if (t === "object") {
o = {} o = {};
} else { } else {
return data return data;
} }
if (t === 'array') { if (t === "array") {
for (let i = 0; i < data.length; i++) { 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) { for (const i in data) {
if ( if (
i != 'spaceHtml' && i != "spaceHtml" &&
i != 'parent' && i != "parent" &&
i != 'level' && i != "level" &&
i != 'expanded' && i != "expanded" &&
i != 'isShow' && i != "isShow" &&
i != 'load' i != "load"
) { ) {
o[i] = this.makeData(data[i]) o[i] = this.makeData(data[i]);
} }
} }
} }
return o return o;
}, },
// 处理表头数据 // 处理表头数据
makeColumns() { makeColumns() {
const columns = this.deepCopy(this.columns) const columns = this.deepCopy(this.columns);
this.tdsWidth = 0 this.tdsWidth = 0;
columns.forEach((column, index) => { columns.forEach((column, index) => {
column._index = index column._index = index;
column._width = column.width ? column.width : '' column._width = column.width ? column.width : "";
column._sortType = 'normal' column._sortType = "normal";
this.tdsWidth += column.width ? parseFloat(column.width) : 0 this.tdsWidth += column.width ? parseFloat(column.width) : 0;
}) });
return columns return columns;
}, },
// 数据处理 增加自定义属性监听 // 数据处理 增加自定义属性监听
initData(items, level, parent) { initData(items, level, parent) {
// this.initItems = [] // this.initItems = []
let spaceHtml = '' let spaceHtml = "";
for (let i = 1; i < level; i++) { for (let i = 1; i < level; i++) {
spaceHtml += 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) => { items.forEach((item, index) => {
item = Object.assign({}, item, { item = Object.assign({}, item, {
parent, parent,
level, level,
spaceHtml spaceHtml,
}) });
if (typeof item.expanded === 'undefined') { if (typeof item.expanded === "undefined") {
item = Object.assign({}, item, { item = Object.assign({}, item, {
expanded: true expanded: true,
}) });
} }
if (typeof item.show === 'undefined') { if (typeof item.show === "undefined") {
item = Object.assign({}, item, { item = Object.assign({}, item, {
isShow: true isShow: true,
}) });
} }
if (typeof item.isChecked === 'undefined') { if (typeof item.isChecked === "undefined") {
item = Object.assign({}, item, { item = Object.assign({}, item, {
isChecked: false isChecked: false,
}) });
} }
item = Object.assign({}, item, { item = Object.assign({}, item, {
load: !!item.expanded load: !!item.expanded,
}) });
this.initItems.push(item) this.initItems.push(item);
if (item.children && item.expanded) { 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) { show(item) {
return ( return (
item.level == 1 || (item.parent && item.parent.expanded && item.isShow) item.level == 1 || (item.parent && item.parent.expanded && item.isShow)
) );
}, },
toggle(index, item) { toggle(index, item) {
const level = item.level + 1 const level = item.level + 1;
let spaceHtml = '' let spaceHtml = "";
for (let i = 1; i < level; i++) { 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.children) {
if (item.expanded) { if (item.expanded) {
item.expanded = !item.expanded item.expanded = !item.expanded;
this.close(index, item) this.close(index, item);
} else { } else {
item.expanded = !item.expanded item.expanded = !item.expanded;
if (item.load) { if (item.load) {
this.open(index, item) this.open(index, item);
} else { } else {
item.load = true item.load = true;
item.children.forEach((child, childIndex) => { 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], "parent", item);
this.$set(this.initItems[index + childIndex + 1], 'level', level) this.$set(this.initItems[index + childIndex + 1], "level", level);
this.$set( this.$set(
this.initItems[index + childIndex + 1], this.initItems[index + childIndex + 1],
'spaceHtml', "spaceHtml",
spaceHtml spaceHtml
) );
this.$set(this.initItems[index + childIndex + 1], 'isShow', true) this.$set(this.initItems[index + childIndex + 1], "isShow", true);
this.$set( this.$set(
this.initItems[index + childIndex + 1], this.initItems[index + childIndex + 1],
'expanded', "expanded",
false false
) );
}) });
} }
} }
} }
...@@ -431,42 +431,42 @@ export default { ...@@ -431,42 +431,42 @@ export default {
open(index, item) { open(index, item) {
if (item.children) { if (item.children) {
item.children.forEach((child, childIndex) => { item.children.forEach((child, childIndex) => {
child.isShow = true child.isShow = true;
if (child.children && child.expanded) { if (child.children && child.expanded) {
this.open(index + childIndex + 1, child) this.open(index + childIndex + 1, child);
} }
}) });
} }
}, },
close(index, item) { close(index, item) {
if (item.children) { if (item.children) {
item.children.forEach((child, childIndex) => { item.children.forEach((child, childIndex) => {
child.isShow = false child.isShow = false;
child.expanded = false child.expanded = false;
if (child.children) { if (child.children) {
this.close(index + childIndex + 1, child) this.close(index + childIndex + 1, child);
} }
}) });
} }
}, },
// 点击check勾选框,判断是否有children节点 如果有就一并勾选 // 点击check勾选框,判断是否有children节点 如果有就一并勾选
handleCheckClick(data, event, index) { handleCheckClick(data, event, index) {
data.isChecked = !data.isChecked data.isChecked = !data.isChecked;
const arr = data.children const arr = data.children;
if (arr) { if (arr) {
if (data.isChecked) { if (data.isChecked) {
this.checkGroup.push(data.id) this.checkGroup.push(data.id);
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
this.checkGroup.push(arr[i].id) this.checkGroup.push(arr[i].id);
} }
} else { } else {
for (let i = 0; i < this.checkGroup.length; i++) { for (let i = 0; i < this.checkGroup.length; i++) {
if (this.checkGroup[i] == data.id) { if (this.checkGroup[i] == data.id) {
this.checkGroup.splice(i, 1) this.checkGroup.splice(i, 1);
} }
for (let j = 0; j < arr.length; j++) { for (let j = 0; j < arr.length; j++) {
if (this.checkGroup[i] == arr[j].id) { if (this.checkGroup[i] == arr[j].id) {
this.checkGroup.splice(i, 1) this.checkGroup.splice(i, 1);
} }
} }
} }
...@@ -475,136 +475,138 @@ export default { ...@@ -475,136 +475,138 @@ export default {
}, },
// checkbox 全选 选择事件 // checkbox 全选 选择事件
handleCheckAll() { handleCheckAll() {
this.checks = !this.checks this.checks = !this.checks;
if (this.checks) { if (this.checks) {
this.checkGroup = this.getArray( this.checkGroup = this.getArray(
this.checkGroup.concat(this.All(this.items)) this.checkGroup.concat(this.All(this.items))
) );
} else { } else {
this.checkGroup = [] this.checkGroup = [];
} }
// this.$emit('on-selection-change', this.checkGroup) // this.$emit('on-selection-change', this.checkGroup)
}, },
// 数组去重 // 数组去重
getArray(a) { getArray(a) {
const hash = {} const hash = {};
const len = a.length const len = a.length;
const result = [] const result = [];
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
if (!hash[a[i]]) { if (!hash[a[i]]) {
hash[a[i]] = true hash[a[i]] = true;
result.push(a[i]) result.push(a[i]);
} }
} }
return result return result;
}, },
checkAllGroupChange(data) { checkAllGroupChange(data) {
if (this.dataLength > 0 && data.length === this.dataLength) { if (this.dataLength > 0 && data.length === this.dataLength) {
this.checks = true this.checks = true;
} else { } else {
this.checks = false this.checks = false;
} }
this.$emit('on-selection-change', this.checkGroup) this.$emit("on-selection-change", this.checkGroup);
}, },
All(data) { All(data) {
let arr = [] let arr = [];
data.forEach((item) => { data.forEach((item) => {
arr.push(item.id) arr.push(item.id);
if (item.children && item.children.length > 0) { 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) { Length(data) {
let { length } = data let { length } = data;
data.forEach((child) => { data.forEach((child) => {
if (child.children) { if (child.children) {
length += this.Length(child.children) length += this.Length(child.children);
} }
}) });
return length return length;
}, },
// 返回表头 // 返回表头
renderHeader(column, $index) { renderHeader(column, $index) {
if ('renderHeader' in this.columns[$index]) { if ("renderHeader" in this.columns[$index]) {
return this.columns[$index].renderHeader(column, $index) return this.columns[$index].renderHeader(column, $index);
} }
return column.title || '#' return column.title || "#";
}, },
// 返回内容 // 返回内容
renderBody(row, column, index) { renderBody(row, column, index) {
return row[column.key] return row[column.key];
}, },
// 默认选中 // 默认选中
renderCheck(data) { renderCheck(data) {
let arr = [] let arr = [];
data.forEach((item) => { data.forEach((item) => {
if (item._checked) { if (item._checked) {
arr.push(item.id) arr.push(item.id);
} }
if (item.children && item.children.length > 0) { 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) { deepCopy(data) {
const t = this.type(data) const t = this.type(data);
let o let o;
let i let i;
let ni let ni;
if (t === 'array') { if (t === "array") {
o = [] o = [];
} else if (t === 'object') { } else if (t === "object") {
o = {} o = {};
} else { } else {
return data return data;
} }
if (t === 'array') { if (t === "array") {
for (i = 0, ni = data.length; i < ni; i++) { 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) { for (i in data) {
o[i] = this.deepCopy(data[i]) o[i] = this.deepCopy(data[i]);
} }
return o return o;
} }
}, },
type(obj) { type(obj) {
const { toString } = Object.prototype const { toString } = Object.prototype;
const map = { const map = {
'[object Boolean]': 'boolean', "[object Boolean]": "boolean",
'[object Number]': 'number', "[object Number]": "number",
'[object String]': 'string', "[object String]": "string",
'[object Function]': 'function', "[object Function]": "function",
'[object Array]': 'array', "[object Array]": "array",
'[object Date]': 'date', "[object Date]": "date",
'[object RegExp]': 'regExp', "[object RegExp]": "regExp",
'[object Undefined]': 'undefined', "[object Undefined]": "undefined",
'[object Null]': 'null', "[object Null]": "null",
'[object Object]': 'object' "[object Object]": "object",
} };
return map[toString.call(obj)] return map[toString.call(obj)];
} },
}, },
beforeDestroy() { beforeDestroy() {
window.onresize = null window.onresize = null;
} },
} };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../assets/css/custom.less";
.treeTbale { .treeTbale {
overflow: 0 auto; overflow: 0 auto;
width: 100% !important; width: 100% !important;
.table-tools { .table-tools {
line-height: 40px; line-height: 40px;
background: @right-header-bg;
.table-search { .table-search {
float: left; float: left;
line-height: 40px; line-height: 40px;
...@@ -622,11 +624,11 @@ export default { ...@@ -622,11 +624,11 @@ export default {
font-size: 17px; font-size: 17px;
margin-left: 5px; margin-left: 5px;
display: inline-block; display: inline-block;
} }
.icon-set .ivu-icon { .icon-set .ivu-icon {
cursor: pointer; cursor: pointer;
} }
table { table {
border-spacing: 0; border-spacing: 0;
border-collapse: collapse; border-collapse: collapse;
......
@import "../../../assets/css/custom.less";
.results { .results {
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background:@layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 88vh; height: 88vh;
...@@ -22,7 +23,7 @@ ...@@ -22,7 +23,7 @@
h4 { h4 {
height: 45px; height: 45px;
line-height: 45px; line-height: 45px;
border-bottom: 1px solid #e4e6ed; border-bottom: 1px solid @left-tree-header-boder-color;
margin-bottom: 15px; margin-bottom: 15px;
padding-left: 10px; padding-left: 10px;
...@@ -64,15 +65,16 @@ ...@@ -64,15 +65,16 @@
.ivu-layout-content { .ivu-layout-content {
margin-left: 5px; margin-left: 5px;
background: rgba(255, 255, 255, 1); background: @right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 88vh; height: 88vh;
overflow: auto; overflow: auto;
position: relative; position: relative;
.i-row { .i-row {
height: 45px; height: 45px;
line-height: 45px; line-height: 45px;
border-bottom: 1px solid #e4e6ed; border-bottom: 1px solid @left-tree-header-boder-color;
margin-bottom: 15px; margin-bottom: 15px;
padding-left: 10px; padding-left: 10px;
...@@ -102,7 +104,7 @@ position: relative; ...@@ -102,7 +104,7 @@ position: relative;
.btn { .btn {
position: absolute; position: absolute;
top:7px; top: 7px;
right: 15px; right: 15px;
} }
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<a class="row_more fr" @click="toivew">更多</a> <a class="row_more fr" @click="toivew">更多</a>
</p> </p>
<div class="row_card_body"> <div class="row_card_body">
<Table border :columns="columns1" :data="data1"></Table> <Table :columns="columns1" :data="data1"></Table>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</Col> </Col>
</Row> </Row>
</Form> </Form>
<Table border :columns="columns" :data="data"></Table> <Table :columns="columns" :data="data"></Table>
<div class="page-v"> <div class="page-v">
<Page :total="4" size="small" show-elevator show-sizer show-total :page-size="20" /> <Page :total="4" size="small" show-elevator show-sizer show-total :page-size="20" />
</div> </div>
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</Col> </Col>
</Row> </Row>
</Form> </Form>
<Table border :columns="columns" :data="data"></Table> <Table :columns="columns" :data="data"></Table>
<div class="page-v"> <div class="page-v">
<Page :total="5" size="small" show-elevator show-sizer show-total :page-size="20" /> <Page :total="5" size="small" show-elevator show-sizer show-total :page-size="20" />
</div> </div>
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</Col> </Col>
</Row> </Row>
</Form> </Form>
<Table border :columns="columns" :data="data"></Table> <Table :columns="columns" :data="data"></Table>
<div class="page-v"> <div class="page-v">
<Page :total="14" size="small" show-elevator show-sizer show-total :page-size="20" /> <Page :total="14" size="small" show-elevator show-sizer show-total :page-size="20" />
</div> </div>
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</Col> </Col>
</Row> </Row>
</Form> </Form>
<Table border :columns="columns" :data="data"></Table> <Table :columns="columns" :data="data"></Table>
<div class="page-v"> <div class="page-v">
<Page :total="11" size="small" show-elevator show-sizer show-total :page-size="20" /> <Page :total="11" size="small" show-elevator show-sizer show-total :page-size="20" />
</div> </div>
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</Col> </Col>
</Row> </Row>
</Form> </Form>
<Table border :columns="columns" :data="data"></Table> <Table :columns="columns" :data="data"></Table>
<div class="page-v"> <div class="page-v">
<Page :total="11" size="small" show-elevator show-sizer show-total :page-size="20" /> <Page :total="11" size="small" show-elevator show-sizer show-total :page-size="20" />
</div> </div>
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</Col> </Col>
</Row> </Row>
</Form> </Form>
<Table border :columns="columns" :data="data"></Table> <Table :columns="columns" :data="data"></Table>
<div class="page-v"> <div class="page-v">
<Page :total="10" size="small" show-elevator show-sizer show-total :page-size="20" /> <Page :total="10" size="small" show-elevator show-sizer show-total :page-size="20" />
</div> </div>
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</Col> </Col>
</Row> </Row>
</Form> </Form>
<Table border :columns="columns" :data="data"></Table> <Table :columns="columns" :data="data"></Table>
<div class="page-v"> <div class="page-v">
<Page :total="6" size="small" show-elevator show-sizer show-total :page-size="20" /> <Page :total="6" size="small" show-elevator show-sizer show-total :page-size="20" />
</div> </div>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</Col> </Col>
<Col :span="16"> <Col :span="16">
<div class="table-b"> <div class="table-b">
<Table border :columns="columns1" :data="data1" height="260"></Table> <Table :columns="columns1" :data="data1" height="260"></Table>
</div> </div>
</Col> </Col>
</Row> </Row>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</div> </div>
<div class="table"> <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 <Page
:total="datatotal" :total="datatotal"
:current="pageindex" :current="pageindex"
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
</Col> </Col>
</Row> </Row>
</Form> </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"> <template slot-scope="{ row,index }" slot="title">
<state code="plan.dispatch.pauseCause" type="text" :value="row.pausecause_id"></state> <state code="plan.dispatch.pauseCause" type="text" :value="row.pausecause_id"></state>
</template> </template>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/> />
</div> </div>
<div class="table"> <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>
</div> </div>
</template> </template>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/> />
</div> </div>
<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>
</div> </div>
</template> </template>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<Button type="primary" :disabled="ishavzj" @click="SendCheckRecord()" class="title_btn ml10">送检记录</Button> <Button type="primary" :disabled="ishavzj" @click="SendCheckRecord()" class="title_btn ml10">送检记录</Button>
</div> </div>
<div class="table01"> <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 slot-scope="{ row,index }" slot="selffillin">
<template v-if="row.selfchecklist.fillinstatus==0||productobj.productstatus==4"> <template v-if="row.selfchecklist.fillinstatus==0||productobj.productstatus==4">
<Checkbox <Checkbox
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<Button type="primary" @click="save()" class="title_btn ml10" v-noClick>汇报</Button> <Button type="primary" @click="save()" class="title_btn ml10" v-noClick>汇报</Button>
</div> </div>
<div class="table01"> <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 slot-scope="{ row,index }" slot="hg">
<template v-if="row.status==0"> <template v-if="row.status==0">
<template v-if="row.productstatus1==0"> <template v-if="row.productstatus1==0">
......
<template> <template>
<div class="new_box"> <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 <Page
:total="datatotal" :total="datatotal"
:current="pageindex" :current="pageindex"
......
<template> <template>
<div class="table-contentProcess"> <div class="table-contentProcess">
<div class="table-tools"> <div class="table-tools">
<div class="table-search"> <div class="table-search">
<Form inline> <Form inline>
...@@ -7,7 +7,12 @@ ...@@ -7,7 +7,12 @@
<span>导入到</span> <span>导入到</span>
</FormItem> </FormItem>
<FormItem> <FormItem>
<dictionary code="import.im.page" style="width:160px" @on-change="pageChange" v-model="pageType"></dictionary> <dictionary
code="import.im.page"
style="width:160px"
@on-change="pageChange"
v-model="pageType"
></dictionary>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" @click="openInfoModal" :disabled="btnIm">导入</Button> <Button type="primary" @click="openInfoModal" :disabled="btnIm">导入</Button>
...@@ -26,7 +31,8 @@ ...@@ -26,7 +31,8 @@
<FormItem> <FormItem>
<Tooltip content="下载文件"> <Tooltip content="下载文件">
<a @click="downFile" tooltip="1111"> <a @click="downFile" tooltip="1111">
<Icon type="md-download" />{{entity.file}} <Icon type="md-download" />
{{entity.file}}
</a> </a>
</Tooltip> </Tooltip>
</FormItem> </FormItem>
...@@ -55,7 +61,16 @@ ...@@ -55,7 +61,16 @@
</div> </div>
</div> </div>
<div class="table-main" ref="main"> <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> <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" /> <component :is="detailExcel" ref="comExcel" @on-datalength="datalength" />
</div> </div>
<FooterToolbar v-if="sheetNames.length>1&&tableImport"> <FooterToolbar v-if="sheetNames.length>1&&tableImport">
...@@ -68,22 +83,27 @@ ...@@ -68,22 +83,27 @@
</Form> </Form>
</FooterToolbar> </FooterToolbar>
<Modal v-model="infoModal" :title="titleInfo" fullscreen> <Modal v-model="infoModal" :title="titleInfo" fullscreen>
<DataGrid :tool="false" :page="false" :columns="colsIm" :data="dataIm" :height="tdHeightExcel+30" ref="dataImport"></DataGrid> <DataGrid
:tool="false"
:page="false"
:columns="colsIm"
:data="dataIm"
:height="tdHeightExcel+30"
ref="dataImport"
></DataGrid>
<div slot="footer"> <div slot="footer">
<Button @click="infoModal=false">关闭</Button> <Button @click="infoModal=false">关闭</Button>
<Button type="primary" @click="importOk" v-show="imBtn">确定导入</Button> <Button type="primary" @click="importOk" v-show="imBtn">确定导入</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import BaseColums from "./baseColums"; import BaseColums from "./baseColums";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { import { Switch } from "view-design";
Switch
} from "view-design";
export default { export default {
name: "Edit", name: "Edit",
data() { data() {
...@@ -110,11 +130,11 @@ export default { ...@@ -110,11 +130,11 @@ export default {
//new //new
colsIm: [], colsIm: [],
dataIm: [], dataIm: [],
excelType: '0', excelType: "0",
btnIm: true, btnIm: true,
listLength: 0, listLength: 0,
titleInfo: '', titleInfo: "",
noDataText: '暂无数据', noDataText: "暂无数据",
imBtn: true, imBtn: true,
//物料管理 //物料管理
treeData: [], //物料管理左侧类别树 treeData: [], //物料管理左侧类别树
...@@ -148,7 +168,6 @@ export default { ...@@ -148,7 +168,6 @@ export default {
return (() => { return (() => {
window.screenHeight = window.innerHeight; window.screenHeight = window.innerHeight;
this.tdHeightExcel = window.screenHeight - 180; this.tdHeightExcel = window.screenHeight - 180;
})(); })();
}; };
}, },
...@@ -166,7 +185,8 @@ export default { ...@@ -166,7 +185,8 @@ export default {
Api.openExcel({ Api.openExcel({
id: v, id: v,
}).then((res) => { })
.then((res) => {
if (res.success) { if (res.success) {
this.openDatas = res.result || []; this.openDatas = res.result || [];
this.dealOpenTable(0); this.dealOpenTable(0);
...@@ -177,25 +197,26 @@ export default { ...@@ -177,25 +197,26 @@ export default {
}); });
} }
} }
}).catch(e => {
this.noDataText = "文件无法解析,建议下载原文件后转换为Excel文件格式重新上传!"
}) })
.catch((e) => {
this.noDataText =
"文件无法解析,建议下载原文件后转换为Excel文件格式重新上传!";
});
}, },
//加载原文件列表 //加载原文件列表
dealOpenTable(val) { dealOpenTable(val) {
this.excelData = this.openDatas[val].dataTable; this.excelData = this.openDatas[val].dataTable;
this.excelDataBack = this.openDatas[val].dataTable; this.excelDataBack = this.openDatas[val].dataTable;
this.listLength = this.excelData.length this.listLength = this.excelData.length;
var tempCos = Object.keys(this.openDatas[val].dataTable[0]); //获取列表标题 var tempCos = Object.keys(this.openDatas[val].dataTable[0]); //获取列表标题
this.columnsImport = []; this.columnsImport = [];
var headersNow = []; var headersNow = [];
headersNow.push({ headersNow.push({
type: 'index', type: "index",
width: 80, width: 80,
align: 'right', align: "right",
title: '序号' title: "序号",
}) });
tempCos.forEach((el) => { tempCos.forEach((el) => {
let headObj = {}; let headObj = {};
headObj.title = el; headObj.title = el;
...@@ -208,11 +229,11 @@ export default { ...@@ -208,11 +229,11 @@ export default {
loadColum(columns) { loadColum(columns) {
let tempCol = this.$u.clone(columns); let tempCol = this.$u.clone(columns);
tempCol.unshift({ tempCol.unshift({
type: 'index', type: "index",
width: 80, width: 80,
align: 'right', align: "right",
title: '序号' title: "序号",
}) });
tempCol.forEach((ele, index) => { tempCol.forEach((ele, index) => {
if (ele.key == "action") { if (ele.key == "action") {
ele.hide = true; ele.hide = true;
...@@ -226,9 +247,9 @@ export default { ...@@ -226,9 +247,9 @@ export default {
//let temData = this.$u.clone(this.excelDataBack); //原始数据 //let temData = this.$u.clone(this.excelDataBack); //原始数据
let temData = []; //原始数据 let temData = []; //原始数据
if (this.excelType == "0") { if (this.excelType == "0") {
temData = this.$u.clone(this.excelDataBack) temData = this.$u.clone(this.excelDataBack);
} else { } else {
temData = this.$u.clone(this.$refs.comExcel.excelData) temData = this.$u.clone(this.$refs.comExcel.excelData);
} }
let arrTitleUse = []; //使用数据字典的字段 let arrTitleUse = []; //使用数据字典的字段
let arrTitleUse1 = []; //使用物料编码的字段 let arrTitleUse1 = []; //使用物料编码的字段
...@@ -239,10 +260,11 @@ export default { ...@@ -239,10 +260,11 @@ export default {
code: elCode.code, code: elCode.code,
}); });
} }
if (elCode.materialKey) { //临时存放物料管理大类和子类列表 if (elCode.materialKey) {
//临时存放物料管理大类和子类列表
arrTitleUse1.push({ arrTitleUse1.push({
key: elCode.key, key: elCode.key,
code: elCode.materialKey code: elCode.materialKey,
}); });
} }
}); });
...@@ -256,16 +278,20 @@ export default { ...@@ -256,16 +278,20 @@ export default {
}); });
//对列表里的部门及数据字典项进行处理 //对列表里的部门及数据字典项进行处理
useData.forEach(eles => { useData.forEach((eles) => {
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id //如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if ( if (
[(eles.departmentTitle && [
eles.departmentTitle != "") || (eles.departmentName && (eles.departmentTitle && eles.departmentTitle != "") ||
eles.departmentName != "")] && (eles.departmentName && eles.departmentName != ""),
] &&
(!eles.departmentId || eles.departmentId == "") (!eles.departmentId || eles.departmentId == "")
) { ) {
this.departArr.forEach((e) => { this.departArr.forEach((e) => {
if ((eles.departmentTitle && eles.departmentTitle == e.name) || (eles.departmentName && eles.departmentName == e.name)) { if (
(eles.departmentTitle && eles.departmentTitle == e.name) ||
(eles.departmentName && eles.departmentName == e.name)
) {
eles.departmentId = e.id; eles.departmentId = e.id;
} }
}); });
...@@ -273,7 +299,8 @@ export default { ...@@ -273,7 +299,8 @@ export default {
//如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle //如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle
eles.departmentId && eles.departmentId &&
eles.departmentId + "" != "" && eles.departmentId + "" != "" &&
(!eles.departmentTitle || eles.departmentTitle == "") && (!eles.departmentName || eles.departmentName == "") (!eles.departmentTitle || eles.departmentTitle == "") &&
(!eles.departmentName || eles.departmentName == "")
) { ) {
this.departArr.forEach((e) => { this.departArr.forEach((e) => {
if (eles.departmentId && eles.departmentId == e.id) { if (eles.departmentId && eles.departmentId == e.id) {
...@@ -284,7 +311,11 @@ export default { ...@@ -284,7 +311,11 @@ export default {
} }
arrTitleUse.forEach((elem) => { arrTitleUse.forEach((elem) => {
if (eles[elem.key] && eles[elem.key] != "" && eles[elem.key] != null) { if (
eles[elem.key] &&
eles[elem.key] != "" &&
eles[elem.key] != null
) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值 //如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
eles[elem.key] = this.$u.dirCode( eles[elem.key] = this.$u.dirCode(
this.$store.getters.dictionaryByKey(elem.code), this.$store.getters.dictionaryByKey(elem.code),
...@@ -292,8 +323,7 @@ export default { ...@@ -292,8 +323,7 @@ export default {
); );
} }
}); });
});
})
this.dataIm = useData; this.dataIm = useData;
}, },
//下载原excel文件 //下载原excel文件
...@@ -346,11 +376,11 @@ export default { ...@@ -346,11 +376,11 @@ export default {
var headers = lines[0].split(","); var headers = lines[0].split(",");
var headersNow = []; var headersNow = [];
headersNow.push({ headersNow.push({
type: 'index', type: "index",
width: 80, width: 80,
align: 'right', align: "right",
title: '序号' title: "序号",
}) });
headers.forEach((elHead) => { headers.forEach((elHead) => {
let headObj = {}; let headObj = {};
headObj.title = elHead; headObj.title = elHead;
...@@ -369,29 +399,28 @@ export default { ...@@ -369,29 +399,28 @@ export default {
} }
this.excelData = result; this.excelData = result;
this.excelDataBack = result; this.excelDataBack = result;
this.changeExcel(0) this.changeExcel(0);
}, },
//切换sheet表重新加载 //切换sheet表重新加载
sheetClick(val) { sheetClick(val) {
this.tabVal = val this.tabVal = val;
if (this.dataType == 0) { if (this.dataType == 0) {
this.dealOpenTable(val); this.dealOpenTable(val);
} else { } else {
this.dealSheet(val); this.dealSheet(val);
} }
if (this.pageType != undefined) { if (this.pageType != undefined) {
this.pageChange(this.pageType) this.pageChange(this.pageType);
} }
}, },
//选择导入的模块 0:用户管理 //选择导入的模块 0:用户管理
pageChange(val) { pageChange(val) {
this.btnIm = false this.btnIm = false;
if (val == undefined) { if (val == undefined) {
this.btnIm = true this.btnIm = true;
} else { } else {
this.btnIm = false this.btnIm = false;
} }
}, },
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
...@@ -402,14 +431,14 @@ export default { ...@@ -402,14 +431,14 @@ export default {
this.$refs.uploadfile.clearFiles(); this.$refs.uploadfile.clearFiles();
let parms = { let parms = {
status: 1, status: 1,
id: this.eid id: this.eid,
} };
//导入中心列表数据状态更新 //导入中心列表数据状态更新
Api.updateimportstatus(parms).then(res => { Api.updateimportstatus(parms).then((res) => {
if (res.success) { if (res.success) {
this.$emit("on-ok"); this.$emit("on-ok");
} }
}) });
this.$emit("on-close"); this.$emit("on-close");
}, },
...@@ -419,7 +448,7 @@ export default { ...@@ -419,7 +448,7 @@ export default {
this.load(this.eid); this.load(this.eid);
this.tdHeightExcel = window.innerHeight - 180; this.tdHeightExcel = window.innerHeight - 180;
if (this.excelType == 1) { if (this.excelType == 1) {
this.changeExcel(0) this.changeExcel(0);
} }
}, },
//打开导入数据格式化后的窗口 //打开导入数据格式化后的窗口
...@@ -451,17 +480,22 @@ export default { ...@@ -451,17 +480,22 @@ export default {
default: default:
this.loadColum(BaseColums.columns0()); this.loadColum(BaseColums.columns0());
} }
this.titleInfo = "批量导入到 【" + this.$u.dirName( this.titleInfo =
"批量导入到 【" +
this.$u.dirName(
this.$store.getters.dictionaryByKey("import.im.page"), this.$store.getters.dictionaryByKey("import.im.page"),
this.pageType this.pageType
) + "】 模块" ) +
this.infoModal = true "】 模块";
this.infoModal = true;
} else { } else {
this.imBtn = true; this.imBtn = true;
if (this.excelData.length == 0) { if (this.excelData.length == 0) {
this.$Message.error("表【" + this.sheetNames[this.tabVal] + "】没有可导入的数据!") this.$Message.error(
"表【" + this.sheetNames[this.tabVal] + "】没有可导入的数据!"
);
} else if (this.pageType == undefined) { } else if (this.pageType == undefined) {
this.$Message.error("请选择需要批量导入到的模块!") this.$Message.error("请选择需要批量导入到的模块!");
} }
} }
}, },
...@@ -510,10 +544,18 @@ export default { ...@@ -510,10 +544,18 @@ export default {
titleId: ele.titleId, titleId: ele.titleId,
departmentTitle: ele.departmentTitle, departmentTitle: ele.departmentTitle,
}; };
if (ele.userName && ele.userName != '' && ele.cardNo && ele.cardNo != '' && ele.departmentId && ele.departmentId != '' && ele.phone && ele.phone != '') { if (
ele.userName &&
ele.userName != "" &&
ele.cardNo &&
ele.cardNo != "" &&
ele.departmentId &&
ele.departmentId != "" &&
ele.phone &&
ele.phone != ""
) {
tempList.push(obj); tempList.push(obj);
} }
}); });
if (tempList.length == 0) { if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!"); this.$Message.error("所有导入的数据均不合法!");
...@@ -521,10 +563,12 @@ export default { ...@@ -521,10 +563,12 @@ export default {
let parms = { let parms = {
list: tempList, list: tempList,
}; };
let url = `${systemUrl}/userimportservice/import` let url = `${systemUrl}/userimportservice/import`;
this.$api.post(url, parms).then((res) => { this.$api.post(url, parms).then((res) => {
if (res.success) { if (res.success) {
this.$Message.success("成功批量导入用户管理成功模块 " + tempList.length + " 条数据"); this.$Message.success(
"成功批量导入用户管理成功模块 " + tempList.length + " 条数据"
);
this.imBtn = false; this.imBtn = false;
this.cancelExcel(); this.cancelExcel();
} else { } else {
...@@ -532,7 +576,6 @@ export default { ...@@ -532,7 +576,6 @@ export default {
} }
}); });
} }
}, },
//批量插入制造资源 //批量插入制造资源
importResource() { importResource() {
...@@ -550,15 +593,16 @@ export default { ...@@ -550,15 +593,16 @@ export default {
numberAvailable: ele.numberAvailable ? ele.numberAvailable : 0, numberAvailable: ele.numberAvailable ? ele.numberAvailable : 0,
json: {}, json: {},
}; };
if (ele.nameOfResource && if (
ele.nameOfResource &&
ele.nameOfResource != "" && ele.nameOfResource != "" &&
ele.code && ele.code &&
ele.code != "" && ele.code != "" &&
ele.resourceCode && ele.resourceCode &&
ele.resourceCode != "") { ele.resourceCode != ""
) {
tempList.push(obj); tempList.push(obj);
} }
}); });
if (tempList.length == 0) { if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!"); this.$Message.error("所有导入的数据均不合法!");
...@@ -566,16 +610,21 @@ export default { ...@@ -566,16 +610,21 @@ export default {
let parms = { let parms = {
list: tempList, list: tempList,
}; };
let url = `${resourceUrl}/resourceimportservice/import` let url = `${resourceUrl}/resourceimportservice/import`;
this.$api.post(url, parms).then((r) => { this.$api
.post(url, parms)
.then((r) => {
if (r.success) { if (r.success) {
this.$Message.success("成功批量导入制造资源成功模块 " + tempList.length + " 条数据"); this.$Message.success(
"成功批量导入制造资源成功模块 " + tempList.length + " 条数据"
);
this.imBtn = false; this.imBtn = false;
this.cancelExcel(); this.cancelExcel();
} else { } else {
this.$Message.error("批量导入失败") this.$Message.error("批量导入失败");
} }
}).catch(err => { })
.catch((err) => {
this.$Message.error("数据异常!"); this.$Message.error("数据异常!");
}); });
} }
...@@ -586,22 +635,37 @@ export default { ...@@ -586,22 +635,37 @@ export default {
let tempList = []; let tempList = [];
tempData.forEach((ele) => { tempData.forEach((ele) => {
let obj = { let obj = {
name: ele.name ? ele.name : '', name: ele.name ? ele.name : "",
version: ele.version ? Number(ele.version) : '', version: ele.version ? Number(ele.version) : "",
drawing: ele.drawing ? ele.drawing : '', drawing: ele.drawing ? ele.drawing : "",
description: ele.description ? ele.description : "", description: ele.description ? ele.description : "",
code: 0, code: 0,
status: ele.status ? Number(ele.status) : '', status: ele.status ? Number(ele.status) : "",
customProperties: {}, customProperties: {},
categoryId: this.getType2(ele.categoryId) ? this.getType2(ele.categoryId) : 1, //左侧树点击的id categoryId: this.getType2(ele.categoryId)
rootCategoryId: this.getType1(ele.rootCategoryId) ? this.getType1(ele.rootCategoryId) : 1, //左侧树点击的数据的最顶层id ? this.getType2(ele.categoryId)
codeRuleId: this.getType3(ele.codeRuleId) ? this.getType3(ele.codeRuleId) : 1, //类别编码名称 : 1, //左侧树点击的id
codeRuleType: ele.codeRuleType ? Number(ele.codeRuleType) : 1 //类别codeType 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 != "") { 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); tempList.push(obj);
} }
}); });
if (tempList.length == 0) { if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!"); this.$Message.error("所有导入的数据均不合法!");
...@@ -609,16 +673,21 @@ export default { ...@@ -609,16 +673,21 @@ export default {
let parms = { let parms = {
list: tempList, list: tempList,
}; };
let url = `${material}/materialimportservice/import` let url = `${material}/materialimportservice/import`;
this.$api.post(url, parms).then((r) => { this.$api
.post(url, parms)
.then((r) => {
if (r.success) { if (r.success) {
this.$Message.success("成功批量导入物料管理模块 " + tempList.length + " 条数据"); this.$Message.success(
"成功批量导入物料管理模块 " + tempList.length + " 条数据"
);
this.imBtn = false; this.imBtn = false;
this.cancelExcel(); this.cancelExcel();
} else { } else {
this.$Message.error("批量导入失败") this.$Message.error("批量导入失败");
} }
}).catch(err => { })
.catch((err) => {
this.$Message.error("数据异常!"); this.$Message.error("数据异常!");
}); });
} }
...@@ -626,62 +695,61 @@ export default { ...@@ -626,62 +695,61 @@ export default {
//物料大类和子类的解析start //物料大类和子类的解析start
getTreeData() { getTreeData() {
let data = { let data = {
conditions: [] conditions: [],
}; };
this.$api.post(`${material}/category/list`, data).then((r) => { this.$api.post(`${material}/category/list`, data).then((r) => {
if (r.success) { if (r.success) {
this.treeData = r.result || [] this.treeData = r.result || [];
} }
}); });
}, },
getType1(val) { getType1(val) {
let tempTreeList = this.$u.clone(this.treeData) let tempTreeList = this.$u.clone(this.treeData);
let rootId = "" let rootId = "";
if (val && val != "" && val != null) { if (val && val != "" && val != null) {
tempTreeList.forEach(ele => { tempTreeList.forEach((ele) => {
if (ele.upId == 0 && ele.name == val) { if (ele.upId == 0 && ele.name == val) {
rootId = ele.id rootId = ele.id;
} }
}) });
} }
return rootId return rootId;
}, },
getType2(val) { getType2(val) {
let tempTreeList = this.$u.clone(this.treeData) let tempTreeList = this.$u.clone(this.treeData);
let childrenId = "" let childrenId = "";
if (val && val != "" && val != null) { if (val && val != "" && val != null) {
tempTreeList.forEach(ele => { tempTreeList.forEach((ele) => {
if (ele.upId > 0 && ele.name == val) { if (ele.upId > 0 && ele.name == val) {
childrenId = ele.id childrenId = ele.id;
} }
}) });
} }
return childrenId return childrenId;
}, },
//物料大类和子类的解析end //物料大类和子类的解析end
//获取编码名称等start //获取编码名称等start
getcodeRuleData() { getcodeRuleData() {
let data = { let data = {
conditions: [] conditions: [],
}; };
this.$api.post(`${material}/coderule/paged`, data).then((r) => { this.$api.post(`${material}/coderule/paged`, data).then((r) => {
if (r.success) { if (r.success) {
this.codeRuleData = r.result.items || [] this.codeRuleData = r.result.items || [];
} }
}); });
}, },
getType3(val) { getType3(val) {
let codeRuleDataList = this.$u.clone(this.codeRuleData) let codeRuleDataList = this.$u.clone(this.codeRuleData);
let codeRuleId = "" let codeRuleId = "";
if (val && val != "" && val != null) { if (val && val != "" && val != null) {
codeRuleDataList.forEach(ele => { codeRuleDataList.forEach((ele) => {
if (ele.name == val) { if (ele.name == val) {
codeRuleId = ele.id codeRuleId = ele.id;
} }
}) });
} }
return codeRuleId return codeRuleId;
}, },
//获取编码名称等end //获取编码名称等end
//插入物料管理end //插入物料管理end
...@@ -693,9 +761,9 @@ export default { ...@@ -693,9 +761,9 @@ export default {
let obj = { let obj = {
classId: null, classId: null,
unicode: "", unicode: "",
name: ele.name ? ele.name : '', name: ele.name ? ele.name : "",
code: ele.code ? ele.code : '', code: ele.code ? ele.code : "",
productId: ele.productId ? ele.productId : '', //? productId: ele.productId ? ele.productId : "", //?
productName: ele.productName ? ele.productName : "", //? productName: ele.productName ? ele.productName : "", //?
productBomId: ele.productBomId ? ele.productBomId : "", //? productBomId: ele.productBomId ? ele.productBomId : "", //?
drawingNo: ele.drawingNo ? ele.drawingNo : "", //? drawingNo: ele.drawingNo ? ele.drawingNo : "", //?
...@@ -719,12 +787,11 @@ export default { ...@@ -719,12 +787,11 @@ export default {
isSendPpm: 1, isSendPpm: 1,
fileId: "", fileId: "",
phase: ele.phase ? ele.phase : null, phase: ele.phase ? ele.phase : null,
isEffect: ele.isEffect ? ele.isEffect : 1 isEffect: ele.isEffect ? ele.isEffect : 1,
}; };
if (ele.name && ele.name != '') { if (ele.name && ele.name != "") {
tempList.push(obj); tempList.push(obj);
} }
}); });
if (tempList.length == 0) { if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!"); this.$Message.error("所有导入的数据均不合法!");
...@@ -732,20 +799,24 @@ export default { ...@@ -732,20 +799,24 @@ export default {
let parms = { let parms = {
list: tempList, list: tempList,
}; };
let url = `${technologyUrl}routingheaderimportservice/import` let url = `${technologyUrl}routingheaderimportservice/import`;
this.$api.post(url, parms).then((r) => { this.$api
.post(url, parms)
.then((r) => {
if (r.success) { if (r.success) {
this.$Message.success("成功批量导入工艺规程模块 " + tempList.length + " 条数据"); this.$Message.success(
"成功批量导入工艺规程模块 " + tempList.length + " 条数据"
);
this.imBtn = false; this.imBtn = false;
this.cancelExcel(); this.cancelExcel();
} else { } else {
this.$Message.error("批量导入失败") this.$Message.error("批量导入失败");
} }
}).catch(err => { })
.catch((err) => {
this.$Message.error("数据异常!"); this.$Message.error("数据异常!");
}); });
} }
}, },
//导入工艺bom //导入工艺bom
importRountingBom() { importRountingBom() {
...@@ -754,30 +825,35 @@ export default { ...@@ -754,30 +825,35 @@ export default {
tempData.forEach((ele) => { tempData.forEach((ele) => {
let obj = { let obj = {
routingHeaderId: Number(this.getRoutingHeaderId(ele.routingHeaderId)), routingHeaderId: Number(this.getRoutingHeaderId(ele.routingHeaderId)),
routingDetailId: ele.routingDetailId ? Number(ele.routingDetailId) : null, routingDetailId: ele.routingDetailId
routingDetailNo: ele.routingDetailNo ? Number(ele.routingDetailNo) : null, ? Number(ele.routingDetailId)
routingDetailName: ele.routingDetailName ? ele.routingDetailName : '', : null,
routingDetailNo: ele.routingDetailNo
? Number(ele.routingDetailNo)
: null,
routingDetailName: ele.routingDetailName ? ele.routingDetailName : "",
routingStepId: 0, routingStepId: 0,
quantity: ele.quantity ? Number(ele.quantity) : 0, quantity: ele.quantity ? Number(ele.quantity) : 0,
materialId: ele.materialId ? ele.materialId : '', materialId: ele.materialId ? ele.materialId : "",
materialType: ele.materialType ? Number(ele.materialType) : '', materialType: ele.materialType ? Number(ele.materialType) : "",
materialNumber: ele.materialNumber ? ele.materialNumber : '', materialNumber: ele.materialNumber ? ele.materialNumber : "",
nameMaterial: ele.nameMaterial ? ele.nameMaterial : '', nameMaterial: ele.nameMaterial ? ele.nameMaterial : "",
brand: ele.brand ? ele.brand : '', brand: ele.brand ? ele.brand : "",
specifications: ele.specifications ? ele.specifications : '', specifications: ele.specifications ? ele.specifications : "",
xhgg: ele.xhgg ? ele.xhgg : '', xhgg: ele.xhgg ? ele.xhgg : "",
texture: ele.texture ? ele.texture : '', texture: ele.texture ? ele.texture : "",
procurementStandards: ele.procurementStandards ? ele.procurementStandards : '', procurementStandards: ele.procurementStandards
qualityGrade: ele.qualityGrade ? ele.qualityGrade : '', ? ele.procurementStandards
: "",
qualityGrade: ele.qualityGrade ? ele.qualityGrade : "",
state: null, state: null,
extend: "", extend: "",
remark: "", remark: "",
drawNum: ele.drawNum ? ele.drawNum : '' drawNum: ele.drawNum ? ele.drawNum : "",
}; };
if (ele.routingDetailId && ele.routingDetailId != null) { if (ele.routingDetailId && ele.routingDetailId != null) {
tempList.push(obj); tempList.push(obj);
} }
}); });
if (tempList.length == 0) { if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!"); this.$Message.error("所有导入的数据均不合法!");
...@@ -785,44 +861,48 @@ export default { ...@@ -785,44 +861,48 @@ export default {
let parms = { let parms = {
list: tempList, list: tempList,
}; };
let url = `${technologyUrl}productinfoimportservice/import` let url = `${technologyUrl}productinfoimportservice/import`;
this.$api.post(url, parms).then((r) => { this.$api
.post(url, parms)
.then((r) => {
if (r.success) { if (r.success) {
this.$Message.success("成功批量导入工艺Bom模块 " + tempList.length + " 条数据"); this.$Message.success(
"成功批量导入工艺Bom模块 " + tempList.length + " 条数据"
);
this.imBtn = false; this.imBtn = false;
this.cancelExcel(); this.cancelExcel();
} else { } else {
this.$Message.error("批量导入失败") this.$Message.error("批量导入失败");
} }
}).catch(err => { })
.catch((err) => {
this.$Message.error("数据异常!"); this.$Message.error("数据异常!");
}); });
} }
}, },
//获取工艺规程列表 //获取工艺规程列表
getRoutingHeaderData() { getRoutingHeaderData() {
let url = `${technologyUrl}routingheader/list`; let url = `${technologyUrl}routingheader/list`;
let data = { let data = {
conditions: [] conditions: [],
}; };
this.$api.post(url, data).then((r) => { this.$api.post(url, data).then((r) => {
if (r.success) { if (r.success) {
this.routingHeaderData = r.result || [] this.routingHeaderData = r.result || [];
} }
}); });
}, },
//根据工艺规程ID获得name //根据工艺规程ID获得name
getRoutingHeaderId(val) { getRoutingHeaderId(val) {
let routingHeaderDataList = this.$u.clone(this.routingHeaderData) let routingHeaderDataList = this.$u.clone(this.routingHeaderData);
let routingHeaderId = 0 let routingHeaderId = 0;
routingHeaderDataList.forEach(ele => { routingHeaderDataList.forEach((ele) => {
if (ele.name == val) { if (ele.name == val) {
routingHeaderId = ele.id routingHeaderId = ele.id;
} }
}) });
return routingHeaderId return routingHeaderId;
}, },
//插入工艺规程 及工艺相关end //插入工艺规程 及工艺相关end
//插入产品管理start //插入产品管理start
...@@ -831,9 +911,9 @@ export default { ...@@ -831,9 +911,9 @@ export default {
let tempList = []; let tempList = [];
tempData.forEach((ele) => { tempData.forEach((ele) => {
let obj = { let obj = {
mmcode: ele.mmcode ? ele.mmcode : '', mmcode: ele.mmcode ? ele.mmcode : "",
drawingNo: ele.drawingNo ? ele.drawingNo : '', drawingNo: ele.drawingNo ? ele.drawingNo : "",
name: ele.name ? ele.name : '', name: ele.name ? ele.name : "",
type: ele.type ? ele.type : 1, type: ele.type ? ele.type : 1,
madeCompany: ele.madeCompany ? ele.madeCompany : null, madeCompany: ele.madeCompany ? ele.madeCompany : null,
madeCompanyTitle: ele.madeCompanyTitle ? ele.madeCompanyTitle : "", madeCompanyTitle: ele.madeCompanyTitle ? ele.madeCompanyTitle : "",
...@@ -844,10 +924,9 @@ export default { ...@@ -844,10 +924,9 @@ export default {
levelTitle: ele.levelTitle ? ele.levelTitle : "", levelTitle: ele.levelTitle ? ele.levelTitle : "",
materialId: ele.materialId ? ele.materialId : "", materialId: ele.materialId ? ele.materialId : "",
}; };
if (ele.name && ele.name != '') { if (ele.name && ele.name != "") {
tempList.push(obj); tempList.push(obj);
} }
}); });
if (tempList.length == 0) { if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!"); this.$Message.error("所有导入的数据均不合法!");
...@@ -856,15 +935,20 @@ export default { ...@@ -856,15 +935,20 @@ export default {
list: tempList, list: tempList,
}; };
let url = `${technologyUrl}productinfoimportservice/import`; let url = `${technologyUrl}productinfoimportservice/import`;
this.$api.post(url, parms).then((r) => { this.$api
.post(url, parms)
.then((r) => {
if (r.success) { if (r.success) {
this.$Message.success("成功批量导入产品管理模块 " + tempList.length + " 条数据"); this.$Message.success(
"成功批量导入产品管理模块 " + tempList.length + " 条数据"
);
this.imBtn = false; this.imBtn = false;
this.cancelExcel(); this.cancelExcel();
} else { } else {
this.$Message.error("批量导入失败") this.$Message.error("批量导入失败");
} }
}).catch(err => { })
.catch((err) => {
this.$Message.error("数据异常!"); this.$Message.error("数据异常!");
}); });
} }
...@@ -873,21 +957,20 @@ export default { ...@@ -873,21 +957,20 @@ export default {
//切换列表和excel按钮 //切换列表和excel按钮
changeExcel(val) { changeExcel(val) {
if (val == 1) { if (val == 1) {
this.tableImport = false this.tableImport = false;
this.detailExcel = () => import("./detailExcel"); this.detailExcel = () => import("./detailExcel");
this.pageType = undefined this.pageType = undefined;
this.excelType = '1'; this.excelType = "1";
} else { } else {
this.detailExcel = null; this.detailExcel = null;
this.tableImport = true; this.tableImport = true;
this.pageType = undefined this.pageType = undefined;
this.excelType = '0'; this.excelType = "0";
this.listLength = this.excelData.length; this.listLength = this.excelData.length;
} }
}, },
datalength(val) { datalength(val) {
this.listLength = val this.listLength = val;
}, },
}, },
watch: { watch: {
...@@ -901,6 +984,7 @@ export default { ...@@ -901,6 +984,7 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import "../../assets/css/custom.less";
.table-contentProcess { .table-contentProcess {
position: relative; position: relative;
height: 100%; height: 100%;
...@@ -938,7 +1022,7 @@ export default { ...@@ -938,7 +1022,7 @@ export default {
.table-tools { .table-tools {
display: flex; display: flex;
line-height: 50px; line-height: 50px;
background: @right-header-bg;
.table-search { .table-search {
flex-grow: 1; flex-grow: 1;
} }
......
<template> <template>
<div class="content"> <div class="content">
<TablePaste hide-table :input-props="inputProps" @on-success="handleSuccess" @on-error="handleError" v-show="showTablePaste" /> <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"> <template slot="easySearch">
<Form inline> <Form inline>
<FormItem> <FormItem>
......
...@@ -319,7 +319,7 @@ export default { ...@@ -319,7 +319,7 @@ export default {
.full { .full {
margin-top: 0; margin-top: 0;
.content { .content {
margin-top: 10px; margin-top: 6px;
.ivu-icon-ios-add:before { .ivu-icon-ios-add:before {
content: "\f341"; content: "\f341";
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</Col> </Col>
<Col :span="24"> <Col :span="24">
<h4>扩展属性</h4> <h4>扩展属性</h4>
<Table border :columns="columns" :data="checkList"> <Table :columns="columns" :data="checkList">
<template slot-scope="{ row, index }" slot="title"> <template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div> <div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div>
<Input <Input
......
...@@ -379,7 +379,7 @@ export default { ...@@ -379,7 +379,7 @@ export default {
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background: @layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 87vh; height: 87vh;
...@@ -452,7 +452,7 @@ export default { ...@@ -452,7 +452,7 @@ export default {
.ivu-layout-content { .ivu-layout-content {
// margin-left: 5px; // margin-left: 5px;
background: rgba(255, 255, 255, 1); background: @right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto; overflow: auto;
padding: 10px; padding: 10px;
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</div> </div>
</div> </div>
<div v-show="showTable"> <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> --> <!-- <DataGrid :columns="columns" ref="grid" :action="action" :tool="false" :height="750" :conditions="easySearch"></DataGrid> -->
</div> </div>
</Content> </Content>
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<Icon type="ios-arrow-forward" size="24" /> <Icon type="ios-arrow-forward" size="24" />
</a> </a>
</div> </div>
<Content :class="!showMenu?'con_bord':''"> <Content :class="!showMenu?'con_bord':''" class="content">
<MasterData ref="dataTable" :nodeInfo="nodeInfo" @on-ok="ok" /> <MasterData ref="dataTable" :nodeInfo="nodeInfo" @on-ok="ok" />
</Content> </Content>
</Layout> </Layout>
...@@ -296,7 +296,7 @@ export default { ...@@ -296,7 +296,7 @@ export default {
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background:@layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 88vh; height: 88vh;
...@@ -369,7 +369,7 @@ export default { ...@@ -369,7 +369,7 @@ export default {
.ivu-layout-content { .ivu-layout-content {
// margin-left: 5px; // margin-left: 5px;
background: rgba(255, 255, 255, 1); background:@right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto; overflow: auto;
padding: 10px; padding: 10px;
......
<template> <template>
<div style="width:100%;margin:0 auto"> <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"> <div style="width100%;margin:40px auto">
<Row> <Row>
<Process ref="userProcess" schemaIdVal="123327da-42b3-41f6-b785-cf933f137a95" /> <Process ref="userProcess" schemaIdVal="123327da-42b3-41f6-b785-cf933f137a95" />
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<Button type="primary" @click="easySearch">查询</Button> <Button type="primary" @click="easySearch">查询</Button>
</Col> </Col>
</Row> </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"> <template slot-scope="{ row, index }" slot="remainingAmount1">
<InputNumber v-model="row.remainingAmount1" @on-change="inputOrderCat(row,index)" min="0"></InputNumber> <InputNumber v-model="row.remainingAmount1" @on-change="inputOrderCat(row,index)" min="0"></InputNumber>
</template> </template>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<Button type="primary" @click="easySearch">查询</Button> <Button type="primary" @click="easySearch">查询</Button>
</Col> </Col>
</Row> </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"> <template slot-scope="{ row, index }" slot="remainingAmount1">
<InputNumber v-model="row.remainingAmount1" @on-change="inputOrderCat(row,index)" min="0"></InputNumber> <InputNumber v-model="row.remainingAmount1" @on-change="inputOrderCat(row,index)" min="0"></InputNumber>
</template> </template>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<Button type="primary" @click="easySearch">查询</Button> <Button type="primary" @click="easySearch">查询</Button>
</Col> </Col>
</Row> </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"> <template slot-scope="{ row, index }" slot="remainingAmount1">
<InputNumber v-model="row.remainingAmount1" @on-change="inputOrderCat(row,index)" min="0"></InputNumber> <InputNumber v-model="row.remainingAmount1" @on-change="inputOrderCat(row,index)" min="0"></InputNumber>
</template> </template>
......
...@@ -431,6 +431,7 @@ export default { ...@@ -431,6 +431,7 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
// @import "../../../assets/css/custom.less";
.table-content { .table-content {
position: relative; position: relative;
// height: 100%; // height: 100%;
...@@ -454,6 +455,7 @@ export default { ...@@ -454,6 +455,7 @@ export default {
.table-tools { .table-tools {
line-height: 40px; line-height: 40px;
// background: @right-header-bg;
.table-search { .table-search {
float: left; float: left;
line-height: 40px; line-height: 40px;
......
...@@ -21,12 +21,15 @@ ...@@ -21,12 +21,15 @@
</div> </div>
</div> </div>
<Table <Table
:border="border" :columns="columnsNow" :border="border"
:data="list" :height="tableHeight" :columns="columnsNow"
ref="table" class="tableCommon" :data="list"
:height="tableHeight"
ref="table"
class="tableCommon"
@on-expand="expand" @on-expand="expand"
@on-selection-change="selectionChange"> @on-selection-change="selectionChange"
</Table> ></Table>
<div class="table-footer"> <div class="table-footer">
<div> <div>
<slot name="footer"></slot> <slot name="footer"></slot>
...@@ -64,7 +67,8 @@ ...@@ -64,7 +67,8 @@
<div slot="header"> <div slot="header">
列设置 列设置
<a @click="undoConfig" class="ml50"> <a @click="undoConfig" class="ml50">
<Icon type="md-refresh" title="恢复初始设置"/></a> <Icon type="md-refresh" title="恢复初始设置" />
</a>
</div> </div>
<ul class="table-columns"> <ul class="table-columns">
<li <li
...@@ -87,12 +91,12 @@ ...@@ -87,12 +91,12 @@
export default { export default {
data() { data() {
return { return {
keys: '', keys: "",
modalSearch: false, modalSearch: false,
search: { search: {
pageIndex: 1, pageIndex: 1,
pageSize: 20, pageSize: 20,
conditions: [] conditions: [],
}, },
pageSizeOpts: [20, 50, 100], pageSizeOpts: [20, 50, 100],
tableHeight: 0, tableHeight: 0,
...@@ -100,325 +104,337 @@ export default { ...@@ -100,325 +104,337 @@ export default {
config: false, config: false,
list: [], list: [],
columnsCur: [], columnsCur: [],
configLoad:false, configLoad: false,
userConfig: null, //用户页面配置信息。, userConfig: null, //用户页面配置信息。,
userId: this.$store.state.userInfo.userId userId: this.$store.state.userInfo.userId,
} };
}, },
props: { props: {
datalist:{ datalist: {
type: Array, type: Array,
default:[] default: [],
}, },
total:{ total: {
type: Number, type: Number,
default:0 default: 0,
}, },
border: { border: {
//是否显示边框 //是否显示边框
type: Boolean, type: Boolean,
default: true default: true,
}, },
placeholder: { placeholder: {
type: String, type: String,
default: '请输入关键字' default: "请输入关键字",
}, },
height: { height: {
type: Number, type: Number,
default: 0 default: 0,
}, },
tool: { tool: {
//是否显示工具栏 //是否显示工具栏
type: Boolean, type: Boolean,
default: true default: true,
}, },
easy: { easy: {
//是否显示简单搜索 //是否显示简单搜索
type: Boolean, type: Boolean,
default: true default: true,
}, },
high: { high: {
//是否显示高级搜索 //是否显示高级搜索
type: Boolean, type: Boolean,
default: true default: true,
}, },
set: { set: {
//是否显示列设置 //是否显示列设置
type: Boolean, type: Boolean,
default: true default: true,
}, },
page: { page: {
//是否分页 //是否分页
type: Boolean, type: Boolean,
default: true default: true,
}, },
data: { data: {
// 当作table使用,直接显示数据 // 当作table使用,直接显示数据
type: Array, type: Array,
default: function() { default: function () {
return [] return [];
} },
}, },
columns: { columns: {
//要显示的字段 //要显示的字段
type: Array, type: Array,
default: [] default: [],
}, },
action: { action: {
//接口地址 //接口地址
type: String, type: String,
default: '' default: "",
}, },
conditions: { conditions: {
//查询条件 //查询条件
type: Object, type: Object,
default: function() { default: function () {
return { return {
keys: { op: 'name', value: '', default: true } keys: { op: "name", value: "", default: true },
} };
} },
} },
}, },
created() { created() {
this.columns.forEach((u) => { this.columns.forEach((u) => {
if (!u.hide) { if (!u.hide) {
u.hide = false u.hide = false;
} }
}) });
this.columnsCur = this.$u.clone(this.columns) this.columnsCur = this.$u.clone(this.columns);
console.warn(this.columnsCur) console.warn(this.columnsCur);
}, },
mounted() { mounted() {
this.keys = '' this.keys = "";
this.intY() this.intY();
this.loadUserConfig(); this.loadUserConfig();
if (this.height === 0) { if (this.height === 0) {
window.onresize = () => { window.onresize = () => {
///浏览器窗口大小变化 ///浏览器窗口大小变化
return (() => { return (() => {
window.screenHeight = window.innerHeight window.screenHeight = window.innerHeight;
this.tableHeight = window.screenHeight - this.firstY - 60 this.tableHeight = window.screenHeight - this.firstY - 60;
})() })();
} };
} else { } else {
this.tableHeight = this.height this.tableHeight = this.height;
} }
//注册拖拽事件。 //注册拖拽事件。
this.$dragging.$on('dragend', (e) => { this.$dragging.$on("dragend", (e) => {
// console.log("dragend",e); // console.log("dragend",e);
this.saveUserconfig() this.saveUserconfig();
}) });
}, },
methods: { methods: {
//数据加载 //数据加载
load() { load() {
if (this.height == 0) { if (this.height == 0) {
this.tableHeight = window.innerHeight - this.firstY - 60 this.tableHeight = window.innerHeight - this.firstY - 60;
} }
if (this.action) { if (this.action) {
this.$api.post(this.action, this.search).then((r) => { this.$api.post(this.action, this.search).then((r) => {
this.list = r.result.items this.list = r.result.items;
this.search.total = r.result.totalCount this.search.total = r.result.totalCount;
}) });
}else{ } else {
this.list = this.datalist this.list = this.datalist;
this.search.total = this.total this.search.total = this.total;
} }
}, },
columnInit(){ columnInit() {
if(this.userConfig){ if (this.userConfig) {
var curColumns=[]; var curColumns = [];
var config=JSON.parse(this.userConfig.content); var config = JSON.parse(this.userConfig.content);
// console.warn("2:列比对",config) // console.warn("2:列比对",config)
if(config.length==this.columnsCur.length){ if (config.length == this.columnsCur.length) {
config.map(u=>{ config.map((u) => {
var item=this.columnsCur.filter(c=>{ var item = this.columnsCur.filter((c) => {
return c.key==u.key; return c.key == u.key;
}); });
if(item[0]){ if (item[0]) {
item[0].hide=u.hide; item[0].hide = u.hide;
curColumns.push(item[0]); curColumns.push(item[0]);
} }
}); });
// console.warn("3:初始化列") // console.warn("3:初始化列")
this.columnsCur=curColumns; this.columnsCur = curColumns;
} }
} }
}, },
loadUserConfig() { loadUserConfig() {
var query = { var query = {
conditions: [ conditions: [
{fieldName:"creatorUserId",fieldValue:this.userId,conditionalType: "Equal"}, {
{fieldName:"component",fieldValue:"Grid",conditionalType: "Equal"}, fieldName: "creatorUserId",
{fieldName:"page",fieldValue:window.location.pathname,conditionalType: "Equal"} fieldValue: this.userId,
] conditionalType: "Equal",
, },
pageSize: 1 {
} 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) => { this.$api.post(`${window.systemUrl}/config/list`, query).then((r) => {
if (r.success) { if (r.success) {
if (r.result.length == 1) { if (r.result.length == 1) {
this.userConfig = r.result[0] this.userConfig = r.result[0];
// console.warn("1:加载用户配置") // console.warn("1:加载用户配置")
this.columnInit(); this.columnInit();
} }
if(!this.configLoad){ if (!this.configLoad) {
this.easySearch(); this.easySearch();
} }
this.configLoad=true; this.configLoad = true;
} }
}) });
}, },
saveUserconfig() { saveUserconfig() {
let url = `${window.systemUrl}/config/update`; let url = `${window.systemUrl}/config/update`;
var content=[]; var content = [];
this.columnsCur.map(u=>{ this.columnsCur.map((u) => {
content.push({ content.push({
key:u.key, key: u.key,
hide:u.hide hide: u.hide,
}) });
}) });
if (!this.userConfig) { if (!this.userConfig) {
url = `${window.systemUrl}/config/create` url = `${window.systemUrl}/config/create`;
var data = { var data = {
page: window.location.pathname, page: window.location.pathname,
component: 'Grid', component: "Grid",
key: this.$u.guid(), key: this.$u.guid(),
content: JSON.stringify(content) content: JSON.stringify(content),
} };
this.$api.post(url,data).then(r=>{ this.$api.post(url, data).then((r) => {
this.loadUserConfig() this.loadUserConfig();
}); });
}else{ } else {
this.userConfig.content=JSON.stringify(content); this.userConfig.content = JSON.stringify(content);
this.$api.post(url,this.userConfig) this.$api.post(url, this.userConfig);
} }
}, },
//展开 //展开
expand(row, status) { expand(row, status) {
this.$emit('on-expand', row, status) this.$emit("on-expand", row, status);
}, },
easySearch() { easySearch() {
if (this.conditions && this.conditions.keys.default) { 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.columnsCur = this.$u.clone(this.columns);
this.saveUserconfig(); this.saveUserconfig();
}, },
complexSearch() { complexSearch() {
var search = this.$refs.search.$children.filter((u) => { var search = this.$refs.search.$children.filter((u) => {
return u.condition return u.condition;
}) });
if (search) { if (search) {
var conditions = search[0].condition var conditions = search[0].condition;
this.reload(conditions) this.reload(conditions);
} }
}, },
reload(conditions) { reload(conditions) {
var where = [] var where = [];
if (conditions) { if (conditions) {
Object.keys(conditions).forEach((u) => { Object.keys(conditions).forEach((u) => {
let v = conditions[u].value let v = conditions[u].value;
let op = conditions[u].op let op = conditions[u].op;
if (!this.$u.isNull(v)) { if (!this.$u.isNull(v)) {
if (op == 'Range') { if (op == "Range") {
let times = [] let times = [];
v.map((u) => { v.map((u) => {
if (!this.$u.isNull(u)) { if (!this.$u.isNull(u)) {
times.push(this.$u.toTime(u)) times.push(this.$u.toTime(u));
} }
}) });
v = times.join(',') v = times.join(",");
} else if (op.indexOf('In') > -1) { } else if (op.indexOf("In") > -1) {
v = v.join(',') v = v.join(",");
} }
if (!this.$u.isNull(v)) { if (!this.$u.isNull(v)) {
where.push({ where.push({
fieldName: u, fieldName: u,
fieldValue: v, fieldValue: v,
conditionalType: op conditionalType: op,
}) });
} }
} }
}) });
} }
this.search.pageIndex = 1 this.search.pageIndex = 1;
this.search.conditions = where this.search.conditions = where;
this.load() this.load();
}, },
pageChange(page) { pageChange(page) {
this.search.page = page this.search.page = page;
this.search.pageIndex = page this.search.pageIndex = page;
this.load() this.load();
}, },
pageSizeChange(size) { pageSizeChange(size) {
this.search.pageSize = size this.search.pageSize = size;
this.search.pageIndex = 1 this.search.pageIndex = 1;
this.load() this.load();
}, },
columnChange(item, i) { columnChange(item, i) {
item.hide = !item.hide; item.hide = !item.hide;
this.$set(this.columnsCur,item,i); this.$set(this.columnsCur, item, i);
this.saveUserconfig(); this.saveUserconfig();
}, },
selectionChange(items) { selectionChange(items) {
this.$emit('on-selection-change', items) this.$emit("on-selection-change", items);
}, },
intY() { intY() {
this.firstY = this.$refs.table.$el.getBoundingClientRect().top this.firstY = this.$refs.table.$el.getBoundingClientRect().top;
} },
}, },
computed: { computed: {
columnsNow() { columnsNow() {
var cols = this.columnsCur.filter((u) => { var cols = this.columnsCur.filter((u) => {
if (u.code) { if (u.code) {
u.render = (h, params) => { u.render = (h, params) => {
let values = u.key let values = u.key;
return h('state', { return h("state", {
props: { props: {
code: u.code, code: u.code,
type: 'text', type: "text",
value: params.row[values] + '' value: params.row[values] + "",
} },
}) });
} };
} }
if (u.type == 'user') { if (u.type == "user") {
u.render = (h, params) => { u.render = (h, params) => {
let values = u.key let values = u.key;
return h('User', { return h("User", {
props: { 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) => { u.render = (h, params) => {
let values = u.key let values = u.key;
return h('DTSpan', { return h("DTSpan", {
props: { props: {
type: u.type, type: u.type,
value: params.row[values] value: params.row[values],
} },
}) });
} };
}
return !u.hide
})
return cols
}
} }
} return !u.hide;
});
return cols;
},
},
};
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../assets/css/custom.less";
.table-content { .table-content {
position: relative; position: relative;
// height: 100%; // height: 100%;
...@@ -437,11 +453,12 @@ export default { ...@@ -437,11 +453,12 @@ export default {
padding: 0 2px; padding: 0 2px;
} }
.tableCommon tr td .ivu-table-cell { .tableCommon tr td .ivu-table-cell {
padding:0 5px; padding: 0 5px;
} }
.table-tools { .table-tools {
line-height: 40px; line-height: 40px;
background: @right-header-bg;
.table-search { .table-search {
float: left; float: left;
line-height: 40px; line-height: 40px;
......
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
<div class="ml10"> <div class="ml10">
<Tabs v-model="currTab" @on-click="clickTab"> <Tabs v-model="currTab" @on-click="clickTab">
<TabPane label="五二九纵" name="name1"> <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>
<TabPane label="五二九横" name="name2">五二九横</TabPane> <TabPane label="五二九横" name="name2">五二九横</TabPane>
<TabPane label="五二九预" name="name3">五二九预</TabPane> <TabPane label="五二九预" name="name3">五二九预</TabPane>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</div> </div>
</div> </div>
<div class="table-boxs"> <div class="table-boxs">
<Table border :columns="columns" :data="data" size="small"></Table> <Table :columns="columns" :data="data" size="small"></Table>
</div> </div>
<div class="shenpi"> <div class="shenpi">
<label>审批人:</label> <label>审批人:</label>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</Row> </Row>
</Form> </Form>
<div class="kuang-boxi"> <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"> <template slot-scope="{ row, index }" slot="slot1">
<InputNumber v-model="row.materialWeight" :min="0" @on-blur="show1(row,index)" /> <InputNumber v-model="row.materialWeight" :min="0" @on-blur="show1(row,index)" />
</template> </template>
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
</div> </div>
</div> </div>
<div class="table-boxs"> <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>
<div class="zong-ji"> <div class="zong-ji">
<div class="xiao-ji">总计</div> <div class="xiao-ji">总计</div>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</Row> </Row>
</Form> </Form>
<div class="kuang-boxi"> <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"> <template slot-scope="{ row, index }" slot="slot1">
<Input v-model="row.materialWeight" placeholder="请输入" @on-blur="show1(row, index)" /> <Input v-model="row.materialWeight" placeholder="请输入" @on-blur="show1(row, index)" />
</template> </template>
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
</div> </div>
</div> </div>
<div class="table-boxs"> <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>
<div class="zong-ji"> <div class="zong-ji">
<div class="xiao-ji">总计</div> <div class="xiao-ji">总计</div>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
footer-hide footer-hide
> >
<div class="kuang-boxi"> <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"> <template slot-scope="{ row, index }" slot="slot1">
<Input v-model="row.name9" placeholder="请输入" @on-change="showPrinting(row,index)" /> <Input v-model="row.name9" placeholder="请输入" @on-change="showPrinting(row,index)" />
</template> </template>
...@@ -59,11 +59,11 @@ ...@@ -59,11 +59,11 @@
import GenerateQuotation from "../components/generateQuotation.vue"; //生成报价单弹框 import GenerateQuotation from "../components/generateQuotation.vue"; //生成报价单弹框
export default { export default {
components: { components: {
GenerateQuotation GenerateQuotation,
}, },
name: "", name: "",
props: { props: {
bjData: Array bjData: Array,
}, },
data() { data() {
return { return {
...@@ -76,13 +76,13 @@ export default { ...@@ -76,13 +76,13 @@ export default {
title: "序号", title: "序号",
type: "index", type: "index",
width: 50, width: 50,
align: "center" align: "center",
}, },
{ {
title: "订单编号", title: "订单编号",
key: "name", key: "name",
align: "center", align: "center",
minWidth: 120 minWidth: 120,
}, },
// { // {
// title: '图号', // title: '图号',
...@@ -94,41 +94,41 @@ export default { ...@@ -94,41 +94,41 @@ export default {
title: "产品名称", title: "产品名称",
key: "name2", key: "name2",
align: "center", align: "center",
minWidth: 80 minWidth: 80,
}, },
{ {
title: "规格", title: "规格",
key: "name4", key: "name4",
align: "center", align: "center",
minWidth: 80 minWidth: 80,
}, },
{ {
title: "材料牌号", title: "材料牌号",
key: "name5", key: "name5",
align: "center", align: "center",
minWidth: 80, minWidth: 80,
slot: "slot6" slot: "slot6",
}, },
{ {
title: "材料重量", title: "材料重量",
key: "name6", key: "name6",
align: "center", align: "center",
minWidth: 80, minWidth: 80,
slot: "slot7" slot: "slot7",
}, },
{ {
title: "材料单价", title: "材料单价",
key: "name7", key: "name7",
align: "center", align: "center",
minWidth: 80, minWidth: 80,
slot: "slot8" slot: "slot8",
}, },
{ {
title: "材料费/件(元)", title: "材料费/件(元)",
key: "name8", key: "name8",
align: "center", align: "center",
minWidth: 70 minWidth: 70,
}, },
{ {
title: "3D打印费", title: "3D打印费",
...@@ -146,19 +146,19 @@ export default { ...@@ -146,19 +146,19 @@ export default {
h("Input", { h("Input", {
props: { props: {
value: "1600", value: "1600",
placeholder: "请输入" placeholder: "请输入",
}, },
on: { on: {
"on-change": value => { "on-change": (value) => {
console.log(value); console.log(value);
} },
} },
}), }),
h("span", " /H") h("span", " /H"),
]); ]);
} },
} },
] ],
}, },
{ {
title: "后处理费", title: "后处理费",
...@@ -176,19 +176,19 @@ export default { ...@@ -176,19 +176,19 @@ export default {
h("Input", { h("Input", {
props: { props: {
value: "200", value: "200",
placeholder: "请输入" placeholder: "请输入",
}, },
on: { on: {
"on-change": value => { "on-change": (value) => {
console.log(value); console.log(value);
} },
} },
}), }),
h("span", " /H") h("span", " /H"),
]); ]);
} },
} },
] ],
}, },
{ {
title: "线切割费", title: "线切割费",
...@@ -206,25 +206,25 @@ export default { ...@@ -206,25 +206,25 @@ export default {
h("Input", { h("Input", {
props: { props: {
value: "100", value: "100",
placeholder: "请输入" placeholder: "请输入",
}, },
on: { on: {
"on-change": value => { "on-change": (value) => {
console.log(value); console.log(value);
} },
} },
}), }),
h("span", " /H") h("span", " /H"),
]); ]);
} },
} },
] ],
}, },
{ {
title: "加工费单价", title: "加工费单价",
key: "name12", key: "name12",
align: "center", align: "center",
minWidth: 60 minWidth: 60,
}, },
{ {
...@@ -232,39 +232,39 @@ export default { ...@@ -232,39 +232,39 @@ export default {
key: "name13", key: "name13",
align: "center", align: "center",
minWidth: 80, minWidth: 80,
slot: "slot4" slot: "slot4",
}, },
{ {
title: "单价", title: "单价",
key: "name14", key: "name14",
align: "center", align: "center",
minWidth: 60 minWidth: 60,
}, },
{ {
title: "数量", title: "数量",
key: "name3", key: "name3",
align: "center", align: "center",
minWidth: 70 minWidth: 70,
}, },
{ {
title: "热处理", title: "热处理",
key: "name15", key: "name15",
align: "center", align: "center",
minWidth: 80, minWidth: 80,
slot: "slot5" slot: "slot5",
}, },
{ {
title: "合计", title: "合计",
key: "name16", key: "name16",
align: "center", align: "center",
minWidth: 80 minWidth: 80,
}, },
{ {
title: "调度", title: "调度",
key: "name17", key: "name17",
align: "center", align: "center",
minWidth: 60 minWidth: 60,
} },
], ],
data: [ data: [
{ {
...@@ -285,7 +285,7 @@ export default { ...@@ -285,7 +285,7 @@ export default {
name14: "", name14: "",
name15: "", name15: "",
name16: "", name16: "",
name17: "小明" name17: "小明",
}, },
{ {
name: "a1233", name: "a1233",
...@@ -305,7 +305,7 @@ export default { ...@@ -305,7 +305,7 @@ export default {
name14: "", name14: "",
name15: "", name15: "",
name16: "", name16: "",
name17: "小明" name17: "小明",
}, },
{ {
name: "a1233", name: "a1233",
...@@ -325,9 +325,9 @@ export default { ...@@ -325,9 +325,9 @@ export default {
name14: "", name14: "",
name15: "", name15: "",
name16: "", name16: "",
name17: "小明" name17: "小明",
} },
] ],
}; };
}, },
mounted() {}, mounted() {},
...@@ -370,9 +370,9 @@ export default { ...@@ -370,9 +370,9 @@ export default {
parseInt(row.name14) * parseInt(row.name3) + parseInt(row.name15)); //合计=单价*数量+热处理 parseInt(row.name14) * parseInt(row.name3) + parseInt(row.name15)); //合计=单价*数量+热处理
}, },
cancel() { cancel() {
this.$emit('update') this.$emit("update");
} },
} },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<Sider hide-trigger v-if="showMenu" class="menu_side" width="300"> <Sider hide-trigger v-if="showMenu" class="menu_side" width="300">
<StoreTree @on-hide="onHide" @on-select="productSearch" /> <StoreTree @on-hide="onHide" @on-select="productSearch" />
</Sider> </Sider>
<Icon type="icon iconfont icondaochu" size="24" /> <!-- <Icon type="icon iconfont icondaochu" size="24" /> -->
<div v-if="!showMenu" class="show_menu"> <div v-if="!showMenu" class="show_menu">
<a class="menu_play fr" @click="showMenuFn" title="展开"> <a class="menu_play fr" @click="showMenuFn" title="展开">
<Icon type="ios-arrow-forward" size="24" /> <Icon type="ios-arrow-forward" size="24" />
...@@ -621,8 +621,7 @@ export default { ...@@ -621,8 +621,7 @@ export default {
margin-top: 0; margin-top: 0;
.content { .content {
margin-top: 10px; margin-top: 6px;
padding-top: 10px;
.ivu-icon-ios-add:before { .ivu-icon-ios-add:before {
content: "\f341"; content: "\f341";
......
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background:@layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 89vh; height: 89vh;
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
} }
.ivu-layout-content { .ivu-layout-content {
// margin-left: 5px; // margin-left: 5px;
background: rgba(255, 255, 255, 1); background: @right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto; overflow: auto;
padding: 10px; padding: 10px;
......
...@@ -227,8 +227,9 @@ export default { ...@@ -227,8 +227,9 @@ export default {
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../../assets/css/custom.less";
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background: @layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
......
...@@ -157,8 +157,9 @@ export default { ...@@ -157,8 +157,9 @@ export default {
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../../assets/css/custom.less";
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background:@layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
......
...@@ -139,8 +139,9 @@ export default { ...@@ -139,8 +139,9 @@ export default {
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../../assets/css/custom.less";
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background:@layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
......
...@@ -226,8 +226,9 @@ export default { ...@@ -226,8 +226,9 @@ export default {
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../../assets/css/custom.less";
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background: @layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
......
...@@ -238,11 +238,12 @@ export default { ...@@ -238,11 +238,12 @@ export default {
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../assets/css/custom.less";
.product-mix { .product-mix {
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
padding-top: 3px; padding-top: 3px;
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background: @layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 89vh; height: 89vh;
...@@ -250,7 +251,7 @@ export default { ...@@ -250,7 +251,7 @@ export default {
} }
.ivu-layout-content { .ivu-layout-content {
// margin-left: 5px; // margin-left: 5px;
background: rgba(255, 255, 255, 1); background:@right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto; overflow: auto;
padding: 10px; padding: 10px;
......
...@@ -301,6 +301,7 @@ export default { ...@@ -301,6 +301,7 @@ export default {
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../assets/css/custom.less";
.set { .set {
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
padding-top: 3px; padding-top: 3px;
...@@ -309,8 +310,9 @@ export default { ...@@ -309,8 +310,9 @@ export default {
width: 100%; width: 100%;
// display: flex; // display: flex;
// display: -webkit-flex; // display: -webkit-flex;
background: @layout-content-bg-color;
.ivu-layout-sider { .ivu-layout-sider {
background: rgba(255, 255, 255, 1); background: @layout-content-bg-color;
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 89vh; height: 89vh;
...@@ -318,7 +320,7 @@ export default { ...@@ -318,7 +320,7 @@ export default {
} }
.ivu-layout-content { .ivu-layout-content {
// margin-left: 5px; // margin-left: 5px;
background: rgba(255, 255, 255, 1); background: @right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto; overflow: auto;
padding: 10px; padding: 10px;
......
.menu_side{ @import "../../assets/css/custom.less";
background: #fff;
.menu_side {
background: @left-tree-bg;
margin: 5px 0 0 0; margin: 5px 0 0 0;
border: 1px solid #dcdee2 border: 1px solid @left-boder-color;
} }
.side_tree{
.side_tree {
background: #ffffff; background: #ffffff;
width: 300px; width: 300px;
border: 1px solid #ddd; border: 1px solid #ddd;
.tree_tit{
.tree_tit {
background: #F5F6FA; background: #F5F6FA;
height: 50px; height: 50px;
line-height: 50px; line-height: 50px;
font-size: 14px; font-size: 14px;
color: #515A6E; color: #515A6E;
.menu_play{
.menu_play {
width: 30px; width: 30px;
height: 50px; height: 50px;
line-height: 50px; line-height: 50px;
...@@ -21,21 +26,25 @@ ...@@ -21,21 +26,25 @@
color: #646464; color: #646464;
} }
} }
.tree_left{
.tree_left {
padding: 8px 15px; padding: 8px 15px;
.ivu-tree{
.ivu-tree {
// height: ; // height: ;
} }
} }
} }
.show_menu{
.show_menu {
width: 30px; width: 30px;
height: 30px; height: 30px;
position: fixed; position: fixed;
top: 100px; top: 100px;
left: 0; left: 0;
z-index: 9; z-index: 9;
.menu_play{
.menu_play {
width: 30px; width: 30px;
height: 30px; height: 30px;
line-height: 34px; line-height: 34px;
...@@ -47,38 +56,46 @@ ...@@ -47,38 +56,46 @@
background: #ffffff; background: #ffffff;
box-shadow: #ccc 2px 2px 4px 1px; box-shadow: #ccc 2px 2px 4px 1px;
} }
.menu_play:hover{
.menu_play:hover {
background-color: #2d8cf0; background-color: #2d8cf0;
color: white; color: white;
} }
} }
.tech_body{
.tech_body {
margin: 5px 5px 5px 20px; margin: 5px 5px 5px 20px;
padding: 2px 18px; padding: 2px 18px;
box-shadow: #98929294 2px 1px 5px 1px; box-shadow: #98929294 2px 1px 5px 1px;
} }
.tech_body02{
.tech_body02 {
margin: 5px; margin: 5px;
padding: 2px 18px; padding: 2px 18px;
box-shadow: #98929294 2px 1px 5px 1px; box-shadow: #98929294 2px 1px 5px 1px;
} }
.product-layout .i-layout-content { .product-layout .i-layout-content {
padding: 4px 10px!important; padding: 4px 10px !important;
} }
.setdetail_body{ .setdetail_body {
// padding: 0 20px; // padding: 0 20px;
.ivu-layout-header{ .ivu-layout-header {
height: 0; height: 0;
} }
.ivu-menu-horizontal{
.ivu-menu-horizontal {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
.ivu-menu-item{
.ivu-menu-item {
width: 115px; width: 115px;
text-align: center; text-align: center;
} }
a.ivu-menu-item-active::before{
a.ivu-menu-item-active::before {
content: ""; content: "";
display: block; display: block;
border-width: 5px 6px 0; border-width: 5px 6px 0;
...@@ -90,7 +107,8 @@ ...@@ -90,7 +107,8 @@
bottom: -6px; bottom: -6px;
left: 43%; left: 43%;
} }
a.ivu-menu-item-active::after{
a.ivu-menu-item-active::after {
content: ""; content: "";
display: block; display: block;
border-width: 4px 4px 0; border-width: 4px 4px 0;
...@@ -108,9 +126,11 @@ ...@@ -108,9 +126,11 @@
.lay100 { .lay100 {
height: calc(100vh - 105px); height: calc(100vh - 105px);
background-color: #F5F6FA; background-color: #F5F6FA;
.con{
.con {
padding: 5px 5px 0px 10px; padding: 5px 5px 0px 10px;
.h100{
.h100 {
overflow-y: auto; overflow-y: auto;
} }
} }
......
@import "../../../assets/css/custom.less";
.ivu-layout-sider{ .ivu-layout-sider{
width: 240px!important; width: 240px!important;
max-width: 240px!important; max-width: 240px!important;
flex: 0 0 240px!important; flex: 0 0 240px!important;
} }
.ivu-layout,.ivu-layout-sider{ .ivu-layout,.ivu-layout-sider{
background: #fff; background: @layout-content-bg-color;
} }
.ivu-menu-vertical.ivu-menu-light:after { .ivu-menu-vertical.ivu-menu-light:after {
display: none; display: none;
......
...@@ -1085,9 +1085,9 @@ html [type=button] { ...@@ -1085,9 +1085,9 @@ html [type=button] {
box-shadow: #c7c7c7 1px 2px 7px 3px; box-shadow: #c7c7c7 1px 2px 7px 3px;
} }
.menu_side { .menu_side {
background: #fff !important; /* background: #fff !important; */
margin: 5px 0 0 0 !important; margin: 5px 0 0 0 !important;
border: 1px solid #dcdee2 !important; /* border: 1px solid #dcdee2 !important; */
} }
.show_menu { .show_menu {
width: 30px; 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