Commit 590fddf4 authored by 仇晓婷's avatar 仇晓婷

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

parents 596e79e2 146db3e9
This diff is collapsed.
<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;
}
......
......@@ -428,12 +428,18 @@ export default {
DipartLocation: {
name: "部门",
organizationType: "组织类型",
status: '是否生产班组',
// status: '是否生产班组',
status: '属性',
departcode: '部门编号',
department: '部门名称',
cityName: '省市县',
creationTime: '创建时间',
upMent: '上级部门',
code:'部门编号',
location:'省市县',
parent_Id:'上级部门',
property:'属性',
parentTitle:'上级部门'
},
instance: {
id: '主键',
......
......@@ -166,6 +166,42 @@ henq.findRoots = (arr1, id) => {
forFn(arr1, id)
return temp
}
//省市县pacc转为list
henq.treeToList1 = (tree) => {
let list = [];
function treeToList1(data) {
data.map(u => {
if (u.children&&u.level!=1) {
treeToList1(u.children, u)
}
else if(u.children&&u.level==1)
{
list=list.concat(u.children);
}
})
}
treeToList1(tree, null)
return list;
}
//根据departId返出上级所有name
henq.getDepartAllName = (list,id) => {
let names = '';
function getDepartAllName(list,id) {
list.map(u => {
if(id==u.id)
{
names=u.name+"/"+names
if (u.parent_Id>0) {
getDepartAllName(list, u.parent_Id)
}
}
})
}
getDepartAllName(list,id)
return names.slice(0,names.length-1);
}
//导出pdf
henq.outPdf = (ele, fileName) => {
// document.head.innerHTML =
......
......@@ -1744,7 +1744,7 @@
"dependencies": {
"ajv": {
"version": "5.5.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
"resolved": "https://registry.npm.taobao.org/ajv/download/ajv-5.5.2.tgz?cache=0&sync_timestamp=1597480760804&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-5.5.2.tgz",
"integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
"dev": true,
"optional": true,
......@@ -1776,7 +1776,7 @@
},
"cross-spawn": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
"resolved": "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-5.1.0.tgz?cache=0&sync_timestamp=1590421014780&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcross-spawn%2Fdownload%2Fcross-spawn-5.1.0.tgz",
"integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
"dev": true,
"optional": true,
......@@ -1856,7 +1856,7 @@
},
"fast-deep-equal": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz",
"resolved": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-1.1.0.tgz",
"integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=",
"dev": true,
"optional": true
......@@ -1894,7 +1894,7 @@
},
"json-schema-traverse": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz",
"resolved": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.3.1.tgz",
"integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=",
"dev": true,
"optional": true
......@@ -1964,7 +1964,7 @@
},
"yallist": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
"resolved": "https://registry.npm.taobao.org/yallist/download/yallist-2.1.2.tgz",
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
"dev": true,
"optional": true
......
......@@ -135,16 +135,39 @@ export default {
},
columns1() {
let col1 = [{
key: "userName",
title: this.l("userName"),
key: "name",
title: this.l1("name"),
align: "left",
},
{
key: "status",
title: this.l("status"),
align: "center",
code: "User.base.status",
key: "parent_Id",
title: this.l1("parent_Id"),
align: "left",
parentDepart: true,
import: true,
},
{
key: "code",
title: this.l1("code"),
align: "left",
},
{
key: "location",
title: this.l1("location"),
align: "left",
location: true,
import: true,
},
{
key: "property",
title: this.l1("property"),
align: "left",
code: "department.property",
},
{
key: "creationTime",
title: this.l1("creationTime"),
align: "left",
},
]
return col1
......@@ -629,6 +652,10 @@ export default {
key = "user" + "." + key;
return i18n.t(key);
},
l1(key) {
key = "DipartLocation" + "." + key;
return i18n.t(key);
},
l2(key) {
key = "resource" + "." + key;
return i18n.t(key);
......@@ -645,8 +672,7 @@ export default {
key = "product_info" + "." + key;
return i18n.t(key);
},
test()
{
test() {
ViewUI.Message.error("terterer")
}
}
\ No newline at end of file
This diff is collapsed.
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