Commit e9b1096e authored by 周远喜's avatar 周远喜

甘特图数据处理。

parent 106c7aee
...@@ -100,7 +100,11 @@ div::-webkit-scrollbar-corner { ...@@ -100,7 +100,11 @@ div::-webkit-scrollbar-corner {
.ib { .ib {
display: inline; display: inline;
} }
.pa{
position: absolute;
}
.pr{position: relative;}
.pf{position: fixed;}
.f14 { .f14 {
font-size: 14px; font-size: 14px;
} }
......
...@@ -275,7 +275,8 @@ export default { ...@@ -275,7 +275,8 @@ export default {
window.onresize = () => { window.onresize = () => {
///浏览器窗口大小变化 ///浏览器窗口大小变化
return (() => { return (() => {
this.tableHeight = this.$refs.main.offsetHeight; console.warn("fasfas",this.$refs.main)
// this.tableHeight = this.$refs.main.offsetHeight;
})(); })();
}; };
}); });
...@@ -290,10 +291,7 @@ export default { ...@@ -290,10 +291,7 @@ export default {
}, },
methods: { methods: {
//数据加载 //数据加载
load() { load() {
if (this.height == 0) {
this.tableHeight = window.innerHeight - this.firstY - 60;
}
if (this.action) { if (this.action) {
//条件初始化处理。 //条件初始化处理。
if (this.initsearch) { if (this.initsearch) {
......
...@@ -22330,9 +22330,9 @@ ...@@ -22330,9 +22330,9 @@
"integrity": "sha1-h1875vsK5BVoqDfzrBqA6qE3uZg=" "integrity": "sha1-h1875vsK5BVoqDfzrBqA6qE3uZg="
}, },
"vue-property-decorator": { "vue-property-decorator": {
"version": "8.4.2", "version": "8.5.1",
"resolved": "https://registry.npmjs.org/vue-property-decorator/-/vue-property-decorator-8.4.2.tgz", "resolved": "https://registry.npmjs.org/vue-property-decorator/-/vue-property-decorator-8.5.1.tgz",
"integrity": "sha512-IqbARlvgPE2pzKfbecKxsu2yEH0Wv7hfHR6m4eZA3LTnNw9hveAX77vDfLFyTeMISS5N7Kucp/xRSHjcQ6bAfQ==", "integrity": "sha512-O6OUN2OMsYTGPvgFtXeBU3jPnX5ffQ9V4I1WfxFQ6dqz6cOUbR3Usou7kgFpfiXDvV7dJQSFcJ5yUPgOtPPm1Q==",
"requires": { "requires": {
"vue-class-component": "^7.1.0" "vue-class-component": "^7.1.0"
} }
...@@ -22419,11 +22419,19 @@ ...@@ -22419,11 +22419,19 @@
} }
}, },
"vue-slider-component": { "vue-slider-component": {
"version": "3.1.3", "version": "3.1.5",
"resolved": "https://registry.npmjs.org/vue-slider-component/-/vue-slider-component-3.1.3.tgz", "resolved": "https://registry.npmjs.org/vue-slider-component/-/vue-slider-component-3.1.5.tgz",
"integrity": "sha512-SPFb1I3G2a4thIwghvVNhcvPGCUz6PIZR1ClwtvN4MT44ZUzvqCMDS7osdKz0hdKu4kfanxET8qZn826A/XPxA==", "integrity": "sha512-RIDL2cjIfSMKxv7IeNQ5gn936SAaLi+UKc97xd8yN92zz0n5dK343GGSay/3ypzhR1C5YIN3n7/LclUQrIDoFg==",
"requires": { "requires": {
"core-js": "^3.6.5",
"vue-property-decorator": "^8.0.0" "vue-property-decorator": "^8.0.0"
},
"dependencies": {
"core-js": {
"version": "3.6.5",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz",
"integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA=="
}
} }
}, },
"vue-style-loader": { "vue-style-loader": {
......
...@@ -39,6 +39,7 @@ export default { ...@@ -39,6 +39,7 @@ export default {
computed:{ computed:{
list(){ list(){
var data={}; var data={};
if(this.data.datas){
var item=JSON.parse(this.data.datas); var item=JSON.parse(this.data.datas);
for(var key in item) for(var key in item)
{ {
...@@ -46,6 +47,7 @@ export default { ...@@ -46,6 +47,7 @@ export default {
data[key]= item[key]; data[key]= item[key];
} }
} }
}
return data; return data;
} }
}, },
......
...@@ -58,7 +58,6 @@ ...@@ -58,7 +58,6 @@
@click="goResults" @click="goResults"
style="background:#515A6E;border:solid 1px #515A6E" style="background:#515A6E;border:solid 1px #515A6E"
>历史方案</Button> >历史方案</Button>
<Button type="primary" @click="resultModal=true">Result</Button>
<Button type="primary" @click="openApsModal">APS排产</Button> <Button type="primary" @click="openApsModal">APS排产</Button>
</template> </template>
<template slot="batch"> <template slot="batch">
......
<template> <template>
<div class="q-pa-sm"> <div class="q-pa-sm">
<div class="pr mt50" v-if="tasks.length==0" >
<Spin size="large" fix ></Spin>
</div>
<gantt-elastic <gantt-elastic
v-else
:options="options" :options="options"
:tasks="tasks" :tasks="tasks"
@tasks-changed="tasksUpdate" @tasks-changed="tasksUpdate"
...@@ -38,6 +43,12 @@ function getDate(hours) { ...@@ -38,6 +43,12 @@ function getDate(hours) {
).getTime(); ).getTime();
return new Date(timeStamp + hours * 60 * 60 * 1000).getTime(); return new Date(timeStamp + hours * 60 * 60 * 1000).getTime();
} }
function GetTimeByTimeStr(dateString) {
var timeArr = dateString.split(" ");
var d = timeArr[0].split("-");
var t = timeArr[1].split(":");
return new Date(d[0], d[1] - 1, d[2], t[0], t[1], t[2]).getTime();
}
let tasks = [ let tasks = [
{ {
id: 1, id: 1,
...@@ -245,7 +256,7 @@ let options = { ...@@ -245,7 +256,7 @@ let options = {
}, },
calendar: { calendar: {
hour: { hour: {
display: false display: true
} }
}, },
chart: { chart: {
...@@ -318,6 +329,17 @@ let options = { ...@@ -318,6 +329,17 @@ let options = {
value: "dispatch_qty", value: "dispatch_qty",
width: 68 width: 68
}, },
{
id:10,
label: "parentId",
value: "parentId",
width: 68
},{
id:11,
label: "duration",
value: "duration",
width: 68
},
{ {
id: 9, id: 9,
label: "%", label: "%",
...@@ -374,13 +396,14 @@ export default { ...@@ -374,13 +396,14 @@ export default {
data() { data() {
return { return {
tasks, tasks:[],
options, options,
dynamicStyle: {}, dynamicStyle: {},
lastId: 16 lastId: 16
}; };
}, },
mounted() { created() {
// this.tasks=tasks;
this.gantData(); this.gantData();
}, },
...@@ -394,15 +417,17 @@ export default { ...@@ -394,15 +417,17 @@ export default {
var list = []; var list = [];
var obj = { var obj = {
id: r.result[0].id, id: r.result[0].id,
// parentId: 0,
name: r.result[0].part_name, name: r.result[0].part_name,
start: r.result[0].plan_start, start:GetTimeByTimeStr(r.result[0].plan_start) ,
endTime: r.result[0].plan_finish, // endTime: GetTimeByTimeStr(r.result[0].plan_finish),
EquipmentNo: "/", EquipmentNo: "/",
duration: 15 * 24 * 60 * 60 * 1000, duration: GetTimeByTimeStr(r.result[0].plan_finish)-GetTimeByTimeStr(r.result[0].plan_start),
percent: 85, percent: 85,
plan_qty: r.result[0].plan_qty, plan_qty: r.result[0].plan_qty,
put_into_qty: "/", put_into_qty: "/",
dispatch_qty: "/" dispatch_qty: "/",
type: "project"
}; };
list.push(obj); list.push(obj);
Api.getdetail({ Api.getdetail({
...@@ -411,6 +436,8 @@ export default { ...@@ -411,6 +436,8 @@ export default {
}).then(r => { }).then(r => {
if (r.result) { if (r.result) {
for (var i = 0; i < r.result.length; i++) { for (var i = 0; i < r.result.length; i++) {
var start=GetTimeByTimeStr(r.result[i].plan_start);
var jg= GetTimeByTimeStr(r.result[i].plan_finish)- start;
let temp = { let temp = {
id: r.result[i].op_task_pk, id: r.result[i].op_task_pk,
name: r.result[i].task_name, name: r.result[i].task_name,
...@@ -418,18 +445,22 @@ export default { ...@@ -418,18 +445,22 @@ export default {
parentId: parentId, parentId: parentId,
// start: r.result[i].plan_start, // start: r.result[i].plan_start,
// endTime: r.result[i].plan_finish, // endTime: r.result[i].plan_finish,
endTime: "2020-7-30", // endTime: "2020-7-30",
start: getDate(-24 * 5), start: start,
duration: 15 * 24 * 60 * 60 * 1000, duration: jg,
percent: 85, percent: 0,
put_into_qty: r.result[i].put_into_qty, put_into_qty: r.result[i].put_into_qty,
dispatch_qty: r.result[i].dispatch_qty dispatch_qty: r.result[i].dispatch_qty,
type:i%2?"task":'milestone',
// type: "milestone",
}; };
list.push(temp); list.push(temp);
} }
this.tasksUpdate(list); this.tasksUpdate(list);
console.warn(list)
} }
}); });
} }
}) })
.catch(error => { .catch(error => {
......
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