Commit 329e6df2 authored by 仇晓婷's avatar 仇晓婷

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

parents 4a4ee0ca dafab4ae
<template> <template>
<div> <div>
<DataGrid <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">
: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="searchBack"></template>
<template slot="searchForm"> <template slot="searchForm">
<Search /> <Search />
</template> </template>
<template slot="buttons"> <template slot="buttons">
<DatePicker <Select v-model="rulesAi" multiple style="width:280px;" class="tl">
type="date" <Option v-for="item in rulesAiList" :value="item.value" :key="item.value">{{ item.label }}</Option>
placeholder="设置基准日期" </Select>
style="width: 150px;" <DatePicker type="date" placeholder="设置基准日期" style="width: 150px;" v-model="entity.setTime" @on-change="getTime"></DatePicker>
v-model="entity.setTime"
@on-change="getTime"
></DatePicker>
<Button type="primary" @click="openApsModal">智能排产</Button> <Button type="primary" @click="openApsModal">智能排产</Button>
</template> </template>
<template slot="batch"> <template slot="batch">
...@@ -52,8 +37,9 @@ ...@@ -52,8 +37,9 @@
</Col> </Col>
</Row> </Row>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
var myDate = new Date(); var myDate = new Date();
var nowDate = myDate.getFullYear() + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate(); var nowDate = myDate.getFullYear() + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate();
...@@ -76,7 +62,10 @@ export default { ...@@ -76,7 +62,10 @@ export default {
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { op: "notes", value: null }, keys: {
op: "notes",
value: null
},
}, },
result: { result: {
res: true, res: true,
...@@ -84,7 +73,8 @@ export default { ...@@ -84,7 +73,8 @@ export default {
}, },
resultModal: false, resultModal: false,
entity: { entity: {
setTime:this.getFormatDate(nowDate) setTime: this.getFormatDate(nowDate),
rules: '',
}, },
editModal: false, editModal: false,
detailModal: false, detailModal: false,
...@@ -96,8 +86,7 @@ export default { ...@@ -96,8 +86,7 @@ export default {
rowIndex1: null, rowIndex1: null,
list: [], list: [],
curId: 0, curId: 0,
columns: [ columns: [{
{
key: "move", key: "move",
title: " ", title: " ",
hide: false, hide: false,
...@@ -260,7 +249,9 @@ export default { ...@@ -260,7 +249,9 @@ export default {
align: "center", align: "center",
// fixed:"right", // fixed:"right",
render: (h, params) => { render: (h, params) => {
return h("div", { class: "action" }, [ return h("div", {
class: "action"
}, [
h("op", { h("op", {
attrs: { attrs: {
icon: "md-refresh", icon: "md-refresh",
...@@ -269,7 +260,9 @@ export default { ...@@ -269,7 +260,9 @@ export default {
oprate: "edit", oprate: "edit",
msg: "确认要恢复工序吗?", msg: "确认要恢复工序吗?",
}, },
on: { click: () => this.refresh(params.row.part_task_pk) }, on: {
click: () => this.refresh(params.row.part_task_pk)
},
}), }),
h("op", { h("op", {
attrs: { attrs: {
...@@ -279,7 +272,9 @@ export default { ...@@ -279,7 +272,9 @@ export default {
oprate: "delete", oprate: "delete",
msg: "确认要移出排产吗?", 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 { ...@@ -296,12 +291,29 @@ export default {
//设置参数结束 //设置参数结束
circleModal: false, //进度条 circleModal: false, //进度条
tempStatu: 0, //新建模型时传过来的id值 tempStatu: 0, //新建模型时传过来的id值
rulesAi: ['1', '2', '3', '4'],
rulesAiList: [{
value: '1',
label: '转序'
}, {
value: '2',
label: '多台'
}, {
value: '3',
label: '加班'
}, {
value: '4',
label: '公休'
}]
}; };
}, },
mounted() { mounted() {
this.loadList(); this.loadList();
}, },
async fetch({ store, params }) { async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
...@@ -438,7 +450,9 @@ export default { ...@@ -438,7 +450,9 @@ export default {
apsOk() { apsOk() {
this.circleModal = true; this.circleModal = true;
//智能排产前订单优先级功能 //智能排产前订单优先级功能
let parmsOrderpriority = { alls: [] }; let parmsOrderpriority = {
alls: []
};
let arryIds = []; let arryIds = [];
this.list.forEach((e, index) => { this.list.forEach((e, index) => {
let objIds = {}; let objIds = {};
...@@ -490,6 +504,7 @@ export default { ...@@ -490,6 +504,7 @@ export default {
//排产计算 //排产计算
let paramsTime = { let paramsTime = {
setTime: this.entity.setTime, setTime: this.entity.setTime,
rules: JSON.stringify(this.rulesAi).replace('[', '').replace(']', '').replace(/\"/g, '')
}; };
Api.apsprepareandcalc(paramsTime) Api.apsprepareandcalc(paramsTime)
.then((res2) => { .then((res2) => {
...@@ -547,29 +562,36 @@ export default { ...@@ -547,29 +562,36 @@ export default {
}, },
}; };
</script> </script>
<style lang="less"> <style lang="less">
.drag { .drag {
cursor: move; cursor: move;
} }
.demo-spin-icon-load { .demo-spin-icon-load {
animation: ani-demo-spin 1s linear infinite; animation: ani-demo-spin 1s linear infinite;
} }
@keyframes ani-demo-spin { @keyframes ani-demo-spin {
from { from {
transform: rotate(0deg); transform: rotate(0deg);
} }
50% { 50% {
transform: rotate(180deg); transform: rotate(180deg);
} }
to { to {
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
.demo-spin-col { .demo-spin-col {
height: 100px; height: 100px;
position: relative; position: relative;
border: 0px solid #eee; border: 0px solid #eee;
} }
.vertical-center-modal { .vertical-center-modal {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -579,6 +601,7 @@ export default { ...@@ -579,6 +601,7 @@ export default {
top: 0; top: 0;
} }
} }
.tempModal { .tempModal {
.ivu-modal-body { .ivu-modal-body {
padding: 16px; padding: 16px;
...@@ -587,6 +610,7 @@ export default { ...@@ -587,6 +610,7 @@ export default {
padding-top: 2px; padding-top: 2px;
padding-bottom: 0px; padding-bottom: 0px;
} }
.ivu-modal-footer { .ivu-modal-footer {
border-top: none; border-top: none;
padding: 12px 18px 12px 18px; 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>
<template> <template>
<div class="content"> <div class="table-content">
<TablePaste hide-table :input-props="inputProps" @on-success="handleSuccess" @on-error="handleError" v-show="showTablePaste" /> <TablePaste hide-table :input-props="inputProps" @on-success="handleSuccess" @on-error="handleError" v-show="showTablePaste" />
<DataGrid border :height="tdHeightExcel" :columns="columnsImport" :data="excelData" :page="false" :set="false"> <div class="table-tools">
<template slot="easySearch"> <div class="table-search">
<Form inline> <Form inline>
<FormItem> <FormItem>
<span>导入到</span> <span>导入到</span>
...@@ -16,13 +16,6 @@ ...@@ -16,13 +16,6 @@
<FormItem> <FormItem>
<Button type="primary" @click="openInfoModal">导入</Button> <Button type="primary" @click="openInfoModal">导入</Button>
</FormItem> </FormItem>
</Form>
</template>
<template slot="buttons">
<Form inline>
<FormItem>
<Button @click="downFile">下载原始文件</Button>
</FormItem>
<FormItem> <FormItem>
<div style="height:34px;overflow: hidden;padding:0"> <div style="height:34px;overflow: hidden;padding:0">
<Upload action :before-upload="beforeUpload" ref="uploadfile" :format="formatList"> <Upload action :before-upload="beforeUpload" ref="uploadfile" :format="formatList">
...@@ -30,16 +23,43 @@ ...@@ -30,16 +23,43 @@
</Upload> </Upload>
</div> </div>
</FormItem> </FormItem>
</Form>
</div>
<div class="btns">
<Form inline>
<FormItem> <FormItem>
<a @click="downFile">
<Icon type="md-download" />{{entity.file}}
</a>
</FormItem>
<FormItem>
<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> <Button @click="openPaste" :type="btnType" :ghost="ghostStatus">{{btnTxt}}</Button>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button @click="resetTable">还原到原始文件</Button> <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> </FormItem>
</Form> </Form>
</template> </div>
</DataGrid> </div>
<FooterToolbar v-if="sheetNames.length>1"> <div class="table-main" ref="main">
<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&&tableImport">
<Form inline> <Form inline>
<FormItem> <FormItem>
<Tabs :animated="false" :value="0" @on-click="sheetClick"> <Tabs :animated="false" :value="0" @on-click="sheetClick">
...@@ -71,6 +91,8 @@ export default { ...@@ -71,6 +91,8 @@ export default {
downUrl: fileUrlDown, downUrl: fileUrlDown,
fileUrlPath: "", fileUrlPath: "",
disabled: false, disabled: false,
detailExcel: null,
tableImport: true,
columns0: [{ columns0: [{
key: "userName", key: "userName",
title: this.l("userName"), title: this.l("userName"),
...@@ -424,7 +446,7 @@ export default { ...@@ -424,7 +446,7 @@ export default {
useData.push(objTm); useData.push(objTm);
}); });
//对列表里的数据字典项进行处理 //对列表里的部门及数据字典项进行处理
useData.forEach(eles => { useData.forEach(eles => {
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id //如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if ( if (
...@@ -551,10 +573,10 @@ export default { ...@@ -551,10 +573,10 @@ export default {
pageChange(val) { pageChange(val) {
switch (val) { switch (val) {
case 0: case 0:
this.loadColum(this.columns0); //this.loadColum(this.columns0);
break; break;
case 1: case 1:
this.loadColum(this.columns1); //this.loadColum(this.columns1);
break; break;
case undefined: case undefined:
if (this.dataType == 0) { if (this.dataType == 0) {
...@@ -564,7 +586,7 @@ export default { ...@@ -564,7 +586,7 @@ export default {
} }
break; break;
default: default:
this.loadColum(this.columns1); //this.loadColum(this.columns1);
} }
}, },
handleClose() { handleClose() {
...@@ -704,6 +726,16 @@ export default { ...@@ -704,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) { l(key) {
key = "user" + "." + key; key = "user" + "." + key;
return this.$t(key); return this.$t(key);
...@@ -720,7 +752,54 @@ export default { ...@@ -720,7 +752,54 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
.content { .table-content {
position: relative;
height: 100%;
display: flex;
flex-direction: column;
.tip {
display: inline;
}
form {
display: inline-block;
.ivu-form-item {
margin: 0;
vertical-align: middle;
}
}
.table-main {
width: 100%;
text-align: left;
padding: 0;
display: block;
overflow-y: auto;
flex-grow: 1;
tr td .ivu-table-cell {
padding: 0 5px;
}
overflow-x: hidden;
}
.table-tools {
display: flex;
line-height: 50px;
.table-search {
flex-grow: 1;
}
.btns {
min-width: 200px;
text-align: right;
}
}
.table-footer { .table-footer {
line-height: 45px; line-height: 45px;
background: #f5f5f5; background: #f5f5f5;
...@@ -728,6 +807,7 @@ export default { ...@@ -728,6 +807,7 @@ export default {
.ivu-footer-toolbar { .ivu-footer-toolbar {
text-align: left; text-align: left;
background: #f5f5f5;
.ivu-footer-toolbar-right { .ivu-footer-toolbar-right {
float: left; float: left;
......
This diff is collapsed.
...@@ -40,7 +40,7 @@ export const actions = { ...@@ -40,7 +40,7 @@ export const actions = {
if (res.result) { if (res.result) {
util.cookies.set('uuid', res.result.userId); util.cookies.set('uuid', res.result.userId);
util.cookies.set('tanantCode', res.result.tanantCode); util.cookies.set('tenantCode', res.result.tenantCode );
util.cookies.set('token', res.result.accessToken); util.cookies.set('token', res.result.accessToken);
sessionStorage.setItem('token', res.result.accessToken) sessionStorage.setItem('token', res.result.accessToken)
// // 设置 vuex 用户信息 // // 设置 vuex 用户信息
......
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