Commit 7e2917fa authored by renjintao's avatar renjintao

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

parents 1366a5c3 fe1902fd
......@@ -21,7 +21,7 @@
import GanttElastic from "gantt-elastic";
import GanttHeader from "./components/gantt-header";
import dayjs from "dayjs";
import Api from "./api";
// just helper to get current dates
function getDate(hours) {
const currentDate = new Date();
......@@ -273,17 +273,18 @@ let options = {
value: "label",
width: 200,
expander: true,
html: true,
events: {
click({ data, column }) {
alert("description clicked!\n" + data.label);
}
}
html: true
// events: {
// click({ data, column }) {
// alert("description clicked!\n" + data.label);
// }
// }
},
{
id: 3,
label: "责任人",
label: "设备编号",
value: "user",
width: 130,
html: true
},
......@@ -295,12 +296,25 @@ let options = {
},
{
id: 5,
label: "类型",
value: "type",
width: 68
label: "结束时间",
value: task => dayjs(task.endTime).format("YYYY-MM-DD"),
width: 78
},
{
id: 6,
label: "投入数量",
value: "put_into_qty",
width: 68
},
{
id: 7,
label: "派工数量",
value: "dispatch_qty",
width: 68
},
{
id: 8,
label: "%",
value: "progress",
width: 35,
......@@ -349,15 +363,60 @@ export default {
GanttElastic,
GanttHeader
},
props: {
id: String
},
data() {
return {
tasks,
tasks:[],
options,
dynamicStyle: {},
lastId: 16
};
},
mounted() {
this.gantData();
},
methods: {
gantData() {
if (this.id) {
Api.paged({ scheduleId: this.id })
.then(r => {
if (r.result) {
Api.getdetail({
part_task_pk: r.result[0].id,
scheduleId: this.id
}).then(r => {
if (r.result) {
var list = [];
for (var i = 0; i < r.result.length; i++) {
let temp = {
id: r.result[i].op_task_pk,
label: r.result[i].task_name,
user: r.result[i].equip_id,
// start: r.result[i].plan_start,
// endTime: r.result[i].plan_finish,
endTime: "2020-7-30",
start: getDate(1),
duration: (15*i) * 24 * 60 * 60 * 1000,
percent: 85,
put_into_qty: r.result[i].put_into_qty,
dispatch_qty: r.result[i].dispatch_qty
};
list.push(temp);
}
this.tasksUpdate(list);
}
});
}
})
.catch(error => {
this.$Message.error("请求失败");
});
}
},
addTask() {
this.tasks.push({
id: this.lastId++,
......@@ -372,9 +431,11 @@ export default {
});
},
tasksUpdate(tasks) {
// console.log(tasks);
this.tasks = tasks;
},
optionsUpdate(options) {
// console.log(options);
this.options = options;
},
styleUpdate(style) {
......
......@@ -50,22 +50,23 @@
<Button type="default" @click="cancel">取消</Button>
</div>
<Modal v-model="modal1Gant" fullscreen title="甘特图" footer-hide>
<Gantt />
<!-- <Gantt :id="id" /> -->
<gantt :is="gantt" :id="id" />
</Modal>
</div>
</template>
<script>
import Api from "./api";
import Gantt from "./gantt";
// import Gantt from "./gantt";
export default {
components: {
Gantt
},
// components: {
// Gantt
// },
data() {
return {
curId: null,
detail: null,
isactive: 0,
isactive: null,
list: [],
name: "name1",
id: null,
......@@ -75,7 +76,8 @@ export default {
showFooter: false,
total: 0,
blacks: false,
gant: false
gant: false,
gantt:null,
};
},
async fetch({ store, params }) {
......@@ -152,10 +154,11 @@ export default {
//甘特图
gantChart() {
this.modal1Gant = true;
this.gantt = () => import("./gantt");
},
changeCheck(item) {
this.isactive = null;
this.blacks = true;
(this.id = null), (this.blacks = true);
if (item.checked == true) {
this.contrastList.push(item.schedule_Id);
} else if (item.checked == false) {
......
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