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"
>
<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>
<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">
......@@ -52,8 +37,9 @@
</Col>
</Row>
</Modal>
</div>
</div>
</template>
<script>
var myDate = new Date();
var nowDate = myDate.getFullYear() + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate();
......@@ -76,7 +62,10 @@ export default {
return {
action: Api.index,
easySearch: {
keys: { op: "notes", value: null },
keys: {
op: "notes",
value: null
},
},
result: {
res: true,
......@@ -84,7 +73,8 @@ export default {
},
resultModal: false,
entity: {
setTime:this.getFormatDate(nowDate)
setTime: this.getFormatDate(nowDate),
rules: '',
},
editModal: false,
detailModal: false,
......@@ -96,8 +86,7 @@ export default {
rowIndex1: null,
list: [],
curId: 0,
columns: [
{
columns: [{
key: "move",
title: " ",
hide: false,
......@@ -260,7 +249,9 @@ export default {
align: "center",
// fixed:"right",
render: (h, params) => {
return h("div", { class: "action" }, [
return h("div", {
class: "action"
}, [
h("op", {
attrs: {
icon: "md-refresh",
......@@ -269,7 +260,9 @@ export default {
oprate: "edit",
msg: "确认要恢复工序吗?",
},
on: { click: () => this.refresh(params.row.part_task_pk) },
on: {
click: () => this.refresh(params.row.part_task_pk)
},
}),
h("op", {
attrs: {
......@@ -279,7 +272,9 @@ export default {
oprate: "delete",
msg: "确认要移出排产吗?",
},
on: { click: () => this.remove(params.row.part_task_pk) },
on: {
click: () => this.remove(params.row.part_task_pk)
},
}),
]);
},
......@@ -296,12 +291,29 @@ export default {
//设置参数结束
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 }) {
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
......@@ -438,7 +450,9 @@ export default {
apsOk() {
this.circleModal = true;
//智能排产前订单优先级功能
let parmsOrderpriority = { alls: [] };
let parmsOrderpriority = {
alls: []
};
let arryIds = [];
this.list.forEach((e, index) => {
let objIds = {};
......@@ -490,6 +504,7 @@ export default {
//排产计算
let paramsTime = {
setTime: this.entity.setTime,
rules: JSON.stringify(this.rulesAi).replace('[', '').replace(']', '').replace(/\"/g, '')
};
Api.apsprepareandcalc(paramsTime)
.then((res2) => {
......@@ -547,29 +562,36 @@ export default {
},
};
</script>
<style lang="less">
.drag {
cursor: move;
}
.demo-spin-icon-load {
animation: ani-demo-spin 1s linear infinite;
}
@keyframes ani-demo-spin {
from {
transform: rotate(0deg);
}
50% {
transform: rotate(180deg);
}
to {
transform: rotate(360deg);
}
}
.demo-spin-col {
height: 100px;
position: relative;
border: 0px solid #eee;
}
.vertical-center-modal {
display: flex;
align-items: center;
......@@ -579,6 +601,7 @@ export default {
top: 0;
}
}
.tempModal {
.ivu-modal-body {
padding: 16px;
......@@ -587,6 +610,7 @@ export default {
padding-top: 2px;
padding-bottom: 0px;
}
.ivu-modal-footer {
border-top: none;
padding: 12px 18px 12px 18px;
......
<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