Commit d5cdcd17 authored by renjintao's avatar renjintao

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

parents fb26967f 65efb352
......@@ -23,7 +23,7 @@
<span v-else v-text="placeholder"> </span>
</div>
</DatePicker>
<div class="time-view" v-else-if="!edit && startDate && endDate">
<div class="time-view" v-else-if="!edit &&( startDate || endDate)">
<span>{{ startDate }}</span>
<span class="jian-tou">{{ jg }} {{ unit }}</span>
<span>{{ endDate }}</span>
......
......@@ -85,7 +85,13 @@ export default {
},
listSlecet() {
let data = {
conditions: [],
conditions: [
{
fieldName: "userId",
fieldValue: this.$store.state.userInfo.id,
conditionalType: "Equal",
},
],
sortBy: "id",
isDesc: false,
};
......@@ -93,15 +99,14 @@ export default {
if (r.result) {
this.projectList = r.result;
if (this.curId) {
this.projectList.map(u=>{
if(u.id==this.curId){
this.projectList.map((u) => {
if (u.id == this.curId) {
this.downName = u.title;
}
})
});
} else {
this.downName = this.projectList[0].title;
this.curdId = this.projectList[0].id;
}
this.loadTree(this.curId);
}
......@@ -115,6 +120,11 @@ export default {
fieldValue: this.curdId,
conditionalType: "Equal",
},
{
fieldName: "userId",
fieldValue: this.$store.state.userInfo.id,
conditionalType: "Equal",
},
],
};
this.$api.post(`${material}/projectplan/list`, params).then((r) => {
......
......@@ -122,7 +122,7 @@ export default {
{
id: 4,
label: "计划开始时间",
// value: 'startDate',
value: 'startDate',
value: (task) => dayjs(task.startDate).format("YYYY-MM-DD"),
width: 160,
},
......
......@@ -22,11 +22,11 @@
<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')">
<Filed :span="12" name="计划日期">
<DateRange :value="entity"></DateRange>
</Filed>
<Filed :span="12" :name="l('plansToStartDate')">
<DateRange :value="entity" start="plansToStartDate" end="plansToEndTime"></DateRange>
<Filed :span="12" name="执行日期">
<DateRange :value="entity" start="runStartDate" end="runEndTime"></DateRange>
</Filed>
<Filed :span="24" :name="l('note')">
<div v-html="entity.note"></div>
......@@ -173,6 +173,13 @@ export default {
id: this.eid,
status: this.status,
};
if(this.status==1){
params.runStartDate="";
}else if(this.status==2){
params.runEndDate="";
}else if(this.status==3){
params.runEndDate="";
}
Api.updatepart(params).then((r) => {
if (r.success) {
this.$Message.success("任务状态汇报成功");
......
<template>
<Layout class="full">
<Layout class="full">
<Sider hide-trigger v-if="showMenu" class="menu_side" width="300">
<ProjectTaskTree :curId="projectId" @on-hide="onHide" @on-select="productSearch" />
<ProjectTaskTree
:curId="projectId"
@on-hide="onHide"
@on-select="productSearch"
/>
</Sider>
<div v-if="!showMenu" class="show_menu">
<a class="menu_play fr" @click="showMenuFn" title="展开">
<Icon type="ios-arrow-forward" size="24" />
</a>
</div>
<Content class="content" :class="!showMenu?'con_bord':''">
<DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch" :lazy="true">
<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>
<FormItem>
<div class="taskMenu">
<Menu mode="horizontal" active-name="1" @on-select="onSelect">
<MenuItem name="1">
所有
</MenuItem>
<MenuItem name="2">
待确认
</MenuItem>
<MenuItem name="3">
工作中
</MenuItem>
<MenuItem name="4">
已完成
</MenuItem>
<MenuItem name="5">
已冻结
</MenuItem>
<Menu mode="horizontal" active-name="-1" @on-select="onSelect">
<MenuItem name="-1"> 所有 </MenuItem>
<MenuItem name="0"> 待确认 </MenuItem>
<MenuItem name="1"> 工作中 </MenuItem>
<MenuItem name="2"> 已完成 </MenuItem>
<MenuItem name="3"> 已冻结 </MenuItem>
<!--
<Submenu name="6">
<template slot="title">
......@@ -45,8 +45,16 @@
</Menu>
</div>
</FormItem>
<FormItem prop="keys"><Input placeholder="请输入项目标题/计划名称/任务标题" v-model="easySearch.keys.value" v-width="240" /> </FormItem>
<FormItem><Button type="primary" @click="search">查询</Button></FormItem>
<FormItem prop="keys"
><Input
placeholder="请输入项目标题/计划名称/任务标题"
v-model="easySearch.keys.value"
v-width="240"
/>
</FormItem>
<FormItem
><Button type="primary" @click="search">查询</Button></FormItem
>
<!--
<FormItem>
<Button @click="highSearch" type="text">
......@@ -57,21 +65,35 @@
</Form>
</template>
<template slot="buttons">
<Button type="primary" @click="add" v-if="planId!=''">新增</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" :projectId="projectId" :row="rowObj" @on-close="cancel" @on-ok="ok" />
<Modal
v-model="modal"
:title="title"
width="1200"
:fullscreen="fullScreen"
footer-hide
>
<component
:is="detail"
:eid="curId"
:pid="planId"
:projectId="projectId"
:row="rowObj"
@on-close="cancel"
@on-ok="ok"
/>
</Modal>
</Content>
</Layout>
</Layout>
</template>
<script>
import Api from './api'
import Search from './search'
import Api from "./api";
import Search from "./search";
export default {
name: 'list',
name: "list",
components: {
Search,
},
......@@ -87,27 +109,31 @@ export default {
easySearch: {
keys: {
op: "title",
value: null
value: null,
},
projectId: {
op: "Equal",
value: ''
value: "",
},
planId: {
op: "In",
value: []
value: [],
},
status: {
op: "In",
value: []
}
value: [],
},
userId: {
op: "Equal",
value: this.$store.state.userInfo.id,
},
},
theme1: 'light',
theme1: "light",
modal: false,
title: "新增",
detail: null,
rowObj: null,
curId: '',
curId: "",
fullScreen: false,
projectId: this.eid,
columns: [
......@@ -131,15 +157,20 @@ export default {
easy: true,
high: true,
render: (h, params) => {
return h('a', {
return h(
"a",
{
attrs: {
oprate: 'detail'
oprate: "detail",
},
on: {
click: () => this.viewRecord(params.row.id, params.row.status)
}
}, params.row.title)
}
click: () =>
this.viewRecord(params.row.id, params.row.status),
},
},
params.row.title
);
},
},
{
key: "level",
......@@ -147,7 +178,7 @@ export default {
align: "center",
high: true,
width: 80,
code: 'project.task.level'
code: "project.task.level",
},
{
key: "status",
......@@ -155,7 +186,7 @@ export default {
align: "center",
high: true,
width: 100,
code: 'project.task.status'
code: "project.task.status",
},
{
......@@ -163,39 +194,37 @@ export default {
title: this.l("userId"),
align: "left",
high: true,
type: 'user'
type: "user",
},
{
key: "startDate",
title: '计划日期',
title: "计划日期",
align: "center",
high: true,
width: 280,
render: (h, params) => {
return h('DateRange', {
return h("DateRange", {
props: {
value: params.row,
start: 'plansToStartDate',
end: 'plansToEndTime',
}
})
}
value: params.row
},
});
},
},
{
key: "startDate",
title: '执行日期',
key: "runStartDate",
title: "执行日期",
align: "center",
high: true,
width: 280,
render: (h, params) => {
return h('DateRange', {
return h("DateRange", {
props: {
value: params.row,
start: "runStartDate",
end: "runEndDate",
}
})
}
},
});
},
},
{
key: "workHour",
......@@ -204,29 +233,33 @@ export default {
high: true,
width: 80,
render: (h, params) => {
return h('a', {
return h(
"a",
{
attrs: {
oprate: 'detail'
oprate: "detail",
},
on: {
click: () => this.viewWork(params.row.id)
}
}, params.row.workHour)
}
click: () => this.viewWork(params.row.id),
},
},
params.row.workHour
);
},
},
{
key: "note",
title: this.l("note"),
align: "left",
high: true,
hide: true
hide: true,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "left",
high: true,
type: 'user'
type: "user",
},
{
key: "creationTime",
......@@ -236,166 +269,172 @@ export default {
width: 150,
},
{
title: '操作',
key: 'action',
title: "操作",
key: "action",
width: 200,
align: 'center',
align: "center",
render: (h, params) => {
return h('div', {
class: "action"
}, [
h('op', {
return h(
"div",
{
class: "action",
},
[
h("op", {
attrs: {
icon: "md-arrow-dropright-circle",
type: "icon",
oprate: "edit",
title: "开始",
disable: params.row.status == 0 ? false : true
disable: params.row.status == 0 ? false : true,
},
on: {
click: () => this.updatepart(params.row.id, 1)
}
click: () => this.updatepart(params.row.id, 1),
},
}),
h('op', {
h("op", {
attrs: {
icon: "ios-alarm",
type: "icon",
oprate: "edit",
title: "汇报工作",
disable: params.row.status == 1 || params.row.status == 3 ? false : true
disable:
params.row.status == 1 || params.row.status == 3
? false
: true,
},
on: {
click: () => this.viewRecord(params.row.id, params.row.status)
}
click: () =>
this.viewRecord(params.row.id, params.row.status),
},
}),
h('op', {
h("op", {
attrs: {
icon: "md-add",
type: "icon",
oprate: "add",
title: "新增记录",
disable: params.row.status == 1 ? false : true
disable: params.row.status == 1 ? false : true,
},
on: {
click: () => this.addRecord(params.row)
}
click: () => this.addRecord(params.row),
},
}),
h('op', {
h("op", {
attrs: {
icon: "md-create",
type: "icon",
oprate: "edit",
title: "修改",
disable: params.row.status == 0 ? false : true
disable: params.row.status == 0 ? false : true,
},
on: {
click: () => this.edit(params.row.id)
}
click: () => this.edit(params.row.id),
},
}),
h('op', {
h("op", {
attrs: {
icon: "md-trash",
type: "icon",
title: "删除",
oprate: 'delete',
disable: params.row.status == 0 ? false : true
oprate: "delete",
disable: params.row.status == 0 ? false : true,
},
on: {
click: () => this.remove(params.row.id)
}
})
])
}
click: () => this.remove(params.row.id),
},
}),
]
);
},
},
],
data1: [{
data1: [
{
id: 1,
title: '测试title'
}],
title: "测试title",
},
],
data: [],
planId: '', //当前计划Id
planIdsCur: []
}
planId: "", //当前计划Id
planIdsCur: [],
};
},
props: {
eid: String
eid: String,
},
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
if (this.eid != '') {
this.projectId = this.eid
this.easySearch.projectId.value = this.eid
if (this.eid != "") {
this.projectId = this.eid;
this.easySearch.projectId.value = this.eid;
}
this.treeHeight = window.innerHeight - 150;
},
mounted() {
if (this.eid != "") {
this.easySearch.projectId.value = this.eid
this.easySearch.projectId.value = this.eid;
this.$refs.grid.reload(this.easySearch);
}
},
methods: {
ok() {
this.$refs.grid.load()
this.modal = false
this.curId = '';
this.$refs.grid.load();
this.modal = false;
this.curId = "";
},
search() {
this.easySearch.planId.value = this.planIdsCur
this.$refs.grid.reload(this.easySearch)
this.easySearch.planId.value = this.planIdsCur;
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = this.projectId;
this.title = "新增";
this.fullScreen = false;
this.detail = () => import('./add')
this.detail = () => import("./add");
this.modal = true;
},
highSearch() {
this.curId = 0;
this.title = "高级搜索";
this.fullScreen = false;
this.detail = () => import('./search')
this.detail = () => import("./search");
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.fullScreen = false;
this.detail = () => import('./add')
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.fullScreen = false;
this.detail = () => import('./detail')
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.curId = id;
this.title = "编辑";
this.fullScreen = false;
this.detail = () => import('./edit')
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success('删除成功')
this.$Message.success("删除成功");
}
})
});
},
cancel() {
this.curId = '';
this.modal = false
this.curId = "";
this.modal = false;
},
onHide() {
// this.$Message.info("收起左侧树")
......@@ -406,85 +445,112 @@ export default {
this.showMenu = true;
},
productSearch(id, item, planIds) {
this.planId = item.selected ? id : '';
this.projectId=item.projectId;
this.planIdsCur = item.selected ? planIds : []
this.planId = item.selected ? id : "";
this.projectId = item.projectId;
this.planIdsCur = item.selected ? planIds : [];
let where = {
planId: {
op: "In",
value: item.selected ? planIds : []
value: item.selected ? planIds : [],
},
projectId: {
op: "Equal",
value: item.projectId
value: item.projectId,
},
};
this.curId=
this.$refs.grid.reload(where);
this.curId = this.$refs.grid.reload(where);
},
updatepart(valId, valStatus) {
let params = {
id: valId,
status: valStatus
}
status: valStatus,
};
if (valStatus == 1) {
params.startDate = ''
params.runStartDate = "";
}
if (valStatus == 2) {
params.endDate = ''
params.runEndDate = "";
}
Api.updatepart(params).then(r => {
Api.updatepart(params)
.then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success('操作成功')
this.$Message.success("操作成功");
} else {
this.$Message.error('操作失败')
this.$Message.error("操作失败");
}
}).catch(err => {
this.disabled = false;
this.$Message.error('操作失败')
console.warn(err)
})
.catch((err) => {
this.disabled = false;
this.$Message.error("操作失败");
console.warn(err);
});
},
onSelect(val) {
this.$refs.grid.reload(this.easySearch)
if (val == -1) {
this.easySearch = {
keys: {
op: "title",
value: null,
},
projectId: {
op: "Equal",
value: "",
},
planId: {
op: "In",
value: [],
},
status: {
op: "In",
value: [],
},
userId: {
op: "Equal",
value: this.$store.state.userInfo.id,
},
};
} else {
this.easySearch.status.value = [val];
}
this.$refs.grid.reload(this.easySearch);
},
viewRecord(id, status) {
this.curId = id;
this.tastkStatus = status;
this.title = "查看记录";
this.fullScreen = true;
this.detail = () => import('./detail')
this.detail = () => import("./detail");
this.modal = true;
},
viewWork(id) {
this.curId = id;
this.title = "查看工时";
this.fullScreen = false;
this.detail = () => import('../record')
this.detail = () => import("../record");
this.modal = true;
},
addRecord(row) {
this.curId = row.id;
this.rowObj = row
this.rowObj = row;
this.title = "新增记录";
this.fullScreen = false;
this.detail = () => import('../record/add')
this.detail = () => import("../record/add");
this.modal = true;
},
l(key) {
let vkey = "project_task" + "." + key;
return this.$t(vkey) || key
}
return this.$t(vkey) || key;
},
},
watch: {
eid(v) {
if (v != "") {
this.eid = v
this.eid = v;
}
}
}
}
},
},
};
</script>
<style lang="less">
......
......@@ -3,7 +3,7 @@ import Api from '@/plugins/request'
// import Mock from 'mockjs'
export const state = () => ({
counter: 0,
dictionary: new Map(), //所有字典项
dictionary: [], //所有字典项
userMap: new Map(), //所有用户缓存;
userNameMap: new Map(), //所有用户名称缓存;
departmentsMap: new Map(), //部门缓存;
......@@ -25,10 +25,11 @@ export const getters = {
dictionaryByKey: (state) => (key) => {
let result = [];
if (state && state.dictionary) {
let items = state.dictionary.get(key);
if (items) {
// console.info("items",items)
return items;
let items = state.dictionary.filter(u=>{
return u.code===key
});
if (items.length>0) {
return items[0].items;
}
}
......@@ -36,12 +37,11 @@ export const getters = {
},
dictionaryByCode: (state) => (key, code) => {
let result = null;
let items = state.dictionary.get(key);
if (items) {
// console.info("items",items)
return items.filter(u => {
return u.code == code
})[0];
let items = state.dictionary.filter(u=>{
return u.code===key
});
if (items.length>0) {
return items[0];
}
return result;
},
......@@ -167,18 +167,12 @@ export const actions = {
async loadDictionary({
commit
}) {
let url = `${systemUrl}/Dictionary/GetAll`
let url = `${systemUrl}/Dictionary/getallanditems`
let {
result
} = await Api.get(url);
var map = new Map();
for (const key in result) {
if (result.hasOwnProperty(key)) {
map.set(key, result[key])
}
}
commit("setDictionary", map);
commit("setDictionary", result);
let r = await Api.get(`${systemUrl}/user/getuserlist`);
var umap = new Map();
......
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