Commit 04eb6985 authored by renjintao's avatar renjintao

record

parent 89336019
......@@ -60,10 +60,11 @@ export default {
message: '必填',
trigger: 'blur'
}],
workHour: [{
workHour: [{
required: true,
message: '必填',
trigger: 'blur'
trigger: 'blur',
type: "number"
}]
}
}
......
......@@ -45,7 +45,7 @@ export default {
required: true,
message: '必填',
trigger: 'blur'
}]
}],
},
parms: {
app: "taskRecord",
......
<template>
<div class="flex">
<div class="fg1" >
<Card>
<p slot="title">任务信息</p>
<div class="detail">
<Row>
<Filed :span="6" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="6" :name="l('creatorUserId')">
<User :value="entity.creatorUserId"/>
</Filed>
<Filed :span="6" :name="l('level')">
<State code="project.task.level" :value="entity.level"/>
</Filed>
<Filed :span="6" :name="l('status')">
<State code="project.task.status" :value="entity.status"/>
</Filed>
<Filed :span="12" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="12" :name="l('userId')">{{entity.userId}}
<User :value="entity.creatorUserId"/>
</Filed>
<Filed :span="24" :name="l('userIds')">
<User v-for="(li,i) in entity.userIds" :value="li" :key="i" class="ml10"/>
</Filed>
<Filed :span="12" :name="l('startDate')"> <DateRange :value="entity"></DateRange></Filed>
<Filed :span="12" :name="l('plansToStartDate')"><DateRange :value="entity" start="plansToStartDate" end="plansToEndTime"></DateRange></Filed>
<Filed :span="24" :name="l('note')">
<div v-html="entity.note"></div>
</Filed>
<div class="flex">
<div class="fg1">
<Card>
<p slot="title">任务信息</p>
<div class="detail">
<Row>
<Filed :span="6" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="6" :name="l('creatorUserId')">
<User :value="entity.creatorUserId" />
</Filed>
<Filed :span="6" :name="l('level')">
<State code="project.task.level" :value="entity.level" />
</Filed>
<Filed :span="6" :name="l('status')">
<State code="project.task.status" :value="entity.status" />
</Filed>
<Filed :span="12" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="12" :name="l('userId')">{{entity.userId}}
<User :value="entity.creatorUserId" />
</Filed>
<Filed :span="24" :name="l('userIds')">
<User v-for="(li,i) in entity.userIds" :value="li" :key="i" class="ml10" />
</Filed>
<Filed :span="12" :name="l('startDate')">
<DateRange :value="entity"></DateRange>
</Filed>
<Filed :span="12" :name="l('plansToStartDate')">
<DateRange :value="entity" start="plansToStartDate" end="plansToEndTime"></DateRange>
</Filed>
<Filed :span="24" :name="l('note')">
<div v-html="entity.note"></div>
</Filed>
<!-- <Filed :span="12" :name="l('plansToEndTime')">{{entity.plansToEndTime}}</Filed> -->
<!-- <Filed :span="12" :name="l('completePercentage')">{{entity.completePercentage}}</Filed>
<!-- <Filed :span="12" :name="l('plansToEndTime')">{{entity.plansToEndTime}}</Filed> -->
<!-- <Filed :span="12" :name="l('completePercentage')">{{entity.completePercentage}}</Filed>
<Filed :span="12" :name="l('upTaskId')">{{entity.upTaskId}}</Filed> -->
</Row>
</div>
</Form>
</Card>
<Card class="mt10" v-if="entity.status!=2">
<p slot="title">任务汇报</p>
<div class="form">
<Form :label-width="120" ref="formValidate">
<Row :gutter="24">
<Col :span="24">
<FormItem label="任务状态">
<RadioGroup v-model="status">
<Radio :label="1">工作中</Radio>
<Radio :label="2">完成</Radio>
<Radio :label="3">冻结</Radio>
</RadioGroup>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="标题" prop="title"> <Input v-model="entitysave.title"/>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="工时" prop="workHour">
<InputNumber v-model="entitysave.workHour" :min="0"></InputNumber>
</FormItem>
</Col>
</Row>
<Col :span="24">
<FormItem label="内容" prop="note">
<Input type="textarea" v-model="entitysave.note" :height="100" />
</FormItem>
</Col>
<Col :span="12">
<FormItem label="附件" prop="attachment">
<files ref="refFile" :parms="parms" files />
</Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button
type="primary"
@click="updatepart"
class="mr10"
>确定</Button
><Button @click="handleClose">取消</Button>
</FormItem>
</Form>
</div>
</Card>
</div>
</Form>
</Card>
<Card class="mt10" v-if="entity.status!=2">
<p slot="title">任务汇报</p>
<div class="form">
<Form :label-width="120" ref="formValidate">
<Row :gutter="24">
<Col :span="24">
<FormItem label="任务状态">
<RadioGroup v-model="status">
<Radio :label="1">工作中</Radio>
<Radio :label="2">完成</Radio>
<Radio :label="3">冻结</Radio>
</RadioGroup>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="标题" prop="title"> <Input v-model="entitysave.title" />
</FormItem>
</Col>
<Col :span="12">
<FormItem label="工时" prop="workHour">
<InputNumber v-model="entitysave.workHour" :min="0"></InputNumber>
</FormItem>
</Col>
<Col :span="24">
<FormItem label="内容" prop="note">
<Input type="textarea" v-model="entitysave.note" :height="100" />
</FormItem>
</Col>
<Col :span="12">
<FormItem label="附件" prop="attachment">
<files ref="refFile" :parms="parms" files />
</Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="updatepart" class="mr10">确定</Button><Button @click="handleClose">取消</Button>
</FormItem>
</Form>
</div>
</Card>
</div>
<div v-width="500" class="pl20">
<Card>
......@@ -90,136 +89,134 @@
<component :is="detail" :eid="curId" />
</Card>
</div>
</div>
</div>
</template>
<script>
import Api from "./api";
import ApiRecord from "../record/api";
export default {
name: "Add",
data() {
return {
entity: {},
parms: {
app: "taskRecord",
eid: null,
name: "",
field: "",
},
status: null,
entitysave: {
projectId: "",
planId: "",
workHour: 0,
title: "",
note: "",
attachment: "",
taskId: "",
},
timeValue: {
startDate: "",
endDate: "",
},
timeValuePlan: {
startDate: "",
endDate: "",
},
divHeight: "200px",
rules: {
title: [
{
required: true,
message: "必填",
trigger: "blur",
},
],
workHour: [
{
required: true,
message: "必填",
trigger: "blur",
},
],
},
detail: null,
curId: "",
};
},
props: {
eid: String,
},
created() {},
mounted() {
if (this.eid) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({
id: v,
}).then((r) => {
this.entity = r.result;
this.status = this.entity.status;
this.entitysave.projectId = this.entity.projectId;
this.entitysave.planId = this.entity.planId;
this.entitysave.taskId = this.eid;
//控制radio显示end
this.$emit("on-load");
this.curId = v;
this.detail = () => import("../record/recordTimeLine");
});
},
updatepart() {
if (this.status != this.entity.status) {
let params = {
id: this.eid,
status: this.status,
name: "Add",
data() {
return {
entity: {},
parms: {
app: "taskRecord",
eid: null,
name: "",
field: "",
},
status: null,
entitysave: {
projectId: "",
planId: "",
workHour: 0,
title: "",
note: "",
attachment: "",
taskId: "",
},
timeValue: {
startDate: "",
endDate: "",
},
timeValuePlan: {
startDate: "",
endDate: "",
},
divHeight: "200px",
rules: {
title: [{
required: true,
message: "必填",
trigger: "blur",
}, ],
workHour: [{
required: true,
message: "必填",
trigger: "blur",
type: "number"
}, ],
},
detail: null,
curId: "",
};
Api.updatepart(params).then((r) => {
if (r.success) {
this.$Message.success("任务状态汇报成功");
this.$emit("on-ok");
} else {
this.$Message.error("操作失败");
}
});
}
ApiRecord.create(this.entitysave).then((res) => {
if (res.success) {
this.$Message.success("工时汇报成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
});
},
handleClose() {
this.$emit("on-close");
props: {
eid: String,
},
created() {},
mounted() {
if (this.eid) {
this.load(this.eid);
}
},
l(key) {
key = "project_task" + "." + key;
return this.$t(key);
methods: {
load(v) {
Api.get({
id: v,
}).then((r) => {
this.entity = r.result;
this.status = this.entity.status;
this.entitysave.projectId = this.entity.projectId;
this.entitysave.planId = this.entity.planId;
this.entitysave.taskId = this.eid;
//控制radio显示end
this.$emit("on-load");
this.curId = v;
this.detail = () => import("../record/recordTimeLine");
});
},
updatepart() {
if (this.status != this.entity.status) {
let params = {
id: this.eid,
status: this.status,
};
Api.updatepart(params).then((r) => {
if (r.success) {
this.$Message.success("任务状态汇报成功");
this.$emit("on-ok");
} else {
this.$Message.error("操作失败");
}
});
}
ApiRecord.create(this.entitysave).then((res) => {
if (res.success) {
this.$Message.success("工时汇报成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "project_task" + "." + key;
return this.$t(key);
},
},
},
watch: {
eid(v) {
if (v) {
this.load(v);
}
watch: {
eid(v) {
if (v) {
this.load(v);
}
},
},
},
};
</script>
<style scoped>
.tex_in10 {
text-align: inherit !important;
text-align: inherit !important;
}
.rightDiv {
width: 18%;
float: left;
padding-left: 50px;
width: 18%;
float: left;
padding-left: 50px;
}
</style>
......@@ -259,7 +259,7 @@ export default {
icon: "ios-alarm",
type: "icon",
oprate: "edit",
title: "报工作",
title: "报工作",
disable: params.row.status == 1 || params.row.status == 3 ? false : true
},
on: {
......
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