Commit d2663a62 authored by renjintao's avatar renjintao

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

parents 4e206966 d0930a07
......@@ -137,7 +137,6 @@ export default {
name: "Add",
data() {
return {
imgName: "",
avatorPath: "",
entity: {
......@@ -196,7 +195,6 @@ export default {
}
Api.create(this.entity)
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
......@@ -205,7 +203,6 @@ export default {
}
})
.catch((err) => {
this.$Message.error("保存失败");
console.warn(err);
});
......
<template>
<div class="detail">
<div class=".detail-document">
<div class="top-title">
<div class="new-detail row-left">
<Row>
<Filed :span="12" :name="l('creationTime')">{{
entity.creationTime
}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">
<User :value="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('state')">
<Filed :span="12" :name="l('title') + ':'">{{ entity.title }}</Filed>
<Filed :span="12" :name="l('state') + ':'">
<state code="project.main.state" :value="entity.state"
/></Filed>
<!-- <Filed :span="12" :name="l('phase')">{{ entity.phase }}</Filed> -->
<Filed :span="12" :name="l('startDate')">{{ entity.startDate }}</Filed>
<Filed :span="12" :name="l('endDate')">{{ entity.endDate }}</Filed>
<!-- <Filed :span="12" :name="l('businessUnits')">{{
entity.businessUnits
}}</Filed> -->
<Filed :span="12" :name="l('type')">
<state code="project.main.type" :value="entity.type" />
</Filed>
<Filed :span="12" :name="l('picture')"
><a @click="imgClick(entity.picture)">查看图片</a></Filed
>
<Filed :span="12" :name="l('attachment')">
<files ref="refFile" :parms="parms" fileFormat :showList="false" />
</Filed>
<Filed :span="24" :name="l('note')">{{ entity.note }}</Filed>
<Filed :span="12" :name="l('startDate') + ':'">{{
entity.startDate
}}</Filed>
<Filed :span="12" :name="l('endDate') + ':'">{{
entity.endDate
}}</Filed>
</Row>
</div>
<ul>
<li>
<a @click="details"> <Icon type="ios-log-in" />&nbsp;详情 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="template"> <Icon type="ios-photos" />&nbsp;模板 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="task"> <Icon type="md-create" />&nbsp;任务 </a>
&nbsp;
<span>|</span>
</li>
</ul>
</div>
<div class="body-document">
<h4 v-text="title"></h4>
<keep-alive>
<component v-bind:is="detail" :eid="eid"></component>
</keep-alive>
</div>
</div>
</template>
<script>
import Api from "./api";
......@@ -49,11 +48,18 @@ export default {
name: "Add",
data() {
return {
modal: false,
title: "详细信息",
detail: null,
curId: this.eid,
avatorPath: "",
downUrl: fileUrlDown,
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }],
},
fileds: [],
parms: {
app: "material",
eid: null,
......@@ -64,25 +70,34 @@ export default {
},
props: ["eid"],
mounted() {
if (this.eid) {
this.load(this.eid);
}
// this.detail = () => import("./details");
// this.parms.eid = this.$u.guid();
// this.parms.eid = r.result.attachment;
},
methods: {
imgClick(img) {
window.open(fileUrlDown + img, "_blank");
},
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.entity.type = r.result.type + "";
this.entity.state = r.result.state + "";
this.parms.eid = r.result.attachment;
this.$emit("on-load");
// this.$emit("on-load");
});
},
handleClose() {
this.$emit("on-close");
details() {
this.title = "详细信息";
this.detail = () => import("./details");
},
template() {
// this.curId = this.eid;
this.title = "模板";
// this.detail = () => import("./add");
},
task() {
// this.curId = this.eid;
this.title = "任务";
// this.detail = () => import("./add");
},
l(key) {
key = "project_main" + "." + key;
......@@ -91,10 +106,71 @@ export default {
},
watch: {
eid(v) {
if (v) {
if (v > 0) {
this.load(v);
}
},
},
};
</script>
<style lang="less">
.top-title {
// margin: 10px;
background: #fff;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
position: relative;
border-radius: 5px;
.row-left {
width: 1100px;
}
ul {
display: -webkit-inline-box;
display: inline-box;
position: absolute;
bottom: 5px;
right: 0px;
li {
width: 70px;
span {
color: #e0e0e0;
}
}
}
}
.body-document {
margin-top: 10px;
background: #fff;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
border-radius: 8px;
min-height: 80vh;
h4 {
height: 50px;
line-height: 50px;
background: #515a6e;
padding: 0 10px;
color: #f5f6fa;
border-radius: 5px 5px 0 0;
}
.img-touxiang {
width: 230px;
height: 230px;
float: right;
margin-top: 10px;
margin-right: 10px;
img {
width: 100%;
height: 100%;
border-radius: 5px;
}
}
.detail-d {
padding-left: 20px;
.filed-d {
border-top: 1px solid #e0e0e0;
}
}
}
.detail-document {
background-color: #f5f7f9 !important;
}
</style>
\ No newline at end of file
<template>
<div>
<Row>
<Col span="20">
<div class="new-detail detail-d">
<Row>
<Filed :span="8" :name="l('creationTime') + ':'">{{
entity.creationTime
}}</Filed>
<Filed :span="8" :name="l('creatorUserId') + ':'">
<User :value="entity.creatorUserId" />
</Filed>
<Filed :span="8" :name="l('type') + ':'">
<state code="project.main.type" :value="entity.type" />
</Filed>
<Filed :span="24" :name="l('note') + ':'">{{ entity.note }}</Filed>
<Filed :span="24" :name="l('attachment') + ':'">
<files
ref="refFile"
:parms="parms"
fileFormat
:showList="false"
/>
</Filed>
</Row>
</div>
</Col>
<Col span="4" class="dcm-right">
<div class="img-touxiang">
<Pictrue :src="avatorPath" v-if="avatorPath" />
<img
src="@/assets/images/files_header.png"
v-else
width="100%"
height="100%"
/>
</div>
</Col>
</Row>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
avatorPath: "",
downUrl: fileUrlDown,
entity: this.row,
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
};
},
props: ["eid"],
mounted() {
if (this.eid) {
this.load(this.eid);
}
this.parms.eid = this.$u.guid();
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.entity.type = r.result.type + "";
this.entity.state = r.result.state + "";
this.parms.eid = r.result.attachment;
this.$emit("on-load");
});
},
l(key) {
key = "project_main" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
......@@ -67,7 +67,7 @@
<Col span="10">
<div class="img-i">
<!-- <img :src="downUrl + row.img" v-if="row.img" /> -->
<Pictrue :src="row.img" v-if="row.img" />
<Pictrue :src="row.picture" v-if="row.picture" />
<img
src="@/assets/images/files_header.png"
v-else
......@@ -102,7 +102,7 @@
>&nbsp;
<a @click="remove(row.id)"> <Icon type="ios-trash" />删除 </a
>&nbsp;
<a @click="view(row.id)"> <Icon type="md-document" />详情 </a>
<a @click="view(row.id)"> <Icon type="md-document" />查看 </a>
&nbsp;
<!-- <a @click="sub(row.id)" v-if="row.status == 1 && row.schemaId">
<Icon type="md-color-wand" />送审
......@@ -113,7 +113,14 @@
</Card>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide :mask-closable="false">
<Modal
v-model="modal"
:title="title"
width="1200"
footer-hide
:mask-closable="false"
:fullscreen="fullscreen"
>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
</div>
......@@ -137,7 +144,7 @@ export default {
easySearch: {
keys: { op: "title", value: null },
},
// single: false,
fullscreen: false,
modal: false,
title: "新增",
detail: null,
......@@ -228,21 +235,21 @@ export default {
);
},
},
{
key: "attachment",
title: this.l("attachment"),
align: "center",
high: true,
render: (h, params) => {
return h(
"a",
{
on: { click: () => this.view(params.row.id) },
},
"查看附件"
);
},
},
// {
// key: "attachment",
// title: this.l("attachment"),
// align: "center",
// high: true,
// render: (h, params) => {
// return h(
// "a",
// {
// on: { click: () => this.view(params.row.id) },
// },
// "查看附件"
// );
// },
// },
// {
// key: "phase",
// title: this.l("phase"),
......@@ -300,7 +307,7 @@ export default {
{
title: "操作",
key: "action",
width: 140,
width: 160,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
......@@ -390,25 +397,28 @@ export default {
this.$refs.grid.reload(this.easySearch);
},
add() {
this.fullscreen = false;
this.curId = 0;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
copy(id) {
console.log(id);
this.fullscreen = false;
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.fullscreen = true;
this.curId = id;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.fullscreen = false;
this.curId = id;
this.title = "编辑";
this.detail = () => import("./edit");
......@@ -499,6 +509,11 @@ export default {
.img-i {
height: 170px;
width: 170px;
img {
height: 170px;
width: 170px;
border-radius: 5px;
}
}
.c {
padding-left: 14px;
......
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