Commit 166767db authored by 周远喜's avatar 周远喜

时间控件修改

parent 2c8fbb84
...@@ -119,9 +119,9 @@ export default { ...@@ -119,9 +119,9 @@ export default {
} }
}, },
watch: { watch: {
value(v){ // value(v){
this.value=[v[this.start],v[this.end]] // this.value=[v[this.start],v[this.end]]
} // }
}, },
}; };
</script> </script>
......
<template> <template>
<div> <div>
<Select :placeholder="placeholder" v-model="name" @on-change="change" :multiple="multiple" clearable filterable transfer> <Select
<Option v-for="item in users" :value="item.userId" :key="item.userId" :label="item.note" :disabled="item.status==0"> :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"> <div class="user">
<State code="project.group.authority" :value="item.authority" class="mr10" type="tag" /> {{item.note}} <State
<State code="project.group.role" :value="item.role" class="mr10" type="tag" /> 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> </div>
</Option> </Option>
</Select> </Select>
</div> </div>
</template> </template>
<script> <script>
...@@ -37,22 +62,28 @@ export default { ...@@ -37,22 +62,28 @@ export default {
default: false, default: false,
}, },
projectId: { projectId: {
type: String type: String,
} },
}, },
methods: { methods: {
load() { load() {
if (this.projectId) {
var params = { var params = {
conditions: [{ conditions: [
{
fieldName: "projectId", fieldName: "projectId",
fieldValue: this.projectId, fieldValue: this.projectId,
conditionalType: "Equal" conditionalType: "Equal",
}] },
} ],
};
// //
this.$api.post(`${material}/projectgroupuser/list`, params).then(r => { this.$api
.post(`${material}/projectgroupuser/list`, params)
.then((r) => {
this.users = r.result; this.users = r.result;
}) });
}
}, },
change(event) { change(event) {
let name = ""; let name = "";
...@@ -66,15 +97,18 @@ export default { ...@@ -66,15 +97,18 @@ export default {
// 加载人员 // 加载人员
}, },
watch: { watch: {
projectId(v){ projectId(v) {
if (v) {
this.load(); this.load();
} }
}, },
},
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "../../assets/css/custom.less"; @import "../../assets/css/custom.less";
.userGroup {} .userGroup {
}
</style> </style>
...@@ -148,6 +148,7 @@ export default { ...@@ -148,6 +148,7 @@ export default {
}, },
props: { props: {
eid: [Number,String], eid: [Number,String],
v:Object
}, },
mounted() { mounted() {
if (this.eid) { if (this.eid) {
......
<template> <template>
<div> <div>
<Card> <Card>
<EditGrid :columns="columns" ref="grid" :items="list" > <EditGrid :columns="columns" ref="grid" :items="list">
<template slot="easySearch"><Form ref="formInline" :model="easySearch" inline><FormItem prop="keys"><Input placeholder="请输入关键字标题" v-model="easySearch.keys.value" /> </FormItem> <template slot="easySearch"
<FormItem><Button type="primary" @click="search">查询</Button> ><Form ref="formInline" :model="easySearch" inline
</FormItem> ><FormItem prop="keys"
</Form></template> ><Input
placeholder="请输入关键字标题"
v-model="easySearch.keys.value"
/>
</FormItem>
<FormItem
><Button type="primary" @click="search">查询</Button>
</FormItem>
</Form></template
>
<!-- <template slot="searchForm"> <!-- <template slot="searchForm">
<Search /> <Search />
</template> --> </template> -->
...@@ -15,7 +24,13 @@ ...@@ -15,7 +24,13 @@
</EditGrid> </EditGrid>
</Card> </Card>
<Modal v-model="modal" :title="title" width="1200" footer-hide> <Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" :v="row" @on-close="cancel" @on-ok="ok" /> <component
:is="detail"
:eid="curId"
:v="row"
@on-close="cancel"
@on-ok="ok"
/>
</Modal> </Modal>
</div> </div>
</template> </template>
...@@ -32,24 +47,24 @@ export default { ...@@ -32,24 +47,24 @@ export default {
author: "henq", author: "henq",
description: "project_plan 10/19/2020 10:23:07 AM", description: "project_plan 10/19/2020 10:23:07 AM",
}, },
props:{ props: {
eid:{ eid: {
type:String type: String,
}, },
data:{ data: {
type:Object, type: Object,
default:()=>{ default: () => {
return { return {
id:"33930562-a9f7-bd95-88ab-d01eb1c4c369", id: "33930562-a9f7-bd95-88ab-d01eb1c4c369",
title:"示例项目" title: "示例项目",
} };
} },
} },
}, },
data() { data() {
return { return {
entity:{}, entity: {},
row:{}, row: {},
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { op: "title", value: null }, keys: { op: "title", value: null },
...@@ -57,7 +72,7 @@ export default { ...@@ -57,7 +72,7 @@ export default {
modal: false, modal: false,
title: "新增", title: "新增",
detail: null, detail: null,
curId:null, curId: null,
list: [], list: [],
columns: [ columns: [
// { key:"id",title:this.$t("id") ,hide:true ,align:"left" ,high:true }, // { key:"id",title:this.$t("id") ,hide:true ,align:"left" ,high:true },
...@@ -78,16 +93,16 @@ export default { ...@@ -78,16 +93,16 @@ export default {
align: "center", align: "center",
high: true, high: true,
code: "mes.project_plan.Type", code: "mes.project_plan.Type",
attr:{ attr: {
type:'icon' type: "icon",
} },
}, },
{ {
key: "direction", key: "direction",
title: this.l("direction"), title: this.l("direction"),
align: "center", align: "center",
code: "mes.project_plan.direction", code: "mes.project_plan.direction",
width:80, width: 80,
easy: true, easy: true,
high: true, high: true,
}, },
...@@ -103,7 +118,7 @@ export default { ...@@ -103,7 +118,7 @@ export default {
key: "status", key: "status",
title: this.l("status"), title: this.l("status"),
align: "center", align: "center",
width:80, width: 80,
high: true, high: true,
code: "mes.project_plan.Status", code: "mes.project_plan.Status",
}, },
...@@ -115,13 +130,19 @@ export default { ...@@ -115,13 +130,19 @@ export default {
// ,type:"date" // ,type:"date"
// }, // },
// { key: "endDate", title: this.l("endDate"), 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',{ key: "endDate",
attrs:{ width: 250,
value:param.row title: "计划日期",
} align: "center",
}) render(h, param) {
}, }, return h("DateRange", {
attrs: {
value: param.row,
},
});
},
},
// { // {
// key: "attachment", // key: "attachment",
// title: this.l("attachment"), // title: this.l("attachment"),
...@@ -133,13 +154,13 @@ export default { ...@@ -133,13 +154,13 @@ export default {
title: this.l("executor"), title: this.l("executor"),
align: "left", align: "left",
high: true, high: true,
type:"users", type: "users",
}, },
{ {
key: "deliverable", key: "deliverable",
title: this.l("deliverable"), title: this.l("deliverable"),
code: "mes.project_plan.deliverable", code: "mes.project_plan.deliverable",
width:80, width: 80,
align: "center", align: "center",
easy: true, easy: true,
high: true, high: true,
...@@ -165,57 +186,50 @@ export default { ...@@ -165,57 +186,50 @@ export default {
render: (h, params) => { render: (h, params) => {
return h("div", { class: "action" }, [ return h("div", { class: "action" }, [
h( h("op", {
"op", attrs: {
{ icon: "md-arrow-dropright-circle",
attrs: { icon: "md-arrow-dropright-circle",
type: "icon", type: "icon",
title: "派发", title: "派发",
oprate: "edit", oprate: "edit",
disable:params.row.status!=0 disable: params.row.status != 0,
}, },
on: { click: () => this.send(params.row) }, on: { click: () => this.send(params.row) },
}, }),
), h("op", {
h( attrs: {
"op", icon: "md-add",
{
attrs: { icon: "md-add",
type: "icon", type: "icon",
title: "新增子任务", title: "新增子任务",
disable:params.row.status>1, disable: params.row.status > 1,
oprate: "edit",}, oprate: "edit",
},
on: { click: () => this.add(params.row) }, on: { click: () => this.add(params.row) },
} }),
), h("op", {
h( attrs: {
"op", icon: "md-create",
{
attrs: { icon: "md-create",
type: "icon", type: "icon",
title: "编辑", title: "编辑",
oprate: "edit", oprate: "edit",
disable:params.row.status!==0, disable: params.row.status !== 0,
}, },
on: { click: () => this.edit(params.row.id) }, on: { click: () => this.edit(params.row) },
} }),
), h("op", {
h( attrs: {
"op", icon: "ios-trash",
{
attrs: { icon: "ios-trash",
type: "icon", type: "icon",
title: "删除", title: "删除",
oprate: "delete", oprate: "delete",
disable:params.row.status!==0, disable: params.row.status !== 0,
msg: "确认要删除吗?" }, msg: "确认要删除吗?",
},
on: { click: () => this.remove(params.row.id) }, on: { click: () => this.remove(params.row.id) },
} }),
),
]); ]);
}, },
}, },
], ],
}; };
}, },
...@@ -235,11 +249,13 @@ export default { ...@@ -235,11 +249,13 @@ export default {
search() { search() {
// this.$refs.grid.reload(this.easySearch); // this.$refs.grid.reload(this.easySearch);
var params = { var params = {
conditions: [{ conditions: [
fieldName:"projectId", {
conditionalType: 'Equal', fieldName: "projectId",
fieldValue:this.eid conditionalType: "Equal",
}], fieldValue: this.eid,
},
],
// conditions: [] // conditions: []
}; };
Api.list(params).then((r) => { Api.list(params).then((r) => {
...@@ -256,53 +272,52 @@ export default { ...@@ -256,53 +272,52 @@ export default {
"upId" "upId"
); );
this.list =data; this.list = data;
}); });
}, },
add(row) { add(row) {
if(row){ if (row) {
this.curId=row.id; this.curId = row.id;
this.row=row this.row = row;
}else{ } else {
this.curId=null; this.curId = null;
this.row={ this.row = {
projectId:this.data.id projectId: this.data.id,
} };
} }
this.title = "新增"; this.title = "新增";
this.detail = () => import("./add"); this.detail = () => import("./add");
this.modal = true; this.modal = true;
}, },
send(row){ send(row) {
console.log(row); console.log(row);
if(!row.startDate){ if (!row.startDate) {
this.$Message.error("未设置开始时间"); this.$Message.error("未设置开始时间");
return return;
} }
if(!row.endDate){ if (!row.endDate) {
this.$Message.error("未设置结束时间"); this.$Message.error("未设置结束时间");
return return;
} }
if(row.executor.length==0){ if (row.executor.length == 0) {
this.$Message.error("请设置执行人"); this.$Message.error("请设置执行人");
return return;
} }
delete row.chlidren; delete row.chlidren;
delete row.parent; delete row.parent;
console.warn(row) console.warn(row);
row.status=1; row.status = 1;
Api.sendtask({ Api.sendtask({
id:row.id, id: row.id,
status:1, status: 1,
}).then(r=>{ }).then((r) => {
if(r.success){ if (r.success) {
this.$Message.info("任务派发成功!"); this.$Message.info("任务派发成功!");
this.search(); this.search();
} }
}) });
}, },
copy(id) { copy(id) {
this.curId = id; this.curId = id;
...@@ -316,8 +331,9 @@ export default { ...@@ -316,8 +331,9 @@ export default {
this.detail = () => import("./detail"); this.detail = () => import("./detail");
this.modal = true; this.modal = true;
}, },
edit(id) { edit(row) {
this.curId = id; this.curId = row.id;
this.row = row;
this.title = "编辑"; this.title = "编辑";
this.detail = () => import("./edit"); this.detail = () => import("./edit");
this.modal = true; this.modal = true;
......
...@@ -79,14 +79,8 @@ ...@@ -79,14 +79,8 @@
></Col> ></Col>
<Col :span="12"> <Col :span="12">
<FormItem label="开始结束时间" prop="date"> <FormItem label="开始结束时间" prop="date">
<DatePicker <DateRange v-model="entity" edit></DateRange>
type="datetimerange" </FormItem
format="yyyy-MM-dd"
v-model="date"
placeholder="请选择时间范围"
@on-change="changeFormat"
style="width: 300px"
></DatePicker> </FormItem
></Col> ></Col>
<Col :span="12" <Col :span="12"
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</li> </li>
<li> <li>
<a @click="template"> <a @click="template">
<Icon type="ios-photos" />模版 <Icon type="ios-photos" />目录
</a> </a>
&nbsp; &nbsp;
<span>|</span> <span>|</span>
......
...@@ -35,14 +35,7 @@ ...@@ -35,14 +35,7 @@
></Col> ></Col>
<Col :span="12"> <Col :span="12">
<FormItem label="开始结束时间" prop="date"> <FormItem label="开始结束时间" prop="date">
<DatePicker <DateRange v-model="entity" edit></DateRange> </FormItem
type="datetimerange"
format="yyyy-MM-dd"
v-model="date"
placeholder="请选择时间范围"
@on-change="changeFormat"
style="width: 300px"
></DatePicker> </FormItem
></Col> ></Col>
<!-- <Col :span="12" <!-- <Col :span="12"
><FormItem :label="l('startDate')" prop="startDate"> ><FormItem :label="l('startDate')" prop="startDate">
......
...@@ -278,35 +278,47 @@ export default { ...@@ -278,35 +278,47 @@ export default {
// high: true, // high: true,
// code: "mes.project_main.Phase", // code: "mes.project_main.Phase",
// }, // },
{ // {
key: "startDate", // key: "startDate",
title: this.l("startDate"), // title: this.l("startDate"),
align: "center", // align: "center",
high: true, // high: true,
render: (h, params) => { // render: (h, params) => {
return h( // return h(
"span", // "span",
params.row.startDate // params.row.startDate
? this.sliceStr(params.row.startDate + " ", 0, 10) // ? this.sliceStr(params.row.startDate + " ", 0, 10)
: "" // : ""
); // );
}, // },
}, // },
// {
// key: "endDate",
// title: this.l("endDate"),
// align: "center",
// high: true,
// render: (h, params) => {
// return h(
// "span",
// params.row.endDate
// ? this.sliceStr(params.row.endDate + " ", 0, 10)
// : ""
// );
// },
// },
{ {
key: "endDate", key: "endDate",
title: this.l("endDate"), width: 250,
title: "计划日期",
align: "center", align: "center",
high: true, render(h, param) {
render: (h, params) => { return h("DateRange", {
return h( attrs: {
"span", value: param.row,
params.row.endDate },
? this.sliceStr(params.row.endDate + " ", 0, 10) });
: ""
);
}, },
}, },
{ {
key: "creationTime", key: "creationTime",
title: this.l("creationTime"), title: this.l("creationTime"),
......
...@@ -59,12 +59,6 @@ export default { ...@@ -59,12 +59,6 @@ export default {
required: true, required: true,
message: '必填', message: '必填',
trigger: 'blur' trigger: 'blur'
}],
workHour: [{
required: true,
message: '必填',
trigger: 'blur',
type: "number"
}] }]
} }
} }
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="计划日期" prop="date"> <FormItem label="计划日期" prop="date">
<DatePicker type="datetimerange" format="yyyy-MM-dd" placeholder="请选择时间范围" @on-change="changeFormat" style="width: 300px"></DatePicker> <DateRange v-model="entity" edit></DateRange>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
...@@ -53,8 +53,10 @@ export default { ...@@ -53,8 +53,10 @@ export default {
userIds: "", userIds: "",
userId: "", userId: "",
note: "", note: "",
plansToStartDate: null, startDate:null,
plansToEndTime: null, endDate:null,
// plansToStartDate: null,
// plansToEndTime: null,
}, },
rules: { rules: {
name: [{ name: [{
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="计划日期" prop="date"> <FormItem label="计划日期" prop="date">
<DatePicker type="datetimerange" format="yyyy-MM-dd" placeholder="请选择时间范围" v-model="planDate" @on-change="changeFormat" style="width: 300px"></DatePicker> <DateRange v-model="entity" edit></DateRange>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
...@@ -47,7 +47,10 @@ export default { ...@@ -47,7 +47,10 @@ export default {
data() { data() {
return { return {
disabled: false, disabled: false,
entity: {}, entity: {
startDate:null,
endDate:null,
},
planDate: [], planDate: [],
rules: { rules: {
name: [{ name: [{
...@@ -65,7 +68,8 @@ export default { ...@@ -65,7 +68,8 @@ export default {
} }
}, },
props: { props: {
eid: String eid: String,
row:Object,
}, },
mounted() { mounted() {
if (this.eid != '' && this.eid != null) { if (this.eid != '' && this.eid != null) {
...@@ -79,9 +83,9 @@ export default { ...@@ -79,9 +83,9 @@ export default {
}).then(r => { }).then(r => {
this.entity = r.result; this.entity = r.result;
this.entity.userId = parseInt(r.result.userId) this.entity.userId = parseInt(r.result.userId)
if (r.result.plansToStartDate && r.result.plansToStartDate != '' && r.result.plansToEndTime && r.result.plansToEndTime != '') { // if (r.result.plansToStartDate && r.result.plansToStartDate != '' && r.result.plansToEndTime && r.result.plansToEndTime != '') {
this.planDate = [r.result.plansToStartDate, r.result.plansToEndTime] // this.planDate = [r.result.plansToStartDate, r.result.plansToEndTime]
} // }
}) })
}, },
handleSubmit() { handleSubmit() {
......
...@@ -167,7 +167,7 @@ export default { ...@@ -167,7 +167,7 @@ export default {
}, },
{ {
key: "startDate", key: "startDate",
title: '实际日期', title: '计划日期',
align: "center", align: "center",
high: true, high: true,
width: 280, width: 280,
...@@ -181,7 +181,7 @@ export default { ...@@ -181,7 +181,7 @@ export default {
}, },
{ {
key: "startDate", key: "startDate",
title: '计划日期', title: '执行日期',
align: "center", align: "center",
high: true, high: true,
width: 280, width: 280,
...@@ -189,8 +189,8 @@ export default { ...@@ -189,8 +189,8 @@ export default {
return h('DateRange', { return h('DateRange', {
props: { props: {
value: params.row, value: params.row,
start: "plansToStartDate", start: "runStartDate",
end: "plansToEndTime", end: "runEndDate",
} }
}) })
} }
......
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