Commit e2fb9534 authored by 周远喜's avatar 周远喜

ok

parent bf1f23c2
<template> <template>
<div> <div>
<Card> <Card>
<EditGrid :columns="columns" ref="grid" :items="list"> <EditGrid :columns="columns" ref="grid" :items="list"
<template slot="easySearch"> >
<Form ref="formInline" :model="easySearch" inline> <template slot="easySearch"><Form ref="formInline" :model="easySearch" inline><FormItem prop="keys"><Input placeholder="请输入关键字标题" v-model="easySearch.keys.value" /> </FormItem>
<FormItem prop="keys"><Input placeholder="请输入关键字标题" v-model="easySearch.keys.value" /> </FormItem> <FormItem><Button type="primary" @click="search">查询</Button>
<FormItem><Button type="primary" @click="search">查询</Button> </FormItem>
</FormItem> </Form></template>
</Form> <!-- <template slot="searchForm">
</template>
<!-- <template slot="searchForm">
<Search /> <Search />
</template> --> </template> -->
<template slot="buttons"> <template slot="buttons">
<Button type="primary" @click="add(null)">新增</Button> <Button type="primary" @click="add(null)">新增</Button>
</template> </template>
</EditGrid> </EditGrid>
</Card> </Card>
<Modal v-model="modal" :title="title" width="1200" footer-hide> <Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" :v="row" @on-close="cancel" @on-ok="ok" /> <component :is="detail" :eid="curId" :v="row" @on-close="cancel" @on-ok="ok" />
</Modal> </Modal>
</div> </div>
</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: {
Search, Search,
}, },
head: { head: {
title: "项目计划", title: "项目计划",
author: "henq", author: "henq",
description: "project_plan 10/19/2020 10:23:07 AM", description: "project_plan 10/19/2020 10:23:07 AM",
},
props:{
eid:{
type:String
}, },
props: { data:{
eid: { type:Object,
type: String default:()=>{
},
data: {
type: Object,
default: () => {
return {
id: "33930562-a9f7-bd95-88ab-d01eb1c4c369",
title: "示例项目"
}
}
}
},
data() {
return { return {
entity: {}, id:"33930562-a9f7-bd95-88ab-d01eb1c4c369",
row: {}, title:"示例项目"
action: Api.index, }
easySearch: { }
keys: { }
op: "title", },
value: null data() {
}, return {
}, entity:{},
modal: false, row:{},
title: "新增", action: Api.index,
detail: null, easySearch: {
curId: null, keys: { op: "title", value: null },
list: [], },
columns: [ modal: false,
// { key:"id",title:this.$t("id") ,hide:true ,align:"left" ,high:true }, title: "新增",
// { key:"creationTime",title:this.l("creationTime") ,align:"left" ,high:true }, detail: null,
// { key:"creatorUserId",title:this.l("creatorUserId") ,align:"left" ,high:true }, curId:null,
// { key:"lastModificationTime",title:this.l("lastModificationTime") ,align:"left" ,high:true }, list: [],
// { key:"lastModifierUserId",title:this.l("lastModifierUserId") ,align:"left" ,high:true }, columns: [
// { key:"isDeleted",title:this.l("isDeleted") ,align:"left" ,high:true }, // { key:"id",title:this.$t("id") ,hide:true ,align:"left" ,high:true },
// { key:"deletionTime",title:this.l("deletionTime") ,align:"left" ,high:true }, // { key:"creationTime",title:this.l("creationTime") ,align:"left" ,high:true },
// { key:"deleterUserId",title:this.l("deleterUserId") ,align:"left" ,high:true }, // { key:"creatorUserId",title:this.l("creatorUserId") ,align:"left" ,high:true },
// { key:"projectId",title:this.l("projectId") ,align:"left" ,high:true }, // { key:"lastModificationTime",title:this.l("lastModificationTime") ,align:"left" ,high:true },
// { key:"upId",title:this.l("upId") ,align:"left" ,high:true }, // { key:"lastModifierUserId",title:this.l("lastModifierUserId") ,align:"left" ,high:true },
// { type: "selection", width: 80, align: "center" }, // { key:"isDeleted",title:this.l("isDeleted") ,align:"left" ,high:true },
{ // { key:"deletionTime",title:this.l("deletionTime") ,align:"left" ,high:true },
title: "操作", // { key:"deleterUserId",title:this.l("deleterUserId") ,align:"left" ,high:true },
key: "action", // { key:"projectId",title:this.l("projectId") ,align:"left" ,high:true },
width: 150, // { key:"upId",title:this.l("upId") ,align:"left" ,high:true },
align: "center", // { type: "selection", width: 80, align: "center" },
// render:(h,params)=>{ {
// return h("Actions" title: "操作",
// ,{ key: "action",
// attrs:{ width: 150,
// row:params, align: "center",
// render:(h,params)=>{
// }, // return h("Actions"
// on:{ // ,{
// 'on-click':this.rowclick // attrs:{
// } // row:params,
// }
// )
// }
render: (h, params) => { // },
return h("div", { // on:{
class: "action" // 'on-click':this.rowclick
}, [ // }
h( // }
"op", { // )
attrs: { // }
icon: "md-arrow-dropright-circle",
type: "icon", render: (h, params) => {
title: "派发", return h("div", { class: "action" }, [
oprate: "edit", h(
}, "op",
on: {
click: () => this.copy(params.row.id)
},
},
),
h(
"op", {
attrs: {
icon: "md-add",
type: "icon",
title: "新增子任务",
oprate: "edit",
},
on: {
click: () => this.add(params.row)
},
}
),
h(
"op", {
attrs: {
icon: "md-eye",
type: "icon",
title: "编辑",
oprate: "edit",
},
on: {
click: () => this.edit(params.row.id)
},
}
),
h(
"op", {
attrs: {
icon: "ios-trash",
type: "icon",
title: "删除",
oprate: "delete",
msg: "确认要删除吗?"
},
on: {
click: () => this.remove(params.row.id)
},
}
),
]);
},
},
{ {
attrs: { icon: "md-arrow-dropright-circle", attrs: { icon: "md-arrow-dropright-circle",
type: "icon", type: "icon",
...@@ -166,14 +104,19 @@ export default { ...@@ -166,14 +104,19 @@ export default {
}, },
on: { click: () => this.copy(params.row.id) }, on: { click: () => this.copy(params.row.id) },
}, },
),
h(
"op",
{ {
key: "title", attrs: { icon: "md-add",
title: this.l("title"), type: "icon",
align: "left", title: "新增子任务",
tree: true, oprate: "edit",},
easy: true, on: { click: () => this.add(params.row) },
high: true, }
}, ),
h(
"op",
{ {
attrs: { icon: "md-create", attrs: { icon: "md-create",
type: "icon", type: "icon",
...@@ -185,131 +128,163 @@ export default { ...@@ -185,131 +128,163 @@ export default {
h( h(
"op", "op",
{ {
key: "endDate", attrs: { icon: "ios-trash",
title: this.l("endDate"), type: "icon",
align: "left", title: "删除",
high: true, oprate: "delete",
type: "date" msg: "确认要删除吗?" },
}, on: { click: () => this.remove(params.row.id) },
// {
// key: "attachment",
// title: this.l("attachment"),
// align: "left",
// high: true,
// },
{
key: "executor",
title: this.l("executor"),
align: "left",
high: true,
type: "users",
},
],
};
},
mounted() {
console.log(this);
this.search();
},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.search();
this.modal = false;
this.curId = null;
},
search() {
// this.$refs.grid.reload(this.easySearch);
var params = {
conditions: [{
fieldName: "projectId",
conditionalType: 'Equal',
fieldValue: this.eid
}],
// conditions: []
};
Api.list(params).then((r) => {
let res = r.result;
var data = this.$u.toTree(
res,
null,
(u) => {
// console.log(u);
u.expanded = true;
u.selected = false;
u.checked = false;
},
"upId"
);
this.list = data;
});
},
// rowclick(row,li){
// return {
// test(){
// alert(1);
// }
// }
// },
add(row) {
if (row) {
this.curId = row.id;
this.row = row
} else {
this.curId = null;
this.row = {
projectId: this.data.id,
} }
} ),
]);
this.title = "新增"; },
this.detail = () => import("./add");
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
}, },
view(id) { {
this.curId = id; key: "type",
this.title = "详情"; width: 90,
this.detail = () => import("./detail"); title: this.l("type"),
this.modal = true; align: "left",
high: true,
code: "mes.project_plan.Type",
}, },
edit(id) { {
this.curId = id; key: "title",
this.title = "编辑"; title: this.l("title"),
this.detail = () => import("./edit"); align: "left",
this.modal = true; tree: true,
easy: true,
high: true,
}, },
remove(id) { {
Api.delete(id).then((r) => { key: "status",
if (r.success) { title: this.l("status"),
this.search(); align: "left",
this.$Message.success("删除成功"); high: true,
} code: "mes.project_plan.Status",
});
}, },
cancel() { {
this.curId = null; key: "startDate",
this.modal = false; title: this.l("startDate"),
align: "left",
high: true
,type:"date"
}, },
l(key) { { key: "endDate", title: this.l("endDate"), align: "left", high: true,type:"date" },
let vkey = "project_plan" + "." + key; // {
return this.$t(vkey) || key; // key: "attachment",
// title: this.l("attachment"),
// align: "left",
// high: true,
// },
{
key: "executor",
title: this.l("executor"),
align: "left",
high: true,
type:"users",
}, },
],
};
},
mounted() {
console.log(this);
this.search();
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.search();
this.modal = false;
this.curId = null;
},
search() {
// this.$refs.grid.reload(this.easySearch);
var params = {
conditions: [{
fieldName:"projectId",
conditionalType: 'Equal',
fieldValue:this.eid
}],
// conditions: []
};
Api.list(params).then((r) => {
let res = r.result;
var data = this.$u.toTree(
res,
null,
(u) => {
// console.log(u);
u.expanded = true;
u.selected = false;
u.checked = false;
},
"upId"
);
this.list =data;
});
},
// rowclick(row,li){
// return {
// test(){
// alert(1);
// }
// }
// },
add(row) {
if(row){
this.curId=row.id;
this.row=row
}else{
this.curId=null;
this.row={
projectId:this.data.id
}
}
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
}, },
edit(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.search();
this.$Message.success("删除成功");
}
});
},
cancel() {
this.curId = null;
this.modal = false;
},
l(key) {
let vkey = "project_plan" + "." + key;
return this.$t(vkey) || key;
},
},
}; };
</script> </script>
<style lang="less"> <style lang="less">
</style> </style>
\ No newline at end of file
...@@ -14,33 +14,45 @@ ...@@ -14,33 +14,45 @@
<Filed :span="12" :name="l('endDate') + ':'">{{ <Filed :span="12" :name="l('endDate') + ':'">{{
entity.endDate entity.endDate
}}</Filed> }}</Filed>
</Row> </Row>
</div> </div>
<ul> <ul>
<li> <li>
<a @click="details"> <Icon type="ios-log-in" />详情 </a> <a @click="details">
&nbsp; <Icon type="ios-log-in" />详情
<span>|</span> </a>
</li> &nbsp;
<li> <span>|</span>
<a @click="template"> <Icon type="ios-photos" />模版</a> </li>
&nbsp; <li>
<span>|</span> <a @click="template">
</li> <Icon type="ios-photos" />模版
<li> </a>
<a @click="task"> <Icon type="md-create" />任务 </a> &nbsp;
&nbsp; <span>|</span>
<span>|</span> </li>
</li> <li>
<li> <a @click="task">
<a @click="group"> <Icon type="md-create" />成员 </a> <Icon type="md-create" />任务
<span>|</span> </a>
</li> &nbsp;
<li> <span>|</span>
<a @click="task"> <Icon type="md-create" />动态 </a> </li>
<span>|</span> <li>
</li> <a @click="groupUser">
</ul> <Icon type="md-create" />成员
</a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="task">
<Icon type="md-create" />动态
</a>
&nbsp;
<span>|</span>
</li>
</ul>
</div> </div>
<div class="body-document"> <div class="body-document">
<h4 v-text="title"></h4> <h4 v-text="title"></h4>
...@@ -91,14 +103,45 @@ export default { ...@@ -91,14 +103,45 @@ export default {
} }
this.detail = () => import("./details"); this.detail = () => import("./details");
}, },
group() { methods: {
// this.curId = this.eid; load(v) {
this.title = "成员管理"; Api.get({
this.detail = () => import("../groupUser/index1"); id: v
}, }).then((r) => {
l(key) { this.entity = r.result;
key = "project_main" + "." + key; // this.$emit("on-load");
return this.$t(key); });
},
details() {
this.title = "详细信息";
this.detail = () => import("./details");
},
template() {
// this.curId = this.eid;
this.title = "项目模板";
this.detail = () => import("../plan");
},
task() {
this.curId = this.eid;
this.title = "任务";
//this.detail = () => import("../task/index");
this.$router.push({
name: "project-task",
params: {
id: this.curId
}
});
},
groupUser() {
// this.curId = this.eid;
this.title = "任务";
// this.detail = () => import("./add");
},
l(key) {
key = "project_main" + "." + key;
return this.$t(key);
},
}, },
watch: { watch: {
eid(v) { eid(v) {
......
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