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

Merge branch 'product' of http://git.mes123.com/zhouyx/mes-ui into product

parents 708252bb 37babb56
......@@ -1120,7 +1120,9 @@ html [type=button] {
a.empower {
color: #FFBD59;
}
.ivu-drawer-wrap{
z-index: 5000;
}
a.icon {
display: inline-block;
......@@ -1138,9 +1140,9 @@ html [type=button] {
}
a.disable {
color: #CAD1D9;
cursor: help;
cursor:not-allowed;
i:hover {
background:#CAD1D9;
background:transparent;
}
}
......
......@@ -386,7 +386,7 @@ export default {
// }
// });
this.columnsCur = items;
console.log("cur", items,this.columnsCur);
// console.log("cur", items,this.columnsCur);
},
//数据加载
load() {
......
<template>
<div class="time-view" v-if="startDate && endDate">
<div>{{ startDate }}</div>
<div class="jian-tou">
<div>{{ jg }} {{ unit }}</div>
</div>
<div>{{ endDate }}</div>
<span>{{ startDate }}</span>
<span class="jian-tou">{{ jg }} {{ unit }}</span>
<span>{{ endDate }}</span>
</div>
</template>
<script>
import dayjs from "dayjs";
export default {
name: "",
data() {
return {
startDate: null,
endDate: null,
unit: "h",
unit: "",
jg: 0,
};
},
......@@ -48,36 +47,12 @@ export default {
methods: {
init(v) {
if (v) {
this.startDate = v[this.start];
this.endDate = v[this.end];
var start = dayjs(v[this.start]);
var end = dayjs(v[this.end]);
this.startDate=start.format("YYYY-MM-DD");
this.endDate=end.format("YYYY-MM-DD");
this.jg=end.diff(start,'day');
}
this.unit = this.mode;
var date1 = new Date(this.startDate).getTime(); //开始时间,时间戳
var date2 = new Date(this.endDate).getTime(); //结束时间,时间戳
this.jg = date2 - date1;
var result = "";
var minute = 1000 * 60;
var hour = minute * 60;
var day = hour * 24;
var month = day * 30;
if (this.jg < 0) return;
var monthC = this.jg / month;
var weekC = this.jg / (7 * day);
var dayC = this.jg / day;
var hourC = this.jg / hour;
var minC = this.jg / minute;
if (this.unit == "m") {
result = "" + parseInt(monthC);
} else if (this.unit == "w") {
result = "" + parseInt(weekC);
} else if (this.unit == "d") {
result = "" + parseInt(dayC);
} else if (this.unit == "h") {
result = "" + parseInt(hourC);
}
this.jg = result;
},
},
watch: {
......@@ -92,21 +67,19 @@ export default {
</script>
<style lang="less">
.time-view {
// width: 600px;
display: -webkit-flex;
display: flex;
display: inline-block;
.jian-tou {
min-width: 55px;
text-align: center;
margin: 5px;
padding: 0 5px 2px 5px;
background-image: url("../../assets/imgicon/range.png");
background-size: 100%;
background-repeat: no-repeat;
margin-top: 7px;
div {
margin-top: -13px;
}
background-position: bottom right;
// border-bottom: #eee 2px solid;
size: 12px;
font-weight: bold;
}
}
</style>
<template>
<Tooltip trigger="hover" v-if="!disable&&title" :content="titles" placement="top-end">
<a v-if="disable" class="disable">
<slot>
<Icon v-if="type=='icon'" :type="icon" :color="colors" />
<span v-else="type=='text'" v-text="text"></span>
</slot>
</a>
<Tooltip trigger="hover" v-else-if="title" :content="titles" placement="top-end">
<a class="op" :class="css" @click="handler">
<slot>
<Icon v-if="type=='icon'" :type="icon" :color="colors" />
......@@ -40,8 +46,8 @@ export default {
type: String
},
disable: {
type: Number,
default: 0
type: Boolean,
default: false
},
},
......@@ -50,7 +56,8 @@ export default {
text: "",
css: "detail",
colors: this.color,
titles: this.title
titles: this.title,
disabled:false,
};
},
created() {
......
......@@ -221,43 +221,17 @@ export default {
</script>
<style lang="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;
// }
.tree-menu{
border: 1px solid #ddd;
.p-list {
position: relative;
}
.icon-d {
position: absolute;
top: 0;
right: 0;
}
// .search {
// height: 50px;
// padding: 5px 10px;
// }
// .fg {
// flex: none;
// // height:0;
// overflow: auto;
// padding-left: 10px;
// }
}
// .tree {
// height: calc(100vh - 215px);
// overflow: auto;
// }
// }
</style>
<template>
<div>
<Select
:placeholder="placeholder"
v-model="name"
@on-change="change"
:multiple="multiple"
clearable
filterable
transfer
>
<Option
v-for="item in users"
:value="item.userId"
:key="item.userId"
:label="item.note"
:disabled="item.status==0"
>
<div class="user">
<State code="project.group.authority" :value="item.authority" class="mr10" type="tag"/> {{item.note}}
<State code="project.group.role" :value="item.role" class="mr10" type="tag"/>
</div>
</Option>
<div>
<Select :placeholder="placeholder" v-model="name" @on-change="change" :multiple="multiple" clearable filterable transfer>
<Option v-for="item in users" :value="item.userId" :key="item.userId" :label="item.note" :disabled="item.status==0">
<div class="user">
<State code="project.group.authority" :value="item.authority" class="mr10" type="tag" /> {{item.note}}
<State code="project.group.role" :value="item.role" class="mr10" type="tag" />
</div>
</Option>
</Select>
</div>
</div>
</template>
<script>
export default {
model: {
prop: "value",
event: "on-change",
},
data() {
return {
name: this.value,
users: this.data,
};
},
created() {
this.load();
},
props: {
value: [String, Number, Array],
placeholder: {
type: String,
default: "请选择人员",
model: {
prop: "value",
event: "on-change",
},
multiple:{
type:Boolean,
default:false,
data() {
return {
name: this.value,
users: this.data,
};
},
projectId:{
type:String
}
created() {
this.load();
},
methods: {
load() {
var params={
// codition:[{fieldName: "groupId", fieldValue: "b9d6fa9e-e033-4a3e-9925-c1f4437d970c", conditionalType: "Equal"}]
codition:[{fieldName: "projectId", fieldValue: this.projectId, conditionalType: "Equal"}]
}
this.$api.post(`${material}/projectgroupuser/list`, params).then(r=>{
this.users=r.result;
})
props: {
value: [String, Number, Array],
placeholder: {
type: String,
default: "请选择人员",
},
multiple: {
type: Boolean,
default: false,
},
projectId: {
type: String
}
},
methods: {
load() {
var params = {
conditions: [{
fieldName: "projectId",
fieldValue: this.projectId,
conditionalType: "Equal"
}]
}
//
this.$api.post(`${material}/projectgroupuser/list`, params).then(r => {
this.users = r.result;
})
},
change(event) {
let name = "";
this.users.forEach((e) => {
if (e.id == event) {
name = e.label;
}
});
this.$emit("on-change", event, name);
},
// 加载人员
},
change(event) {
let name = "";
this.users.forEach((e) => {
if (e.id == event) {
name = e.label;
watch: {
projectId(v){
this.load();
}
});
this.$emit("on-change", event, name);
},
// 加载人员
},
};
</script>
<style lang="less">
@import "../../assets/css/custom.less";
.userGroup {
}
.userGroup {}
</style>
This source diff could not be displayed because it is too large. You can view the blob instead.
import Api from '@/plugins/request'
export default {
index:`${material}/projectgroupuser/paged`,
paged(params){
return Api.post(`${material}/projectgroupuser/paged`,params);
index: `${material}/projectgroupuser/paged`,
paged(params) {
return Api.post(`${material}/projectgroupuser/paged`, params);
},
list(params){
return Api.post(`${material}/projectgroupuser/list`,params);
},
get(params){
return Api.get(`${material}/projectgroupuser/get`,params);
list(params) {
return Api.post(`${material}/projectgroupuser/list`, params);
},
create(params){
return Api.post(`${material}/projectgroupuser/create`,params);
get(params) {
return Api.get(`${material}/projectgroupuser/get`, params);
},
update(params){
return Api.post(`${material}/projectgroupuser/update`,params);
create(params) {
return Api.post(`${material}/projectgroupuser/create`, params);
},
update(params) {
return Api.post(`${material}/projectgroupuser/update`, params);
},
delete(id) {
return Api.delete(`${material}/projectgroupuser/delete`,{params:{id:id}});
return Api.delete(`${material}/projectgroupuser/delete`, { params: { id: id } });
},
deletes(params) {
return Api.post(`${material}/projectgroupuser/batchdelete`,params);
}
}
\ No newline at end of file
return Api.post(`${material}/projectgroupuser/batchdelete`, params);
},
groundPaged(params) {
// return Api.post(`${material}/projectgroup/paged`, params);
return Api.post(`${material}/projectgroup/list`, params);
},
importTeam(params) { //批量添加
return Api.post(`${material}/projectgroupuser/createbatch`, params);
},
allTeams(params) { //添加项目组和成员
return Api.post(`${material}/projectgroupuser/creategroupanduser`, params);
},
}
\ No newline at end of file
<template>
<div>
<Table border :columns="columns" :data="list" ref="table" class="tableCommon" stripe>
<template slot-scope="{ row, index }" slot="userId">
<a class="op detail" v-if="edit != index" @click="view(row.id)"><User :value="row.userId"></User></a>
<UserSelect v-else ref="userSelected" v-model="cur.userId" @on-change="setRow"/>
</template>
<template slot-scope="{ row, index }" slot="role">
<state v-if="edit != index" code="project.group.role" :value="row.role" type="text"></state>
<Dictionary v-else code="project.group.role" v-model="cur.role"></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="status">
<state v-if="edit != index" code="project.group.status" :value="row.status" type="text"></state>
<Dictionary v-else code="project.group.status" v-model="cur.status"></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="whour">
<span v-if="edit != index" v-text="row.whour"></span>
<InputNumber v-else type="text" v-model.trim="cur.whour" />
</template>
<template slot-scope="{ row, index }" slot="whourpd">
<span v-if="edit != index" v-text="row.whourpd"></span>
<InputNumber v-else type="text" v-model.trim="cur.whourpd" />
</template>
<template slot-scope="{ row, index }" slot="authority">
<state v-if="edit != index" code="project.group.authority" :value="row.authority" type="text"></state>
<Dictionary v-else code="project.group.authority" v-model="cur.authority" @on-change="changeAuthority"></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="note">
<span v-if="edit != index" v-text="row.note"></span>
<Input v-else type="text" v-model.trim="cur.note" :disabled="true" />
</template>
<template slot-scope="{ row, index }" slot="action">
<div v-if="edit != index" class="action">
<op class="edit" @click="editRow(row,index)" :disabled="edit != -1" :style="{'color': edit != -1?'#ccc':'' }">编辑</op>
<op class="remove" @click="delRow(row.id)" :disabled="edit != -1" :style="{'color': edit != -1?'#ccc':'' }">删除</op>
</div>
<div class="action" v-else>
<op class="edit" @click="save">保存</op>
<op class="remove" @click="remove(row,index)">取消</op>
</div>
</template>
<div>
<Row :gutter="10" class="importWindow" type="flex" align="middle">
<Col span="5">
<Form :label-width="80" class="forms">
<FormItem label="复制团队">
<Select v-model="groupId" @on-change="loadGroup">
<Option :value="v.id" v-for="(v, i) in teams" :key="i">{{
v.title
}}</Option>
</Select>
</FormItem>
</Form>
</Col>
<Col span="2" v-if="groupUsers.length>0">
<label>可导入人员:{{ groupUsers.length }}</label>
<Button type="primary" @click="importBtn">导入</Button>
</Col>
</Row>
<Table
border
:columns="columns"
:data="list"
ref="table"
class="tableCommon"
stripe
>
<template slot-scope="{ row, index }" slot="userId">
<a class="op detail" v-if="edit != index" @click="view(row.id)"
><User :value="row.userId"></User
></a>
<UserSelect
v-else
ref="userSelected"
v-model="cur.userId"
@on-change="setRow"
/>
</template>
<template slot-scope="{ row, index }" slot="role">
<state
v-if="edit != index"
code="project.group.role"
:value="row.role"
type="text"
></state>
<Dictionary
v-else
code="project.group.role"
v-model="cur.role"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="status">
<state
v-if="edit != index"
code="project.group.status"
:value="row.status"
type="text"
></state>
<Dictionary
v-else
code="project.group.status"
v-model="cur.status"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="whour">
<span v-if="edit != index" v-text="row.whour"></span>
<InputNumber v-else type="text" v-model.trim="cur.whour" />
</template>
<template slot-scope="{ row, index }" slot="whourpd">
<span v-if="edit != index" v-text="row.whourpd"></span>
<InputNumber v-else type="text" v-model.trim="cur.whourpd" />
</template>
<template slot-scope="{ row, index }" slot="authority">
<state
v-if="edit != index"
code="project.group.authority"
:value="row.authority"
type="text"
></state>
<Dictionary
v-else
code="project.group.authority"
v-model="cur.authority"
@on-change="changeAuthority"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="note">
<span v-if="edit != index" v-text="row.note"></span>
<Input v-else type="text" v-model.trim="cur.note" :disabled="true" />
</template>
<template slot-scope="{ row, index }" slot="action">
<div v-if="edit != index" class="action">
<op
class="edit"
@click="editRow(row, index)"
:disabled="edit != -1"
:style="{ color: edit != -1 ? '#ccc' : '' }"
>编辑</op
>
<op
class="remove"
@click="delRow(row.id)"
:disabled="edit != -1"
:style="{ color: edit != -1 ? '#ccc' : '' }"
>删除</op
>
</div>
<div class="action" v-else>
<op class="edit" @click="save">保存</op>
<op class="remove" @click="remove(row, index)">取消</op>
</div>
</template>
</Table>
<div class="footerWidth"><Button type="primary" long @click="addList" :disabled="edit != -1">新增人员</Button></div>
<div class="footerWidth">
<Button type="primary" long @click="addList" :disabled="edit != -1"
>新增人员</Button
>
</div>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" />
<component :is="detail" :eid="curId" @on-close="cancel" />
</Modal>
</div>
</div>
</template>
<script>
import Api from './api'
import Api from "./api";
export default {
name: 'list',
head: {
title: "项目成员",
author: "henq",
description: "project_group_user 10/21/2020 11:46:56 AM",
},
data() {
return {
modal: false,
title: "新增",
detail: null,
curId: '',
edit: -1,
authorityCount: 0, //列表中权限里是否存在项目经理(列表中唯一)
authorityCur: 0, //当前行的权限 值
cur: {
id: '',
userId: null,
role: 1,
status: 1,
whour: 14,
whourpd: 7.0,
authority: 2,
note: ''
},
columns: [{
type: "index",
title: '编号',
align: "right",
width: 80
}, {
key: "userId",
title: this.l("userId"),
align: "left",
slot: 'userId'
},
{
key: "role",
title: this.l("role"),
align: "center",
width: 180,
slot: 'role'
},
{
key: "status",
title: this.l("status"),
align: "center",
width: 150,
slot: 'status'
},
// {
// key: "joindate",
// title: this.l("joindate"),
// align: "center",
// width: 180,
// slot: 'joindate'
// },
{
key: "whour",
title: this.l("whour"),
align: "right",
width: 150,
slot: 'whour'
},
{
key: "whourpd",
title: this.l("whourpd"),
align: "right",
width: 150,
slot: 'whourpd'
},
{
key: "authority",
title: this.l("authority"),
align: "center",
width: 200,
slot: 'authority'
},
// {
// key: "note",
// title: this.l("note"),
// align: "left",
// slot: 'note'
// },
{
title: '操作',
key: 'action',
width: 140,
align: 'center',
slot: 'action',
},
],
list: []
}
},
props: {
eid: String,
projectId:String
},
mounted() {
if (this.eid||this.projectId ) {
this.load()
}
},
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods: {
load() {
let params = {
conditions: [{
fieldName: "groupId",
fieldValue: this.eid,
conditionalType: "Equal",
}],
}
if(this.projectId){
params = {
conditions: [{
fieldName: "projectId",
fieldValue: this.projectId,
conditionalType: "Equal",
}],
}
}
Api.list(params).then(r => {
if (r.success) {
this.list = r.result
}
})
name: "list",
head: {
title: "项目成员",
author: "henq",
description: "project_group_user 10/21/2020 11:46:56 AM",
},
data() {
return {
modal1: false,
detail: null,
groupUsers: [],
rules: {
name: [
{
required: true,
message: "The name cannot be empty",
trigger: "blur",
},
],
},
groupId: null,
modal: false,
title: "新增",
detail: null,
curId: "",
edit: -1,
authorityCount: 0, //列表中权限里是否存在项目经理(列表中唯一)
authorityCur: 0, //当前行的权限 值
cur: {
id: "",
userId: null,
role: 1,
status: 1,
whour: 14,
whourpd: 7.0,
authority: 2,
note: "",
},
columns: [
{
type: "index",
title: "编号",
align: "right",
width: 80,
},
setRow(e,name){
this.cur.note=name;
{
key: "userId",
title: this.l("userId"),
align: "left",
slot: "userId",
},
//新增
addList() {
this.edit = this.list.length;
this.cur = {
userId: null,
role: 0,
status: 1,
joindate: '',
whour: 14,
whourpd: 7.0,
authority: 0,
projectId:this.projectId,
note: ''
};
this.authorityCur = 0
this.list.push(this.cur);
{
key: "role",
title: this.l("role"),
align: "center",
width: 180,
slot: "role",
},
//编辑
editRow(row, index) {
this.cur=this.$u.clone(row);
this.edit = index
{
key: "status",
title: this.l("status"),
align: "center",
width: 150,
slot: "status",
},
changeUser(val, item) {
this.cur.note = item
{
key: "whour",
title: this.l("whour"),
align: "right",
width: 150,
slot: "whour",
},
//选择权限
changeAuthority(val) {
if (this.authorityCur != 1 && this.authorityCount == 1 && val == 1) {
this.$Message.error("已存在权限:项目经理,请选择其他权限!")
this.cur.authority = null
}
{
key: "whourpd",
title: this.l("whourpd"),
align: "right",
width: 150,
slot: "whourpd",
},
//删除
delRow(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.load()
this.$Message.success('删除成功')
this.edit = -1;
}
})
{
key: "authority",
title: this.l("authority"),
align: "center",
width: 200,
slot: "authority",
},
//新增时取消
remove(row, index) {
if (!row.id || !row.groupId) {
this.list.pop();
}
this.edit = -1;
{
title: "操作",
key: "action",
width: 140,
align: "center",
slot: "action",
},
//新增保存或修改保存
save() {
this.cur.groupId = this.eid
if (this.cur.userId==0||this.cur.userId==null) {
this.$Message.error("请选择人员");
return;
}
var cnt=this.list.filter(u=>{
return u.userId==this.cur.userId
],
list: [],
teams: [],
};
},
props: {
eid: String,
},
mounted() {
if (this.eid || this.projectId) {
this.load();
this.groundTeam();
}
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
loadGroup() {
console.log('groupId', this.groupId);
Api.list({
conditions: [
{
fieldName: "groupId",
fieldValue: this.groupId,
conditionalType: "Equal",
},
],
}).then((r) => {
if (r.success) {
let obj = {};
let list = r.result.reduce((cur,next) => {
obj[next.userId] ? "" : obj[next.userId] = true && cur.push(next);
return cur;
},[])
var users = [];
list.map((u) => {
var cnt = this.list.filter((p) => {
return p.userId == u.userId;
}).length;
if(cnt>1){
this.$Message.error("此人已经选择");
return;
}
if (this.cur.role===undefined) {
this.$Message.error("请选择人员角色");
return;
if (cnt == 0) {
delete u.id;
delete u.groupId;
u.groupId = this.eid;
u.authority = 2;
u.projectId = this.eid;
users.push(u);
}
if (this.cur.authority ===undefined) {
this.$Message.error("请选择人员权限");
return;
}
if (this.cur.id && this.cur.id != '') { //人员修改
Api.update(this.cur).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success('修改成功')
this.edit = -1
this.load()
} else {
this.$Message.error('修改失败')
}
})
} else { //人员新增
Api.create(this.cur).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success('保存成功')
this.edit = -1
this.load()
} else {
this.$Message.error('保存失败')
}
})
}
},
getFormatDateStart(dates) {
const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate()) +
" 00:00:01";
return resDate;
},
p(s) {
return s < 10 ? "0" + s : s;
},
l(key) {
let vkey = "project_group_user" + "." + key;
return this.$t(vkey) || key
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import('./detail')
this.modal = true;
},
editRow1(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import('./edit')
this.modal = true;
},
cancel() {
this.curId = this.eid;
this.modal = false
});
this.groupUsers=[];
this.groupUsers = users;
if (this.groupUsers.length == 0) {
this.$Message.warning("团队已有成员,请勿复制!");
}
}
//old弹框模式方法end
});
},
watch: {
eid(v) {
if (v) {
this.load();
}
},
projectId(v) {
if (v) {
this.load();
}
importBtn() {
if (this.groupUsers.length > 0) {
Api.importTeam(this.groupUsers).then((r) => {
if (r.success) {
this.load("strat");
this.groupUsers=[];
this.$Message.success("复制成功!");
}
});
}
},
groundTeam() {
let data = { conditions: [] };
Api.groundPaged(data).then((r) => {
if (r.success) {
this.teams = r.result;
}
}
}
});
},
load() {
let params = {
conditions: [
{
fieldName: "groupId",
fieldValue: this.eid,
conditionalType: "Equal",
},
],
};
Api.list(params).then((r) => {
if (r.success) {
this.list = r.result;
}
});
},
setRow(e, name) {
this.cur.note = name;
},
//新增
addList() {
this.edit = this.list.length;
this.cur = {
userId: null,
role: 0,
status: 1,
joindate: "",
whour: 14,
whourpd: 7.0,
authority: 0,
projectId: this.projectId,
note: "",
};
this.authorityCur = 0;
this.list.push(this.cur);
},
//编辑
editRow(row, index) {
this.cur = this.$u.clone(row);
this.edit = index;
},
changeUser(val, item) {
this.cur.note = item;
},
//选择权限
changeAuthority(val) {
if (this.authorityCur != 1 && this.authorityCount == 1 && val == 1) {
this.$Message.error("已存在权限:项目经理,请选择其他权限!");
this.cur.authority = null;
}
},
//删除
delRow(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.load();
this.$Message.success("删除成功");
this.edit = -1;
}
});
},
//新增时取消
remove(row, index) {
if (!row.id || !row.groupId) {
this.list.pop();
}
this.edit = -1;
},
//新增保存或修改保存
save() {
this.cur.groupId = this.eid;
if (this.cur.userId === undefined) {
this.$Message.error("请选择人员");
return;
}
var cnt = this.list.filter((u) => {
return u.userId == this.cur.userId;
}).length;
if (cnt > 1) {
this.$Message.error("此人已经选择");
return;
}
if (this.cur.role === undefined) {
this.$Message.error("请选择人员角色");
return;
}
if (this.cur.authority == undefined) {
this.$Message.error("请选择人员权限");
return;
}
if (this.cur.id && this.cur.id != "") {
//人员修改
Api.update(this.cur).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("修改成功");
this.edit = -1;
this.load();
} else {
this.$Message.error("修改失败");
}
});
} else {
//人员新增
Api.create(this.cur).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.edit = -1;
this.load();
} else {
this.$Message.error("保存失败");
}
});
}
},
getFormatDateStart(dates) {
const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate()) +
" 00:00:01";
return resDate;
},
p(s) {
return s < 10 ? "0" + s : s;
},
l(key) {
let vkey = "project_group_user" + "." + key;
return this.$t(vkey) || key;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
},
editRow1(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
cancel() {
this.curId = this.eid;
this.modal = false;
},
//old弹框模式方法end
},
watch: {
eid(v) {
if (v) {
this.load();
}
},
},
};
</script>
<style lang="less">
* {
margin: 0;
padding: 0;
}
.importWindow {
height: 50px;
.forms {
margin-top: 8px;
}
Button {
margin-bottom: 15px;
}
}
.footerWidth {
width: calc(100%);
margin-top: 5px;
width: calc(100%);
margin-top: 5px;
}
</style>
<template>
<div>
<Row :gutter="10" class="importWindow" type="flex" align="middle">
<Col span="5">
<Form :label-width="80" class="forms">
<FormItem label="复制团队">
<Select v-model="groupId" @on-change="loadGroup">
<Option :value="v.id" v-for="(v, i) in teams" :key="i">{{
v.title
}}</Option>
</Select>
</FormItem>
</Form>
</Col>
<Col span="4" v-if="groupUsers.length>0">
<label>可导入人员:{{ groupUsers.length }}</label>
<Button type="primary" @click="importBtn">导入</Button>
</Col>
<Col span="1" offset="17" class="ar">
<Button icon="md-construct" @click="clickTeams">存为团队</Button>
</Col>
<Modal v-model="modalFormk" :title="title" width="1200" footer-hide>
<Form ref="modalForm" :model="modalForm" :rules="rules" :label-width="90" >
<Row>
<Col :span="12">
<FormItem :label="l('title')" prop="title">
<Input v-model="modalForm.title"> </Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('content')" prop="content">
<Input v-model="modalForm.content"> </Input>
</FormItem>
</Col>
</Row>
<Row v-if="data1 && data1.length > 0">
<Table :columns="columns1" :data="data1" class="tableCommon">
<template slot-scope="{ row, index }" slot="userId">
{{ row.note }}
</template>
<template slot-scope="{ row, index }" slot="role">
<state code="project.group.role" :value="row.role" type="text" ></state>
</template>
<template slot-scope="{ row, index }" slot="status">
<state code="project.group.status" :value="row.status" type="text" ></state>
</template>
<template slot-scope="{ row, index }" slot="whour">
<span v-text="row.whour"></span>
</template>
<template slot-scope="{ row, index }" slot="whourpd">
<span v-text="row.whourpd"></span>
</template>
<template slot-scope="{ row, index }" slot="authority">
<state code="project.group.authority" :value="row.authority" type="text" ></state>
</template>
</Table>
</Row>
<Row type="flex" justify="end" class="footM">
<FormItem>
<Button type="primary" @click="saveBtn('modalForm')">保存</Button>
<Button @click="closeBtn('modalForm')" class="ml20">取消</Button>
</FormItem>
</Row>
</Form>
</Modal>
</Row>
<Table border :columns="columns" :data="list" ref="table" class="tableCommon" stripe >
<template slot-scope="{ row, index }" slot="userId">
<a class="op detail" v-if="edit != index" @click="view(row.id)"
><User :value="row.userId"></User
></a>
<UserSelect
v-else
ref="userSelected"
v-model="cur.userId"
@on-change="setRow"
/>
</template>
<template slot-scope="{ row, index }" slot="role">
<state
v-if="edit != index"
code="project.group.role"
:value="row.role"
type="text"
></state>
<Dictionary
v-else
code="project.group.role"
v-model="cur.role"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="status">
<state
v-if="edit != index"
code="project.group.status"
:value="row.status"
type="text"
></state>
<Dictionary
v-else
code="project.group.status"
v-model="cur.status"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="whour">
<span v-if="edit != index" v-text="row.whour"></span>
<InputNumber v-else type="text" v-model.trim="cur.whour" />
</template>
<template slot-scope="{ row, index }" slot="whourpd">
<span v-if="edit != index" v-text="row.whourpd"></span>
<InputNumber v-else type="text" v-model.trim="cur.whourpd" />
</template>
<template slot-scope="{ row, index }" slot="authority">
<state
v-if="edit != index"
code="project.group.authority"
:value="row.authority"
type="text"
></state>
<Dictionary
v-else
code="project.group.authority"
v-model="cur.authority"
@on-change="changeAuthority"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="note">
<span v-if="edit != index" v-text="row.note"></span>
<Input v-else type="text" v-model.trim="cur.note" :disabled="true" />
</template>
<template slot-scope="{ row, index }" slot="action">
<div v-if="edit != index" class="action">
<op
class="edit"
@click="editRow(row, index)"
:disabled="edit != -1"
:style="{ color: edit != -1 ? '#ccc' : '' }"
>编辑</op
>
<op
class="remove"
@click="delRow(row.id)"
:disabled="edit != -1"
:style="{ color: edit != -1 ? '#ccc' : '' }"
>删除</op
>
</div>
<div class="action" v-else>
<op class="edit" @click="save">保存</op>
<op class="remove" @click="remove(row, index)">取消</op>
</div>
</template>
</Table>
<div class="footerWidth">
<Button type="primary" long @click="addList" :disabled="edit != -1"
>新增人员</Button
>
</div>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" />
</Modal>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "list",
head: {
title: "项目成员",
author: "henq",
description: "project_group_user 10/21/2020 11:46:56 AM",
},
data() {
return {
columns1: [
{
key: "note",
title: this.l("userId"),
align: "center",
easy: true,
high: true,
},
{
key: "role",
title: this.l("role"),
align: "center",
easy: true,
high: true,
slot: "role",
},
{
key: "status",
title: this.l("status"),
align: "center",
width: 150,
slot: "status",
},
{
key: "whour",
title: this.l("whour"),
align: "center",
width: 150,
slot: "whour",
},
{
key: "whourpd",
title: this.l("whourpd"),
align: "center",
width: 150,
slot: "whourpd",
},
{
key: "authority",
title: this.l("authority"),
align: "center",
width: 200,
slot: "authority",
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "center",
high: true,
type: "date",
width: 180,
},
],
data1: [],
groupUsers: [],
modalFormk: false,
detail: null,
modal: false,
modalForm: {
title: "",
content: "",
creationTime: null,
creatorUserId: null,
deleterUserId: null,
deletionTime: null,
isDeleted: null,
lastModificationTime: null,
lastModifierUserId: null,
planId: "",
projectId: "",
},
rules: {
title: [
{
required: true,
message: "必填",
trigger: "blur",
},
],
},
groupId: null,
title: "新增",
curId: "",
edit: -1,
authorityCount: 0, //列表中权限里是否存在项目经理(列表中唯一)
authorityCur: 0, //当前行的权限 值
cur: {
id: "",
userId: null,
role: 1,
status: 1,
whour: 14,
whourpd: 7.0,
authority: 2,
note: "",
},
columns: [
{
type: "index",
title: "编号",
align: "right",
width: 80,
},
{
key: "userId",
title: this.l("userId"),
align: "left",
slot: "userId",
},
{
key: "role",
title: this.l("role"),
align: "center",
width: 180,
slot: "role",
},
{
key: "status",
title: this.l("status"),
align: "center",
width: 150,
slot: "status",
},
{
key: "whour",
title: this.l("whour"),
align: "right",
width: 150,
slot: "whour",
},
{
key: "whourpd",
title: this.l("whourpd"),
align: "right",
width: 150,
slot: "whourpd",
},
{
key: "authority",
title: this.l("authority"),
align: "center",
width: 200,
slot: "authority",
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
slot: "action",
},
],
list: [],
teams: [],
};
},
props: {
eid: String,
projectId: String,
},
mounted() {
if (this.eid || this.projectId) {
this.load("strat");
this.groundTeam();
}
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
loadGroup() {
Api.list({
conditions: [
{
fieldName: "groupId",
fieldValue: this.groupId,
conditionalType: "Equal",
},
],
}).then((r) => {
if (r.success) {
let obj = {};
let list = r.result.reduce((cur,next) => {
obj[next.userId] ? "" : obj[next.userId] = true && cur.push(next);
return cur;
},[])
var users = [];
list.map((u) => {
var cnt = this.list.filter((p) => {
return p.userId == u.userId;
}).length;
if (cnt == 0) {
delete u.id;
delete u.groupId;
u.authority = 2;
u.projectId = this.eid;
users.push(u);
}
});
this.groupUsers=[];
this.groupUsers = users;
if (this.groupUsers.length == 0) {
this.$Message.warning("团队已有成员,请勿复制!");
}
}
});
},
importBtn() {
if (this.groupUsers.length > 0) {
Api.importTeam(this.groupUsers).then((r) => {
if (r.success) {
this.load("strat");
this.groupUsers=[];
this.$Message.success("复制成功!");
}
});
}
},
clickTeams() {
this.modalFormk = true;
this.load("save");
},
saveBtn(name) {
this.$refs[name].validate((valid) => {
if (valid) {
if (this.data1.length > 0) {
this.modalForm.projectId = this.data1[0].projectId;
Api.allTeams(this.modalForm)
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.modalFormk = false;
this.$refs[name].resetFields();
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.modalFormk = false;
this.$Message.error("保存失败");
});
}
} else {
this.$Message.error("请填写数据!");
}
});
},
closeBtn(name) {
this.$refs[name].resetFields();
this.modalFormk = false;
},
groundTeam() {
let data = { conditions: []};
Api.groundPaged(data).then((r) => {
if (r.success) {
this.teams = r.result;
}
});
},
load(s) {
let params = {
conditions: [
{
fieldName: "projectId",
fieldValue: this.eid,
conditionalType: "Equal",
},
],
};
Api.list(params).then((r) => {
if (r.success) {
if (s == "strat") {
this.list = r.result;
} else {
var date = new Date(); //实例一个时间对象;
var year = date.getFullYear(); //获取系统的年;
var month =
date.getMonth() + 1 < 10
? "0" + (date.getMonth() + 1)
: date.getMonth() + 1; //获取系统月份,由于月份是从0开始计算,所以要加1
var day = change(date.getDate()); //获取系统日
var hour = change(date.getHours()); //获取系统时间
var minute = change(date.getMinutes()); //分
var second = change(date.getSeconds()); //秒
function change(t) {
if (t < 10) {
return "0" + t;
} else {
return t;
}
}
let newTime =
year +
"-" +
month +
"-" +
day +
" " +
hour +
":" +
minute +
":" +
second;
r.result.filter((v) => {
return (v.creationTime = newTime);
});
this.data1 = r.result;
console.log("data1", this.data1);
}
}
});
},
setRow(e, name) {
this.cur.note = name;
},
//新增
addList() {
this.edit = this.list.length;
this.cur = {
userId: null,
role: 0,
status: 1,
joindate: "",
whour: 14,
whourpd: 7.0,
authority: 0,
projectId: this.projectId,
note: "",
};
this.authorityCur = 0;
this.list.push(this.cur);
},
//编辑
editRow(row, index) {
this.cur = this.$u.clone(row);
this.edit = index;
},
changeUser(val, item) {
this.cur.note = item;
},
//选择权限
changeAuthority(val) {
if (this.authorityCur != 1 && this.authorityCount == 1 && val == 1) {
this.$Message.error("已存在权限:项目经理,请选择其他权限!");
this.cur.authority = null;
}
},
//删除
delRow(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.load("strat");
this.$Message.success("删除成功");
this.edit = -1;
}
});
},
//新增时取消
remove(row, index) {
if (!row.id || !row.groupId) {
this.list.pop();
}
this.edit = -1;
},
//新增保存或修改保存
save() {
this.cur.groupId = this.eid;
if (this.cur.userId === undefined) {
this.$Message.error("请选择人员");
return;
}
var cnt = this.list.filter((u) => {
return u.userId == this.cur.userId;
}).length;
if (cnt > 1) {
this.$Message.error("此人已经选择");
return;
}
if (this.cur.role === undefined) {
this.$Message.error("请选择人员角色");
return;
}
if (this.cur.authority === undefined) {
this.$Message.error("请选择人员权限");
return;
}
if (this.cur.id && this.cur.id != "") {
//人员修改
Api.update(this.cur).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("修改成功");
this.edit = -1;
this.load("strat");
} else {
this.$Message.error("修改失败");
}
});
} else {
//人员新增
Api.create(this.cur).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.edit = -1;
this.load("strat");
} else {
this.$Message.error("保存失败");
}
});
}
},
getFormatDateStart(dates) {
const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate()) +
" 00:00:01";
return resDate;
},
p(s) {
return s < 10 ? "0" + s : s;
},
l(key) {
let vkey = "project_group_user" + "." + key;
return this.$t(vkey) || key;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
},
editRow1(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
cancel() {
this.curId = this.eid;
this.modal = false;
},
//old弹框模式方法end
},
watch: {
eid(v) {
if (v) {
this.load("strat");
}
},
projectId(v) {
if (v) {
this.load("strat");
}
},
},
};
</script>
<style lang="less">
.importWindow {
height: 50px;
.forms {
margin-top: 8px;
}
Button {
margin-bottom: 15px;
}
}
.footerWidth {
width: calc(100%);
margin-top: 5px;
}
.footM {
margin-top: 10px;
}
</style>
<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('entity')" prop="entity">
<Input v-model="entity.entity"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('entityId')" prop="entityId">
<Input v-model="entity.entityId"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('action')" prop="action">
<Dictionary
code="mes.project_log.Action"
v-model="entity.action"
></Dictionary> </FormItem
></Col>
<Col :span="24"
><FormItem :label="l('content')" prop="content">
<Input
v-model="entity.content"
type="textarea"
:rows="5"
></Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('upId')" prop="upId">
<Input v-model="entity.upId"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('projectId')" prop="projectId">
<Input v-model="entity.projectId"> </Input> </FormItem
></Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled"
>保存</Button
>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
disabled: false,
entity: {
creationTime: null,
creatorUserId: null,
lastModificationTime: null,
lastModifierUserId: null,
isDeleted: null,
deletionTime: null,
deleterUserId: null,
entity: "",
entityId: "",
action: null,
content: "",
upId: "",
projectId: "",
},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
props: {
v: Object,
eid: Number,
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.create(this.entity)
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.entity.id = 0;
});
},
l(key) {
key = "project_log" + "." + key;
return this.$t(key);
},
},
watch: {
v() {
this.entity = this.$u.clone(this.v);
},
eid(v) {
if (v > 0) {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index: `${material}/projectlog/paged`,
paged(params) {
return Api.post(`${material}/projectlog/paged`, params);
},
listall(params) {
return Api.post(`${material}/projectlog/list`, params);
},
get(params) {
return Api.get(`${material}/projectlog/get`, params);
},
create(params) {
return Api.post(`${material}/projectlog/create`, params);
},
update(params) {
return Api.post(`${material}/projectlog/update`, params);
},
delete(id) {
return Api.delete(`${material}/projectlog/delete`, { params: { id: id } });
},
deletes(params) {
return Api.post(`${material}/projectlog/batchdelete`, params);
},
list(params) {
return Api.post(`${material}/projectgroupuser/list`, params);
},
}
\ No newline at end of file
<template>
<div class="detail">
<Row>
<Filed :span="12" :name="l('creationTime')">{{
entity.creationTime
}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">{{
entity.creatorUserId
}}</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{
entity.lastModificationTime
}}</Filed>
<Filed :span="12" :name="l('lastModifierUserId')">{{
entity.lastModifierUserId
}}</Filed>
<!-- <Filed :span="12" :name="l('isDeleted')">{{ entity.isDeleted }}</Filed> -->
<Filed :span="12" :name="l('deletionTime')">{{
entity.deletionTime
}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{
entity.deleterUserId
}}</Filed>
<Filed :span="12" :name="l('entity')">{{ entity.entity }}</Filed>
<Filed :span="12" :name="l('entityId')">{{ entity.entityId }}</Filed>
<Filed :span="12" :name="l('action')">{{ entity.action }}</Filed>
<Filed :span="24" :name="l('content')">{{ entity.content }}</Filed>
<Filed :span="12" :name="l('upId')">{{ entity.upId }}</Filed>
<Filed :span="12" :name="l('projectId')">{{ entity.projectId }}</Filed>
</Row>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
props: {
eid: String,
},
mounted() {
if (this.eid ) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.$emit("on-load");
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "project_log" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
},
},
};
</script>
<style lang="less">
.detail{
width: 100%;
}
</style>
\ No newline at end of file
<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('entity')" prop="entity">
<Input v-model="entity.entity"> </Input> </FormItem
></Col>
<Col :span="12">
<FormItem :label="l('entityId')" prop="entityId">
<Input v-model="entity.entityId"> </Input> </FormItem >
</Col>
<Col :span="12"
><FormItem :label="l('action')" prop="action">
<Dictionary
code="mes.project_log.Action"
v-model="entity.action"
></Dictionary>
</FormItem
></Col>
<Col :span="24"
><FormItem :label="l('content')" prop="content">
<Input
v-model="entity.content"
type="textarea"
:rows="5"
></Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('upId')" prop="upId">
<Input v-model="entity.upId"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('projectId')" prop="projectId">
<Input v-model="entity.projectId"> </Input> </FormItem
></Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled"
>保存</Button
>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Edit",
data() {
return {
disabled: false,
entity: {
},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
props: {
eid: String,
},
mounted() {
console.log("this.eid",this.eid)
if (this.eid) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
debugger
this.entity = r.result;
});
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.update(this.entity)
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "project_log" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action">
<template slot="searchForm">
<Search />
</template>
<!-- <template slot="buttons">
<Button type="primary" @click="add">新增</Button>
</template> -->
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
</div>
</template>
<script>
import Api from "./api";
import Search from "./search";
export default {
name: "list",
components: {
Search,
},
head: {
title: "项目日志",
author: "henq",
description: "project_log 10/20/2020 10:22:04 AM",
},
data() {
return {
action: Api.index,
easySearch: {},
modal: false,
title: "新增",
detail: null,
curId: "",
columns: [
{
key: "id",
title: this.$t("id"),
hide: true,
align: "left",
high: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
high: true,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "left",
high: true,
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
align: "left",
high: true,
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
align: "left",
high: true,
},
{
key: "isDeleted",
title: this.l("isDeleted"),
align: "left",
high: true,
},
{
key: "deletionTime",
title: this.l("deletionTime"),
align: "left",
high: true,
},
{
key: "deleterUserId",
title: this.l("deleterUserId"),
align: "left",
high: true,
},
{ key: "entity", title: this.l("entity"), align: "left", high: true },
{
key: "entityId",
title: this.l("entityId"),
align: "left",
high: true,
},
{
key: "action",
title: this.l("action"),
align: "left",
high: true,
code: "mes.project_log.Action",
},
{ key: "upId", title: this.l("upId"), align: "left", high: true },
{
key: "projectId",
title: this.l("projectId"),
align: "left",
high: true,
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
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: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) },
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) },
},
"删除"
),
]);
},
},
],
};
},
mounted() {
console.log(this);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = "";
},
search() {
this.$refs.grid.reload(this.easySearch);
},
// add() {
// this.curId = 0;
// 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("./list");
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.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
cancel() {
this.curId = "";
this.modal = false;
},
l(key) {
/*
project_log:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
entity:'实体',
entityId:'实体的id',
action:'行动',
content:'内容',
upId:'计划或任务id',
projectId:'项目id',
}
*/
let vkey = "project_log" + "." + key;
return this.$t(vkey) || key;
},
},
};
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<div>
<div class="formBg">
<Form ref="formInline" :model="easySearch" inline>
<FormItem>
<div class="taskMenu">
<Menu mode="horizontal" active-name="0" @on-select="onSelectTime">
<MenuItem name="0"> 所有 </MenuItem>
<MenuItem name="1"> 今天 </MenuItem>
<MenuItem name="2"> 昨天 </MenuItem>
<MenuItem name="3"> 本周 </MenuItem>
<MenuItem name="4"> 上周 </MenuItem>
<MenuItem name="5"> 本月 </MenuItem>
<MenuItem name="6"> 上月 </MenuItem>
</Menu>
<Dropdown @on-click="onSelectUser">
<a href="javascript:void(0)">
按用户查看
<Icon type="ios-arrow-down"></Icon>
</a>
<DropdownMenu slot="list">
<DropdownItem
v-for="(v, index) in list"
:key="index"
:name="v.userId"
>{{ v.note }}</DropdownItem
>
</DropdownMenu>
</Dropdown>
</div>
</FormItem>
<FormItem style="float: right">
<Button type="primary" @click="add" v-if="false">新增记录</Button>
</FormItem>
</Form>
</div>
<div>
<div class="group">
<Row>
<Col span="4">
<div class="fr boxBoder">
<List>
<ListItem>
<ListItemMeta>
<template slot="title">
<h3>{{ listTitle }}</h3>
</template>
<template slot="description">
{{ listTime }}
</template>
</ListItemMeta>
<template slot="action">
<li>
<Icon
type="md-arrow-dropright"
size="24"
color="#2d8cf0"
/>
</li>
</template>
</ListItem>
</List>
</div>
</Col>
<Col span="2">
<Divider class="dividerpram" />
</Col>
<Col span="18">
<div class="boxBoder">
<Timeline v-if="recordList && recordList.length > 0">
<TimelineItem
v-for="(item, index) in recordList"
:key="index"
v-if="recordList && recordList.length > 0"
>
<p class="TimelineItemli">
<!-- <span class="timeSpan">{{ item.creationTime }}</span> -->
<DTSpan class="timeSpan" :value="item.creationTime " />
<User :value="item.creatorUserId" />
<state code="mes.project_log.Action" :value="item.action" />
<!-- {{ item.entity }} {{ item.content }} -->
</p>
<!-- <p class="content">{{item.creationTime}}</p>
<p class="content">
<User :value="item.creatorUserId"></User>&nbsp;&nbsp;新增:{{item.title}}&nbsp;&nbsp;
<Tooltip max-width="400" v-if="item.note">
<a>详细信息</a>
<div slot="content">
<div v-html=" item.note"></div>
</div>
</Tooltip>
&nbsp;&nbsp;
</p>
<p v-if="item.note">
<div class="pl10" v-html="item.note"></div>
</p>
<p class="pl10" v-if="item.attachment"><a @click="viewFiles(item.attachment)">查看附件</a></p> -->
</TimelineItem>
</Timeline>
<p class="content" v-else>暂无数据</p>
</div>
</Col>
</Row>
</div>
</div>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
<Modal
v-model="modalFiles"
title="查看附件"
width="800"
footer-hide
:mask-closable="false"
>
<FilesView ref="refFile" :parms="parms" />
</Modal>
</div>
</template>
<script>
import Api from "./api";
import Search from "./search";
export default {
name: "list",
components: {
Search
},
head: {
title: "项目的工作记录",
author: "henq",
description: "project_plan_record 10/20/2020 2:55:13 PM",
},
props: {
eid: String,
projectId: String,
},
data() {
return {
action: Api.index,
easySearch: {
keys: {
op: "title",
value: null,
},
},
list: [],
users: "",
modalFiles: false,
modal: false,
title: "新增",
detail: null,
curId: "",
columns: [
{
key: "id",
title: this.$t("id"),
hide: true,
align: "left",
high: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
high: true,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "left",
high: true,
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
align: "left",
high: true,
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
align: "left",
high: true,
},
{
key: "isDeleted",
title: this.l("isDeleted"),
align: "left",
high: true,
},
{
key: "deletionTime",
title: this.l("deletionTime"),
align: "left",
high: true,
},
{
key: "deleterUserId",
title: this.l("deleterUserId"),
align: "left",
high: true,
},
{
key: "projectId",
title: this.l("projectId"),
align: "left",
high: true,
},
{
key: "planId",
title: this.l("planId"),
align: "left",
high: true,
},
{
key: "workHour",
title: this.l("workHour"),
align: "left",
high: true,
},
{
key: "status",
title: this.l("status"),
align: "left",
high: true,
code: "mes.project_plan_record.Status",
},
{
key: "title",
title: this.l("title"),
align: "left",
easy: true,
high: true,
},
{
key: "note",
title: this.l("note"),
align: "left",
high: true,
},
{
key: "attachment",
title: this.l("attachment"),
align: "left",
high: true,
},
{
key: "taskId",
title: this.l("taskId"),
align: "left",
high: true,
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
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: {
oprate: "edit",
},
on: {
click: () => this.edit(params.row.id),
},
},
"编辑"
),
h(
"op",
{
attrs: {
oprate: "delete",
},
on: {
click: () => this.remove(params.row.id),
},
},
"删除"
),
]
);
},
},
],
recordList: [],
parms: {
app: "taskRecord",
eid: null,
name: "",
field: "",
},
listTitle: "所有",
listTime: this.$u.getToday(),
startTime: "",
endTime: "",
};
},
mounted() {
if (this.eid) {
this.load();
this.moreGroup();
}
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
moreGroup() {
//按成员查看
let params = {
conditions: [
{
fieldName: "projectId",
fieldValue: this.eid,
conditionalType: "Equal",
},
],
};
if (this.projectId) {
params = {
conditions: [
{
fieldName: "projectId",
fieldValue: this.projectId,
conditionalType: "Equal",
},
],
};
}
Api.list(params).then((r) => {
if (r.success) {
let obj = {};
let list = r.result.reduce((cur, next) => {
obj[next.userId] ? "" : (obj[next.userId] = true && cur.push(next));
return cur;
}, []);
this.list = list;
}
});
},
load() {
var params = {
conditions: [
{
fieldName: "projectId",
fieldValue: this.eid,
conditionalType: "Equal",
},
],
};
if (this.startTime && this.endTime) {
params.conditions.push({
fieldName: "creationTime",
conditionalType: "Range",
fieldValue: `${this.startTime},${this.endTime}`,
});
}
if (this.users) {
params.conditions.push({
fieldName: "userId",
conditionalType: "Equal",
fieldValue: this.users,
});
}
Api.listall(params).then((r) => {
if (r.success) {
this.recordList = r.result;
// this.recordList.forEach((e) => {
// e.creationTime = e.creationTime.slice(11, 16);
// });
}
});
},
ok() {
this.load();
this.modal = false;
this.curId = "";
},
search() {
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = this.eid;
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.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
cancel() {
this.curId = 0;
this.modal = false;
},
viewFiles(val) {
this.parms.eid = val;
this.modalFiles = true;
},
onSelectUser(value) {
this.users = value;
this.load();
},
onSelectTime(name) {
let title = "所有";
let time = this.$u.getToday();
let startTime = "";
let endTime = "";
var date = new Date();
var year = date.getFullYear();
switch (name) {
case "0":
title = "所有";
time = "截止当前:" + this.$u.getToday();
startTime = "";
endTime = "";
break;
case "1":
title = "今天";
time = this.$u.getToday();
startTime = this.$u.getToday() + " 00:00:00";
endTime = this.$u.getToday() + " 23:59:59";
break;
case "2":
title = "昨天";
time = this.$u.getYestoday();
startTime = this.$u.getYestoday() + " 00:00:00";
endTime = this.$u.getYestoday() + " 23:59:59";
break;
case "3":
title = "本周";
time = this.$u.getCurMonday(1) + "--" + this.$u.getToday();
startTime = this.$u.getCurMonday(1) + " 00:00:00";
endTime = this.$u.getToday() + " 23:59:59";
break;
case "4":
title = "上周";
time = this.$u.getCurMonday(-6) + "--" + this.$u.getCurMonday(0);
startTime = this.$u.getCurMonday(-6) + " 00:00:00";
endTime = this.$u.getCurMonday(0) + " 23:59:59";
break;
case "5":
title = "本月";
time = this.$u.getCurMonth(0);
var month = date.getMonth() + 1;
var d = new Date(year, month, 0);
var d1 = new Date(d);
var datetime =
d.getFullYear() +
"-" +
(d.getMonth() + 1) +
"-" +
d.getDate() +
" ";
startTime = this.$u.getCurMonth(0) + "-01 00:00:00";
endTime = datetime + " 23:59:59";
break;
case "6":
title = "上月";
time = this.$u.getCurMonth(-1);
var month = date.getMonth();
var d = new Date(year, month, 0);
var d1 = new Date(d);
var datetime =
d.getFullYear() +
"-" +
(d.getMonth() + 1) +
"-" +
d.getDate() +
" ";
startTime = this.$u.getCurMonth(-1) + "-01 00:00:00";
endTime = datetime + " 23:59:59";
break;
default:
title = "所有";
time = "截止当前:" + this.$u.getToday();
startTime = "";
endTime = "";
break;
}
this.listTitle = title;
this.listTime = time;
this.startTime = startTime;
this.endTime = endTime;
this.load();
},
l(key) {
let vkey = "project_plan_record" + "." + key;
return this.$t(vkey) || key;
},
},
watch: {
eid(v) {
if (v != "" && v != null) {
this.load();
}
},
},
};
</script>
<style lang="less">
.formBg {
padding-top: 10px;
background: #f5f5f5;
line-height: 30px;
}
.formBg .taskMenu .ivu-menu-horizontal {
background: #f5f5f5;
}
.taskMenu {
display: inline-flex;
align-items: center;
}
.group {
margin-top: 15px;
}
.group .ivu-row {
border: none;
}
.time {
font-size: 14px;
font-weight: bold;
}
.content {
padding-left: 5px;
}
.boxBoder {
border: 2px solid #2db7f5;
border-radius: 5px;
padding: 10px 20px;
display: flex;
.ivu-timeline {
margin-left: 80px;
}
.TimelineItemli {
position: relative;
.timeSpan {
position: absolute;
left: -109px;
}
}
}
.dividerpram {
background-color: #2db7f5;
height: 2px;
}
</style>
<template>
<Form ref="form" :model="condition" :label-width="90">
<Row>
<Col :span="12" :v-if="condition.id.show"
><FormItem :label="$t('id')" prop="id">
<Input v-model="condition.id.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.creationTime.show"
><FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker
type="daterange"
v-model="condition.creationTime.value"
></DatePicker> </FormItem
></Col>
<Col :span="12" :v-if="condition.creatorUserId.show"
><FormItem :label="l('creatorUserId')" prop="creatorUserId">
<Input v-model="condition.creatorUserId.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.lastModificationTime.show"
><FormItem
:label="l('lastModificationTime')"
prop="lastModificationTime"
>
<DatePicker
type="daterange"
v-model="condition.lastModificationTime.value"
></DatePicker> </FormItem
></Col>
<Col :span="12" :v-if="condition.lastModifierUserId.show"
><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<Input v-model="condition.lastModifierUserId.value">
</Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.deletionTime.show"
><FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker
type="daterange"
v-model="condition.deletionTime.value"
></DatePicker> </FormItem
></Col>
<Col :span="12" :v-if="condition.entity.show"
><FormItem :label="l('entity')" prop="entity">
<Input v-model="condition.entity.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.entityId.show"
><FormItem :label="l('entityId')" prop="entityId">
<Input v-model="condition.entityId.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.action.show"
><FormItem :label="l('action')" prop="action">
<Dictionary
code="mes.project_log.Action"
v-model="condition.action.value"
></Dictionary> </FormItem
></Col>
<Col :span="24" :v-if="condition.content.show"
><FormItem :label="l('content')" prop="content">
<Input v-model="condition.content.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.upId.show"
><FormItem :label="l('upId')" prop="upId">
<Input v-model="condition.upId.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.projectId.show"
><FormItem :label="l('projectId')" prop="projectId">
<Input v-model="condition.projectId.value"> </Input> </FormItem
></Col>
</Row>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
condition: {
id: { op: "Equal", value: null, show: true },
creationTime: { op: "Range", value: null, show: true },
creatorUserId: { op: "Equal", value: null, show: true },
lastModificationTime: { op: "Range", value: null, show: true },
lastModifierUserId: { op: "Equal", value: null, show: true },
deletionTime: { op: "Range", value: null, show: true },
entity: { op: "Equal", value: null, show: true },
entityId: { op: "Equal", value: null, show: true },
action: { op: "Equal", value: null, show: true },
content: { op: "Equal", value: null, show: true },
upId: { op: "Equal", value: null, show: true },
projectId: { op: "Equal", value: null, show: true },
},
};
},
methods: {
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "project_log" + "." + key;
return this.$t(key);
},
},
};
</script>
\ No newline at end of file
<template>
<div>
<Card>
<EditGrid :columns="columns" ref="grid" :items="list"
>
<EditGrid :columns="columns" ref="grid" :items="list" >
<template slot="easySearch"><Form ref="formInline" :model="easySearch" inline><FormItem prop="keys"><Input placeholder="请输入关键字标题" v-model="easySearch.keys.value" /> </FormItem>
<FormItem><Button type="primary" @click="search">查询</Button>
</FormItem>
......@@ -100,7 +99,7 @@ export default {
type: "icon",
title: "派发",
oprate: "edit",
disable:params.row.status
disable:params.row.status!=0
},
on: { click: () => this.send(params.row) },
},
......@@ -111,6 +110,7 @@ export default {
attrs: { icon: "md-add",
type: "icon",
title: "新增子任务",
disable:params.row.status>1,
oprate: "edit",},
on: { click: () => this.add(params.row) },
}
......@@ -121,7 +121,9 @@ export default {
attrs: { icon: "md-create",
type: "icon",
title: "编辑",
oprate: "edit", },
oprate: "edit",
disable:params.row.status!==0,
},
on: { click: () => this.edit(params.row.id) },
}
),
......@@ -132,6 +134,7 @@ export default {
type: "icon",
title: "删除",
oprate: "delete",
disable:params.row.status!==0,
msg: "确认要删除吗?" },
on: { click: () => this.remove(params.row.id) },
}
......
......@@ -136,11 +136,12 @@ export default {
},
group() {
this.title = "项目成员";
this.detail = () => import("../groupUser/index1");
this.detail = () => import("../groupUser/list");
},
log() {
this.title = "项目动态";
this.detail = () => import("../record/index1");
log() {
this.curId = this.eid;
this.title = "动态";
this.detail = () => import("../log/list");
},
l(key) {
key = "project_main" + "." + key;
......
......@@ -12,13 +12,12 @@
</Col>
<Col :span="24">
<FormItem :label="l('note')" prop="note">
<i-quill v-model="entity.note" :height="300" v-paste="handleImg" /></Input>
<i-quill v-model="entity.note" :height="300" v-paste="handleImg" />
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('attachment')" prop="attachment">
<files ref="refFile" :parms="parms" files />
</Input>
</FormItem>
</Col>
</Row>
......@@ -41,17 +40,9 @@ export default {
return {
disabled: false,
entity: {
creationTime: null,
creatorUserId: null,
lastModificationTime: null,
lastModifierUserId: null,
isDeleted: null,
deletionTime: null,
deleterUserId: null,
projectId: "",
planId: "",
workHour: 0,
status: null,
title: "",
note: "",
attachment: "",
......@@ -64,21 +55,33 @@ export default {
field: "",
},
rules: {
name: [{
title: [{
required: true,
message: '必填',
trigger: 'blur'
}],
workHour: [{
required: true,
message: '必填',
trigger: 'blur',
type: "number"
}]
}
}
},
props: {
v: Object,
eid: String
eid: String,
row: {
type: Object,
default: () => {
return null;
},
},
},
mounted() {
if (this.eid != "") {
this.load(this.eid);
// this.load(this.eid);
this.parms.eid = this.$u.guid();
}
},
......@@ -93,6 +96,8 @@ export default {
}
this.disabled = true;
this.entity.taskId = this.eid
this.entity.projectId = this.row.projectId
this.entity.planId = this.row.planId
Api.create(this.entity).then((r) => {
this.disabled = false;
if (r.success) {
......@@ -148,13 +153,19 @@ export default {
},
watch: {
v() {
this.entity = this.$u.clone(this.v)
//this.entity = this.$u.clone(this.v)
},
eid(v) {
if (v != "") {
this.load(v);
}
}
},
row(v) {
if (v != null) {
//this.entity.projectId = v.projectId
//this.entity.planId = v.planId
}
},
}
}
</script>
......@@ -12,13 +12,12 @@
</Col>
<Col :span="24">
<FormItem :label="l('note')" prop="note">
<i-quill v-model="entity.note" :height="300" v-paste="handleImg" /></Input>
<i-quill v-model="entity.note" :height="300" v-paste="handleImg" />
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('attachment')" prop="attachment">
<files ref="refFile" :parms="parms" files />
</Input>
</FormItem>
</Col>
</Row>
......@@ -46,7 +45,7 @@ export default {
required: true,
message: '必填',
trigger: 'blur'
}]
}],
},
parms: {
app: "taskRecord",
......
......@@ -98,7 +98,7 @@ export default {
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
align: "center",
high: true,
},
{
......
......@@ -17,14 +17,13 @@
<p class="content">
操作员:<User :value="item.creatorUserId"></User>
</p>
<p class="content">
<p class="content" v-if="item.workHour&&item.workHour>0">
工时:{{item.workHour}}
</p>
<p class="content">
标题:{{item.title}}
</p>
<p class="pl10" v-if="item.note"><a @click="view(item.id)">查看详细</a></p>
<p class="pl10" v-if="item.attachment"><a @click="viewFiles(item.attachment)">查看附件</a></p>
<p class="pl10" v-if="item.note&&item.note.length>0"><a @click="view(item.id)">查看详细</a></p>
</TimelineItem>
</Timeline>
<p class="content" v-else>暂无数据</p>
......
......@@ -12,12 +12,12 @@
</Col>
<Col :span="12">
<FormItem :label="l('userId')" prop="userId">
<UserSelect ref="userSelected" v-model="entity.userId" />
<UserGroup v-model="entity.userId" :projectId="eid" />
</FormItem>
</Col>
<Col :span="12">
<FormItem label="计划起止日期" prop="date">
<DatePicker type="datetimerange" format="yyyy-MM-dd" v-model="date" placeholder="请选择时间范围" @on-change="changeFormat" style="width: 300px"></DatePicker>
<FormItem label="计划日期" prop="date">
<DatePicker type="datetimerange" format="yyyy-MM-dd" placeholder="请选择时间范围" @on-change="changeFormat" style="width: 300px"></DatePicker>
</FormItem>
</Col>
<Col :span="24">
......
<template>
<div class="detail" style="width:100%;overflow:auto">
<div style="width:80%; border-right:1px solid #ccc;padding-right:30px;float:left">
<Row style="height:284px">
<Filed :span="12" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="12" :name="l('level')">
<state code="project.task.level" :value="entity.level" type="text"></state>
</Filed>
<Filed :span="12" :name="l('status')">
<state code="project.task.status" :value="entity.status" type="text"></state>
</Filed>
<Filed :span="12" :name="l('userId')">
<User :value="parseInt(entity.userId)"></User>
</Filed>
<Filed :span="12" name="计划起止日期">
<TimeDifference :timeValue="timeValuePlan" :work="0"></TimeDifference>
</Filed>
<Filed :span="12" name="实际起止日期">
<TimeDifference :timeValue="timeValue" :work="1"></TimeDifference>
</Filed>
<div class="flex">
<div class="fg1">
<Card>
<p slot="title">任务信息</p>
<div class="detail">
<Row>
<Filed :span="6" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="6" :name="l('creatorUserId')">
<User :value="entity.creatorUserId" />
</Filed>
<Filed :span="6" :name="l('level')">
<State code="project.task.level" :value="entity.level" />
</Filed>
<Filed :span="6" :name="l('status')">
<State code="project.task.status" :value="entity.status" />
</Filed>
<Filed :span="12" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="12" :name="l('userId')">{{entity.userId}}
<User :value="entity.creatorUserId" />
</Filed>
<Filed :span="24" :name="l('userIds')">
<User v-for="(li,i) in entity.userIds" :value="li" :key="i" class="ml10" />
</Filed>
<Filed :span="12" :name="l('startDate')">
<DateRange :value="entity"></DateRange>
</Filed>
<Filed :span="12" :name="l('plansToStartDate')">
<DateRange :value="entity" start="plansToStartDate" end="plansToEndTime"></DateRange>
</Filed>
<Filed :span="24" :name="l('note')">
<div v-html="entity.note"></div>
</Filed>
<Filed :span="24" :name="l('note')">
<div style="height:200px" v-html="entity.note" class="tex_in10"></div>
</Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">
<User :value="entity.creatorUserId"></User>
</Filed>
</Row>
<!-- <Filed :span="12" :name="l('plansToEndTime')">{{entity.plansToEndTime}}</Filed> -->
<!-- <Filed :span="12" :name="l('completePercentage')">{{entity.completePercentage}}</Filed>
<Filed :span="12" :name="l('upTaskId')">{{entity.upTaskId}}</Filed> -->
</Row>
</div>
</Form>
</Card>
<Card class="mt10" v-if="entity.status!=2">
<p slot="title">任务汇报</p>
<div class="form">
<Form :label-width="120" ref="formValidate">
<Row :gutter="24">
<Col :span="24">
<FormItem label="任务状态">
<RadioGroup v-model="status">
<Radio :label="1">工作中</Radio>
<Radio :label="2">完成</Radio>
<Radio :label="3">冻结</Radio>
</RadioGroup>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="标题" prop="title"> <Input v-model="entitysave.title" />
</FormItem>
</Col>
<Col :span="12">
<FormItem label="工时" prop="workHour">
<InputNumber v-model="entitysave.workHour" :min="0"></InputNumber>
</FormItem>
</Col>
<Col :span="24">
<FormItem label="内容" prop="note">
<Input type="textarea" v-model="entitysave.note" :height="100" />
</FormItem>
</Col>
<Col :span="12">
<FormItem label="附件" prop="attachment">
<files ref="refFile" :parms="parms" files />
</Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="updatepart" class="mr10">确定</Button><Button @click="handleClose">取消</Button>
</FormItem>
</Form>
</div>
</Card>
</div>
<div class="rightDiv" :style="{height:divHeight}">
<component :is="detail" :eid="curId" />
<div v-width="500" class="pl20">
<Card>
<p slot="title">工作记录</p>
<component :is="detail" :eid="curId" />
</Card>
</div>
<FooterToolbar class="ftball">
<div class="tip"><Button type="primary" @click="updatepart(2)">完成</Button><Button type="primary" @click="updatepart(3)">冻结</Button><Button @click="handleClose">取消</Button></div>
</FooterToolbar>
</div>
</template>
<script>
import Api from './api'
import ApiTask from '../task/api'
import Api from "./api";
import ApiRecord from "../record/api";
export default {
name: 'Add',
name: "Add",
data() {
return {
entity: {},
parms: {
app: "taskRecord",
eid: null,
name: "",
field: "",
},
status: null,
entitysave: {
projectId: "",
planId: "",
workHour: 0,
title: "",
note: "",
attachment: "",
taskId: "",
},
timeValue: {
startDate: "",
endDate: "",
......@@ -54,104 +124,93 @@ export default {
startDate: "",
endDate: "",
},
divHeight: '200px',
divHeight: "200px",
rules: {
name: [{
title: [{
required: true,
message: '必填',
trigger: 'blur'
}],
code: [{
message: "必填",
trigger: "blur",
}, ],
workHour: [{
required: true,
message: '必填',
trigger: 'blur'
}]
message: "必填",
trigger: "blur",
type: "number"
}, ],
},
detail: null,
curId: '',
}
curId: "",
};
},
props: {
eid: String
},
created() {
this.divHeight = window.innerHeight - 150 + 'px'
eid: String,
},
created() {},
mounted() {
if (this.eid != '' && this.eid != null) {
if (this.eid) {
this.load(this.eid);
}
window.onresize = () => {
return (() => {
this.divHeight = window.innerHeight - 150 + 'px'
})()
}
},
methods: {
load(v) {
Api.get({
id: v
}).then(r => {
id: v,
}).then((r) => {
this.entity = r.result;
this.timeValue = {
startDate: r.result.startDate,
endDate: r.result.endDate,
},
this.timeValuePlan = {
startDate: r.result.plansToStartDate,
endDate: r.result.plansToEndTime,
},
this.$emit('on-load')
this.curId = v
this.detail = () => import('../record/recordTimeLine')
})
this.status = this.entity.status;
this.entitysave.projectId = this.entity.projectId;
this.entitysave.planId = this.entity.planId;
this.entitysave.taskId = this.eid;
//控制radio显示end
this.$emit("on-load");
this.curId = v;
this.detail = () => import("../record/recordTimeLine");
});
},
updatepart(valStatus) {
let params = {
id: this.eid,
status: valStatus
updatepart() {
if (this.status != this.entity.status) {
let params = {
id: this.eid,
status: this.status,
};
Api.updatepart(params).then((r) => {
if (r.success) {
this.$Message.success("任务状态汇报成功");
this.$emit("on-ok");
} else {
this.$Message.error("操作失败");
}
});
}
if (valStatus == 1) {
params.startDate = ''
}
if (valStatus == 2) {
params.endDate = ''
}
ApiTask.updatepart(params).then(r => {
if (r.success) {
this.$Message.success('操作成功')
this.$emit('on-ok')
ApiRecord.create(this.entitysave).then((res) => {
if (res.success) {
this.$Message.success("工时汇报成功");
this.$emit("on-ok");
} else {
this.$Message.error('操作失败')
this.$Message.error("保存失败");
}
}).catch(err => {
this.disabled = false;
this.$Message.error('操作失败')
console.warn(err)
})
});
},
handleClose() {
this.$emit('on-close')
this.$emit("on-close");
},
l(key) {
key = "project_task" + "." + key;
return this.$t(key)
}
return this.$t(key);
},
},
watch: {
eid(v) {
if (v != '' && v != null) {
if (v) {
this.load(v);
}
}
}
}
},
},
};
</script>
<style scoped>
.tex_in10 {
text-indent: 12px;
text-align: inherit !important;
}
......@@ -159,6 +218,5 @@ export default {
width: 18%;
float: left;
padding-left: 50px;
}
</style>
......@@ -12,13 +12,17 @@
</Col>
<Col :span="12">
<FormItem :label="l('userId')" prop="userId">
<UserSelect ref="userSelected" v-model="entity.userId" /></Input>
<UserGroup v-model="entity.userId" :projectId="entity.projectId" />
</FormItem>
</Col>
<Col :span="12">
<FormItem label="计划日期" prop="date">
<DatePicker type="datetimerange" format="yyyy-MM-dd" placeholder="请选择时间范围" v-model="planDate" @on-change="changeFormat" style="width: 300px"></DatePicker>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('note')" prop="note">
<i-quill v-model="entity.note" :height="300" v-paste="handleImg" /></Input>
<i-quill v-model="entity.note" :height="300" v-paste="handleImg" />
</FormItem>
</Col>
</Row>
......@@ -44,6 +48,7 @@ export default {
return {
disabled: false,
entity: {},
planDate: [],
rules: {
name: [{
required: true,
......@@ -74,6 +79,9 @@ export default {
}).then(r => {
this.entity = r.result;
this.entity.userId = parseInt(r.result.userId)
if (r.result.plansToStartDate && r.result.plansToStartDate != '' && r.result.plansToEndTime && r.result.plansToEndTime != '') {
this.planDate = [r.result.plansToStartDate, r.result.plansToEndTime]
}
})
},
handleSubmit() {
......@@ -120,6 +128,10 @@ export default {
// new R
}
},
changeFormat(val) {
this.entity.plansToStartDate = val[0];
this.entity.plansToEndTime = val[1];
},
l(key) {
key = "project_task" + "." + key;
return this.$t(key)
......
......@@ -8,7 +8,7 @@
<Icon type="ios-arrow-forward" size="24" />
</a>
</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">
<template slot="easySearch">
<Form ref="formInline" inline>
......@@ -44,15 +44,6 @@
-->
</Menu>
</div>
<div class="taskTab" v-if="false">
<Tabs value="statu2">
<TabPane label="所有" name="statu1" />
<TabPane label="未关闭" name="statu2" />
<TabPane label="指派给我" name="statu3" />
<TabPane label="由我参与" name="statu4" />
<TabPane label="已延期" name="statu5" />
</Tabs>
</div>
</FormItem>
<FormItem prop="keys"><Input placeholder="请输入项目标题/计划名称/任务标题" v-model="easySearch.keys.value" v-width="240" /> </FormItem>
<FormItem><Button type="primary" @click="search">查询</Button></FormItem>
......@@ -66,16 +57,11 @@
</Form>
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>
</template>
<template slot="batch">
<Button type="primary" class="mr10 ml10">开始</Button>
<Button type="primary" class="mr10 ml10">暂停</Button>
<Button type="primary" class="mr10 ml10">继续</Button>
<Button type="primary" @click="add" v-if="planId!=''">新增</Button>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" :fullscreen="fullScreen" footer-hide>
<component :is="detail" :eid="curId" :pid="planId" @on-close="cancel" @on-ok="ok" />
<component :is="detail" :eid="curId" :pid="planId" :row="rowObj" @on-close="cancel" @on-ok="ok" />
</Modal>
</Content>
</Layout>
......@@ -110,12 +96,17 @@ export default {
planId: {
op: "In",
value: []
},
status: {
op: "In",
value: []
}
},
theme1: 'light',
modal: false,
title: "新增",
detail: null,
rowObj: null,
curId: '',
fullScreen: false,
projectId: '',
......@@ -163,7 +154,7 @@ export default {
title: this.l("status"),
align: "center",
high: true,
width: 120,
width: 100,
code: 'project.task.status'
},
......@@ -176,36 +167,30 @@ export default {
},
{
key: "startDate",
title: '计划起止日期',
title: '实际日期',
align: "center",
high: true,
width: 200,
width: 280,
render: (h, params) => {
return h('TimeDifference', {
return h('DateRange', {
props: {
timeValue: {
startDate: params.row.plansToStartDate,
endDate: params.row.plansToEndTime,
},
work: 0
value: params.row,
}
})
}
},
{
key: "startDate",
title: '实际起止日期',
title: '计划日期',
align: "center",
high: true,
width: 200,
width: 280,
render: (h, params) => {
return h('TimeDifference', {
return h('DateRange', {
props: {
timeValue: {
startDate: params.row.startDate,
endDate: params.row.endDate,
},
work: 1
value: params.row,
start: "plansToStartDate",
end: "plansToEndTime",
}
})
}
......@@ -262,8 +247,8 @@ export default {
icon: "md-arrow-dropright-circle",
type: "icon",
oprate: "edit",
title: params.row.status == 0 ? "开始" : params.row.status == 2 ? "继续" : '',
disable: params.row.status
title: "开始",
disable: params.row.status == 0 ? false : true
},
on: {
click: () => this.updatepart(params.row.id, 1)
......@@ -274,11 +259,11 @@ export default {
icon: "ios-alarm",
type: "icon",
oprate: "edit",
title: "完成",
disable: params.row.status == 1 ? 0 : 1
title: "汇报工作",
disable: params.row.status == 1 || params.row.status == 3 ? false : true
},
on: {
click: () => this.updatepart(params.row.id, 2)
click: () => this.viewRecord(params.row.id, params.row.status)
}
}),
h('op', {
......@@ -287,10 +272,10 @@ export default {
type: "icon",
oprate: "add",
title: "新增记录",
disable: params.row.status == 1 ? 0 : 1
disable: params.row.status == 1 ? false : true
},
on: {
click: () => this.addRecord(params.row.id)
click: () => this.addRecord(params.row)
}
}),
h('op', {
......@@ -299,7 +284,7 @@ export default {
type: "icon",
oprate: "edit",
title: "修改",
disable: params.row.status
disable: params.row.status == 0 ? false : true
},
on: {
click: () => this.edit(params.row.id)
......@@ -311,7 +296,7 @@ export default {
type: "icon",
title: "删除",
oprate: 'delete',
disable: params.row.status
disable: params.row.status == 0 ? false : true
},
on: {
click: () => this.remove(params.row.id)
......@@ -357,7 +342,7 @@ export default {
ok() {
this.$refs.grid.load()
this.modal = false
this.curId = 0;
this.curId = '';
},
search() {
this.easySearch.planId.value = this.planIdsCur
......@@ -407,7 +392,7 @@ export default {
})
},
cancel() {
this.curId = 0;
this.curId = '';
this.modal = false
},
onHide() {
......@@ -475,8 +460,9 @@ export default {
this.detail = () => import('../record')
this.modal = true;
},
addRecord(id) {
this.curId = id;
addRecord(row) {
this.curId = row.id;
this.rowObj = row
this.title = "新增记录";
this.fullScreen = false;
this.detail = () => import('../record/add')
......
<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('title')" prop="title">
<Input v-model="entity.title"> </Input> </FormItem
></Col>
<Col :span="24"
><FormItem :label="l('note')" prop="note">
<Input
v-model="entity.note"
type="textarea"
:rows="5"
></Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('template')" prop="template">
<Input v-model="entity.template"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('attachment')" prop="attachment">
<Input v-model="entity.attachment"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('type')" prop="type">
<Dictionary code="project.task.level" v-model="entity.type"></Dictionary>
<!-- <Dictionary
code="mes.project_template.Type"
v-model="entity.type"
></Dictionary> -->
</FormItem >
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled"
>保存</Button
>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
disabled: false,
entity: {
creationTime: null,
creatorUserId: null,
lastModificationTime: null,
lastModifierUserId: null,
isDeleted: null,
deletionTime: null,
deleterUserId: null,
title: "",
note: "",
template: "",
attachment: "",
type: null,
},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
props: {
v: Object,
eid: String,
},
mounted() {
if (this.eid ) {
this.load(this.eid);
}
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.create(this.entity)
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.entity.id = 0;
});
},
l(key) {
key = "project_template" + "." + key;
return this.$t(key);
},
},
watch: {
v() {
this.entity = this.$u.clone(this.v);
},
eid(v) {
if (v !="") {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index: `${material}/projecttemplate/paged`,
paged(params) {
return Api.post(`${material}/projecttemplate/paged`, params);
},
get(params) {
return Api.get(`${material}/projecttemplate/get`, params);
},
create(params) {
return Api.post(`${material}/projecttemplate/create`, params);
},
update(params) {
return Api.post(`${material}/projecttemplate/update`, params);
},
delete(id) {
return Api.delete(`${material}/projecttemplate/delete`, { params: { id: id } });
},
deletes(params) {
return Api.post(`${material}/projecttemplate/batchdelete`, params);
}
}
\ No newline at end of file
<template>
<div class="detail">
<Row>
<!-- <Filed :span="12" :name="l('creationTime')">{{
entity.creationTime
}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">{{
entity.creatorUserId
}}</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{
entity.lastModificationTime
}}</Filed>
<Filed :span="12" :name="l('lastModifierUserId')">{{
entity.lastModifierUserId
}}</Filed>
<Filed :span="12" :name="l('isDeleted')">{{ entity.isDeleted }}</Filed>
<Filed :span="12" :name="l('deletionTime')">{{
entity.deletionTime
}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{
entity.deleterUserId
}}</Filed> -->
<Filed :span="12" :name="l('title')">{{ entity.title }}</Filed>
<Filed :span="12" :name="l('template')">{{ entity.template }}</Filed>
<Filed :span="12" :name="l('attachment')">{{ entity.attachment }}</Filed>
<Filed :span="12" :name="l('type')">{{ entity.type }}</Filed>
<Filed :span="24" :name="l('note')">{{ entity.note }}</Filed>
</Row>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
props: {
eid: String,
},
mounted() {
if (this.eid ) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.$emit("on-load");
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "project_template" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v !="") {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
<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('title')" prop="title">
<Input v-model="entity.title"> </Input> </FormItem
></Col>
<Col :span="24"
><FormItem :label="l('note')" prop="note">
<Input
v-model="entity.note"
type="textarea"
:rows="5"
></Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('template')" prop="template">
<Input v-model="entity.template"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('attachment')" prop="attachment">
<Input v-model="entity.attachment"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('type')" prop="type">
<!-- code="mes.project_template.Type" -->
<Dictionary
code="project.task.level"
v-model="entity.type"
></Dictionary> </FormItem
></Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled" >保存</Button >
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Edit",
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
props: {
eid: String,
},
mounted() {
if (this.eid) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
});
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.update(this.entity)
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "project_template" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v != "") {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action"
><template slot="easySearch"
><Form ref="formInline" :model="easySearch" inline
><FormItem prop="keys"
><Input
placeholder="请输入关键字标题"
v-model="easySearch.keys.value"
/>
</FormItem>
<FormItem
><Button type="primary" @click="search">查询</Button></FormItem
>
</Form></template
>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
</div>
</template>
<script>
import Api from "./api";
import Search from "./search";
export default {
name: "list",
components: {
Search,
},
head: {
title: "",
author: "henq",
description: "project_template 10/29/2020 5:40:26 PM",
},
data() {
return {
action: Api.index,
easySearch: {
keys: { op: "title", value: null },
},
modal: false,
title: "新增",
detail: null,
curId: 0,
columns: [
{
key: "id",
title: this.$t("id"),
hide: true,
align: "left",
high: true,
},
// {
// key: "creationTime",
// title: this.l("creationTime"),
// align: "left",
// high: true,
// },
// {
// key: "creatorUserId",
// title: this.l("creatorUserId"),
// align: "left",
// high: true,
// },
// {
// key: "lastModificationTime",
// title: this.l("lastModificationTime"),
// align: "left",
// high: true,
// },
// {
// key: "lastModifierUserId",
// title: this.l("lastModifierUserId"),
// align: "left",
// high: true,
// },
// {
// key: "isDeleted",
// title: this.l("isDeleted"),
// align: "left",
// high: true,
// },
// {
// key: "deletionTime",
// title: this.l("deletionTime"),
// align: "left",
// high: true,
// },
// {
// key: "deleterUserId",
// title: this.l("deleterUserId"),
// align: "left",
// high: true,
// },
{
key: "title",
title: this.l("title"),
align: "left",
easy: true,
high: true,
},
{
key: "attachment",
title: this.l("attachment"),
align: "left",
high: true,
},
{
key: "type",
title: this.l("type"),
align: "left",
high: true,
code:"project.task.level"
// code: "mes.project_template.Type",
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
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: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) },
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) },
},
"删除"
),
]);
},
},
],
};
},
mounted() {
console.log(this);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = "";
},
search() {
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = "";
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.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
cancel() {
this.curId = 0;
this.modal = false;
},
l(key) {
/*
project_template:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'标题',
note:'请注意',
template:'模板',
attachment:'附件',
type:'模版类型',
}
*/
let vkey = "project_template" + "." + key;
return this.$t(vkey) || key;
},
},
};
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<Form ref="form" :model="condition" :label-width="90">
<Row>
<Col :span="12" :v-if="condition.id.show"
><FormItem :label="$t('id')" prop="id">
<Input v-model="condition.id.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.creationTime.show"
><FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker
type="daterange"
v-model="condition.creationTime.value"
></DatePicker> </FormItem
></Col>
<Col :span="12" :v-if="condition.creatorUserId.show"
><FormItem :label="l('creatorUserId')" prop="creatorUserId">
<Input v-model="condition.creatorUserId.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.lastModificationTime.show"
><FormItem
:label="l('lastModificationTime')"
prop="lastModificationTime"
>
<DatePicker
type="daterange"
v-model="condition.lastModificationTime.value"
></DatePicker> </FormItem
></Col>
<Col :span="12" :v-if="condition.lastModifierUserId.show"
><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<Input v-model="condition.lastModifierUserId.value">
</Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.deletionTime.show"
><FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker
type="daterange"
v-model="condition.deletionTime.value"
></DatePicker> </FormItem
></Col>
<Col :span="12" :v-if="condition.title.show"
><FormItem :label="l('title')" prop="title">
<Input v-model="condition.title.value"> </Input> </FormItem
></Col>
<Col :span="24" :v-if="condition.note.show"
><FormItem :label="l('note')" prop="note">
<Input v-model="condition.note.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.attachment.show"
><FormItem :label="l('attachment')" prop="attachment">
<Input v-model="condition.attachment.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.type.show"
><FormItem :label="l('type')" prop="type">
<Dictionary
code="mes.project_template.Type"
v-model="condition.type.value"
></Dictionary> </FormItem
></Col>
</Row>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
condition: {
id: { op: "Equal", value: null, show: true },
creationTime: { op: "Range", value: null, show: true },
creatorUserId: { op: "Equal", value: null, show: true },
lastModificationTime: { op: "Range", value: null, show: true },
lastModifierUserId: { op: "Equal", value: null, show: true },
deletionTime: { op: "Range", value: null, show: true },
title: { op: "Equal", value: null, show: true },
note: { op: "Equal", value: null, show: true },
attachment: { op: "Equal", value: null, show: true },
type: { op: "Equal", value: null, show: true },
},
};
},
methods: {
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "project_template" + "." + key;
return this.$t(key);
},
},
};
</script>
\ No newline at end of file
......@@ -76,7 +76,7 @@ import InputCode from '@/components/page/inputCode.vue'
import Pictrue from '@/components/page/pictrue.vue'
import WordTree from '@/components/page/wordTree.vue'
import Actions from '@/components/page/actions.vue'
import DateDRange from '@/components/page/dateRange.vue'
import DateRange from '@/components/page/dateRange.vue'
import FilesViewer from '@/components/page/filesViewer.vue'
......@@ -158,7 +158,7 @@ Vue.component("InputCode", InputCode)
Vue.component("Pictrue", Pictrue)
Vue.component("WordTree", WordTree)
Vue.component("Actions", Actions)
Vue.component("DateDRange", DateDRange)
Vue.component("DateRange", DateRange)
Vue.component("Life", Life)
Vue.component("FilesViewer",FilesViewer)
......
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