Commit 12a18031 authored by renjintao's avatar renjintao

updatestatus

parent 2d3d17be
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<Col :span="12">
<FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creatorUserId')" prop="creatorUserId">
<InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
<DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isDeleted')" prop="isDeleted">
<InputNumber v-model="entity.isDeleted"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deleterUserId')" prop="deleterUserId">
<InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('projectId')" prop="projectId"> <Input v-model="entity.projectId"> </Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('planId')" prop="planId"> <Input v-model="entity.planId"> </Input>
</FormItem>
</Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('workHour')" prop="workHour"> <FormItem :label="l('workHour')" prop="workHour">
<InputNumber v-model="entity.workHour"></InputNumber> <InputNumber v-model="entity.workHour"></InputNumber>
...@@ -66,11 +24,6 @@ ...@@ -66,11 +24,6 @@
<FormItem :label="l('attachment')" prop="attachment"> <Input v-model="entity.attachment"> </Input> <FormItem :label="l('attachment')" prop="attachment"> <Input v-model="entity.attachment"> </Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12">
<FormItem :label="l('taskId')" prop="taskId">
<Input v-model="entity.taskId"></Input>
</FormItem>
</Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
...@@ -126,6 +79,7 @@ export default { ...@@ -126,6 +79,7 @@ export default {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true; this.disabled = true;
this.entity.taskId = this.eid
Api.create(this.entity).then((r) => { Api.create(this.entity).then((r) => {
this.disabled = false; this.disabled = false;
if (r.success) { if (r.success) {
......
...@@ -80,22 +80,6 @@ ...@@ -80,22 +80,6 @@
<User :value="item.creatorUserId"></User> 关闭了 任务 1089 测试任务 <User :value="item.creatorUserId"></User> 关闭了 任务 1089 测试任务
</p> </p>
</TimelineItem> </TimelineItem>
<TimelineItem>
<p class="content">12:13</p>
<p class="content">管理员 继续了 任务 1089 测试任务</p>
</TimelineItem>
<TimelineItem>
<p class="content">11:54</p>
<p class="content">管理员 暂停了 任务 1089 测试任务</p>
</TimelineItem>
<TimelineItem>
<p class="content">09:20</p>
<p class="content">管理员 开启了 任务 1089 测试任务</p>
</TimelineItem>
<TimelineItem>
<p class="content">09:08</p>
<p class="content">管理员 创建了 任务 1089 测试任务</p>
</TimelineItem>
</Timeline> </Timeline>
</div> </div>
</Col> </Col>
...@@ -297,6 +281,8 @@ export default { ...@@ -297,6 +281,8 @@ export default {
fieldValue: v, fieldValue: v,
conditionalType: "Equal", conditionalType: "Equal",
}], }],
sortBy: "creationTime",
isDesc: false,
} }
Api.list(params).then(r => { Api.list(params).then(r => {
if (r.success) { if (r.success) {
...@@ -306,15 +292,15 @@ export default { ...@@ -306,15 +292,15 @@ export default {
}) })
}, },
ok() { ok() {
this.$refs.grid.load() this.load(this.eid)
this.modal = false this.modal = false
this.curId = 0; this.curId = '';
}, },
search() { search() {
this.$refs.grid.reload(this.easySearch) this.$refs.grid.reload(this.easySearch)
}, },
add() { add() {
this.curId = 0; this.curId = this.eid;
this.title = "新增记录"; this.title = "新增记录";
this.detail = () => import('./add') this.detail = () => import('./add')
this.modal = true; this.modal = true;
......
...@@ -12,11 +12,6 @@ ...@@ -12,11 +12,6 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="project.task.status" v-model="entity.status"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('projectTitle')" prop="projectTitle"> <Input v-model="entity.projectTitle"> </Input> <FormItem :label="l('projectTitle')" prop="projectTitle"> <Input v-model="entity.projectTitle"> </Input>
</FormItem> </FormItem>
</Col> </Col>
...@@ -146,6 +141,7 @@ export default { ...@@ -146,6 +141,7 @@ export default {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true; this.disabled = true;
this.entity.status = 0
Api.create(this.entity).then((r) => { Api.create(this.entity).then((r) => {
this.disabled = false; this.disabled = false;
if (r.success) { if (r.success) {
......
...@@ -19,5 +19,9 @@ export default { ...@@ -19,5 +19,9 @@ export default {
}, },
deletes(params) { deletes(params) {
return Api.post(`${material}/projecttask/batchdelete`,params); return Api.post(`${material}/projecttask/batchdelete`,params);
} },
//改变状态
updatestatus(params) {
return Api.post(`${material}/projecttask/updatestatus`,params);
}
} }
\ No newline at end of file
...@@ -239,47 +239,37 @@ export default { ...@@ -239,47 +239,37 @@ export default {
return h('div', { return h('div', {
class: "action" 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', { h('op', {
attrs: { attrs: {
icon: "ios-play", icon: "ios-play",
type: "icon", type: "icon",
title: "继续", title: params.row.status == 0 ? "开始" : params.row.status == 2 ? "继续" : '无法操作',
color: "#19be6b", color: params.row.status == 0 || params.row.status == 2 ? "#19be6b" : '#ccc',
}, },
on: { on: {
click: () => this.edit(params.row.id) click: () => params.row.status == 0 || params.row.status == 2 ? this.updatestatus(params.row.id, 1) : null
} }
}), }),
h('op', { h('op', {
attrs: { attrs: {
icon: "ios-pause", icon: "ios-pause",
type: "icon", type: "icon",
title: "暂停", title: params.row.status == 1 ? "暂停" : "无法操作",
color: "#19be6b", color: params.row.status == 1 ? "#19be6b" : "#ccc",
}, },
on: { on: {
click: () => this.edit(params.row.id) click: () => params.row.status == 1 ? this.updatestatus(params.row.id, 2) : null
} }
}), }),
h('op', { h('op', {
attrs: { attrs: {
icon: "ios-close", icon: "ios-close",
type: "icon", type: "icon",
title: "完成", title: params.row.status != 0 ? "完成" : "无法操作",
color: "#19be6b", color: params.row.status != 0 ? "#19be6b" : "#ccc",
}, },
on: { on: {
click: () => this.edit(params.row.id) click: () => params.row.status != 0 ? this.updatestatus(params.row.id, 3) : null
} }
}), }),
h('op', { h('op', {
...@@ -396,6 +386,19 @@ export default { ...@@ -396,6 +386,19 @@ export default {
}; };
this.$refs.grid.reload(where); this.$refs.grid.reload(where);
}, },
updatestatus(valId, valStatus) {
let params = {
id: valId,
status: valStatus,
detail: ''
}
Api.updatestatus(params).then(r => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success('修改成功')
}
})
},
onSelect(val) { onSelect(val) {
this.$refs.grid.reload(this.easySearch) this.$refs.grid.reload(this.easySearch)
}, },
......
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