Commit fe3dbe01 authored by renjintao's avatar renjintao

my edit

parents 8f3deafa 8986812c
......@@ -1085,7 +1085,6 @@ html [type=button] {
}
i {
font-size: 16px;
padding: 4px;
border-radius: 3px;
}
......@@ -1094,7 +1093,6 @@ html [type=button] {
background: #1890FF;
color: #fff;
}
background: transparent;
}
......@@ -1105,66 +1103,45 @@ html [type=button] {
a.add {
color: #249E91;
}
// a.add:hover {
// // color: #27AB9D;
// }
a.edit {
// color: #32B187;
color: rgb(6, 147, 212)
}
// a.edit:hover {
// color: #35BD90
// }
a.remove,
a.delete {
color: #FF7A8B;
i:hover {
background: #FF7A8B;
background: orange;
color: #fff;
}
}
a.delete {
color: #FF7A8B;
}
a.empower {
color: #FFBD59;
}
a.disable {
color: #CAD1D9;
}
a.icon {
display: inline-block;
width: 28px;
height: 28px;
line-height: 28px;
width: 22px;
height: 22px;
line-height: 22px;
margin: 0px 0 0 0;
border-radius: 50%;
color: #515A6E;
background: #F5F6FA;
.ivu-icon {
font-weight: bold;
font-size: 18px;
font-size: 20px;
}
}
a.disable {
color: #CAD1D9;
cursor: help;
i:hover {
background:#CAD1D9;
}
}
// a.icon:hover {
// background: #27AB9D;
// color: #fff;
// }
// a.icon:active {
// background: #229185;
// color: #fff;
// }
}
......
......@@ -11,7 +11,7 @@ export default {
name: 'dtSpan',
data() {
return {
date:"33333"
date:""
}
},
props: {
......@@ -21,7 +21,7 @@ export default {
},
value: {
type: String,
default: '2001-01-01 00:00:00'
default: ''
},
},
created() {
......
......@@ -52,13 +52,25 @@ export default {
titles: this.title
};
},
disalbe: {
// 0 启用 1 禁用 2权限不足
type: Number,
default: 0,
},
},
data() {
return {
text: "",
css: "detail",
};
},
created() {
var oprates = {
detail: "查看",
edit: "编辑",
add: "添加",
delete: "删除",
remove: "删除"
remove: "删除",
};
if (oprates[this.oprate]) {
......@@ -69,58 +81,76 @@ export default {
} else if (this.type == "icon") {
this.css = "icon";
}
},
mounted() {
if (this.disable) {
this.colors = "#ccc";
this.titles = ''
if (this.disalbe) {
this.css = "disable"
}
},
methods: {
handler() {
if (!this.disable) {
if (this.disalbe == 0) {
if (this.oprate == "delete" || this.oprate == "remove") {
this.$Modal.confirm({
title: this.title,
content: "<p>" + this.msg + "</p>",
onOk: () => {
this.$emit("click", event);
}
},
});
} else {
this.$emit("click", event);
}
}
}
},
watch: {
v() {},
disable(v) {
if (v) {
this.colors = "#ccc";
this.titles = '';
} else {
this.colors = this.color;
this.titles = this.title;
}
this.disable = v
},
color(v) {
if (v && v != '') {
this.colors = v
}
},
mounted() {
},
title(v) {
if (v && v != '') {
this.titles = v
}
},
},
};
if (this.disable) {
this.colors = "#ccc";
this.titles = ''
}
},
methods: {
handler() {
if (!this.disable) {
if (this.oprate == "delete" || this.oprate == "remove") {
this.$Modal.confirm({
title: this.title,
content: "<p>" + this.msg + "</p>",
onOk: () => {
this.$emit("click", event);
}
});
} else {
this.$emit("click", event);
}
}
}
},
watch: {
v() {},
disable(v) {
if (v) {
this.colors = "#ccc";
this.titles = '';
} else {
this.colors = this.color;
this.titles = this.title;
}
this.disable = v
},
color(v) {
if (v && v != '') {
this.colors = v
}
},
title(v) {
if (v && v != '') {
this.titles = v
}
},
},
};
</script>
<style lang="less">
......
<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"
:disabled="item.status==1"
>
<div class="user">
<State v-show="item.authority" code="project.group.authority" :value="item.authority" class="mr10"/> {{item.note}} <User :value="item.userId"/></span><Tag>{{item.role}}</Tag>
</div>
</Option>
</Select>
</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: "请选择人员",
},
multiple:{
type:Boolean,
default:false,
},
projectId:{
type:String
}
},
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}/projectplan/list`, params).then(r=>{
this.users=r.result;
})
},
change(event) {
let name = "";
this.data.forEach((e) => {
if (e.id == event) {
name = e.label;
}
});
this.$emit("on-change", event, name);
},
// 加载人员
},
};
</script>
<style lang="less">
@import "../../assets/css/custom.less";
.userGroup {
}
</style>
......@@ -93,7 +93,6 @@ export default {
click: () => this.view(params.row.id)
}
}, '查看'),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h('op', {
attrs: {
oprate: 'edit'
......@@ -111,13 +110,10 @@ export default {
}
}, '删除'),
h('op', {
attrs: {
oprate: 'edit'
},
on: {
click: () => this.openGroupUser(params.row)
}
}, '项目团队'),
}, '成员'),
])
}
},
......
<template>
<div class="detail">
<div class="detail">
<Row>
<Filed :span="12" :name="l('userId')">
<User :value="entity.userId"></User>
</Filed>
<Filed :span="12" :name="l('role')">{{entity.role}}</Filed>
<Filed :span="12" :name="l('note')">{{entity.note}}</Filed>
<Filed :span="12" :name="l('status')">{{entity.status}}</Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">
<User :value="entity.creatorUserId"></User>
</Filed>
<Filed :span="12" :name="l('userId')">
<User :value="entity.userId"></User>
</Filed>
<Filed :span="12" :name="l('role')">
<State code="project.group.role" :value="entity.role" />
</Filed>
<Filed :span="12" :name="l('authority')">
<State code="project.group.authority" :value="entity.authority" />
</Filed>
<!-- <Filed :span="12" name="姓名">{{ entity.note }}</Filed> -->
<Filed :span="12" :name="l('status')">
<State code="project.group.status" :value="entity.status"
/></Filed>
<Filed :span="12" :name="l('creationTime')">{{
entity.creationTime
}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">
<User :value="entity.creatorUserId"></User>
</Filed>
</Row>
</div>
</div>
</template>
<script>
import Api from './api'
import Api from "./api";
export default {
name: 'Add',
data() {
return {
entity: {},
rules: {
name: [{
required: true,
message: '必填',
trigger: 'blur'
}],
code: [{
required: true,
message: '必填',
trigger: 'blur'
}]
}
}
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.eid != null) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({
id: v,
}).then((r) => {
this.entity = r.result;
this.$emit("on-load");
});
},
props: {
eid: String
handleClose() {
this.$emit("on-close");
},
mounted() {
if (this.eid != '' && this.eid != null) {
this.load(this.eid);
}
l(key) {
key = "project_group_user" + "." + key;
return this.$t(key);
},
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_group_user" + "." + key;
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != "" && v != null) {
this.load(v);
}
},
watch: {
eid(v) {
if (v != '' && v != null) {
this.load(v);
}
}
}
}
},
};
</script>
This diff is collapsed.
......@@ -95,7 +95,7 @@
></Col>
<Col :span="12"
><FormItem :label="l('executor')" prop="executor">
<UserSelect v-model="entity.executor" multiple></UserSelect>
<UserGroup v-model="entity.executor" multiple :projectId="v.projectId"></UserGroup>
</FormItem>
</Col
>
......
......@@ -95,7 +95,7 @@
></Col>
<Col :span="12"
><FormItem :label="l('executor')" prop="executor">
<UserSelect v-model="entity.executor" multiple></UserSelect>
<UserGroup v-model="entity.executor" multiple :projectId="entity.projectId"></UserGroup>
</FormItem>
</Col
>
......
......@@ -158,12 +158,13 @@ export default {
},
},
{
key: "type",
width: 90,
title: this.l("type"),
align: "left",
high: true,
code: "mes.project_plan.Type",
attrs: { icon: "md-arrow-dropright-circle",
type: "icon",
title: "派发",
oprate: "edit",
disalbe:1,
},
on: { click: () => this.copy(params.row.id) },
},
{
key: "title",
......@@ -174,19 +175,15 @@ export default {
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"
},
attrs: { icon: "md-create",
type: "icon",
title: "编辑",
oprate: "edit", },
on: { click: () => this.edit(params.row.id) },
}
),
h(
"op",
{
key: "endDate",
title: this.l("endDate"),
......
......@@ -14,45 +14,33 @@
<Filed :span="12" :name="l('endDate') + ':'">{{
entity.endDate
}}</Filed>
</Row>
</div>
<ul>
<li>
<a @click="details">
<Icon type="ios-log-in" />详情
</a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="template">
<Icon type="ios-photos" />模版
</a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="task">
<Icon type="md-create" />任务
</a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="groupUser">
<Icon type="md-create" />成员
</a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="task">
<Icon type="md-create" />动态
</a>
&nbsp;
<span>|</span>
</li>
</ul>
</Row>
</div>
<ul>
<li>
<a @click="details"> <Icon type="ios-log-in" />详情 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="template"> <Icon type="ios-photos" />模版</a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="task"> <Icon type="md-create" />任务 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="group"> <Icon type="md-create" />成员 </a>
<span>|</span>
</li>
<li>
<a @click="task"> <Icon type="md-create" />动态 </a>
<span>|</span>
</li>
</ul>
</div>
<div class="body-document">
<h4 v-text="title"></h4>
......@@ -103,45 +91,14 @@ export default {
}
this.detail = () => import("./details");
},
methods: {
load(v) {
Api.get({
id: v
}).then((r) => {
this.entity = r.result;
// this.$emit("on-load");
});
},
details() {
this.title = "详细信息";
this.detail = () => import("./details");
},
template() {
// this.curId = this.eid;
this.title = "项目模板";
this.detail = () => import("../plan");
},
task() {
this.curId = this.eid;
this.title = "任务";
//this.detail = () => import("../task/index");
this.$router.push({
name: "project-task",
params: {
id: this.curId
}
});
},
groupUser() {
// this.curId = this.eid;
this.title = "任务";
// this.detail = () => import("./add");
},
l(key) {
key = "project_main" + "." + key;
return this.$t(key);
},
group() {
// this.curId = this.eid;
this.title = "成员管理";
this.detail = () => import("../groupUser/index1");
},
l(key) {
key = "project_main" + "." + key;
return this.$t(key);
},
watch: {
eid(v) {
......
......@@ -349,45 +349,105 @@ export default {
this.detail = () => import('./add')
this.modal = true;
},
productSearch(id, item, planIds) {
this.planId = item.selected ? id : '';
this.planIdsCur = item.selected ? planIds : []
let where = {
planId: {
op: "In",
value: item.selected ? planIds : []
},
projectId: {
op: "Equal",
value: this.$route.params.id
},
};
this.$refs.grid.reload(where);
},
updatepart(valId, valStatus) {
let params = {
id: valId,
status: valStatus,
}
Api.updatepart(params).then(r => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success('操作成功')
} else {
this.$Message.error('操作失败')
}
}).catch(err => {
this.disabled = false;
this.$Message.error('操作失败')
console.warn(err)
})
},
},
mounted() {
console.log(this);
},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = 0;
this.title = "新增";
this.fullScreen = false;
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 = 0;
this.modal = false
this.modal = false;
},
onHide() {
// this.$Message.info("收起左侧树")
......@@ -397,62 +457,59 @@ export default {
//this.$Message.info("展开左侧树")
this.showMenu = true;
},
productSearch(id, item, planIds) {
this.planId = item.selected ? id : '';
this.planIdsCur = item.selected ? planIds : []
productSearch(id, item, productIds, ids) {
let where = {
planId: {
bomId: {
op: "In",
value: item.selected ? planIds : []
},
projectId: {
op: "Equal",
value: this.$route.params.id
value: ids,
},
};
this.$refs.grid.reload(where);
},
updatepart(valId, valStatus) {
updatestatus(valId, valStatus) {
let params = {
id: valId,
status: valStatus,
}
Api.updatepart(params).then(r => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success('操作成功')
} else {
this.$Message.error('操作失败')
}
}).catch(err => {
this.disabled = false;
this.$Message.error('操作失败')
console.warn(err)
})
detail: "",
};
Api.updatestatus(params)
.then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("操作成功");
} else {
this.$Message.error("操作失败");
}
})
.catch((err) => {
this.disabled = false;
this.$Message.error("操作失败");
console.warn(err);
});
},
onSelect(val) {
this.$refs.grid.reload(this.easySearch)
this.$refs.grid.reload(this.easySearch);
},
viewRecord(id) {
this.curId = id;
this.title = "查看记录";
this.fullScreen = true;
this.detail = () => import('./detail')
this.detail = () => import("./detail");
this.modal = true;
},
addRecord(id) {
this.curId = id;
this.title = "新增记录";
this.fullScreen = true;
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;
},
},
};
</script>
<style lang="less">
......
......@@ -26,6 +26,7 @@ import Tools from '@/components/page/tool.vue'
import State from '@/components/page/state.vue'
import Dictionary from '@/components/page/dictionary.vue'
import UserSelect from '@/components/page/userSelect.vue'
import UserGroup from '@/components/page/userGroup.vue'
import Materiel from '@/components/page/materiel.vue'
import RoleSelect from '@/components/page/roleSelect.vue'
import UserExamSelect from '@/components/page/userExamSelect.vue'
......@@ -130,6 +131,7 @@ Vue.component("WorkShopSelect", WorkShopSelect)
Vue.component("WorkShopName",WorkShopName)
Vue.component("workShopDefault", workShopDefault)
Vue.component("WorkShop", WorkShop)
Vue.component("UserGroup", UserGroup)
Vue.component("EquipSelect", EquipSelect)
Vue.component("EquipTypeSelect", EquipTypeSelect)
Vue.component("ResourceSelect", ResourceSelect)
......
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