Commit 977179d8 authored by 周远喜's avatar 周远喜

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

parents 45d6199a 6fc8e6b8
<template>
<div class="time-view" v-if="timeValue.startDate && timeValue.endDate">
<div>{{ timeValue.startDate }}</div>
<div class="time-view" v-if="startDate && endDate">
<div>{{ startDate }}</div>
<div class="jian-tou">
<div>{{ date }}</div>
<div>{{ jg }} {{ unit }}</div>
</div>
<div>{{ timeValue.endDate }}</div>
<div>{{ endDate }}</div>
</div>
</template>
<script>
export default {
name: "",
data() {
return {};
return {
startDate: null,
endDate: null,
unit: "h",
jg: 0,
};
},
props: {
// model: {
// prop: "value",
// event: "on-change",
// },
value: Object,
start: {
type: String,
default: "startDate",
},
end: {
type: String,
default: "endDate",
},
mode: {
type: String,
default: "h", //h:小时,d:天,w:周,m:月
},
timeValue: {
type: [String, Object],
default: "",
},
work: {
type: [String, Number], //传入的work为0,转换为小时,1为天,2为周,3为月
default: 0,
default: 8,
},
},
computed: {
date() {
var date1 = new Date(this.timeValue.startDate).getTime(); //开始时间,时间戳
var date2 = new Date(this.timeValue.endDate).getTime(); //结束时间,时间戳
var date3 = 0;
date3 = date2 - date1;
// var timeSpanStr;
// if (date3 <= 1000 * 60 * 1) {
// timeSpanStr = "刚刚";
// } else if (1000 * 60 * 1 < date3 && date3 <= 1000 * 60 * 60) {
// timeSpanStr = Math.round(date3 / (1000 * 60)) + "分钟";
// } else if (1000 * 60 * 60 * 1 < date3 && date3 <= 1000 * 60 * 60 * 24) {
// timeSpanStr = Math.round(date3 / (1000 * 60 * 60)) + "小时";
// } else if (
// 1000 * 60 * 60 * 24 <
// date3
// // && date3 <= 1000 * 60 * 60 * 24 * 30
// ) {
// timeSpanStr = Math.round(date3 / (1000 * 60 * 60 * 24)) + "天";
// }
// return timeSpanStr;
mounted() {
this.init();
},
methods: {
init(v) {
if (v) {
this.startDate = v[this.start];
this.endDate = v[this.end];
}
this.unit = this.mode;
var date1 = new Date(this.startDate).getTime(); //开始时间,时间戳
var date2 = new Date(this.endDate).getTime(); //结束时间,时间戳
this.jg = date2 - date1;
var result = "";
var minute = 1000 * 60;
var hour = minute * 60;
var day = hour * 24;
var month = day * 30;
if (date3 < 0) return;
var monthC = date3 / month;
var weekC = date3 / (7 * day);
var dayC = date3 / day;
var hourC = date3 / hour;
var minC = date3 / minute;
if (this.work == 3) {
result = "" + parseInt(monthC) + "月";
} else if (this.work == 2) {
result = "" + parseInt(weekC) + "周";
} else if (this.work == 1) {
result = "" + parseInt(dayC) + "天";
} else if (this.work == 0) {
result = "" + parseInt(hourC) + " h";
}
// if (monthC >= 1) {
// result = "" + parseInt(monthC) + "月";
// } else if (weekC >= 1) {
// result = "" + parseInt(weekC) + "周";
// } else if (dayC >= 1) {
// result = "" + parseInt(dayC) + "天";
// } else if (hourC >= 1) {
// result = "" + parseInt(hourC) + "小时";
// }
// else if (minC >= 1) {
// result = "" + parseInt(minC) + "分钟";
// }
else {
result = "0";
if (this.jg < 0) return;
var monthC = this.jg / month;
var weekC = this.jg / (7 * day);
var dayC = this.jg / day;
var hourC = this.jg / hour;
var minC = this.jg / minute;
if (this.unit == "m") {
result = "" + parseInt(monthC);
} else if (this.unit == "w") {
result = "" + parseInt(weekC);
} else if (this.unit == "d") {
result = "" + parseInt(dayC);
} else if (this.unit == "h") {
result = "" + parseInt(hourC);
}
return result;
this.jg = result;
},
},
watch: {
value: {
handler: function (n, v) {
this.init(n);
},
deep: true,
},
},
mounted() {},
methods: {},
watch: {},
};
</script>
<style lang="less">
......
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="100">
<!-- <DateDRange :value="timeValue" ></DateDRange> -->
<Row>
<Col span="8" class="projct-img">
<FormItem :label="l('picture')" prop="picture">
......@@ -87,7 +88,7 @@
style="width: 300px"
></DatePicker> </FormItem
></Col>
<!-- <DateDRange :timeValue="timeValue" :wrok="1"></DateDRange> -->
<Col :span="12"
><FormItem :label="l('type')" prop="type">
<Dictionary
......
......@@ -17,14 +17,13 @@
<p class="content">
操作员:<User :value="item.creatorUserId"></User>
</p>
<p class="content">
<p class="content" v-if="item.workHour&&item.workHour>0">
工时:{{item.workHour}}
</p>
<p class="content">
标题:{{item.title}}
</p>
<p class="pl10" v-if="item.note"><a @click="view(item.id)">查看详细</a></p>
<p class="pl10" v-if="item.attachment"><a @click="viewFiles(item.attachment)">查看附件</a></p>
<p class="pl10" v-if="item.note&&item.note.length>0"><a @click="view(item.id)">查看详细</a></p>
</TimelineItem>
</Timeline>
<p class="content" v-else>暂无数据</p>
......
<template>
<div class="detail" style="width:100%;overflow:auto">
<div style="width:100%;overflow:auto">
<div style="width:80%; border-right:1px solid #ccc;padding-right:30px;float:left">
<Row style="height:284px">
<Filed :span="12" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="12" :name="l('level')">
<Form :label-width="5" ref="formValidate">
<Row>
<Col :span="8">
<FormItem label>
<span style="float:left">{{l('title')}}&nbsp;</span>
{{entity.title}}
</FormItem>
</Col>
<Col :span="8">
<FormItem label>
<span style="float:left">{{l('level')}}&nbsp;</span>
<state code="project.task.level" :value="entity.level" type="text"></state>
</Filed>
<Filed :span="12" :name="l('status')">
</FormItem>
</Col>
<Col :span="8">
<FormItem label>
<span style="float:left">{{l('status')}}&nbsp;</span>
<state code="project.task.status" :value="entity.status" type="text"></state>
</Filed>
<Filed :span="12" :name="l('userId')">
</FormItem>
</Col>
<Col :span="8">
<FormItem label>
<span style="float:left">{{l('userId')}}&nbsp;</span>
<User :value="parseInt(entity.userId)"></User>
</Filed>
<Filed :span="12" name="计划起止日期">
<TimeDifference :timeValue="timeValuePlan" :work="0"></TimeDifference>
</Filed>
<Filed :span="12" name="实际起止日期">
<TimeDifference :timeValue="timeValue" :work="1"></TimeDifference>
</Filed>
<Filed :span="24" :name="l('note')">
<div style="height:200px" v-html="entity.note" class="tex_in10"></div>
</Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">
</FormItem>
</Col>
<Col :span="8">
<FormItem label>
<span style="float:left">计划起止日期:&nbsp;</span>
<DateRange :timeValue="timeValuePlan">
</DateRange>
</FormItem>
</Col>
<Col :span="8">
<FormItem label>
<span style="float:left">实际起止日期:&nbsp;</span>
<DateRange :timeValue="timeValue"></DateRange>
</FormItem>
</Col>
</Row>
<Row :gutter="24" index="">
<Col :span="24">
<FormItem label><span style="float:left">{{l('note')}}&nbsp;</span>
<div style="height:200px;background:#fff;border:#c5c5c5 solid 1px;margin-left:50px;padding:10px;" v-html="entity.note" class="tex_in10"></div>
</FormItem>
</Col>
<Col :span="8">
<FormItem label>
<span style="float:left">{{l('creationTime')}}&nbsp;</span>
{{entity.creationTime}}
</FormItem>
</Col>
<Col :span="8">
<FormItem label>
<span style="float:left">{{l('creatorUserId')}}&nbsp;</span>
<User :value="entity.creatorUserId"></User>
</Filed>
</FormItem>
</Col>
</Row>
<Row :gutter="24">
<Col :span="8">
<FormItem label>
<span style="float:left">操作:&nbsp;</span>
<Dictionary code="project.task.status" v-model="entitySave.status" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="8">
<FormItem label>
<span style="float:left">工时:&nbsp;</span>
<InputNumber v-model="entitySave.workHour" :min="0"></InputNumber>
</FormItem>
</Col>
</Row>
</Form>
</div>
<div class="rightDiv" :style="{height:divHeight}">
<component :is="detail" :eid="curId" />
</div>
<FooterToolbar class="ftball">
<div class="tip"><Button type="primary" @click="updatepart(2)">完成</Button><Button type="primary" @click="updatepart(3)">冻结</Button><Button @click="handleClose">取消</Button></div>
<div class="tip"><Button type="primary" @click="updatepart(2)">确定</Button><Button @click="handleClose">取消</Button></div>
</FooterToolbar>
</div>
......@@ -46,6 +95,7 @@ export default {
data() {
return {
entity: {},
entitySave: {},
timeValue: {
startDate: "",
endDate: "",
......@@ -96,14 +146,16 @@ export default {
this.timeValue = {
startDate: r.result.startDate,
endDate: r.result.endDate,
},
};
this.timeValuePlan = {
startDate: r.result.plansToStartDate,
endDate: r.result.plansToEndTime,
},
this.$emit('on-load')
this.curId = v
this.detail = () => import('../record/recordTimeLine')
};
this.entitySave.status = this.$u.clone(this.entity.status);
this.entitySave.workHour = 0;
this.$emit('on-load');
this.curId = v;
this.detail = () => import('../record/recordTimeLine');
})
},
......@@ -151,7 +203,6 @@ export default {
<style scoped>
.tex_in10 {
text-indent: 12px;
text-align: inherit !important;
}
......
......@@ -181,13 +181,12 @@ export default {
high: true,
width: 200,
render: (h, params) => {
return h('TimeDifference', {
return h('DateRange', {
props: {
timeValue: {
startDate: params.row.plansToStartDate,
endDate: params.row.plansToEndTime,
},
work: 0
}
}
})
}
......@@ -199,13 +198,12 @@ export default {
high: true,
width: 200,
render: (h, params) => {
return h('TimeDifference', {
return h('DateRange', {
props: {
timeValue: {
startDate: params.row.startDate,
endDate: params.row.endDate,
},
work: 1
}
}
})
}
......@@ -274,11 +272,11 @@ export default {
icon: "ios-alarm",
type: "icon",
oprate: "edit",
title: "完成",
title: "回报工作",
disable: params.row.status == 1 ? 0 : 1
},
on: {
click: () => this.updatepart(params.row.id, 2)
click: () => this.viewRecord(params.row.id, params.row.status)
}
}),
h('op', {
......
......@@ -76,7 +76,7 @@ import InputCode from '@/components/page/inputCode.vue'
import Pictrue from '@/components/page/pictrue.vue'
import WordTree from '@/components/page/wordTree.vue'
import Actions from '@/components/page/actions.vue'
import DateDRange from '@/components/page/dateRange.vue'
import DateRange from '@/components/page/dateRange.vue'
import FilesViewer from '@/components/page/filesViewer.vue'
......@@ -158,7 +158,7 @@ Vue.component("InputCode", InputCode)
Vue.component("Pictrue", Pictrue)
Vue.component("WordTree", WordTree)
Vue.component("Actions", Actions)
Vue.component("DateDRange", DateDRange)
Vue.component("DateRange", DateRange)
Vue.component("Life", Life)
Vue.component("FilesViewer",FilesViewer)
......
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