Commit 12a18031 authored by renjintao's avatar renjintao

updatestatus

parent 2d3d17be
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<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">
<FormItem :label="l('workHour')" prop="workHour">
<InputNumber v-model="entity.workHour"></InputNumber>
......@@ -66,11 +24,6 @@
<FormItem :label="l('attachment')" prop="attachment"> <Input v-model="entity.attachment"> </Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('taskId')" prop="taskId">
<Input v-model="entity.taskId"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
......@@ -126,6 +79,7 @@ export default {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
this.entity.taskId = this.eid
Api.create(this.entity).then((r) => {
this.disabled = false;
if (r.success) {
......
......@@ -80,22 +80,6 @@
<User :value="item.creatorUserId"></User> 关闭了 任务 1089 测试任务
</p>
</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>
</div>
</Col>
......@@ -297,6 +281,8 @@ export default {
fieldValue: v,
conditionalType: "Equal",
}],
sortBy: "creationTime",
isDesc: false,
}
Api.list(params).then(r => {
if (r.success) {
......@@ -306,15 +292,15 @@ export default {
})
},
ok() {
this.$refs.grid.load()
this.load(this.eid)
this.modal = false
this.curId = 0;
this.curId = '';
},
search() {
this.$refs.grid.reload(this.easySearch)
},
add() {
this.curId = 0;
this.curId = this.eid;
this.title = "新增记录";
this.detail = () => import('./add')
this.modal = true;
......
......@@ -12,11 +12,6 @@
</FormItem>
</Col>
<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>
</Col>
......@@ -146,6 +141,7 @@ export default {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
this.entity.status = 0
Api.create(this.entity).then((r) => {
this.disabled = false;
if (r.success) {
......
......@@ -19,5 +19,9 @@ export default {
},
deletes(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 {
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: {
icon: "ios-play",
type: "icon",
title: "继续",
color: "#19be6b",
title: params.row.status == 0 ? "开始" : params.row.status == 2 ? "继续" : '无法操作',
color: params.row.status == 0 || params.row.status == 2 ? "#19be6b" : '#ccc',
},
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', {
attrs: {
icon: "ios-pause",
type: "icon",
title: "暂停",
color: "#19be6b",
title: params.row.status == 1 ? "暂停" : "无法操作",
color: params.row.status == 1 ? "#19be6b" : "#ccc",
},
on: {
click: () => this.edit(params.row.id)
click: () => params.row.status == 1 ? this.updatestatus(params.row.id, 2) : null
}
}),
h('op', {
attrs: {
icon: "ios-close",
type: "icon",
title: "完成",
color: "#19be6b",
title: params.row.status != 0 ? "完成" : "无法操作",
color: params.row.status != 0 ? "#19be6b" : "#ccc",
},
on: {
click: () => this.edit(params.row.id)
click: () => params.row.status != 0 ? this.updatestatus(params.row.id, 3) : null
}
}),
h('op', {
......@@ -396,6 +386,19 @@ export default {
};
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) {
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