Commit 6dcc37b6 authored by 仇晓婷's avatar 仇晓婷

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

parents f17feb44 b6524048
...@@ -45,7 +45,10 @@ div::-webkit-scrollbar-thumb:hover { ...@@ -45,7 +45,10 @@ div::-webkit-scrollbar-thumb:hover {
div::-webkit-scrollbar-corner { div::-webkit-scrollbar-corner {
background: @scrollbar-corner-bg-color; background: @scrollbar-corner-bg-color;
} }
.ivu-date-picker{
display: block;
width: 100%;
}
/*flex*/ /*flex*/
.flex { .flex {
display: flex; display: flex;
......
<template> <template>
<div class="time-view" v-if="startDate && endDate"> <DatePicker
v-if="edit"
:open="open"
:value="value3"
type="datetimerange"
@on-change="handleChange"
@on-clear="handleClear"
@on-ok="handleClear"
confirm
>
<div
class="time-range ivu-input"
href="javascript:void(0)"
@click="handleClick"
>
<Icon type="ios-calendar-outline"></Icon>
<div class="time-view" v-if="startDate && endDate">
<span>{{ startDate }}</span>
<span class="jian-tou">{{ jg }} {{ unit }}</span>
<span>{{ endDate }}</span>
</div>
<span v-else v-text="placeholder"> </span>
</div>
</DatePicker>
<div class="time-view" v-else-if="!edit && startDate && endDate">
<span>{{ startDate }}</span> <span>{{ startDate }}</span>
<span class="jian-tou">{{ jg }} {{ unit }}</span> <span class="jian-tou">{{ jg }} {{ unit }}</span>
<span>{{ endDate }}</span> <span>{{ endDate }}</span>
</div> </div>
</template> </template>
...@@ -9,12 +33,14 @@ ...@@ -9,12 +33,14 @@
import dayjs from "dayjs"; import dayjs from "dayjs";
export default { export default {
name: "", name: "",
model: {
prop: "value",
event: "on-change",
},
data() { data() {
return { return {
startDate: null, value3: [this.value[this.start],this.value[this.endDate]],
endDate: null, open: false,
unit: "天",
jg: 0,
}; };
}, },
props: { props: {
...@@ -23,6 +49,14 @@ export default { ...@@ -23,6 +49,14 @@ export default {
type: String, type: String,
default: "startDate", default: "startDate",
}, },
unit: {
type: String,
default: "天",
},
placeholder: {
type: String,
default: "请选择时间范围",
},
end: { end: {
type: String, type: String,
default: "endDate", default: "endDate",
...@@ -35,51 +69,77 @@ export default { ...@@ -35,51 +69,77 @@ export default {
type: [String, Object], type: [String, Object],
default: "", default: "",
}, },
edit: {
type: Boolean,
default: false,
},
work: { work: {
type: [String, Number], //传入的work为0,转换为小时,1为天,2为周,3为月 type: [String, Number], //传入的work为0,转换为小时,1为天,2为周,3为月
default: 8, default: 8,
}, },
}, },
created() {
mounted() {
this.init();
}, },
methods: { methods: {
init(v) { handleClick() {
if (v) { this.open = !this.open;
var start = dayjs(v[this.start]); },
var end = dayjs(v[this.end]); handleChange(date, t) {
this.startDate=start.format("YYYY-MM-DD"); if (date.length == 2) {
this.endDate=end.format("YYYY-MM-DD"); this.value3 = date;
this.jg=end.diff(start,'day'); this.value[this.start] = date[0];
this.value[this.end] = dayjs(date[1]).format("YYYY-MM-DD 23:59:59");
this.$emit("on-change", this.value);
} }
this.open = false;
},
handleClear() {
this.open = false;
}, },
}, },
watch: { computed: {
value: { startDate() {
handler: function (n, v) { if (this.value && this.value[this.start]) {
this.init(n); var start = dayjs(this.value[this.start]);
}, return start.format("YYYY-MM-DD");
deep: true, }
}, },
endDate() {
if (this.value&&this.value[this.end]) {
var end = dayjs(this.value[this.end]);
return end.format("YYYY-MM-DD");
}
},
jg(){
if (this.value&&this.value[this.start] && this.value[this.end]) {
var start = dayjs(this.value[this.start]);
var end = dayjs(this.value[this.end]);
return end.diff(start,'day')+1;
}
}
},
watch: {
value(v){
this.value=[v[this.start],v[this.end]]
}
}, },
}; };
</script> </script>
<style lang="less"> <style lang="less">
.time-view { .time-view {
display: inline-block; display: inline-block;
span{size: 12px}
.jian-tou { span.jian-tou {
min-width: 55px; min-width:60px;
text-align: center; text-align: center;
padding: 0 5px 2px 5px; display: inline-block;
background-image: url("../../assets/imgicon/range.png"); background-image: url("../../assets/imgicon/range.png");
background-size: 100%; background-size: 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: bottom right; background-position: 100% 80%;
// border-bottom: #eee 2px solid; // border-bottom: #eee 2px solid;
size: 12px; size: 12px;
font-weight: bold; color: orange;
} }
} }
</style> </style>
...@@ -2011,6 +2011,8 @@ document_category: { ...@@ -2011,6 +2011,8 @@ document_category: {
deletionTime: '删除时间', deletionTime: '删除时间',
deleterUserId: '删除人', deleterUserId: '删除人',
projectId: '项目id', projectId: '项目id',
direction:"方向",
deliverable:"交付物",
upId: '父级', upId: '父级',
title: '标题', title: '标题',
status: '状态', status: '状态',
......
...@@ -51,6 +51,23 @@ ...@@ -51,6 +51,23 @@
><FormItem :label="l('upId')" prop="upId"> ><FormItem :label="l('upId')" prop="upId">
<Input v-model="entity.upId"></Input> </FormItem <Input v-model="entity.upId"></Input> </FormItem
></Col> --> ></Col> -->
<Col :span="12"
><FormItem :label="l('type')" prop="type">
<Dictionary
code="mes.project_plan.Type"
v-model="entity.type"
type="radio"
></Dictionary> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('direction')" prop="direction">
<Dictionary
code="mes.project_plan.direction"
v-model="entity.direction"
type="radio"
></Dictionary> </FormItem
></Col>
<Col :span="24" <Col :span="24"
><FormItem :label="l('title')" prop="title"> ><FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"> </Input> </FormItem <Input v-model="entity.title"> </Input> </FormItem
...@@ -73,32 +90,34 @@ ...@@ -73,32 +90,34 @@
></Col> ></Col>
<Col :span="12" <Col :span="12"
><FormItem :label="l('startDate')" prop="startDate"> ><FormItem :label="l('startDate')" prop="startDate">
<DatePicker <DateRange v-model="entity" edit></DateRange> </FormItem
type="date"
v-model="entity.startDate"
></DatePicker> </FormItem
></Col> ></Col>
<Col :span="12" <!-- <Col :span="12"
><FormItem :label="l('endDate')" prop="endDate"> ><FormItem :label="l('endDate')" prop="endDate">
<DatePicker <DatePicker
type="date" type="date"
v-model="entity.endDate" v-model="entity.endDate"
></DatePicker> </FormItem ></DatePicker> </FormItem
></Col> ></Col> -->
<Col :span="12" <Col :span="12"
><FormItem :label="l('type')" prop="type"> ><FormItem :label="l('executor')" prop="executor">
<UserGroup
v-model="entity.executor"
multiple
:projectId="v.projectId"
></UserGroup>
</FormItem>
</Col>
<Col :span="12"
><FormItem :label="l('deliverable')" prop="deliverable">
<Dictionary <Dictionary
code="mes.project_plan.Type" code="mes.project_plan.deliverable"
v-model="entity.type" v-model="entity.deliverable"
type="radio" type="radio"
></Dictionary> </FormItem ></Dictionary>
></Col>
<Col :span="12"
><FormItem :label="l('executor')" prop="executor">
<UserGroup v-model="entity.executor" multiple :projectId="v.projectId"></UserGroup>
</FormItem> </FormItem>
</Col </Col>
>
<Col :span="24" <Col :span="24"
><FormItem :label="l('attachment')" prop="attachment"> ><FormItem :label="l('attachment')" prop="attachment">
<files <files
...@@ -137,8 +156,11 @@ export default { ...@@ -137,8 +156,11 @@ export default {
endDate: null, endDate: null,
type: 0, type: 0,
attachment: "", attachment: "",
deliverable: 0,
direction: 0,
executor: [], executor: [],
}, },
daterange: [],
parmsName: "app=material&eid=1&name=ProjectPlan", parmsName: "app=material&eid=1&name=ProjectPlan",
rules: { rules: {
title: [{ required: true, message: "必填", trigger: "blur" }], title: [{ required: true, message: "必填", trigger: "blur" }],
...@@ -155,6 +177,9 @@ export default { ...@@ -155,6 +177,9 @@ export default {
// } // }
}, },
methods: { methods: {
dateChange(v, t) {
console.warn(v, t);
},
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<!-- <Col :span="12" <!-- <Col :span="12"
...@@ -51,6 +51,23 @@ ...@@ -51,6 +51,23 @@
><FormItem :label="l('upId')" prop="upId"> ><FormItem :label="l('upId')" prop="upId">
<Input v-model="entity.upId"></Input> </FormItem <Input v-model="entity.upId"></Input> </FormItem
></Col> --> ></Col> -->
<Col :span="12"
><FormItem :label="l('type')" prop="type">
<Dictionary
code="mes.project_plan.Type"
v-model="entity.type"
type="radio"
></Dictionary> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('direction')" prop="direction">
<Dictionary
code="mes.project_plan.direction"
v-model="entity.direction"
type="radio"
></Dictionary> </FormItem
></Col>
<Col :span="24" <Col :span="24"
><FormItem :label="l('title')" prop="title"> ><FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"> </Input> </FormItem <Input v-model="entity.title"> </Input> </FormItem
...@@ -73,32 +90,34 @@ ...@@ -73,32 +90,34 @@
></Col> ></Col>
<Col :span="12" <Col :span="12"
><FormItem :label="l('startDate')" prop="startDate"> ><FormItem :label="l('startDate')" prop="startDate">
<DatePicker <DateRange v-model="entity" edit></DateRange> </FormItem
type="date"
v-model="entity.startDate"
></DatePicker> </FormItem
></Col> ></Col>
<Col :span="12" <!-- <Col :span="12"
><FormItem :label="l('endDate')" prop="endDate"> ><FormItem :label="l('endDate')" prop="endDate">
<DatePicker <DatePicker
type="date" type="date"
v-model="entity.endDate" v-model="entity.endDate"
></DatePicker> </FormItem ></DatePicker> </FormItem
></Col> ></Col> -->
<Col :span="12" <Col :span="12"
><FormItem :label="l('type')" prop="type"> ><FormItem :label="l('executor')" prop="executor">
<UserGroup
v-model="entity.executor"
multiple
:projectId="v.projectId"
></UserGroup>
</FormItem>
</Col>
<Col :span="12"
><FormItem :label="l('deliverable')" prop="deliverable">
<Dictionary <Dictionary
code="mes.project_plan.Type" code="mes.project_plan.deliverable"
v-model="entity.type" v-model="entity.deliverable"
type="radio" type="radio"
></Dictionary> </FormItem ></Dictionary>
></Col>
<Col :span="12"
><FormItem :label="l('executor')" prop="executor">
<UserGroup v-model="entity.executor" multiple :projectId="entity.projectId"></UserGroup>
</FormItem> </FormItem>
</Col </Col>
>
<Col :span="24" <Col :span="24"
><FormItem :label="l('attachment')" prop="attachment"> ><FormItem :label="l('attachment')" prop="attachment">
<files <files
......
...@@ -71,7 +71,80 @@ export default { ...@@ -71,7 +71,80 @@ export default {
// { key:"projectId",title:this.l("projectId") ,align:"left" ,high:true }, // { key:"projectId",title:this.l("projectId") ,align:"left" ,high:true },
// { key:"upId",title:this.l("upId") ,align:"left" ,high:true }, // { key:"upId",title:this.l("upId") ,align:"left" ,high:true },
// { type: "selection", width: 80, align: "center" }, // { type: "selection", width: 80, align: "center" },
{
key: "type",
width: 90,
title: this.l("type"),
align: "center",
high: true,
code: "mes.project_plan.Type",
attr:{
type:'icon'
}
},
{
key: "direction",
title: this.l("direction"),
align: "center",
code: "mes.project_plan.direction",
width:80,
easy: true,
high: true,
},
{
key: "title",
title: this.l("title"),
align: "left",
tree: true,
easy: true,
high: true,
},
{
key: "status",
title: this.l("status"),
align: "center",
width:80,
high: true,
code: "mes.project_plan.Status",
},
// {
// key: "startDate",
// title: this.l("startDate"),
// align: "left",
// high: true
// ,type:"date"
// },
// { key: "endDate", title: this.l("endDate"), align: "left", high: true,type:"date" },
{ key: "endDate",width:250, title: "计划日期", align: "left",render(h,param) {
return h('DateRange',{
attrs:{
value:param.row
}
})
}, },
// {
// key: "attachment",
// title: this.l("attachment"),
// align: "left",
// high: true,
// },
{ {
key: "executor",
title: this.l("executor"),
align: "left",
high: true,
type:"users",
},
{
key: "deliverable",
title: this.l("deliverable"),
code: "mes.project_plan.deliverable",
width:80,
align: "center",
easy: true,
high: true,
},
{
title: "操作", title: "操作",
key: "action", key: "action",
width: 150, width: 150,
...@@ -142,60 +215,7 @@ export default { ...@@ -142,60 +215,7 @@ export default {
]); ]);
}, },
}, },
{
key: "type",
width: 90,
title: this.l("type"),
align: "left",
high: true,
code: "mes.project_plan.Type",
attr:{
type:'icon'
}
},
{
key: "title",
title: this.l("title"),
align: "left",
tree: true,
easy: true,
high: true,
},
{
key: "status",
title: this.l("status"),
align: "left",
high: true,
code: "mes.project_plan.Status",
},
// {
// key: "startDate",
// title: this.l("startDate"),
// align: "left",
// high: true
// ,type:"date"
// },
// { key: "endDate", title: this.l("endDate"), align: "left", high: true,type:"date" },
{ key: "endDate", title: "计划日期", align: "left",render(h,param) {
return h('DateRange',{
attrs:{
value:param.row
}
})
}, },
// {
// key: "attachment",
// title: this.l("attachment"),
// align: "left",
// high: true,
// },
{
key: "executor",
title: this.l("executor"),
align: "left",
high: true,
type:"users",
},
], ],
}; };
}, },
......
...@@ -178,7 +178,7 @@ export default { ...@@ -178,7 +178,7 @@ export default {
this.curId = row.id; this.curId = row.id;
this.title = "项目团队---" + row.title; this.title = "项目团队---" + row.title;
this.fullscreen = true; this.fullscreen = true;
this.detail = () => import('../groupUser/index1') this.detail = () => import('../../groupUser/index1')
this.modal = true; this.modal = true;
}, },
cancel() { cancel() {
...@@ -192,7 +192,3 @@ export default { ...@@ -192,7 +192,3 @@ export default {
} }
} }
</script> </script>
<style lang="less">
</style>
<template>
<div class="setings">
<Menu
mode="horizontal"
:theme="theme1"
active-name="1"
@on-select="tabsSel"
>
<MenuItem name="1">
<Icon type="md-contacts" />
团队管理
</MenuItem>
<MenuItem name="2">
<Icon type="ios-document" />
项目模板
</MenuItem>
</Menu>
<keep-alive>
<component v-bind:is="detail"></component>
</keep-alive>
</div>
</template>
<script>
import Api from "../../../api";
export default {
name: "projectSetings",
data() {
return {
theme1: "light",
detail: null,
};
},
mounted() {
this.group();
},
methods: {
tabsSel(name) {
if (name == 1) {
this.group();
} else {
this.template();
}
},
group() {
this.detail = () => import("./group");
},
template() {
this.detail = () => import("./templates");
},
},
};
</script>
...@@ -72,4 +72,9 @@ export default { ...@@ -72,4 +72,9 @@ export default {
}, },
}, },
}; };
</script> </script>
\ No newline at end of file <style lang="less" scoped>
.detail{
width: 100%;
}
</style>style>
\ No newline at end of file
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