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

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

parents 2c62f0ff 3c2f481f
<template>
<div class="time-view" v-if="timeValue.startDate && timeValue.endDate">
<span>{{ timeValue.startDate }}</span
>&nbsp; <span class="line">————</span>&nbsp;
<!-- {{ date }} -->
<span>{{ timeValue.endDate }}</span>
<div class="jian-tou"></div>
<div class="day-time">{{ date }}</div>
<div>{{ timeValue.startDate }}</div>
<div class="jian-tou">
<div>{{ date }}</div>
</div>
<div>{{ timeValue.endDate }}</div>
</div>
</template>
<script>
......@@ -69,7 +68,7 @@ export default {
} else if (this.work == 1) {
result = "" + parseInt(dayC) + "天";
} else if (this.work == 0) {
result = "" + parseInt(hourC) + "小时";
result = "" + parseInt(hourC) + " h";
}
// if (monthC >= 1) {
// result = "" + parseInt(monthC) + "月";
......@@ -96,25 +95,21 @@ export default {
</script>
<style lang="less">
.time-view {
width: 300px;
position: relative;
.day-time {
position: absolute;
bottom: 11px;
left: 83px;
}
.line {
font-size: 18px;
}
// width: 600px;
display: -webkit-flex;
display: flex;
.jian-tou {
position: absolute;
bottom: 9px;
left: 144px;
width: 7px;
height: 7px;
border-top: 2px solid #666;
border-right: 2px solid #666;
transform: rotate(45deg);
min-width: 55px;
text-align: center;
margin: 5px;
background-image: url("../../assets/imgicon/range.png");
background-size: 100%;
background-repeat: no-repeat;
margin-top: 7px;
div {
margin-top: -13px;
}
}
}
</style>
......@@ -81,17 +81,18 @@ export default {
},
methods: {
handler() {
if (this.oprate == "delete" || this.oprate == "remove") {
this.$Modal.confirm({
title: this.title,
content: "<p>" + this.msg + "</p>",
onOk: () => {
this.$emit("click", event);
}
});
} else {
this.$emit("click", event);
if (this.disable == 0) {
if (this.oprate == "delete" || this.oprate == "remove") {
this.$Modal.confirm({
title: this.title,
content: "<p>" + this.msg + "</p>",
onOk: () => {
this.$emit("click", event);
}
});
} else {
this.$emit("click", event);
}
}
}
},
......
<template>
<div class="flex fd tree-menu">
<h3>
任务结构
<div class="fr mr10 mt10">
<ButtonGroup class="fr" size="small">
<Button :icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'" @click="toggle" title="展开/合并"></Button>
<Button icon="md-refresh" title="刷新" @click="loadTree"></Button>
<Button icon="md-rewind" title="收起" @click="hide"></Button>
</ButtonGroup>
</div>
</h3>
<div class="flex fd tree-menu">
<!-- 任务结构 -->
<div class="p-list">
<h3>
<Dropdown @on-click="clickItem">
<a href="javascript:void(0)">
{{ downName }}
<Icon type="ios-arrow-down"></Icon>
</a>
<DropdownMenu slot="list">
<DropdownItem
v-for="item in projectList"
:key="item.id"
:name="item.id"
>{{ item.title }}</DropdownItem
>
</DropdownMenu>
</Dropdown>
</h3>
<div class="mr10 mt10 icon-d">
<ButtonGroup class="fr" size="small">
<Button
:icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'"
@click="toggle"
title="展开/合并"
></Button>
<Button
icon="md-refresh"
title="刷新"
@click="loadTree(curId)"
></Button>
<Button icon="md-rewind" title="收起" @click="hide"></Button>
</ButtonGroup>
</div>
</div>
<div class="search">
<Input search placeholder="请输入关键字" v-model="keys" clearable />
<Input search placeholder="请输入关键字" v-model="keys" clearable />
</div>
<div class="fg">
<div class="tree">
<Tree :data="data" :render="renderContent" ref="tree" @on-select-change="change"></Tree>
</div>
<div class="tree">
<Tree
:data="data"
:render="renderContent"
ref="tree"
@on-select-change="change"
></Tree>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "",
data() {
return {
keys: "",
expand: true,
list: []
};
name: "",
data() {
return {
keys: "",
expand: true,
list: [],
downName: "",
projectList: [],
curdId: this.curId,
};
},
props: {
curId: {
type: String,
default: "",
},
props: {
curId: {
type: String,
default: '',
},
},
created() {
this.listSlecet();
// this.loadTree();
},
methods: {
clickItem(val) {
console.log(val);
this.projectList.forEach((e) => {
if (val == e.id) {
this.downName = e.title;
}
});
this.curdId = val;
this.loadTree();
},
created() {
this.loadTree();
listSlecet() {
let data = {
conditions: [],
sortBy: "id",
isDesc: false,
};
this.$api.post(`${material}/projectmain/list`, data).then((r) => {
if (r.result) {
this.projectList = r.result;
this.downName = this.projectList[0].title;
this.curdId = this.projectList[0].id;
this.loadTree(this.projectList[0].id);
}
});
},
methods: {
loadTree() {
let params = {
conditions: [{
fieldName: "projectId",
fieldValue: this.curId,
conditionalType: "Equal"
}]
}
this.$api.post(`${material}/projectplan/list`, params).then(r => {
var data = this.$u.toTree(
r.result,
null,
u => {
u.value = u.id;
u.expand = true;
u.selected = false;
u.checked = false;
},
"upId"
);
this.list = this.$u.clone(data);
});
},
toggle() {
this.expand = !this.expand;
},
renderContent(h, {
root,
node,
data
}) {
// let type = "md-folder";
// if (data.isProduct != 0) {
// type = "ios-image";
// }
return h("div", [
h("state", {
props: {
code: "mes.project_plan.Type",
type: "icon",
value: data.type + ""
}
}),
h(
"span", {
style: {
// color: data.isProduct == 0 ? "#000" : "rgba(38, 128, 235, 1)"
}
},
data.title
),
h("state", {
props: {
code: "mes.project_plan.Status",
type: "tag",
value: data.status
}
}),
]);
},
change(v, b) {
// console.log(b);
let ids = [];
let productIds = [];
// if (b.bomId !== 0) {
// ids.push(b.bomId);
// }
var curentId = ''
curentId = b.id
productIds.push(b.value);
if (b.children) {
addId(b.children);
loadTree() {
let params = {
conditions: [
{
fieldName: "projectId",
fieldValue: this.curdId,
conditionalType: "Equal",
},
],
};
this.$api.post(`${material}/projectplan/list`, params).then((r) => {
var data = this.$u.toTree(
r.result,
null,
(u) => {
u.value = u.id;
u.expand = true;
u.selected = false;
u.checked = false;
},
"upId"
);
this.list = this.$u.clone(data);
});
},
toggle() {
this.expand = !this.expand;
},
renderContent(h, { root, node, data }) {
var items = this.$store.getters.dictionaryByKey(
"mes.project_plan.Status"
);
var item = items.filter((u) => {
return u.code == data.status;
})[0];
// console.warn("jjjjjj", items, item);
var color = item.color || "black";
return h("div", [
h("state", {
props: {
code: "mes.project_plan.Type",
type: "icon",
value: data.type + "",
size: 16,
},
}),
h("Badge", {
props: {
color: color,
text: data.title,
},
}),
]);
},
change(v, b) {
// console.log(b);
let ids = [];
let productIds = [];
// if (b.bomId !== 0) {
// ids.push(b.bomId);
// }
var curentId = "";
curentId = b.id;
productIds.push(b.value);
if (b.children) {
addId(b.children);
function addId(data) {
data.map(u => {
// if (u.bomId !== 0) {
// ids.push(u.bomId);
// }
productIds.push(u.value);
if (u.children) {
addId(u.children);
}
});
}
function addId(data) {
data.map((u) => {
// if (u.bomId !== 0) {
// ids.push(u.bomId);
// }
productIds.push(u.value);
if (u.children) {
addId(u.children);
}
this.$emit("on-select", curentId, b, productIds);
},
hide() {
this.$emit("on-hide");
});
}
}
this.$emit("on-select", curentId, b, productIds);
},
hide() {
this.$emit("on-hide");
},
computed: {
data() {
let items = this.$u.clone(this.list);
let expand = this.expand;
let result = [];
search(this.keys, items);
},
computed: {
data() {
let items = this.$u.clone(this.list);
let expand = this.expand;
let result = [];
search(this.keys, items);
function search(keys, data) {
data.map(u => {
if (keys.length < 2) {
u.expand = expand;
result.push(u);
} else {
u.expand = expand;
if (u.title.indexOf(keys) > -1) {
result.push(u);
} else if (u.children) {
search(keys, u.children);
}
}
});
function search(keys, data) {
data.map((u) => {
if (keys.length < 2) {
u.expand = expand;
result.push(u);
} else {
u.expand = expand;
if (u.title.indexOf(keys) > -1) {
result.push(u);
} else if (u.children) {
search(keys, u.children);
}
return result;
}
}
});
}
return result;
},
watch: {
curId(v) {
if (v) {
this.loadTree();
}
},
},
watch: {
curId(v) {
if (v) {
this.curdId = v;
this.loadTree();
}
},
},
};
</script>
<style lang="less">
@import "../../assets/css/custom.less";
.tree-menu {
h3 {
height: 50px;
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: bold;
line-height: 50px;
color: @left-tree-header-color;
background: @left-tree-header-bg-color;
opacity: 1;
padding-left: 10px;
}
// @import "../../assets/css/custom.less";
.search {
height: 50px;
padding: 5px 10px;
}
// .tree-menu {
// h3 {
// height: 50px;
// font-size: 14px;
// font-family: Microsoft YaHei;
// font-weight: bold;
// line-height: 50px;
// color: @left-tree-header-color;
// background: @left-tree-header-bg-color;
// opacity: 1;
// padding-left: 10px;
// }
.p-list {
position: relative;
}
.icon-d {
position: absolute;
top: 0;
right: 0;
}
// .search {
// height: 50px;
// padding: 5px 10px;
// }
.fg {
flex: none;
// height:0;
overflow: auto;
padding-left: 10px;
}
// .fg {
// flex: none;
// // height:0;
// overflow: auto;
// padding-left: 10px;
// }
.tree {
height: calc(100vh - 215px);
overflow: auto;
}
}
// .tree {
// height: calc(100vh - 215px);
// overflow: auto;
// }
// }
</style>
<template>
<div class="ib" @click="showLife">
<div class="ib" v-if="!isMore">
<span v-if="type=='text'" :style="style">{{name}}</span>
<Tag v-if="type=='tag'" :color="tagcolor">{{name}}</Tag>
<Badge v-if="type=='dot'" :color="tagcolor" :text="name" />
<Icon v-if="type=='icon'" :type="item.icon" :color="tagcolor" :title="name" size="24" />
<span v-if="type == 'text'" :style="style">{{ name }}</span>
<Tag v-if="type == 'tag'" :color="tagcolor">{{ name }}</Tag>
<Badge v-if="type == 'dot'" :color="tagcolor" :text="name" />
<Icon
v-if="type == 'icon'"
:type="item.icon"
:color="tagcolor"
:title="name"
:size="size"
/>
</div>
<div class="ib" v-else v-for="(li,i) in items" :key="i">
<span v-if="type=='text'" :style="li.style">{{li.name}}</span>
<Tag v-if="type=='tag'" :color="li.tagcolor">{{li.name}}</Tag>
<Badge v-if="type=='dot'" :color="li.tagcolor" :text="li.name" />&nbsp;
<div class="ib" v-else v-for="(li, i) in items" :key="i">
<span v-if="type == 'text'" :style="li.style">{{ li.name }}</span>
<Tag v-if="type == 'tag'" :color="li.tagcolor">{{ li.name }}</Tag>
<Badge v-if="type == 'dot'" :color="li.tagcolor" :text="li.name" />&nbsp;
</div>
<Modal v-model="modal" title="生命周期" width="800" footer-hide :mask-closable="false">
<component :is="detail" :code="code" :value="value" :mode="mode" />
<Modal
v-model="modal"
title="生命周期"
width="800"
footer-hide
:mask-closable="false"
>
<component :is="detail" :code="code" :value="value" :mode="mode" />
</Modal>
</div>
</template>
......@@ -21,48 +33,52 @@ export default {
name: "state",
data() {
return {
mode:'0',
mode: "0",
name: "",
isMore: false,
modal:false,
modal: false,
item: {},
items: [],
data: [],
detail:null,
detail: null,
};
},
props: {
default: {
type: String,
default: ""
default: "",
},
type: {
type: String,
default: "text",
validator: function(value) {
validator: function (value) {
return ["text", "tag", "dot", "icon"].indexOf(value) != -1;
}
},
},
code: {
type: String,
required: true
required: true,
},
value: {
type: [String, Number],
required: false
required: false,
},
color: {
type: Boolean,
default: true
default: true,
},
size: {
type: Number,
default: 24,
},
icon: {
type: Boolean,
default: false
default: false,
},
img: {
type: Boolean,
default: false
}
default: false,
},
},
created() {
this.data = this.$store.getters.dictionaryByKey(this.code) || [];
......@@ -71,7 +87,7 @@ export default {
setName(v) {
if ((v + "").indexOf(",") == -1) {
var item;
this.data.map(u => {
this.data.map((u) => {
if (u.code == v) {
item = u;
}
......@@ -81,7 +97,7 @@ export default {
this.item = item;
} else {
if (this.value == "undefined") {
this.name = ' '
this.name = " ";
} else {
this.name = this.value;
}
......@@ -90,7 +106,7 @@ export default {
this.isMore = true;
var items = [];
var ul = (v + "").split(",");
this.data.map(u => {
this.data.map((u) => {
if (ul.indexOf(u.code) > -1) {
u.tagcolor = u.color | "default";
u.style = { color: u.color | "inherit" };
......@@ -99,11 +115,11 @@ export default {
});
this.items = items;
}
}
,showLife(){
this.modal= true ;
this.detail=()=>import("./life");
}
},
showLife() {
this.modal = true;
this.detail = () => import("./life");
},
},
computed: {
tagcolor() {
......@@ -125,9 +141,9 @@ export default {
color:
this.item && this.item.color != "" && this.item.color != null
? this.item.color
: "inherit"
: "inherit",
};
}
},
},
watch: {
value(v) {
......@@ -139,7 +155,7 @@ export default {
this.setName(this.value);
this.$forceUpdate();
}
}
}
},
},
};
</script>
\ No newline at end of file
......@@ -87,7 +87,7 @@
style="width: 300px"
></DatePicker> </FormItem
></Col>
<!-- <TimeDifference :timeValue="timeValue" :wrok="1"></TimeDifference> -->
<!-- <DateDRange :timeValue="timeValue" :wrok="1"></DateDRange> -->
<Col :span="12"
><FormItem :label="l('type')" prop="type">
<Dictionary
......
......@@ -88,6 +88,19 @@ export default {
);
},
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "left",
high: true,
type: 'user'
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
high: true,
},
{
title: '操作',
key: 'action',
......
<template>
<div>
<div class="formBg">
<Form ref="formInline" :model="easySearch" inline>
<FormItem style="float:right">
<Button type="primary" @click="add" v-if="false">新增记录</Button>
</FormItem>
</Form>
</div>
<div>
<div class="group">
<Row>
<Col span="24">
<Timeline v-if="recordList&&recordList.length>0">
<TimelineItem v-for="(item,index) in recordList" :key="index" v-if="recordList&&recordList.length>0">
<p class="content">{{item.creationTime}}</p>
<p class="content">
操作员:<User :value="item.creatorUserId"></User>
</p>
<p class="content">
工时:{{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>
</TimelineItem>
</Timeline>
<p class="content" v-else>暂无数据</p>
</Col>
</Row>
</div>
</div>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
<Modal v-model="modalFiles" title="查看附件" width="800" footer-hide :mask-closable="false">
<FilesView ref="refFile" :parms="parms" />
</Modal>
</div>
</template>
<script>
import Api from './api'
import Search from './search'
export default {
name: 'list',
components: {
Search
},
head: {
title: "项目的工作记录",
author: "henq",
description: "project_plan_record 10/20/2020 2:55:13 PM",
},
props: {
eid: String
},
data() {
return {
action: Api.index,
easySearch: {
keys: {
op: "title",
value: null
}
},
modalFiles: false,
modal: false,
title: "新增",
detail: null,
curId: '',
columns: [{
key: "id",
title: this.$t("id"),
hide: true,
align: "left",
high: true
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
high: true
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "left",
high: true
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
align: "left",
high: true
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
align: "left",
high: true
},
{
key: "isDeleted",
title: this.l("isDeleted"),
align: "left",
high: true
},
{
key: "deletionTime",
title: this.l("deletionTime"),
align: "left",
high: true
},
{
key: "deleterUserId",
title: this.l("deleterUserId"),
align: "left",
high: true
},
{
key: "projectId",
title: this.l("projectId"),
align: "left",
high: true
},
{
key: "planId",
title: this.l("planId"),
align: "left",
high: true
},
{
key: "workHour",
title: this.l("workHour"),
align: "left",
high: true
},
{
key: "status",
title: this.l("status"),
align: "left",
high: true,
code: 'mes.project_plan_record.Status'
},
{
key: "title",
title: this.l("title"),
align: "left",
easy: true,
high: true
},
{
key: "note",
title: this.l("note"),
align: "left",
high: true
},
{
key: "attachment",
title: this.l("attachment"),
align: "left",
high: true
},
{
key: "taskId",
title: this.l("taskId"),
align: "left",
high: true
},
{
title: '操作',
key: 'action',
width: 140,
align: 'center',
render: (h, params) => {
return h('div', {
class: "action"
}, [
h('op', {
attrs: {
oprate: 'detail'
},
on: {
click: () => this.view(params.row.id)
}
}, '查看'),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h('op', {
attrs: {
oprate: 'edit'
},
on: {
click: () => this.edit(params.row.id)
}
}, '编辑'),
h('op', {
attrs: {
oprate: 'delete'
},
on: {
click: () => this.remove(params.row.id)
}
}, '删除')
])
}
},
],
recordList: [],
parms: {
app: "taskRecord",
eid: null,
name: "",
field: "",
},
listTitle: '所有',
listTime: '截止当前:' + this.$u.getToday()
}
},
mounted() {
if (this.eid != '' && this.eid != null) {
this.load(this.eid);
}
},
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods: {
load(v) {
//alert("aaa____" + v)
let params = {
conditions: [{
fieldName: "taskId",
fieldValue: v,
conditionalType: "Equal",
}],
sortBy: "creationTime",
isDesc: false,
}
Api.list(params).then(r => {
if (r.success) {
this.recordList = r.result
}
})
},
ok() {
this.load(this.eid)
this.modal = false
this.curId = '';
},
search() {
this.$refs.grid.reload(this.easySearch)
},
add() {
this.curId = this.eid;
this.title = "新增记录";
this.detail = () => import('./add')
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import('./add')
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import('./detail')
this.modal = true;
},
edit(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import('./edit')
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success('删除成功')
}
})
},
cancel() {
this.curId = 0;
this.modal = false
},
viewFiles(val) {
this.parms.eid = val;
this.modalFiles = true;
},
l(key) {
let vkey = "project_plan_record" + "." + key;
return this.$t(vkey) || key
}
},
watch: {
eid(v) {
if (v != '' && v != null) {
this.load(v);
}
}
}
}
</script>
<style lang="less">
.formBg {
padding-top: 10px;
background: #f5f5f5;
line-height: 30px;
}
.formBg .taskMenu .ivu-menu-horizontal {
background: #f5f5f5;
}
.group {
margin-top: 15px;
}
.group .ivu-row {
border: none
}
.time {
font-size: 14px;
font-weight: bold;
}
.content {
padding-left: 5px;
}
.boxBoder {
border: 2px solid #2db7f5;
border-radius: 5px;
padding: 10px 20px
}
.dividerpram {
background-color: #2db7f5;
height: 2px
}
</style>
......@@ -15,6 +15,11 @@
<UserSelect ref="userSelected" v-model="entity.userId" />
</FormItem>
</Col>
<Col :span="12">
<FormItem label="计划起止日期" prop="date">
<DatePicker type="datetimerange" format="yyyy-MM-dd" v-model="date" placeholder="请选择时间范围" @on-change="changeFormat" style="width: 300px"></DatePicker>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('note')" prop="note">
<i-quill v-model="entity.note" :height="300" v-paste="handleImg" />
......@@ -40,29 +45,16 @@ export default {
return {
disabled: false,
entity: {
creationTime: null,
creatorUserId: null,
lastModificationTime: null,
lastModifierUserId: null,
isDeleted: null,
deletionTime: null,
deleterUserId: null,
title: "",
planId: null,
projectId: null,
planId: '',
projectId: '',
level: null,
status: null,
projectTitle: "",
planTitle: "",
userIds: "",
userId: "",
endDate: null,
note: "",
startDate: null,
plansToStartDate: null,
plansToEndTime: null,
completePercentage: null,
upTaskId: null
},
rules: {
name: [{
......@@ -124,6 +116,10 @@ export default {
this.entity.id = 0;
});
},
changeFormat(val) {
this.entity.plansToStartDate = val[0];
this.entity.plansToEndTime = val[1];
},
handleImg(e) {
console.warn(e)
let file = null
......
<template>
<div class="detail" style="width:100%">
<Row style="height:284px">
<Filed :span="6" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="6" :name="l('creatorUserId')">
<User :value="entity.creatorUserId"></User>
</Filed>
<Filed :span="6" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="6" :name="l('level')">
<state code="project.task.level" :value="entity.level" type="text"></state>
</Filed>
<Filed :span="6" :name="l('status')">
<state code="project.task.status" :value="entity.status" type="text"></state>
</Filed>
<Filed :span="6" :name="l('userId')">{{entity.userId}}</Filed>
<Filed :span="6" :name="l('endDate')">{{entity.endDate}}</Filed>
<Filed :span="6" :name="l('startDate')">{{entity.startDate}}</Filed>
<Filed :span="24" :name="l('note')">
<div style="height:200px" v-html="entity.note" class="tex_in10"></div>
</Filed>
</Row>
<component :is="detail" :eid="curId" />
<div class="detail" 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')">
<state code="project.task.level" :value="entity.level" type="text"></state>
</Filed>
<Filed :span="12" :name="l('status')">
<state code="project.task.status" :value="entity.status" type="text"></state>
</Filed>
<Filed :span="12" :name="l('userId')">
<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')">
<User :value="entity.creatorUserId"></User>
</Filed>
</Row>
</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>
</FooterToolbar>
</div>
</template>
<script>
import Api from './api'
import ApiTask from '../task/api'
export default {
name: 'Add',
data() {
return {
entity: {},
timeValue: {
startDate: "",
endDate: "",
},
timeValuePlan: {
startDate: "",
endDate: "",
},
divHeight: '200px',
rules: {
name: [{
required: true,
......@@ -49,10 +74,18 @@ export default {
props: {
eid: String
},
created() {
this.divHeight = window.innerHeight - 150 + 'px'
},
mounted() {
if (this.eid != '' && this.eid != null) {
this.load(this.eid);
}
window.onresize = () => {
return (() => {
this.divHeight = window.innerHeight - 150 + 'px'
})()
}
},
methods: {
load(v) {
......@@ -60,12 +93,44 @@ export default {
id: v
}).then(r => {
this.entity = r.result;
this.$emit('on-load')
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/index1')
this.detail = () => import('../record/recordTimeLine')
})
},
updatepart(valStatus) {
let params = {
id: this.eid,
status: valStatus
}
if (valStatus == 1) {
params.startDate = ''
}
if (valStatus == 2) {
params.endDate = ''
}
ApiTask.updatepart(params).then(r => {
if (r.success) {
this.$Message.success('操作成功')
this.$emit('on-ok')
} else {
this.$Message.error('操作失败')
}
}).catch(err => {
this.disabled = false;
this.$Message.error('操作失败')
console.warn(err)
})
},
handleClose() {
this.$emit('on-close')
},
......@@ -89,4 +154,11 @@ export default {
text-indent: 12px;
text-align: inherit !important;
}
.rightDiv {
width: 18%;
float: left;
padding-left: 50px;
}
</style>
......@@ -9,7 +9,7 @@
</a>
</div>
<Content class="content" :class="!showMenu?'con_bord':''">
<DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch" :lazy="true" :set="false">
<DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch" :lazy="true">
<template slot="easySearch">
<Form ref="formInline" inline>
<FormItem>
......@@ -145,7 +145,7 @@ export default {
oprate: 'detail'
},
on: {
click: () => this.viewRecord(params.row.id)
click: () => this.viewRecord(params.row.id, params.row.status)
}
}, params.row.title)
}
......@@ -155,29 +155,15 @@ export default {
title: this.l("level"),
align: "center",
high: true,
width: 80,
code: 'project.task.level'
},
{
key: "projectTitle",
title: this.l("projectTitle"),
align: "left",
easy: true,
high: true,
hide: true,
},
{
key: "planTitle",
title: this.l("planTitle"),
align: "left",
easy: true,
high: true,
hide: true,
},
{
key: "status",
title: this.l("status"),
align: "center",
high: true,
width: 120,
code: 'project.task.status'
},
......@@ -190,21 +176,46 @@ export default {
},
{
key: "startDate",
title: this.l("startDate"),
title: '计划起止日期',
align: "center",
high: true,
width: 200,
render: (h, params) => {
return h('TimeDifference', {
props: {
timeValue: {
startDate: params.row.plansToStartDate,
endDate: params.row.plansToEndTime,
},
work: 0
}
})
}
},
{
key: "endDate",
title: this.l("endDate"),
key: "startDate",
title: '实际起止日期',
align: "center",
high: true,
width: 200,
render: (h, params) => {
return h('TimeDifference', {
props: {
timeValue: {
startDate: params.row.startDate,
endDate: params.row.endDate,
},
work: 1
}
})
}
},
{
key: "workHour",
title: this.l("workHour"),
align: "center",
align: "right",
high: true,
width: 80,
render: (h, params) => {
return h('a', {
attrs: {
......@@ -223,21 +234,20 @@ export default {
high: true,
hide: true
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
high: true,
hide: true,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "left",
high: true,
hide: true,
type: 'user'
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "center",
high: true,
width: 150,
},
{
title: '操作',
key: 'action',
......@@ -253,33 +263,22 @@ export default {
type: "icon",
oprate: "edit",
title: params.row.status == 0 ? "开始" : params.row.status == 2 ? "继续" : '',
//disable: (params.row.status == 0 || params.row.status == 2) ? false : true
disable: params.row.status
},
on: {
click: () => this.updatepart(params.row.id, 1)
}
}),
// h('op', {
// attrs: {
// icon: "ios-pause",
// type: "icon",
// title: "暂停",
// //disable: params.row.status == 1 ? false : true
// },
// on: {
// click: () => this.updatepart(params.row.id, 2)
// }
// }),
h('op', {
attrs: {
icon: "ios-alarm",
type: "icon",
oprate: "edit",
title: "完成",
//disable: (params.row.status != 0 && params.row.status != 3) ? false : true
disable: params.row.status == 1 ? 0 : 1
},
on: {
click: () => this.updatepart(params.row.id, 3)
click: () => this.updatepart(params.row.id, 2)
}
}),
h('op', {
......@@ -288,7 +287,7 @@ export default {
type: "icon",
oprate: "add",
title: "新增记录",
// disable: (params.row.status != 3 && params.row.status != 4) ? false : true
disable: params.row.status == 1 ? 0 : 1
},
on: {
click: () => this.addRecord(params.row.id)
......@@ -300,7 +299,7 @@ export default {
type: "icon",
oprate: "edit",
title: "修改",
//disable: (params.row.status == 0 || params.row.status == 2) ? false : true
disable: params.row.status
},
on: {
click: () => this.edit(params.row.id)
......@@ -312,7 +311,7 @@ export default {
type: "icon",
title: "删除",
oprate: 'delete',
// disable: (params.row.status == 0 || params.row.status == 3) ? false : true
disable: params.row.status
},
on: {
click: () => this.remove(params.row.id)
......@@ -439,6 +438,12 @@ export default {
id: valId,
status: valStatus
}
if (valStatus == 1) {
params.startDate = ''
}
if (valStatus == 2) {
params.endDate = ''
}
Api.updatepart(params).then(r => {
if (r.success) {
this.$refs.grid.load();
......@@ -455,8 +460,9 @@ export default {
onSelect(val) {
this.$refs.grid.reload(this.easySearch)
},
viewRecord(id) {
viewRecord(id, status) {
this.curId = id;
this.tastkStatus = status;
this.title = "查看记录";
this.fullScreen = true;
this.detail = () => import('./detail')
......
......@@ -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 TimeDifference from '@/components/page/timeDifference.vue'
import DateDRange 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("TimeDifference", TimeDifference)
Vue.component("DateDRange", DateDRange)
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