Commit a68d5a4b authored by 仇晓婷's avatar 仇晓婷

任务

parent a014758f
<template> <template>
<div class="flex fd tree-menu"> <div class="flex fd tree-menu">
<!-- 任务结构 -->
<div class="p-list">
<h3> <h3>
任务结构 <Dropdown @on-click="clickItem">
<div class="fr mr10 mt10"> <a href="javascript:void(0)">
{{ downName }}
<Icon type="ios-arrow-down"></Icon>
</a>
<DropdownMenu slot="list">
<DropdownItem
v-for="item in projectList"
:key="item.id"
:name="item.id"
>{{ item.title }}</DropdownItem
>
</DropdownMenu>
</Dropdown>
</h3>
<div class="mr10 mt10 icon-d">
<ButtonGroup class="fr" size="small"> <ButtonGroup class="fr" size="small">
<Button :icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'" @click="toggle" title="展开/合并"></Button> <Button
:icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'"
@click="toggle"
title="展开/合并"
></Button>
<Button icon="md-refresh" title="刷新" @click="loadTree"></Button> <Button icon="md-refresh" title="刷新" @click="loadTree"></Button>
<Button icon="md-rewind" title="收起" @click="hide"></Button> <Button icon="md-rewind" title="收起" @click="hide"></Button>
</ButtonGroup> </ButtonGroup>
</div> </div>
</h3> </div>
<div class="search"> <div class="search">
<Input search placeholder="请输入关键字" v-model="keys" clearable /> <Input search placeholder="请输入关键字" v-model="keys" clearable />
</div> </div>
<div class="fg"> <div class="fg">
<div class="tree"> <div class="tree">
<Tree :data="data" :render="renderContent" ref="tree" @on-select-change="change"></Tree> <Tree
:data="data"
:render="renderContent"
ref="tree"
@on-select-change="change"
></Tree>
</div>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
...@@ -28,32 +53,62 @@ export default { ...@@ -28,32 +53,62 @@ export default {
return { return {
keys: "", keys: "",
expand: true, expand: true,
list: [] list: [],
downName: "",
projectList: [],
}; };
}, },
props: { props: {
curId: { curId: {
type: String, type: String,
default: '', default: "",
}, },
}, },
created() { created() {
this.loadTree(); this.listSlecet();
// this.loadTree();
}, },
methods: { methods: {
loadTree() { clickItem(val) {
console.log(val);
this.projectList.forEach((e) => {
if (val == e.id) {
this.downName = e.title;
}
});
this.loadTree(val);
},
listSlecet() {
let data = {
conditions: [],
sortBy: "id",
isDesc: false,
};
this.$api.post(`${material}/projectmain/list`, data).then((r) => {
if (r.result) {
this.projectList = r.result;
this.downName = this.projectList[0].title;
// this.curId = this.projectList[0].id;
this.loadTree(this.projectList[0].id);
}
});
},
loadTree(v) {
let params = { let params = {
conditions: [{ conditions: [
{
fieldName: "projectId", fieldName: "projectId",
fieldValue: this.curId, fieldValue: v,
conditionalType: "Equal" conditionalType: "Equal",
}] },
} ],
this.$api.post(`${material}/projectplan/list`, params).then(r => { };
this.$api.post(`${material}/projectplan/list`, params).then((r) => {
var data = this.$u.toTree( var data = this.$u.toTree(
r.result, r.result,
null, null,
u => { (u) => {
u.value = u.id; u.value = u.id;
u.expand = true; u.expand = true;
u.selected = false; u.selected = false;
...@@ -67,37 +122,29 @@ export default { ...@@ -67,37 +122,29 @@ export default {
toggle() { toggle() {
this.expand = !this.expand; this.expand = !this.expand;
}, },
renderContent(h, { renderContent(h, { root, node, data }) {
root, var items = this.$store.getters.dictionaryByKey(
node, "mes.project_plan.Status"
data );
}) { var item = items.filter((u) => {
// let type = "md-folder"; return u.code == data.status;
// if (data.isProduct != 0) { })[0];
// type = "ios-image"; console.warn("jjjjjj", items, item);
// } var color = item.color || "black";
return h("div", [ return h("div", [
h("state", { h("state", {
props: { props: {
code: "mes.project_plan.Type", code: "mes.project_plan.Type",
type: "icon", type: "icon",
value: data.type + "" value: data.type + "",
} size: 16,
}),
h(
"span", {
style: {
// color: data.isProduct == 0 ? "#000" : "rgba(38, 128, 235, 1)"
}
}, },
data.title }),
), h("Badge", {
h("state", {
props: { props: {
code: "mes.project_plan.Status", color: color,
type: "tag", text: data.title,
value: data.status },
}
}), }),
]); ]);
}, },
...@@ -108,14 +155,14 @@ export default { ...@@ -108,14 +155,14 @@ export default {
// if (b.bomId !== 0) { // if (b.bomId !== 0) {
// ids.push(b.bomId); // ids.push(b.bomId);
// } // }
var curentId = '' var curentId = "";
curentId = b.id curentId = b.id;
productIds.push(b.value); productIds.push(b.value);
if (b.children) { if (b.children) {
addId(b.children); addId(b.children);
function addId(data) { function addId(data) {
data.map(u => { data.map((u) => {
// if (u.bomId !== 0) { // if (u.bomId !== 0) {
// ids.push(u.bomId); // ids.push(u.bomId);
// } // }
...@@ -130,7 +177,7 @@ export default { ...@@ -130,7 +177,7 @@ export default {
}, },
hide() { hide() {
this.$emit("on-hide"); this.$emit("on-hide");
} },
}, },
computed: { computed: {
data() { data() {
...@@ -140,7 +187,7 @@ export default { ...@@ -140,7 +187,7 @@ export default {
search(this.keys, items); search(this.keys, items);
function search(keys, data) { function search(keys, data) {
data.map(u => { data.map((u) => {
if (keys.length < 2) { if (keys.length < 2) {
u.expand = expand; u.expand = expand;
result.push(u); result.push(u);
...@@ -155,12 +202,12 @@ export default { ...@@ -155,12 +202,12 @@ export default {
}); });
} }
return result; return result;
} },
}, },
watch: { watch: {
curId(v) { curId(v) {
if (v) { if (v) {
this.loadTree(); this.loadTree(v);
} }
}, },
}, },
...@@ -168,36 +215,43 @@ export default { ...@@ -168,36 +215,43 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import "../../assets/css/custom.less"; // @import "../../assets/css/custom.less";
.tree-menu {
h3 {
height: 50px;
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: bold;
line-height: 50px;
color: @left-tree-header-color;
background: @left-tree-header-bg-color;
opacity: 1;
padding-left: 10px;
}
.search { // .tree-menu {
height: 50px; // h3 {
padding: 5px 10px; // height: 50px;
} // font-size: 14px;
// font-family: Microsoft YaHei;
// font-weight: bold;
// line-height: 50px;
// color: @left-tree-header-color;
// background: @left-tree-header-bg-color;
// opacity: 1;
// padding-left: 10px;
// }
.p-list {
position: relative;
}
.icon-d {
position: absolute;
top: 0;
right: 0;
}
// .search {
// height: 50px;
// padding: 5px 10px;
// }
.fg { // .fg {
flex: none; // flex: none;
// height:0; // // height:0;
overflow: auto; // overflow: auto;
padding-left: 10px; // padding-left: 10px;
} // }
.tree { // .tree {
height: calc(100vh - 215px); // height: calc(100vh - 215px);
overflow: auto; // overflow: auto;
} // }
} // }
</style> </style>
<template> <template>
<div class="ib" @click="showLife"> <div class="ib" @click="showLife">
<div class="ib" v-if="!isMore"> <div class="ib" v-if="!isMore">
<span v-if="type=='text'" :style="style">{{name}}</span> <span v-if="type == 'text'" :style="style">{{ name }}</span>
<Tag v-if="type=='tag'" :color="tagcolor">{{name}}</Tag> <Tag v-if="type == 'tag'" :color="tagcolor">{{ name }}</Tag>
<Badge v-if="type=='dot'" :color="tagcolor" :text="name" /> <Badge v-if="type == 'dot'" :color="tagcolor" :text="name" />
<Icon v-if="type=='icon'" :type="item.icon" :color="tagcolor" :title="name" size="24" /> <Icon
v-if="type == 'icon'"
:type="item.icon"
:color="tagcolor"
:title="name"
:size="size"
/>
</div> </div>
<div class="ib" v-else v-for="(li,i) in items" :key="i"> <div class="ib" v-else v-for="(li, i) in items" :key="i">
<span v-if="type=='text'" :style="li.style">{{li.name}}</span> <span v-if="type == 'text'" :style="li.style">{{ li.name }}</span>
<Tag v-if="type=='tag'" :color="li.tagcolor">{{li.name}}</Tag> <Tag v-if="type == 'tag'" :color="li.tagcolor">{{ li.name }}</Tag>
<Badge v-if="type=='dot'" :color="li.tagcolor" :text="li.name" />&nbsp; <Badge v-if="type == 'dot'" :color="li.tagcolor" :text="li.name" />&nbsp;
</div> </div>
<Modal v-model="modal" title="生命周期" width="800" footer-hide :mask-closable="false"> <Modal
v-model="modal"
title="生命周期"
width="800"
footer-hide
:mask-closable="false"
>
<component :is="detail" :code="code" :value="value" :mode="mode" /> <component :is="detail" :code="code" :value="value" :mode="mode" />
</Modal> </Modal>
</div> </div>
...@@ -21,48 +33,52 @@ export default { ...@@ -21,48 +33,52 @@ export default {
name: "state", name: "state",
data() { data() {
return { return {
mode:'0', mode: "0",
name: "", name: "",
isMore: false, isMore: false,
modal:false, modal: false,
item: {}, item: {},
items: [], items: [],
data: [], data: [],
detail:null, detail: null,
}; };
}, },
props: { props: {
default: { default: {
type: String, type: String,
default: "" default: "",
}, },
type: { type: {
type: String, type: String,
default: "text", default: "text",
validator: function(value) { validator: function (value) {
return ["text", "tag", "dot", "icon"].indexOf(value) != -1; return ["text", "tag", "dot", "icon"].indexOf(value) != -1;
} },
}, },
code: { code: {
type: String, type: String,
required: true required: true,
}, },
value: { value: {
type: [String, Number], type: [String, Number],
required: false required: false,
}, },
color: { color: {
type: Boolean, type: Boolean,
default: true default: true,
},
size: {
type: Number,
default: 24,
}, },
icon: { icon: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
img: { img: {
type: Boolean, type: Boolean,
default: false default: false,
} },
}, },
created() { created() {
this.data = this.$store.getters.dictionaryByKey(this.code) || []; this.data = this.$store.getters.dictionaryByKey(this.code) || [];
...@@ -71,7 +87,7 @@ export default { ...@@ -71,7 +87,7 @@ export default {
setName(v) { setName(v) {
if ((v + "").indexOf(",") == -1) { if ((v + "").indexOf(",") == -1) {
var item; var item;
this.data.map(u => { this.data.map((u) => {
if (u.code == v) { if (u.code == v) {
item = u; item = u;
} }
...@@ -81,7 +97,7 @@ export default { ...@@ -81,7 +97,7 @@ export default {
this.item = item; this.item = item;
} else { } else {
if (this.value == "undefined") { if (this.value == "undefined") {
this.name = ' ' this.name = " ";
} else { } else {
this.name = this.value; this.name = this.value;
} }
...@@ -90,7 +106,7 @@ export default { ...@@ -90,7 +106,7 @@ export default {
this.isMore = true; this.isMore = true;
var items = []; var items = [];
var ul = (v + "").split(","); var ul = (v + "").split(",");
this.data.map(u => { this.data.map((u) => {
if (ul.indexOf(u.code) > -1) { if (ul.indexOf(u.code) > -1) {
u.tagcolor = u.color | "default"; u.tagcolor = u.color | "default";
u.style = { color: u.color | "inherit" }; u.style = { color: u.color | "inherit" };
...@@ -99,11 +115,11 @@ export default { ...@@ -99,11 +115,11 @@ export default {
}); });
this.items = items; this.items = items;
} }
} },
,showLife(){ showLife() {
this.modal= true ; this.modal = true;
this.detail=()=>import("./life"); this.detail = () => import("./life");
} },
}, },
computed: { computed: {
tagcolor() { tagcolor() {
...@@ -125,9 +141,9 @@ export default { ...@@ -125,9 +141,9 @@ export default {
color: color:
this.item && this.item.color != "" && this.item.color != null this.item && this.item.color != "" && this.item.color != null
? this.item.color ? this.item.color
: "inherit" : "inherit",
}; };
} },
}, },
watch: { watch: {
value(v) { value(v) {
...@@ -139,7 +155,7 @@ export default { ...@@ -139,7 +155,7 @@ export default {
this.setName(this.value); this.setName(this.value);
this.$forceUpdate(); this.$forceUpdate();
} }
} },
} },
}; };
</script> </script>
\ No newline at end of file
<template> <template>
<Layout class="full"> <Layout class="full">
<Sider hide-trigger v-if="showMenu" class="menu_side" width="300"> <Sider hide-trigger v-if="showMenu" class="menu_side" width="300">
<ProjectTaskTree :curId="projectId" @on-hide="onHide" @on-select="productSearch" /> <ProjectTaskTree
:curId="projectId"
@on-hide="onHide"
@on-select="productSearch"
/>
</Sider> </Sider>
<div v-if="!showMenu" class="show_menu"> <div v-if="!showMenu" class="show_menu">
<a class="menu_play fr" @click="showMenuFn" title="展开"> <a class="menu_play fr" @click="showMenuFn" title="展开">
<Icon type="ios-arrow-forward" size="24" /> <Icon type="ios-arrow-forward" size="24" />
</a> </a>
</div> </div>
<Content class="content" :class="!showMenu?'con_bord':''"> <Content class="content" :class="!showMenu ? 'con_bord' : ''">
<DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch" :lazy="true" :set="false"> <DataGrid
:columns="columns"
ref="grid"
:action="action"
:conditions="easySearch"
:lazy="true"
:set="false"
>
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" inline> <Form ref="formInline" inline>
<FormItem> <FormItem>
<div class="taskMenu"> <div class="taskMenu">
<Menu mode="horizontal" active-name="2" @on-select="onSelect"> <Menu mode="horizontal" active-name="2" @on-select="onSelect">
<MenuItem name="1"> <MenuItem name="1"> 所有 </MenuItem>
所有 <MenuItem name="2"> 未关闭 </MenuItem>
</MenuItem> <MenuItem name="3"> 指派给我 </MenuItem>
<MenuItem name="2"> <MenuItem name="4"> 由我参与 </MenuItem>
未关闭 <MenuItem name="5"> 已延期 </MenuItem>
</MenuItem>
<MenuItem name="3">
指派给我
</MenuItem>
<MenuItem name="4">
由我参与
</MenuItem>
<MenuItem name="5">
已延期
</MenuItem>
<!-- <!--
<Submenu name="6"> <Submenu name="6">
<template slot="title"> <template slot="title">
...@@ -54,8 +55,16 @@ ...@@ -54,8 +55,16 @@
</Tabs> </Tabs>
</div> </div>
</FormItem> </FormItem>
<FormItem prop="keys"><Input placeholder="请输入项目标题/计划名称/任务标题" v-model="easySearch.keys.value" v-width="240" /> </FormItem> <FormItem prop="keys"
<FormItem><Button type="primary" @click="search">查询</Button></FormItem> ><Input
placeholder="请输入项目标题/计划名称/任务标题"
v-model="easySearch.keys.value"
v-width="240"
/>
</FormItem>
<FormItem
><Button type="primary" @click="search">查询</Button></FormItem
>
<!-- <!--
<FormItem> <FormItem>
<Button @click="highSearch" type="text"> <Button @click="highSearch" type="text">
...@@ -74,18 +83,30 @@ ...@@ -74,18 +83,30 @@
<Button type="primary" class="mr10 ml10">继续</Button> <Button type="primary" class="mr10 ml10">继续</Button>
</template> </template>
</DataGrid> </DataGrid>
<Modal v-model="modal" :title="title" width="1200" :fullscreen="fullScreen" footer-hide> <Modal
<component :is="detail" :eid="curId" :pid="planId" @on-close="cancel" @on-ok="ok" /> v-model="modal"
:title="title"
width="1200"
:fullscreen="fullScreen"
footer-hide
>
<component
:is="detail"
:eid="curId"
:pid="planId"
@on-close="cancel"
@on-ok="ok"
/>
</Modal> </Modal>
</Content> </Content>
</Layout> </Layout>
</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,
}, },
...@@ -101,24 +122,24 @@ export default { ...@@ -101,24 +122,24 @@ export default {
easySearch: { easySearch: {
keys: { keys: {
op: "title", op: "title",
value: null value: null,
}, },
projectId: { projectId: {
op: "Equal", op: "Equal",
value: '' value: "",
}, },
planId: { planId: {
op: "In", op: "In",
value: [] value: [],
}
}, },
theme1: 'light', },
theme1: "light",
modal: false, modal: false,
title: "新增", title: "新增",
detail: null, detail: null,
curId: '', curId: "",
fullScreen: false, fullScreen: false,
projectId: '', projectId: "",
columns: [ columns: [
// { // {
// key: "selection", // key: "selection",
...@@ -140,22 +161,26 @@ export default { ...@@ -140,22 +161,26 @@ export default {
easy: true, easy: true,
high: true, high: true,
render: (h, params) => { render: (h, params) => {
return h('a', { return h(
"a",
{
attrs: { attrs: {
oprate: 'detail' oprate: "detail",
}, },
on: { on: {
click: () => this.viewRecord(params.row.id) click: () => this.viewRecord(params.row.id),
} },
}, params.row.title) },
} params.row.title
);
},
}, },
{ {
key: "level", key: "level",
title: this.l("level"), title: this.l("level"),
align: "center", align: "center",
high: true, high: true,
code: 'project.task.level' code: "project.task.level",
}, },
{ {
key: "projectTitle", key: "projectTitle",
...@@ -178,7 +203,7 @@ export default { ...@@ -178,7 +203,7 @@ export default {
title: this.l("status"), title: this.l("status"),
align: "center", align: "center",
high: true, high: true,
code: 'project.task.status' code: "project.task.status",
}, },
{ {
...@@ -186,7 +211,7 @@ export default { ...@@ -186,7 +211,7 @@ export default {
title: this.l("userId"), title: this.l("userId"),
align: "left", align: "left",
high: true, high: true,
type: 'user' type: "user",
}, },
{ {
key: "startDate", key: "startDate",
...@@ -206,22 +231,26 @@ export default { ...@@ -206,22 +231,26 @@ export default {
align: "center", align: "center",
high: true, high: true,
render: (h, params) => { render: (h, params) => {
return h('a', { return h(
"a",
{
attrs: { attrs: {
oprate: 'detail' oprate: "detail",
}, },
on: { on: {
click: () => this.viewWork(params.row.id) click: () => this.viewWork(params.row.id),
} },
}, params.row.workHour) },
} params.row.workHour
);
},
}, },
{ {
key: "note", key: "note",
title: this.l("note"), title: this.l("note"),
align: "left", align: "left",
high: true, high: true,
hide: true hide: true,
}, },
{ {
key: "creationTime", key: "creationTime",
...@@ -236,28 +265,36 @@ export default { ...@@ -236,28 +265,36 @@ export default {
align: "left", align: "left",
high: true, high: true,
hide: true, hide: true,
type: 'user' type: "user",
}, },
{ {
title: '操作', title: "操作",
key: 'action', key: "action",
width: 200, width: 200,
align: 'center', align: "center",
render: (h, params) => { render: (h, params) => {
return h('div', { return h(
class: "action" "div",
}, [ {
h('op', { class: "action",
},
[
h("op", {
attrs: { attrs: {
icon: "md-arrow-dropright-circle", icon: "md-arrow-dropright-circle",
type: "icon", type: "icon",
oprate: "edit", oprate: "edit",
title: params.row.status == 0 ? "开始" : params.row.status == 2 ? "继续" : '', title:
params.row.status == 0
? "开始"
: params.row.status == 2
? "继续"
: "",
//disable: (params.row.status == 0 || params.row.status == 2) ? false : true //disable: (params.row.status == 0 || params.row.status == 2) ? false : true
}, },
on: { on: {
click: () => this.updatepart(params.row.id, 1) click: () => this.updatepart(params.row.id, 1),
} },
}), }),
// h('op', { // h('op', {
// attrs: { // attrs: {
...@@ -270,7 +307,7 @@ export default { ...@@ -270,7 +307,7 @@ export default {
// click: () => this.updatepart(params.row.id, 2) // click: () => this.updatepart(params.row.id, 2)
// } // }
// }), // }),
h('op', { h("op", {
attrs: { attrs: {
icon: "ios-alarm", icon: "ios-alarm",
type: "icon", type: "icon",
...@@ -279,10 +316,10 @@ export default { ...@@ -279,10 +316,10 @@ export default {
//disable: (params.row.status != 0 && params.row.status != 3) ? false : true //disable: (params.row.status != 0 && params.row.status != 3) ? false : true
}, },
on: { on: {
click: () => this.updatepart(params.row.id, 3) click: () => this.updatepart(params.row.id, 3),
} },
}), }),
h('op', { h("op", {
attrs: { attrs: {
icon: "md-add", icon: "md-add",
type: "icon", type: "icon",
...@@ -291,10 +328,10 @@ export default { ...@@ -291,10 +328,10 @@ export default {
// disable: (params.row.status != 3 && params.row.status != 4) ? false : true // disable: (params.row.status != 3 && params.row.status != 4) ? false : true
}, },
on: { on: {
click: () => this.addRecord(params.row.id) click: () => this.addRecord(params.row.id),
} },
}), }),
h('op', { h("op", {
attrs: { attrs: {
icon: "md-create", icon: "md-create",
type: "icon", type: "icon",
...@@ -303,113 +340,112 @@ export default { ...@@ -303,113 +340,112 @@ export default {
//disable: (params.row.status == 0 || params.row.status == 2) ? false : true //disable: (params.row.status == 0 || params.row.status == 2) ? false : true
}, },
on: { on: {
click: () => this.edit(params.row.id) click: () => this.edit(params.row.id),
} },
}), }),
h('op', { h("op", {
attrs: { attrs: {
icon: "md-trash", icon: "md-trash",
type: "icon", type: "icon",
title: "删除", title: "删除",
oprate: 'delete', oprate: "delete",
// disable: (params.row.status == 0 || params.row.status == 3) ? false : true // disable: (params.row.status == 0 || params.row.status == 3) ? false : true
}, },
on: { on: {
click: () => this.remove(params.row.id) click: () => this.remove(params.row.id),
} },
}) }),
]) ]
} );
},
}, },
], ],
data1: [{ data1: [
{
id: 1, id: 1,
title: '测试title' title: "测试title",
}], },
],
data: [], data: [],
planId: '', //当前计划Id planId: "", //当前计划Id
planIdsCur: [] planIdsCur: [],
} };
}, },
props: { props: {
eid: String eid: String,
}, },
async fetch({ async fetch({ store, params }) {
store, await store.dispatch("loadDictionary"); // 加载数据字典
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
}, },
created() { created() {
if (this.eid != '') { if (this.eid != "") {
this.projectId = this.eid this.projectId = this.eid;
this.easySearch.projectId.value = this.eid this.easySearch.projectId.value = this.eid;
} }
this.treeHeight = window.innerHeight - 150; this.treeHeight = window.innerHeight - 150;
}, },
mounted() { mounted() {
if (this.eid != "") { if (this.eid != "") {
this.easySearch.projectId.value = this.eid this.easySearch.projectId.value = this.eid;
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
} }
}, },
methods: { methods: {
ok() { ok() {
this.$refs.grid.load() this.$refs.grid.load();
this.modal = false this.modal = false;
this.curId = 0; 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("收起左侧树")
...@@ -420,16 +456,16 @@ export default { ...@@ -420,16 +456,16 @@ export default {
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);
...@@ -437,61 +473,64 @@ export default { ...@@ -437,61 +473,64 @@ export default {
updatepart(valId, valStatus) { updatepart(valId, valStatus) {
let params = { let params = {
id: valId, id: valId,
status: valStatus status: valStatus,
} };
Api.updatepart(params).then(r => { 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 => {
this.disabled = false;
this.$Message.error('操作失败')
console.warn(err)
}) })
.catch((err) => {
this.disabled = false;
this.$Message.error("操作失败");
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;
...@@ -506,6 +545,21 @@ export default { ...@@ -506,6 +545,21 @@ export default {
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