Commit 2e4f3489 authored by renjintao's avatar renjintao

process

parent 9eddae69
...@@ -135,16 +135,40 @@ export default { ...@@ -135,16 +135,40 @@ export default {
}, },
columns1() { columns1() {
let col1 = [{ let col1 = [{
key: "userName", key: "name",
title: this.l("userName"), title: this.l1("name"),
align: "left", align: "left",
}, },
{ {
key: "status", key: "parent_Id",
title: this.l("status"), title: this.l1("parent_Id"),
align: "center", align: "left",
code: "User.base.status", hide: true,
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 return col1
...@@ -629,6 +653,10 @@ export default { ...@@ -629,6 +653,10 @@ export default {
key = "user" + "." + key; key = "user" + "." + key;
return i18n.t(key); return i18n.t(key);
}, },
l1(key) {
key = "DipartLocation" + "." + key;
return i18n.t(key);
},
l2(key) { l2(key) {
key = "resource" + "." + key; key = "resource" + "." + key;
return i18n.t(key); return i18n.t(key);
...@@ -645,8 +673,7 @@ export default { ...@@ -645,8 +673,7 @@ export default {
key = "product_info" + "." + key; key = "product_info" + "." + key;
return i18n.t(key); return i18n.t(key);
}, },
test() test() {
{
ViewUI.Message.error("terterer") ViewUI.Message.error("terterer")
} }
} }
\ No newline at end of file
<template> <template>
<div class="table-contentProcess"> <div class="table-contentProcess">
<div class="table-tools"> <div class="table-tools">
<div class="table-search"> <div class="table-search">
<Form inline> <Form inline>
...@@ -7,12 +7,7 @@ ...@@ -7,12 +7,7 @@
<span>导入到</span> <span>导入到</span>
</FormItem> </FormItem>
<FormItem> <FormItem>
<dictionary <dictionary code="import.im.page" style="width:160px" @on-change="pageChange" v-model="pageType"></dictionary>
code="import.im.page"
style="width:160px"
@on-change="pageChange"
v-model="pageType"
></dictionary>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" @click="openInfoModal" :disabled="btnIm">导入</Button> <Button type="primary" @click="openInfoModal" :disabled="btnIm">导入</Button>
...@@ -61,16 +56,7 @@ ...@@ -61,16 +56,7 @@
</div> </div>
</div> </div>
<div class="table-main" ref="main"> <div class="table-main" ref="main">
<Table <Table :border="true" :columns="columnsImport" :data="excelData" :height="tdHeightExcel" :no-data-text="noDataText" ref="table" class="tableCommon" v-if="tableImport"></Table>
:border="true"
:columns="columnsImport"
:data="excelData"
:height="tdHeightExcel"
:no-data-text="noDataText"
ref="table"
class="tableCommon"
v-if="tableImport"
></Table>
<component :is="detailExcel" ref="comExcel" @on-datalength="datalength" /> <component :is="detailExcel" ref="comExcel" @on-datalength="datalength" />
</div> </div>
<FooterToolbar v-if="sheetNames.length>1&&tableImport"> <FooterToolbar v-if="sheetNames.length>1&&tableImport">
...@@ -83,27 +69,22 @@ ...@@ -83,27 +69,22 @@
</Form> </Form>
</FooterToolbar> </FooterToolbar>
<Modal v-model="infoModal" :title="titleInfo" fullscreen> <Modal v-model="infoModal" :title="titleInfo" fullscreen>
<DataGrid <DataGrid :tool="false" :page="false" :columns="colsIm" :data="dataIm" :height="tdHeightExcel+30" ref="dataImport"></DataGrid>
:tool="false"
:page="false"
:columns="colsIm"
:data="dataIm"
:height="tdHeightExcel+30"
ref="dataImport"
></DataGrid>
<div slot="footer"> <div slot="footer">
<Button @click="infoModal=false">关闭</Button> <Button @click="infoModal=false">关闭</Button>
<Button type="primary" @click="importOk" v-show="imBtn">确定导入</Button> <Button type="primary" @click="importOk" v-show="imBtn">确定导入</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import BaseColums from "./baseColums"; import BaseColums from "./baseColums";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { Switch } from "view-design"; import {
Switch
} from "view-design";
export default { export default {
name: "Edit", name: "Edit",
data() { data() {
...@@ -505,6 +486,9 @@ export default { ...@@ -505,6 +486,9 @@ export default {
case 0: case 0:
this.importUser(); this.importUser();
break; break;
case 1:
this.importDepart();
break;
case 2: case 2:
this.importResource(); this.importResource();
break; break;
...@@ -577,6 +561,47 @@ export default { ...@@ -577,6 +561,47 @@ export default {
}); });
} }
}, },
//批量插入部门
importDepart() {
let tempData = this.$u.clone(this.dataIm);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
parentTitle: ele.parent_Id ? ele.parent_Id : '',
name: ele.name ? ele.name : '', //部门名称
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否
property: ele.property ? ele.property : '' //属性
};
if (
ele.name &&
ele.name != ""
) {
tempList.push(obj);
}
});
if (tempList.length == 0) {
this.$Message.error("所有导入的数据均不合法!");
} else {
let parms = {
list: tempList,
};
let url = `${systemUrl}/departmentimport/import`;
this.$api.post(url, parms).then((res) => {
if (res.success) {
this.$Message.success(
"成功批量导入部门管理成功模块 " + tempList.length + " 条数据"
);
this.imBtn = false;
this.cancelExcel();
} else {
this.$Message.error("批量导入部门管理失败!");
}
});
}
},
//批量插入制造资源 //批量插入制造资源
importResource() { importResource() {
let tempData = this.$u.clone(this.dataIm); let tempData = this.$u.clone(this.dataIm);
...@@ -642,15 +667,12 @@ export default { ...@@ -642,15 +667,12 @@ export default {
code: 0, code: 0,
status: ele.status ? Number(ele.status) : "", status: ele.status ? Number(ele.status) : "",
customProperties: {}, customProperties: {},
categoryId: this.getType2(ele.categoryId) categoryId: this.getType2(ele.categoryId) ?
? this.getType2(ele.categoryId) this.getType2(ele.categoryId) : 1, //左侧树点击的id
: 1, //左侧树点击的id rootCategoryId: this.getType1(ele.rootCategoryId) ?
rootCategoryId: this.getType1(ele.rootCategoryId) this.getType1(ele.rootCategoryId) : 1, //左侧树点击的数据的最顶层id
? this.getType1(ele.rootCategoryId) codeRuleId: this.getType3(ele.codeRuleId) ?
: 1, //左侧树点击的数据的最顶层id this.getType3(ele.codeRuleId) : 1, //类别编码名称
codeRuleId: this.getType3(ele.codeRuleId)
? this.getType3(ele.codeRuleId)
: 1, //类别编码名称
codeRuleType: ele.codeRuleType ? Number(ele.codeRuleType) : 1, //类别codeType codeRuleType: ele.codeRuleType ? Number(ele.codeRuleType) : 1, //类别codeType
}; };
if ( if (
...@@ -825,12 +847,10 @@ export default { ...@@ -825,12 +847,10 @@ export default {
tempData.forEach((ele) => { tempData.forEach((ele) => {
let obj = { let obj = {
routingHeaderId: Number(this.getRoutingHeaderId(ele.routingHeaderId)), routingHeaderId: Number(this.getRoutingHeaderId(ele.routingHeaderId)),
routingDetailId: ele.routingDetailId routingDetailId: ele.routingDetailId ?
? Number(ele.routingDetailId) Number(ele.routingDetailId) : null,
: null, routingDetailNo: ele.routingDetailNo ?
routingDetailNo: ele.routingDetailNo Number(ele.routingDetailNo) : null,
? Number(ele.routingDetailNo)
: null,
routingDetailName: ele.routingDetailName ? ele.routingDetailName : "", routingDetailName: ele.routingDetailName ? ele.routingDetailName : "",
routingStepId: 0, routingStepId: 0,
quantity: ele.quantity ? Number(ele.quantity) : 0, quantity: ele.quantity ? Number(ele.quantity) : 0,
...@@ -842,9 +862,8 @@ export default { ...@@ -842,9 +862,8 @@ export default {
specifications: ele.specifications ? ele.specifications : "", specifications: ele.specifications ? ele.specifications : "",
xhgg: ele.xhgg ? ele.xhgg : "", xhgg: ele.xhgg ? ele.xhgg : "",
texture: ele.texture ? ele.texture : "", texture: ele.texture ? ele.texture : "",
procurementStandards: ele.procurementStandards procurementStandards: ele.procurementStandards ?
? ele.procurementStandards ele.procurementStandards : "",
: "",
qualityGrade: ele.qualityGrade ? ele.qualityGrade : "", qualityGrade: ele.qualityGrade ? ele.qualityGrade : "",
state: null, state: null,
extend: "", extend: "",
...@@ -985,6 +1004,7 @@ export default { ...@@ -985,6 +1004,7 @@ export default {
<style lang="less"> <style lang="less">
@import "../../assets/css/custom.less"; @import "../../assets/css/custom.less";
.table-contentProcess { .table-contentProcess {
position: relative; position: relative;
height: 100%; height: 100%;
...@@ -1023,6 +1043,7 @@ export default { ...@@ -1023,6 +1043,7 @@ export default {
display: flex; display: flex;
line-height: 50px; line-height: 50px;
background: @right-header-bg; background: @right-header-bg;
.table-search { .table-search {
flex-grow: 1; flex-grow: 1;
} }
......
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