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