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
This diff is collapsed.
This diff is collapsed.
<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
This diff is collapsed.
<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">
......
This diff is collapsed.
......@@ -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