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,341 +382,56 @@ export default { ...@@ -383,341 +382,56 @@ export default {
this.modal = false this.modal = false
this.curId = 0; this.curId = 0;
}, },
projectId: {
op: "Equal",
value: "",
},
planId: {
op: "In",
value: [],
},
},
theme1: "light",
modal: false,
title: "新增",
detail: null,
curId: "",
fullScreen: false,
projectId: "",
columns: [
// {
// key: "selection",
// type: "selection",
// width: 50,
// align: "center"
// },
{
key: "id",
title: this.$t("id"),
align: "left",
high: true,
hide: true,
},
{
key: "title",
title: this.l("title"),
align: "left",
easy: true,
high: true,
render: (h, params) => {
return h(
"a", {
attrs: {
oprate: "detail",
},
on: {
click: () => this.viewRecord(params.row.id),
},
},
params.row.title
);
},
},
{
key: "level",
title: this.l("level"),
align: "center",
high: true,
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,
code: "project.task.status",
},
{
key: "userId",
title: this.l("userId"),
align: "left",
high: true,
type: "user",
},
{
key: "startDate",
title: this.l("startDate"),
align: "center",
high: true,
},
{
key: "endDate",
title: this.l("endDate"),
align: "center",
high: true,
},
{
key: "workHour",
title: this.l("workHour"),
align: "center",
high: true,
render: (h, params) => {
return h(
"a", {
attrs: {
oprate: "detail",
},
on: {
click: () => this.viewWork(params.row.id),
},
},
params.row.workHour
);
},
},
updatepart(valId, valStatus) {
let params = {
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();
this.$Message.success('操作成功')
} else {
this.$Message.error('操作失败')
}
}).catch(err => {
this.disabled = false;
this.$Message.error('操作失败')
console.warn(err)
})
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
high: true,
hide: true,
},
viewRecord(id) {
this.curId = id;
this.title = "查看记录";
this.fullScreen = false;
this.detail = () => import('./detail')
this.modal = true;
},
{
title: "操作",
key: "action",
width: 200,
align: "center",
render: (h, params) => {
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() {
if (this.eid != "") {
this.projectId = this.eid;
this.easySearch.projectId.value = this.eid;
}
this.treeHeight = window.innerHeight - 150;
},
mounted() {
if (this.eid != "") {
this.easySearch.projectId.value = this.eid;
this.$refs.grid.reload(this.easySearch);
}
},
methods: {
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() { search() {
this.easySearch.planId.value = this.planIdsCur; this.easySearch.planId.value = this.planIdsCur
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch)
}, },
add() { add() {
this.curId = this.projectId; this.curId = this.projectId;
this.title = "新增"; this.title = "新增";
this.fullScreen = false; this.fullScreen = false;
this.detail = () => import("./add"); this.detail = () => import('./add')
this.modal = true; this.modal = true;
}, },
highSearch() { highSearch() {
this.curId = 0; this.curId = 0;
this.title = "高级搜索"; this.title = "高级搜索";
this.fullScreen = false; this.fullScreen = false;
this.detail = () => import("./search"); this.detail = () => import('./search')
this.modal = true; this.modal = true;
}, },
copy(id) { copy(id) {
this.curId = id; this.curId = id;
this.title = "克隆"; this.title = "克隆";
this.fullScreen = false; this.fullScreen = false;
this.detail = () => import("./add"); this.detail = () => import('./add')
this.modal = true; this.modal = true;
}, },
view(id) { view(id) {
this.curId = id; this.curId = id;
this.title = "详情"; this.title = "详情";
this.fullScreen = false; this.fullScreen = false;
this.detail = () => import("./detail"); this.detail = () => import('./detail')
this.modal = true; this.modal = true;
}, },
edit(id) { edit(id) {
this.curId = id; this.curId = id;
this.title = "编辑"; this.title = "编辑";
this.fullScreen = false; this.fullScreen = false;
this.detail = () => import("./edit"); this.detail = () => import('./edit')
this.modal = true; this.modal = true;
}, },
remove(id) { remove(id) {
Api.delete(id).then((r) => { Api.delete(id).then((r) => {
if (r.success) { if (r.success) {
this.$refs.grid.load(); this.$refs.grid.load();
this.$Message.success("删除成功"); this.$Message.success('删除成功')
} }
}); })
}, },
cancel() { cancel() {
this.curId = 0; this.curId = 0;
this.modal = false; this.modal = false
}, },
onHide() { onHide() {
// this.$Message.info("收起左侧树") // this.$Message.info("收起左侧树")
...@@ -728,16 +442,16 @@ props: { ...@@ -728,16 +442,16 @@ props: {
this.showMenu = true; this.showMenu = true;
}, },
productSearch(id, item, planIds) { productSearch(id, item, planIds) {
this.planId = item.selected ? id : ""; this.planId = item.selected ? id : '';
this.planIdsCur = item.selected ? planIds : []; this.planIdsCur = item.selected ? planIds : []
let where = { let where = {
planId: { planId: {
op: "In", op: "In",
value: item.selected ? planIds : [], value: item.selected ? planIds : []
}, },
projectId: { projectId: {
op: "Equal", op: "Equal",
value: this.eid, value: this.eid
}, },
}; };
this.$refs.grid.reload(where); this.$refs.grid.reload(where);
...@@ -745,65 +459,67 @@ props: { ...@@ -745,65 +459,67 @@ props: {
updatepart(valId, valStatus) { updatepart(valId, valStatus) {
let params = { let params = {
id: valId, id: valId,
status: valStatus, status: valStatus
}; }
Api.updatepart(params) if (valStatus == 1) {
.then((r) => { params.startDate = ''
}
if (valStatus == 2) {
params.endDate = ''
}
Api.updatepart(params).then(r => {
if (r.success) { if (r.success) {
this.$refs.grid.load(); this.$refs.grid.load();
this.$Message.success("操作成功"); this.$Message.success('操作成功')
} else { } else {
this.$Message.error("操作失败"); this.$Message.error('操作失败')
} }
}) }).catch(err => {
.catch((err) => {
this.disabled = false; this.disabled = false;
this.$Message.error("操作失败"); this.$Message.error('操作失败')
console.warn(err); console.warn(err)
}); })
}, },
onSelect(val) { onSelect(val) {
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch)
}, },
viewRecord(id) { viewRecord(id) {
this.curId = id; this.curId = id;
this.title = "查看记录"; this.title = "查看记录";
this.fullScreen = true; this.fullScreen = true;
this.detail = () => import("./detail"); this.detail = () => import('./detail')
this.modal = true; this.modal = true;
}, },
viewWork(id) { viewWork(id) {
this.curId = id; this.curId = id;
this.title = "查看工时"; this.title = "查看工时";
this.fullScreen = false; this.fullScreen = false;
this.detail = () => import("../record"); this.detail = () => import('../record')
this.modal = true; this.modal = true;
}, },
addRecord(id) { addRecord(id) {
this.curId = id; this.curId = id;
this.title = "新增记录"; this.title = "新增记录";
this.fullScreen = false; this.fullScreen = false;
this.detail = () => import("../record/add"); this.detail = () => import('../record/add')
this.modal = true; this.modal = true;
}, },
l(key) { l(key) {
let vkey = "project_task" + "." + key; let vkey = "project_task" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key
}, }
}, },
watch: { watch: {
eid(v) { eid(v) {
if (v != "") { if (v != "") {
this.eid = 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