Commit 43dd63ed authored by renjintao's avatar renjintao

task

parent a5776103
...@@ -53,8 +53,8 @@ export default { ...@@ -53,8 +53,8 @@ export default {
userIds: "", userIds: "",
userId: "", userId: "",
note: "", note: "",
planStartDate: null, planstartdate: null,
planEndDate: null, planenddate: null,
}, },
rules: { rules: {
name: [{ name: [{
...@@ -117,8 +117,8 @@ export default { ...@@ -117,8 +117,8 @@ export default {
}); });
}, },
changeFormat(val) { changeFormat(val) {
this.entity.planStartDate = val[0]; this.entity.planstartdate = val[0];
this.entity.planEndDate = val[1]; this.entity.planenddate = val[1];
}, },
handleImg(e) { handleImg(e) {
console.warn(e) console.warn(e)
......
...@@ -54,8 +54,7 @@ ...@@ -54,8 +54,7 @@
</Tabs> </Tabs>
</div> </div>
</FormItem> </FormItem>
<FormItem prop="keys"><Input placeholder="请输入项目标题/计划名称/任务标题" v-model="easySearch.keys.value" v-width="240" /> <FormItem prop="keys"><Input placeholder="请输入项目标题/计划名称/任务标题" v-model="easySearch.keys.value" v-width="240" /> </FormItem>
</FormItem>
<FormItem><Button type="primary" @click="search">查询</Button></FormItem> <FormItem><Button type="primary" @click="search">查询</Button></FormItem>
<!-- <!--
<FormItem> <FormItem>
...@@ -83,8 +82,8 @@ ...@@ -83,8 +82,8 @@
</template> </template>
<script> <script>
import Api from "./api"; import Api from './api'
import Search from "./search"; import Search from './search'
export default { export default {
name: 'list', name: 'list',
components: { components: {
...@@ -199,8 +198,8 @@ export default { ...@@ -199,8 +198,8 @@ export default {
return h('TimeDifference', { return h('TimeDifference', {
props: { props: {
timeValue: { timeValue: {
startDate: params.row.planStartDate, startDate: params.row.planstartdate,
endDate: params.row.planEndDate, endDate: params.row.planenddate,
}, },
work: 1 work: 1
} }
...@@ -383,124 +382,79 @@ export default { ...@@ -383,124 +382,79 @@ export default {
this.modal = false this.modal = false
this.curId = 0; this.curId = 0;
}, },
projectId: { search() {
op: "Equal", this.easySearch.planId.value = this.planIdsCur
value: "", this.$refs.grid.reload(this.easySearch)
},
planId: {
op: "In",
value: [],
}, },
}, add() {
theme1: "light", this.curId = this.projectId;
modal: false, this.title = "新增";
title: "新增", this.fullScreen = false;
detail: null, this.detail = () => import('./add')
curId: "", this.modal = true;
fullScreen: false,
projectId: "",
columns: [
// {
// key: "selection",
// type: "selection",
// width: 50,
// align: "center"
// },
{
key: "id",
title: this.$t("id"),
align: "left",
high: true,
hide: true,
}, },
{ highSearch() {
key: "title", this.curId = 0;
title: this.l("title"), this.title = "高级搜索";
align: "left", this.fullScreen = false;
easy: true, this.detail = () => import('./search')
high: true, this.modal = true;
render: (h, params) => {
return h(
"a", {
attrs: {
oprate: "detail",
},
on: {
click: () => this.viewRecord(params.row.id),
},
},
params.row.title
);
},
}, },
{ copy(id) {
key: "level", this.curId = id;
title: this.l("level"), this.title = "克隆";
align: "center", this.fullScreen = false;
high: true, this.detail = () => import('./add')
code: "project.task.level", this.modal = true;
}, },
{ view(id) {
key: "projectTitle", this.curId = id;
title: this.l("projectTitle"), this.title = "详情";
align: "left", this.fullScreen = false;
easy: true, this.detail = () => import('./detail')
high: true, this.modal = true;
hide: true,
}, },
{ edit(id) {
key: "planTitle", this.curId = id;
title: this.l("planTitle"), this.title = "编辑";
align: "left", this.fullScreen = false;
easy: true, this.detail = () => import('./edit')
high: true, this.modal = true;
hide: true,
}, },
{ remove(id) {
key: "status", Api.delete(id).then((r) => {
title: this.l("status"), if (r.success) {
align: "center", this.$refs.grid.load();
high: true, this.$Message.success('删除成功')
code: "project.task.status", }
})
}, },
cancel() {
{ this.curId = 0;
key: "userId", this.modal = false
title: this.l("userId"),
align: "left",
high: true,
type: "user",
}, },
{ onHide() {
key: "startDate", // this.$Message.info("收起左侧树")
title: this.l("startDate"), this.showMenu = false;
align: "center",
high: true,
}, },
{ showMenuFn() {
key: "endDate", //this.$Message.info("展开左侧树")
title: this.l("endDate"), this.showMenu = true;
align: "center",
high: true,
}, },
{ productSearch(id, item, planIds) {
key: "workHour", this.planId = item.selected ? id : '';
title: this.l("workHour"), this.planIdsCur = item.selected ? planIds : []
align: "center", let where = {
high: true, planId: {
render: (h, params) => { op: "In",
return h( value: item.selected ? planIds : []
"a", { },
attrs: { projectId: {
oprate: "detail", op: "Equal",
}, value: this.eid
on: { },
click: () => this.viewWork(params.row.id), };
}, this.$refs.grid.reload(where);
},
params.row.workHour
);
},
}, },
updatepart(valId, valStatus) { updatepart(valId, valStatus) {
let params = { let params = {
...@@ -526,284 +480,46 @@ export default { ...@@ -526,284 +480,46 @@ export default {
console.warn(err) console.warn(err)
}) })
}, },
{ onSelect(val) {
key: "creationTime", this.$refs.grid.reload(this.easySearch)
title: this.l("creationTime"),
align: "left",
high: true,
hide: true,
}, },
viewRecord(id) { viewRecord(id) {
this.curId = id; this.curId = id;
this.title = "查看记录"; this.title = "查看记录";
this.fullScreen = false; this.fullScreen = true;
this.detail = () => import('./detail') this.detail = () => import('./detail')
this.modal = true; this.modal = true;
}, },
{ viewWork(id) {
title: "操作", this.curId = id;
key: "action", this.title = "查看工时";
width: 200, this.fullScreen = false;
align: "center", this.detail = () => import('../record')
render: (h, params) => { this.modal = true;
return h(
"div", {
class: "action",
},
[
h("op", {
attrs: {
icon: "md-arrow-dropright-circle",
type: "icon",
oprate: "edit",
title: params.row.status == 0 ?
"开始" :
params.row.status == 2 ?
"继续" :
"",
//disable: (params.row.status == 0 || params.row.status == 2) ? false : true
},
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
},
on: {
click: () => this.updatepart(params.row.id, 3),
},
}),
h("op", {
attrs: {
icon: "md-add",
type: "icon",
oprate: "add",
title: "新增记录",
// disable: (params.row.status != 3 && params.row.status != 4) ? false : true
},
on: {
click: () => this.addRecord(params.row.id),
},
}),
h("op", {
attrs: {
icon: "md-create",
type: "icon",
oprate: "edit",
title: "修改",
//disable: (params.row.status == 0 || params.row.status == 2) ? false : true
},
on: {
click: () => this.edit(params.row.id),
},
}),
h("op", {
attrs: {
icon: "md-trash",
type: "icon",
title: "删除",
oprate: "delete",
// disable: (params.row.status == 0 || params.row.status == 3) ? false : true
},
on: {
click: () => this.remove(params.row.id),
},
}),
]
);
},
},
],
data1: [{
id: 1,
title: "测试title",
}, ],
data: [],
planId: "", //当前计划Id
planIdsCur: [],
};
},
props: {
eid: String,
},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
}, },
created() { addRecord(id) {
if (this.eid != "") { this.curId = id;
this.projectId = this.eid; this.title = "新增记录";
this.easySearch.projectId.value = this.eid; this.fullScreen = false;
} this.detail = () => import('../record/add')
this.treeHeight = window.innerHeight - 150; this.modal = true;
}, },
mounted() { l(key) {
if (this.eid != "") { let vkey = "project_task" + "." + key;
this.easySearch.projectId.value = this.eid; return this.$t(vkey) || key
this.$refs.grid.reload(this.easySearch); }
},
watch: {
eid(v) {
if (v != "") {
this.eid = v
} }
}, }
methods: { }
ok() { }
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.easySearch.planId.value = this.planIdsCur;
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = this.projectId;
this.title = "新增";
this.fullScreen = false;
this.detail = () => import("./add");
this.modal = true;
},
highSearch() {
this.curId = 0;
this.title = "高级搜索";
this.fullScreen = false;
this.detail = () => import("./search");
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.fullScreen = false;
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.fullScreen = false;
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.curId = id;
this.title = "编辑";
this.fullScreen = false;
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;
},
onHide() {
// this.$Message.info("收起左侧树")
this.showMenu = false;
},
showMenuFn() {
//this.$Message.info("展开左侧树")
this.showMenu = true;
},
productSearch(id, item, planIds) {
this.planId = item.selected ? id : "";
this.planIdsCur = item.selected ? planIds : [];
let where = {
planId: {
op: "In",
value: item.selected ? planIds : [],
},
projectId: {
op: "Equal",
value: this.eid,
},
};
this.$refs.grid.reload(where);
},
updatepart(valId, valStatus) {
let params = {
id: valId,
status: valStatus,
};
Api.updatepart(params)
.then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("操作成功");
} else {
this.$Message.error("操作失败");
}
})
.catch((err) => {
this.disabled = false;
this.$Message.error("操作失败");
console.warn(err);
});
},
onSelect(val) {
this.$refs.grid.reload(this.easySearch);
},
viewRecord(id) {
this.curId = id;
this.title = "查看记录";
this.fullScreen = true;
this.detail = () => import("./detail");
this.modal = true;
},
viewWork(id) {
this.curId = id;
this.title = "查看工时";
this.fullScreen = false;
this.detail = () => import("../record");
this.modal = true;
},
addRecord(id) {
this.curId = id;
this.title = "新增记录";
this.fullScreen = false;
this.detail = () => import("../record/add");
this.modal = true;
},
l(key) {
let vkey = "project_task" + "." + key;
return this.$t(vkey) || key;
},
},
watch: {
eid(v) {
if (v != "") {
this.eid = v;
}
},
},
};
</script> </script>
<style lang="less"> <style lang="less">
@import "../../../assets/css/custom.less";
.full { .full {
margin-top: 0; margin-top: 0;
...@@ -818,23 +534,6 @@ props: { ...@@ -818,23 +534,6 @@ props: {
content: "\f33d"; content: "\f33d";
} }
} }
.ivu-layout-sider {
background: @layout-content-bg-color;
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
// height: 89vh;
overflow: auto;
}
.ivu-layout-content {
margin-left: 5px;
background: @right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto;
padding: 10px;
// height: 89vh;
}
} }
.taskTab .ivu-tabs-bar { .taskTab .ivu-tabs-bar {
......
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