Commit 65c73757 authored by renjintao's avatar renjintao

Merge branch 'product' of git.mes123.com:zhouyx/mes-ui into product-rjt

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