Commit b543d5d8 authored by renjintao's avatar renjintao

智能排产

parent 0219e91a
<template>
<div>
<DataGrid
:columns="columns"
ref="grid"
:draggable="true"
:data="list"
:high="false"
@on-drag-drop="onDragDrop"
:page="false"
@on-selection-change="onSelect"
:batch="true"
:border="true"
:easy="false"
>
<template slot="searchBack"></template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<DatePicker
type="date"
placeholder="设置基准日期"
style="width: 150px;"
v-model="entity.setTime"
@on-change="getTime"
></DatePicker>
<Button type="primary" @click="openApsModal">智能排产</Button>
</template>
<template slot="batch">
<Button type="primary" class="mr10 ml10" @click="removeOk">移出排产</Button>
</template>
<div>
<DataGrid :columns="columns" ref="grid" :draggable="true" :data="list" :high="false" @on-drag-drop="onDragDrop" :page="false" @on-selection-change="onSelect" :batch="true" :border="true" :easy="false">
<template slot="searchBack"></template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Select v-model="rulesAi" multiple style="width:280px;" class="tl">
<Option v-for="item in rulesAiList" :value="item.value" :key="item.value">{{ item.label }}</Option>
</Select>
<DatePicker type="date" placeholder="设置基准日期" style="width: 150px;" v-model="entity.setTime" @on-change="getTime"></DatePicker>
<Button type="primary" @click="openApsModal">智能排产</Button>
</template>
<template slot="batch">
<Button type="primary" class="mr10 ml10" @click="removeOk">移出排产</Button>
</template>
</DataGrid>
<Modal v-model="apsModal" title="确定智能排产" @on-ok="apsOk" @on-cancel="cancel">
<p>确定进行智能排产?</p>
<p>确定进行智能排产?</p>
</Modal>
<Modal v-model="resultModal" title="数据检查" width="1500" @on-ok="cancel" @on-cancel="cancel">
<CheckResult :data="result"></CheckResult>
<CheckResult :data="result"></CheckResult>
</Modal>
<Modal v-model="apsCheckModal" title="确定智能排产" @on-ok="apsCheckOk" @on-cancel="cancel">
<p>已有排产方案,是否移出排产池?</p>
<p>已有排产方案,是否移出排产池?</p>
</Modal>
<Modal v-model="circleModal" title footer-hide :mask-closable="false">
<div slot="close"></div>
<Row>
<Col class="demo-spin-col" span="24">
<Spin fix>
<Icon type="ios-loading" size="36" class="demo-spin-icon-load"></Icon>
<div>智能排产进行中......</div>
</Spin>
</Col>
</Row>
<div slot="close"></div>
<Row>
<Col class="demo-spin-col" span="24">
<Spin fix>
<Icon type="ios-loading" size="36" class="demo-spin-icon-load"></Icon>
<div>智能排产进行中......</div>
</Spin>
</Col>
</Row>
</Modal>
</div>
</div>
</template>
<script>
var myDate = new Date();
var nowDate = myDate.getFullYear() + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate();
......@@ -64,533 +50,571 @@ import Duration from "./duration";
import Expand from "./components/excute";
import CheckResult from "./components/check";
export default {
name: "list",
components: {
Add,
Expand,
Temp,
Duration,
CheckResult,
},
data() {
return {
action: Api.index,
easySearch: {
keys: { op: "notes", value: null },
},
result: {
res: true,
datas: "{}",
},
resultModal: false,
entity: {
setTime:this.getFormatDate(nowDate)
},
editModal: false,
detailModal: false,
deletelModal: false,
apsModal: false,
apsCheckModal: false,
tempParams: null,
insertTItle1: "插单",
rowIndex1: null,
list: [],
curId: 0,
columns: [
{
key: "move",
title: " ",
hide: false,
align: "center",
width: 30,
render: (h, params) => {
return h("Icon", {
attrs: {
type: "md-more",
size: 18,
},
class: "drag",
});
},
},
{
type: "expand",
width: 50,
render: (h, params) => {
return h(Expand, {
props: {
rowId: params.row.part_task_pk,
},
name: "list",
components: {
Add,
Expand,
Temp,
Duration,
CheckResult,
},
data() {
return {
action: Api.index,
easySearch: {
keys: {
op: "notes",
value: null
},
},
result: {
res: true,
datas: "{}",
},
resultModal: false,
entity: {
setTime: this.getFormatDate(nowDate),
rules: '',
},
editModal: false,
detailModal: false,
deletelModal: false,
apsModal: false,
apsCheckModal: false,
tempParams: null,
insertTItle1: "插单",
rowIndex1: null,
list: [],
curId: 0,
columns: [{
key: "move",
title: " ",
hide: false,
align: "center",
width: 30,
render: (h, params) => {
return h("Icon", {
attrs: {
type: "md-more",
size: 18,
},
class: "drag",
});
},
},
{
type: "expand",
width: 50,
render: (h, params) => {
return h(Expand, {
props: {
rowId: params.row.part_task_pk,
},
});
},
},
{
key: "selection",
type: "selection",
width: 50,
align: "center",
},
{
key: "id",
title: this.l("id"),
hide: true,
align: "left",
sortable: true,
width: 50,
},
{
key: "mesCode",
title: this.l("mes_code"),
align: "left",
high: true,
width: 240,
},
{
key: "product_name",
title: this.l("product_name"),
align: "left",
high: true,
},
{
key: "drawingnum",
title: this.l("drawingnum"),
align: "left",
high: true,
},
{
key: "project_no",
title: this.l("project_no"),
align: "left",
high: true,
},
{
key: "batchnum",
title: this.l("batchnum"),
align: "left",
high: true,
},
{
key: "urgency_level",
title: this.l("urgency_level"),
align: "left",
high: true,
code: "plan.order.urgencyLevel",
width: 100,
},
{
key: "priority",
title: this.l("priority"),
align: "left",
high: true,
hide: true,
render: (h, params) => {
return h("span", {}, params.index + 1);
},
},
{
key: "plan_qty",
title: this.l("plan_qty"),
align: "right",
width: 100,
high: true,
},
{
key: "spare_qty",
title: this.l("spare_qty"),
align: "right",
width: 100,
high: true,
hide: true,
},
{
key: "plan_start",
title: this.l("plan_start"),
align: "center",
high: true,
hide: true,
resizable: true,
width: 150,
},
{
key: "plan_finish",
title: this.l("plan_finish"),
align: "center",
high: true,
hide: true,
sortable: true,
resizable: true,
width: 150,
},
{
key: "notes",
title: this.l("notes"),
align: "left",
easy: true,
high: true,
hide: true,
},
{
key: "demand_start",
title: this.l("demand_start"),
align: "center",
resizable: true,
width: 150,
type: "date",
},
{
key: "demand_finish",
title: this.l("demand_finish"),
align: "center",
high: true,
resizable: true,
width: 150,
type: "date",
},
{
key: "badjustflag",
title: this.l("badjustflag"),
align: "left",
high: true,
hide: true,
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
// fixed:"right",
render: (h, params) => {
return h("div", {
class: "action"
}, [
h("op", {
attrs: {
icon: "md-refresh",
type: "icon",
title: "恢复工序",
oprate: "edit",
msg: "确认要恢复工序吗?",
},
on: {
click: () => this.refresh(params.row.part_task_pk)
},
}),
h("op", {
attrs: {
icon: "ios-trash",
type: "icon",
title: "移出排产池",
oprate: "delete",
msg: "确认要移出排产吗?",
},
on: {
click: () => this.remove(params.row.part_task_pk)
},
}),
]);
},
},
],
arrPartPkId: [],
//设置参数开始
setParams: {
opTaskPk: 0, //工单ID
partTaskPk: 0, //生产计划ID
taskSeq: "", //工序编号
count: 0, //生产计划数量
},
//设置参数结束
circleModal: false, //进度条
tempStatu: 0, //新建模型时传过来的id值
rulesAi: ['1', '2', '3', '4'],
rulesAiList: [{
value: '1',
label: '转序'
}, {
value: '2',
label: '多台'
}, {
value: '3',
label: '加班'
}, {
value: '4',
label: '公休'
}]
};
},
mounted() {
this.loadList();
},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
//排产池加载数据列表
loadList() {
Api.getall().then((res) => {
if (res.success) {
this.list = res.result;
}
});
},
},
{
key: "selection",
type: "selection",
width: 50,
align: "center",
},
{
key: "id",
title: this.l("id"),
hide: true,
align: "left",
sortable: true,
width: 50,
},
{
key: "mesCode",
title: this.l("mes_code"),
align: "left",
high: true,
width: 240,
},
{
key: "product_name",
title: this.l("product_name"),
align: "left",
high: true,
},
{
key: "drawingnum",
title: this.l("drawingnum"),
align: "left",
high: true,
},
{
key: "project_no",
title: this.l("project_no"),
align: "left",
high: true,
detail(id) {
this.detailModal = true;
this.curId = id;
},
{
key: "batchnum",
title: this.l("batchnum"),
align: "left",
high: true,
edit(id) {
this.editModal = true;
this.curId = id;
},
{
key: "urgency_level",
title: this.l("urgency_level"),
align: "left",
high: true,
code: "plan.order.urgencyLevel",
width: 100,
refresh(partPkId) {
//恢复工序
let params = {
id: partPkId,
};
Api.recoveryoptasksimluate(params).then((r) => {
if (r.success) {
this.$Message.success("恢复成功");
this.list = [];
this.loadList();
}
});
},
{
key: "priority",
title: this.l("priority"),
align: "left",
high: true,
hide: true,
render: (h, params) => {
return h("span", {}, params.index + 1);
},
remove(partPkId) {
//移出排产池
this.tempParams = null;
let paramsArry = [];
if (partPkId.constructor == Array) {
paramsArry = partPkId;
} else {
paramsArry.push(partPkId);
}
let params = {
partPks: paramsArry,
};
Api.beforeshiftoutapspool(params)
.then((res) => {
if (res.success) {
if (res.result) {
this.checkapspool(params);
} else {
this.tempParams = null;
this.tempParams = params;
this.apsCheckModal = true;
}
} else {
this.$Message.error("校验失败");
}
})
.catch((err) => {
this.$Message.error("连接错误1");
});
},
{
key: "plan_qty",
title: this.l("plan_qty"),
align: "right",
width: 100,
high: true,
apsCheckOk() {
this.checkapspool(this.tempParams);
},
{
key: "spare_qty",
title: this.l("spare_qty"),
align: "right",
width: 100,
high: true,
hide: true,
checkapspool(params) {
Api.shiftoutapspool(params)
.then((r) => {
if (r.success) {
this.$Message.success("移出排产池操作成功");
this.loadList();
//移出排产后将aps对应的store数量去掉
this.$store.commit(
"setCountAps",
this.$store.state.countAps - params.partPks.length
);
} else {
this.$Message.error("移出排产池操作失败");
}
})
.catch((err) => {
this.$Message.error("连接失败2");
});
},
{
key: "plan_start",
title: this.l("plan_start"),
align: "center",
high: true,
hide: true,
resizable: true,
width: 150,
onSelect(a, b) {
//批量选择
let selectRows = a;
this.arrPartPkId = [];
selectRows.forEach((e) => {
this.arrPartPkId.push(e.part_task_pk);
});
},
{
key: "plan_finish",
title: this.l("plan_finish"),
align: "center",
high: true,
hide: true,
sortable: true,
resizable: true,
width: 150,
removeOk() {
//批量选择移出排产池
this.remove(this.arrPartPkId);
},
{
key: "notes",
title: this.l("notes"),
align: "left",
easy: true,
high: true,
hide: true,
removeCancel() {
this.deletelModal = false;
},
{
key: "demand_start",
title: this.l("demand_start"),
align: "center",
resizable: true,
width: 150,
type: "date",
cancel() {
this.curId = 0;
this.detailModal = false;
this.editModal = false;
this.deletedlModal = false;
this.apsModal = false;
this.apsCheckModal = false;
this.resultModal = false;
},
{
key: "demand_finish",
title: this.l("demand_finish"),
align: "center",
high: true,
resizable: true,
width: 150,
type: "date",
onDragDrop(a, b) {
//拖拽排序
//this.list.splice(b, 1, ...this.list.splice(a, 1, this.list[b]));
let tempArray = this.list[a];
this.list.splice(a, 1);
this.list.splice(b, 0, tempArray);
},
{
key: "badjustflag",
title: this.l("badjustflag"),
align: "left",
high: true,
hide: true,
l(key) {
let vkey = "mes_part_task_plan_simulate" + "." + key;
return this.$t(vkey) || key;
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
// fixed:"right",
render: (h, params) => {
return h("div", { class: "action" }, [
h("op", {
attrs: {
icon: "md-refresh",
type: "icon",
title: "恢复工序",
oprate: "edit",
msg: "确认要恢复工序吗?",
},
on: { click: () => this.refresh(params.row.part_task_pk) },
}),
h("op", {
attrs: {
icon: "ios-trash",
type: "icon",
title: "移出排产池",
oprate: "delete",
msg: "确认要移出排产吗?",
},
on: { click: () => this.remove(params.row.part_task_pk) },
}),
]);
},
getTime(value) {
this.entity.getTime = value;
},
],
arrPartPkId: [],
//设置参数开始
setParams: {
opTaskPk: 0, //工单ID
partTaskPk: 0, //生产计划ID
taskSeq: "", //工序编号
count: 0, //生产计划数量
},
//设置参数结束
circleModal: false, //进度条
tempStatu: 0, //新建模型时传过来的id值
};
},
mounted() {
this.loadList();
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
//排产池加载数据列表
loadList() {
Api.getall().then((res) => {
if (res.success) {
this.list = res.result;
}
});
},
detail(id) {
this.detailModal = true;
this.curId = id;
},
edit(id) {
this.editModal = true;
this.curId = id;
},
refresh(partPkId) {
//恢复工序
let params = {
id: partPkId,
};
Api.recoveryoptasksimluate(params).then((r) => {
if (r.success) {
this.$Message.success("恢复成功");
this.list = [];
this.loadList();
}
});
},
remove(partPkId) {
//移出排产池
this.tempParams = null;
let paramsArry = [];
if (partPkId.constructor == Array) {
paramsArry = partPkId;
} else {
paramsArry.push(partPkId);
}
let params = {
partPks: paramsArry,
};
Api.beforeshiftoutapspool(params)
.then((res) => {
if (res.success) {
if (res.result) {
this.checkapspool(params);
openApsModal() {
if (this.entity.setTime != "") {
this.apsModal = true;
} else {
this.tempParams = null;
this.tempParams = params;
this.apsCheckModal = true;
this.$Message.error("请设置基准日期");
}
} else {
this.$Message.error("校验失败");
}
})
.catch((err) => {
this.$Message.error("连接错误1");
});
},
apsCheckOk() {
this.checkapspool(this.tempParams);
},
checkapspool(params) {
Api.shiftoutapspool(params)
.then((r) => {
if (r.success) {
this.$Message.success("移出排产池操作成功");
this.loadList();
//移出排产后将aps对应的store数量去掉
this.$store.commit(
"setCountAps",
this.$store.state.countAps - params.partPks.length
);
} else {
this.$Message.error("移出排产池操作失败");
}
})
.catch((err) => {
this.$Message.error("连接失败2");
});
},
onSelect(a, b) {
//批量选择
let selectRows = a;
this.arrPartPkId = [];
selectRows.forEach((e) => {
this.arrPartPkId.push(e.part_task_pk);
});
},
removeOk() {
//批量选择移出排产池
this.remove(this.arrPartPkId);
},
removeCancel() {
this.deletelModal = false;
},
cancel() {
this.curId = 0;
this.detailModal = false;
this.editModal = false;
this.deletedlModal = false;
this.apsModal = false;
this.apsCheckModal = false;
this.resultModal = false;
},
onDragDrop(a, b) {
//拖拽排序
//this.list.splice(b, 1, ...this.list.splice(a, 1, this.list[b]));
let tempArray = this.list[a];
this.list.splice(a, 1);
this.list.splice(b, 0, tempArray);
},
l(key) {
let vkey = "mes_part_task_plan_simulate" + "." + key;
return this.$t(vkey) || key;
},
getTime(value) {
this.entity.getTime = value;
},
openApsModal() {
if (this.entity.setTime != "") {
this.apsModal = true;
} else {
this.$Message.error("请设置基准日期");
}
},
},
//确定智能排产
apsOk() {
this.circleModal = true;
//智能排产前订单优先级功能
let parmsOrderpriority = { alls: [] };
let arryIds = [];
this.list.forEach((e, index) => {
let objIds = {};
objIds.orderId = e.part_task_pk;
objIds.priority = index + 1;
arryIds.push(objIds);
});
parmsOrderpriority.alls = arryIds;
Api.orderpriority(parmsOrderpriority)
.then((res) => {
if (res.success) {
if (res.result) {
//this.$Message.success("排序成功");
//智能排产前检查
Api.apsdatachecked()
.then((res1) => {
if (res1.success) {
this.checkOk();
} else {
// this.circleModal = false;
// this.$Message.error("操作失败:数据校验");
this.result = res1.result;
this.resultModal = true;
}
//确定智能排产
apsOk() {
this.circleModal = true;
//智能排产前订单优先级功能
let parmsOrderpriority = {
alls: []
};
let arryIds = [];
this.list.forEach((e, index) => {
let objIds = {};
objIds.orderId = e.part_task_pk;
objIds.priority = index + 1;
arryIds.push(objIds);
});
parmsOrderpriority.alls = arryIds;
Api.orderpriority(parmsOrderpriority)
.then((res) => {
if (res.success) {
if (res.result) {
//this.$Message.success("排序成功");
//智能排产前检查
Api.apsdatachecked()
.then((res1) => {
if (res1.success) {
this.checkOk();
} else {
// this.circleModal = false;
// this.$Message.error("操作失败:数据校验");
this.result = res1.result;
this.resultModal = true;
}
})
.catch(
function (err) {
this.circleModal = false;
this.$Message.error("操作失败");
}.bind(this)
);
} else {
this.circleModal = false;
this.$Message.error("排序失败,请重新智能排产操作");
}
} else {
this.circleModal = false;
this.$Message.error("操作失败:排序");
}
})
.catch(
function (err) {
this.circleModal = false;
this.$Message.error("操作失败");
}.bind(this)
function (err) {
this.circleModal = false;
this.$Message.error("操作失败");
}.bind(this)
);
} else {
this.circleModal = false;
this.$Message.error("排序失败,请重新智能排产操作");
}
} else {
this.circleModal = false;
this.$Message.error("操作失败:排序");
}
})
.catch(
function (err) {
this.circleModal = false;
this.$Message.error("操作失败");
}.bind(this)
);
},
checkOk() {
//排产计算
let paramsTime = {
setTime: this.entity.setTime,
};
Api.apsprepareandcalc(paramsTime)
.then((res2) => {
if (res2.success) {
if (res2.result.res) {
// this.$Message.success("排产计算成功");
//智能排产操作start
Api.aischedule(paramsTime).then((res3) => {
if (res3.success) {
if (res3.result.res) {
this.$Message.success("排产成功");
this.circleModal = false;
this.$router.push({
path: "/aps/results",
// params: { customerId: id }
});
} else {
this.circleModal = false;
this.$Message.error(res3.result.msg);
}
}
});
//智能排产操作end
} else {
this.circleModal = false;
this.$Message.error(res2.result.msg);
}
} else {
this.circleModal = false;
this.$Message.error("操作失败:排产计算");
}
})
.catch(
function (err) {
this.circleModal = false;
this.$Message.error("操作失败");
}.bind(this)
);
},
},
checkOk() {
//排产计算
let paramsTime = {
setTime: this.entity.setTime,
rules: JSON.stringify(this.rulesAi).replace('[', '').replace(']', '').replace(/\"/g, '')
};
Api.apsprepareandcalc(paramsTime)
.then((res2) => {
if (res2.success) {
if (res2.result.res) {
// this.$Message.success("排产计算成功");
//智能排产操作start
Api.aischedule(paramsTime).then((res3) => {
if (res3.success) {
if (res3.result.res) {
this.$Message.success("排产成功");
this.circleModal = false;
this.$router.push({
path: "/aps/results",
// params: { customerId: id }
});
} else {
this.circleModal = false;
this.$Message.error(res3.result.msg);
}
}
});
//智能排产操作end
} else {
this.circleModal = false;
this.$Message.error(res2.result.msg);
}
} else {
this.circleModal = false;
this.$Message.error("操作失败:排产计算");
}
})
.catch(
function (err) {
this.circleModal = false;
this.$Message.error("操作失败");
}.bind(this)
);
},
getFormatDate(dates) {
const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate()) +
" 00:00:01";
return resDate;
getFormatDate(dates) {
const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate()) +
" 00:00:01";
return resDate;
},
p(s) {
return s < 10 ? "0" + s : s;
}
},
p(s) {
return s < 10 ? "0" + s : s;
}
},
};
</script>
<style lang="less">
.drag {
cursor: move;
cursor: move;
}
.demo-spin-icon-load {
animation: ani-demo-spin 1s linear infinite;
animation: ani-demo-spin 1s linear infinite;
}
@keyframes ani-demo-spin {
from {
transform: rotate(0deg);
}
50% {
transform: rotate(180deg);
}
to {
transform: rotate(360deg);
}
from {
transform: rotate(0deg);
}
50% {
transform: rotate(180deg);
}
to {
transform: rotate(360deg);
}
}
.demo-spin-col {
height: 100px;
position: relative;
border: 0px solid #eee;
height: 100px;
position: relative;
border: 0px solid #eee;
}
.vertical-center-modal {
display: flex;
align-items: center;
justify-content: center;
display: flex;
align-items: center;
justify-content: center;
.ivu-modal {
top: 0;
}
.ivu-modal {
top: 0;
}
}
.tempModal {
.ivu-modal-body {
padding: 16px;
font-size: 14px;
line-height: 1.5;
padding-top: 2px;
padding-bottom: 0px;
}
.ivu-modal-footer {
border-top: none;
padding: 12px 18px 12px 18px;
text-align: right;
}
.ivu-modal-body {
padding: 16px;
font-size: 14px;
line-height: 1.5;
padding-top: 2px;
padding-bottom: 0px;
}
.ivu-modal-footer {
border-top: none;
padding: 12px 18px 12px 18px;
text-align: right;
}
}
</style>
<template>
<div class="h100">
<Tabs type="card" width="100">
<TabPane label="excel数据">
<TablePaste hide-table :input-props="inputProps" @on-success="handleSuccess" @on-error="handleError" />
</TabPane>
<TabPane label="预览">
<Table border="true" :columns="columnsImport" :data="excelData" :height="tableHeight" ref="tableExcel" class="tableCommon"></Table>
</TabPane>
</Tabs>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "detailExcel",
data() {
return {
entity: {},
downUrl: fileUrlDown,
fileUrlPath: "",
excelRows: 100,
tableHeight: '',
inputProps: {
rows: 10,
placeholder: "请从Excel复制一段表格数据,粘贴在这里",
},
};
},
props: {
eid: Number,
},
created() {
this.excelRows = parseInt((window.innerHeight - 231) / 21) + 1;
this.inputProps.rows = this.excelRows
this.tableHeight = window.innerHeight - 200
},
mounted() {
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.excelRows = parseInt((window.screenHeight - 231) / 21) + 1;
this.inputProps.rows = this.excelRows
this.tableHeight = window.innerHeight - 200
})();
};
},
methods: {
load(v) {
Api.get({
id: v,
}).then((r) => {
this.entity = r.result;
this.$emit("on-load");
});
},
handleClose() {
this.$emit("on-close");
},
downFile(path) {
//alert(path)
let truePath = path;
if (truePath.length > 2) {
if (
truePath.substring(0, 7).toLowerCase() == "http://" ||
truePath.substring(0, 8).toLowerCase() == "https://"
) {
window.open(truePath, "_blank");
} else {
this.fileUrlPath = this.downUrl + path;
window.open(this.fileUrlPath, "_blank");
}
}
},
l(key) {
key = "import_center" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
},
},
};
</script>
......@@ -29,28 +29,37 @@
<div class="btns">
<Form inline>
<FormItem>
原文件:<a @click="downFile">{{entity.file}}</a>
<a @click="downFile">
<Icon type="md-download" />{{entity.file}}
</a>
</FormItem>
<FormItem>
<a class="ml10 mr10" @click="resetTable">刷新</a>
<a class="ml10 mr10" @click="resetTable">
<Icon type="md-eye" />预览
</a>
</FormItem>
<FormItem v-if="show">
<Button @click="openPaste" :type="btnType" :ghost="ghostStatus">{{btnTxt}}</Button>
</FormItem>
<FormItem>
<RadioGroup value="large" type="button">
<Radio label="large">数据列表</Radio>
<Radio label="default">粘贴Excel</Radio>
<RadioGroup value="0" type="button" @on-change="changeExcel">
<Radio label="0">
<Icon type="md-list" />列表
</Radio>
<Radio label="1">
<Icon type="md-clipboard" />Excel
</Radio>
</RadioGroup>
</FormItem>
</Form>
</div>
</div>
<div class="table-main" ref="main">
<Table border="true" :columns="columnsImport" :data="excelData" :height="tdHeightExcel" ref="table" class="tableCommon"></Table>
<Table border="true" :columns="columnsImport" :data="excelData" :height="tdHeightExcel" ref="table" class="tableCommon" v-if="tableImport"></Table>
<component :is="detailExcel" />
</div>
<FooterToolbar v-if="sheetNames.length>1">
<FooterToolbar v-if="sheetNames.length>1&&tableImport">
<Form inline>
<FormItem>
<Tabs :animated="false" :value="0" @on-click="sheetClick">
......@@ -82,6 +91,8 @@ export default {
downUrl: fileUrlDown,
fileUrlPath: "",
disabled: false,
detailExcel: null,
tableImport: true,
columns0: [{
key: "userName",
title: this.l("userName"),
......@@ -715,6 +726,16 @@ export default {
}
});
},
changeExcel(val) {
if (val == 1) {
this.tableImport = false
this.detailExcel = () => import("./detailExcel");
} else {
this.detailExcel = null;
this.tableImport = true
}
},
l(key) {
key = "user" + "." + key;
return this.$t(key);
......
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