Commit 7e16e1e1 authored by renjintao's avatar renjintao

product process

parent 8428bc03
<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">
......@@ -36,16 +36,7 @@
</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">
......@@ -58,26 +49,21 @@
</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() {
......@@ -173,22 +159,19 @@ export default {
}
});
this.colsIm = tempCol;
this.colsIm.unshift(
{
this.colsIm.unshift({
type: "index",
width: 80,
align: "right",
title: "序号",
},
{
}, {
key: "ico",
title: " ",
align: "center",
width: 60,
render: (h, params) => {
return h(
"div",
{
"div", {
class: "",
},
[
......@@ -203,8 +186,7 @@ export default {
]
);
},
}
);
});
//处理原始数据和表头进行对应
let temCol = this.$u.clone(this.colsIm); //原始数据表头
let temColPage = this.$u.clone(columns); //需要显示的页面的表头
......@@ -273,10 +255,28 @@ export default {
eles[elem.key] != null
) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
let codeArr = []
let keyValue = eles[elem.key]
if (keyValue.length > 0 && (keyValue.indexOf(',') > -1 || keyValue.indexOf(',') > -1)) { //如果对应的数据包含多个数据字典项,比如包含“,”或“,”
if (keyValue.indexOf(',') > -1) {
codeArr = keyValue.split(',')
}
if (keyValue.indexOf > -1) {
codeArr = keyValue.split(',')
}
}
if (codeArr.length <= 1) { //对应的数据包含一个数据字典项
eles[elem.key] = this.$u.dirCode(
this.$store.getters.dictionaryByKey(elem.code),
eles[elem.key]
);
} else { //对应的数据包含多个数据字典项
let codeInfo = ''
codeArr.forEach(el => {
codeInfo = codeInfo + this.$u.dirCode(this.$store.getters.dictionaryByKey(elem.code), el) + ",";
})
eles[elem.key] = codeInfo.substr(0, codeInfo.length - 1)
}
}
});
});
......@@ -463,6 +463,7 @@ export default {
<style lang="less">
@import "../../../assets/css/custom.less";
.table-content {
position: relative;
height: 100%;
......@@ -501,6 +502,7 @@ export default {
display: flex;
line-height: 50px;
background: @right-header-bg;
.table-search {
flex-grow: 1;
}
......
......@@ -304,11 +304,29 @@ export default {
eles[elem.key] != "" &&
eles[elem.key] != null
) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值。
let codeArr = []
let keyValue = eles[elem.key]
if (keyValue.length > 0 && (keyValue.indexOf(',') > -1 || keyValue.indexOf(',') > -1)) { //如果对应的数据包含多个数据字典项,比如包含“,”或“,”
if (keyValue.indexOf(',') > -1) {
codeArr = keyValue.split(',')
}
if (keyValue.indexOf > -1) {
codeArr = keyValue.split(',')
}
}
if (codeArr.length <= 1) { //对应的数据包含一个数据字典项
eles[elem.key] = this.$u.dirCode(
this.$store.getters.dictionaryByKey(elem.code),
eles[elem.key]
);
} else { //对应的数据包含多个数据字典项
let codeInfo = ''
codeArr.forEach(el => {
codeInfo = codeInfo + this.$u.dirCode(this.$store.getters.dictionaryByKey(elem.code), el) + ",";
})
eles[elem.key] = codeInfo.substr(0, codeInfo.length - 1)
}
}
});
});
......@@ -579,7 +597,7 @@ export default {
parent_Id: ele.parent_Id ? ele.parent_Id : '', //上级部门 [id]
code: ele.code ? ele.code : '', //部门编号
location: ele.location ? this.getCityValue(ele.location) : '', //省市县
isProduction: 0, //是否生产班组:1是,0否
isProduction: ele.property.indexOf('1') > -1 && ele.property.indexOf('2') > -1 && ele.property.indexOf('3') > -1 ? 1 : 0, //是否生产班组:1是,0否. 属性值为三个值,则是生产班组
property: ele.property ? ele.property : '' //属性
};
if (
......
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