Commit 0b19c975 authored by renjintao's avatar renjintao

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

parents e063137c 6d5f8dbc
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<Col :span="12"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker> <Col :span="24">
</FormItem></Col> <FormItem :label="l('title')" prop="title" style="width:95%">
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber> <Input v-model="entity.title"></Input>
</FormItem></Col> </FormItem>
<Col :span="12"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker> </Col>
</FormItem></Col> <Col :span="24">
<Col :span="12"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <InputNumber v-model="entity.lastModifierUserId"></InputNumber> <FormItem label>
</FormItem></Col> <files ref="refFile" :parms="parms" files />
<Col :span="12"><FormItem :label="l('isDeleted')" prop="isDeleted"> <InputNumber v-model="entity.isDeleted"></InputNumber> </FormItem>
</FormItem></Col> <!-- <FormItem :label="l('filePath')" prop="filePath">
<Col :span="12"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="date" v-model="entity.deletionTime"></DatePicker> <InputFile v-model="entity.filePath"></InputFile>
</FormItem></Col> </FormItem> -->
<Col :span="12"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <InputNumber v-model="entity.deleterUserId"></InputNumber> </Col>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('title')" prop="title"> <Input v-model="entity.title"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('creator')" prop="creator"> <Input v-model="entity.creator"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('content')" prop="content"> <Input v-model="entity.content"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('filePath')" prop="filePath"> <InputFile v-model="entity.filePath"></InputFile>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('filePaths')" prop="filePaths"> <Input v-model="entity.filePaths"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('dispatchId')" prop="dispatchId"> <InputNumber v-model="entity.dispatchId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('routingDetailId')" prop="routingDetailId"> <InputNumber v-model="entity.routingDetailId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('routingHeaderId')" prop="routingHeaderId"> <InputNumber v-model="entity.routingHeaderId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('type')" prop="type"> <InputNumber v-model="entity.type"></InputNumber>
</FormItem></Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Add', name: "Add",
data() { data() {
return { return {
disabled: false, disabled: false,
entity: {creationTime: null, entity: {
creatorUserId: null, // creationTime: null,
lastModificationTime: null, creatorUserId: this.$store.state.userInfo.userId,
lastModifierUserId: null, // lastModificationTime: null,
isDeleted: null, // lastModifierUserId: null,
deletionTime: null, // isDeleted: null,
deleterUserId: null, // deletionTime: null,
title: "", // deleterUserId: null,
creator: "", title: "",
content: "", creator: this.$store.state.userInfo.userName,
filePath: "", content: "",
filePaths: "", filePath: "",
dispatchId: null, filePaths: "",
routingDetailId: null, dispatchId: null,
routingHeaderId: null, routingDetailId: null,
type: null}, routingHeaderId: null,
type: 1
},
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }] name: [{ required: true, message: "必填", trigger: "blur" }]
} },
} parms:{
},
};
}, },
props: { props: {
v: Object, v: Object,
eid: Number eid: Number
}, },
created(){
console.log(this.entity.creator)
},
mounted() { mounted() {
if (this.eid > 0) { if (this.eid > 0) {
this.load(this.eid); this.load(this.eid);
...@@ -79,27 +68,29 @@ type: null}, ...@@ -79,27 +68,29 @@ type: null},
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate(v => {
if (v) { if (v) {
this.disabled = true; this.disabled = true;
Api.create(this.entity).then((r) => { Api.create(this.entity)
.then(r => {
this.disabled = false; this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$emit('on-ok') this.$emit("on-ok");
} else { } 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);
});
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
load(v) { load(v) {
Api.get({ id: v }).then(r => { Api.get({ id: v }).then(r => {
...@@ -109,12 +100,12 @@ type: null}, ...@@ -109,12 +100,12 @@ type: null},
}, },
l(key) { l(key) {
key = "process_case" + "." + key; key = "process_case" + "." + key;
return this.$t(key) return this.$t(key);
} }
}, },
watch: { watch: {
v() { v() {
this.entity = this.$u.clone(this.v) this.entity = this.$u.clone(this.v);
}, },
eid(v) { eid(v) {
if (v > 0) { if (v > 0) {
...@@ -122,5 +113,5 @@ type: null}, ...@@ -122,5 +113,5 @@ type: null},
} }
} }
} }
} };
</script> </script>
\ No newline at end of file \ No newline at end of file
...@@ -11,13 +11,8 @@ ...@@ -11,13 +11,8 @@
<Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed> <Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed>
<Filed :span="12" :name="l('title')">{{entity.title}}</Filed> <Filed :span="12" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="12" :name="l('creator')">{{entity.creator}}</Filed> <Filed :span="12" :name="l('creator')">{{entity.creator}}</Filed>
<Filed :span="12" :name="l('content')">{{entity.content}}</Filed>
<Filed :span="12" :name="l('filePath')">{{entity.filePath}}</Filed> <Filed :span="12" :name="l('filePath')">{{entity.filePath}}</Filed>
<Filed :span="12" :name="l('filePaths')">{{entity.filePaths}}</Filed> <Filed :span="12" :name="l('filePaths')">{{entity.filePaths}}</Filed>
<Filed :span="12" :name="l('dispatchId')">{{entity.dispatchId}}</Filed>
<Filed :span="12" :name="l('routingDetailId')">{{entity.routingDetailId}}</Filed>
<Filed :span="12" :name="l('routingHeaderId')">{{entity.routingHeaderId}}</Filed>
<Filed :span="12" :name="l('type')">{{entity.type}}</Filed>
</Row> </Row>
</div> </div>
......
...@@ -27,7 +27,37 @@ ...@@ -27,7 +27,37 @@
<Button type="primary" @click="add">新增</Button> <Button type="primary" @click="add">新增</Button>
</template> </template>
<template slot="card" slot-scope="{row}"> <template slot="card" slot-scope="{row}">
<div class="card_box" @click="changeCards(row)"> <div class="card_body">
<Row class="title_i">
<Col :span="21">案例名称:{{row.title}}</Col>
<Col :span="3" class="btn_click">
<!-- <a @click="edit(row.id)">
<Icon type="ios-create" @click="edit(row.id)" />
</a> -->
<a @click="view(row.id)">
<Icon type="ios-paper" />
</a>
<a @click="remove(row.id)">
<Icon type="ios-trash" />
</a>
</Col>
</Row>
<div class="down_text">
<Row :gutter="16">
<Col span="6">
<div class="file">
<Icon type="ios-paper" v-if="row.id%2==0" />
<Icon type="md-film" v-else />
</div>
</Col>
<Col span="18">
<p>{{row.creationTime}}</p>
<p>{{row.id}}{{row.creator}}</p>
</Col>
</Row>
</div>
</div>
<!-- <div class="card_box" @click="changeCards(row)">
<Row :gutter="16"> <Row :gutter="16">
<Col span="6"> <Col span="6">
<div class="file"> <div class="file">
...@@ -43,12 +73,15 @@ ...@@ -43,12 +73,15 @@
<p>{{row.id}}{{row.creator}}</p> <p>{{row.id}}{{row.creator}}</p>
</Col> </Col>
</Row> </Row>
</div> </div> -->
</template> </template>
</DataGrid> </DataGrid>
<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" @on-close="cancel" @on-ok="ok" /> <component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal> </Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel" :mask-closable="false">
<p>确定删除?</p>
</Modal>
</div> </div>
</template> </template>
<script> <script>
...@@ -72,6 +105,7 @@ export default { ...@@ -72,6 +105,7 @@ export default {
type: { op: "Equal", value: 1 } type: { op: "Equal", value: 1 }
}, },
modal: false, modal: false,
deletelModal: false,
title: "新增", title: "新增",
detail: null, detail: null,
curId: 0, curId: 0,
...@@ -251,6 +285,11 @@ export default { ...@@ -251,6 +285,11 @@ export default {
this.modal = true; this.modal = true;
}, },
remove(id) { remove(id) {
this.deletelModal = true;
this.curId = id;
},
removeOk(){
let id = this.curId;
Api.delete(id).then(r => { Api.delete(id).then(r => {
if (r.success) { if (r.success) {
this.$refs.grid.load(); this.$refs.grid.load();
...@@ -261,6 +300,7 @@ export default { ...@@ -261,6 +300,7 @@ export default {
cancel() { cancel() {
this.curId = 0; this.curId = 0;
this.modal = false; this.modal = false;
this.deletedlModal = false;
}, },
l(key) { l(key) {
/* /*
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<Col :span="12"> <Col :span="24">
<FormItem :label="l('creationTime')" prop="creationTime"> <FormItem :label="l('title')" prop="title" style="width:95%">
<DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creatorUserId')" prop="creatorUserId">
<InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
<DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isDeleted')" prop="isDeleted">
<InputNumber v-model="entity.isDeleted"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deleterUserId')" prop="deleterUserId">
<InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"></Input> <Input v-model="entity.title"></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="24">
<FormItem :label="l('creator')" prop="creator"> <FormItem label>
<Input v-model="entity.creator"></Input> <files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('content')" prop="content">
<Input v-model="entity.content"></Input>
</FormItem> </FormItem>
</Col> <!-- <FormItem :label="l('filePath')" prop="filePath">
<Col :span="12">
<FormItem :label="l('filePath')" prop="filePath">
<InputFile v-model="entity.filePath"></InputFile> <InputFile v-model="entity.filePath"></InputFile>
</FormItem> </FormItem> -->
</Col>
<Col :span="12">
<FormItem :label="l('filePaths')" prop="filePaths">
<Input v-model="entity.filePaths"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('dispatchId')" prop="dispatchId">
<InputNumber v-model="entity.dispatchId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('routingDetailId')" prop="routingDetailId">
<InputNumber v-model="entity.routingDetailId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('routingHeaderId')" prop="routingHeaderId">
<InputNumber v-model="entity.routingHeaderId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('type')" prop="type">
<InputNumber v-model="entity.type"></InputNumber>
</FormItem>
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
...@@ -96,32 +29,38 @@ export default { ...@@ -96,32 +29,38 @@ export default {
return { return {
disabled: false, disabled: false,
entity: { entity: {
creationTime: null, // creationTime: null,
creatorUserId: null, creatorUserId: this.$store.state.userInfo.userId,
lastModificationTime: null, // lastModificationTime: null,
lastModifierUserId: null, // lastModifierUserId: null,
isDeleted: null, // isDeleted: null,
deletionTime: null, // deletionTime: null,
deleterUserId: null, // deleterUserId: null,
title: "", title: "",
creator: "", creator: this.$store.state.userInfo.userName,
content: "", content: "",
filePath: "", filePath: "",
filePaths: "", filePaths: "",
dispatchId: null, dispatchId: null,
routingDetailId: null, routingDetailId: null,
routingHeaderId: null, routingHeaderId: null,
type: null type: 2
}, },
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }] name: [{ required: true, message: "必填", trigger: "blur" }]
} },
parms:{
},
}; };
}, },
props: { props: {
v: Object, v: Object,
eid: Number eid: Number
}, },
created(){
console.log(this.entity.creator)
},
mounted() { mounted() {
if (this.eid > 0) { if (this.eid > 0) {
this.load(this.eid); this.load(this.eid);
......
...@@ -24,7 +24,37 @@ ...@@ -24,7 +24,37 @@
<Button type="primary" @click="add">新增</Button> <Button type="primary" @click="add">新增</Button>
</template> </template>
<template slot="card" slot-scope="{row}"> <template slot="card" slot-scope="{row}">
<div class="card_box" @click="changeCards(row)"> <div class="card_body">
<Row class="title_i">
<Col :span="21">工艺名称:{{row.title}}</Col>
<Col :span="3" class="btn_click">
<!-- <a @click="edit(row.id)">
<Icon type="ios-create" @click="edit(row.id)" />
</a> -->
<a @click="view(row.id)">
<Icon type="ios-paper" />
</a>
<a @click="remove(row.id)">
<Icon type="ios-trash" />
</a>
</Col>
</Row>
<div class="down_text">
<Row :gutter="16">
<Col span="6">
<div class="file">
<Icon type="ios-paper" v-if="row.id%2==0" />
<Icon type="md-film" v-else />
</div>
</Col>
<Col span="18">
<p>{{row.creationTime}}</p>
<p>{{row.id}}{{row.creator}}</p>
</Col>
</Row>
</div>
</div>
<!-- <div class="card_box" @click="changeCards(row)">
<Row :gutter="16"> <Row :gutter="16">
<Col span="6"> <Col span="6">
<div class="file"> <div class="file">
...@@ -40,12 +70,15 @@ ...@@ -40,12 +70,15 @@
<p>{{row.id}}{{row.creator}}</p> <p>{{row.id}}{{row.creator}}</p>
</Col> </Col>
</Row> </Row>
</div> </div> -->
</template> </template>
</DataGrid> </DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide> <Modal v-model="modal" :title="title" width="1200" footer-hide :mask-closable="false">
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" /> <component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal> </Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel" :mask-closable="false">
<p>确定删除?</p>
</Modal>
</div> </div>
</template> </template>
<script> <script>
...@@ -58,8 +91,8 @@ export default { ...@@ -58,8 +91,8 @@ export default {
}, },
head: { head: {
title: "工艺提醒", title: "工艺提醒",
author: "henq", // author: "henq",
description: "process_case 6/1/2020 5:06:34 PM" // description: "process_case 6/1/2020 5:06:34 PM"
}, },
data() { data() {
return { return {
...@@ -69,6 +102,7 @@ export default { ...@@ -69,6 +102,7 @@ export default {
type: { op: "Equal", value: 2 } type: { op: "Equal", value: 2 }
}, },
modal: false, modal: false,
deletelModal: false,
title: "新增", title: "新增",
detail: null, detail: null,
curId: 0, curId: 0,
...@@ -242,6 +276,11 @@ export default { ...@@ -242,6 +276,11 @@ export default {
this.modal = true; this.modal = true;
}, },
remove(id) { remove(id) {
this.deletelModal = true;
this.curId = id;
},
removeOk(){
let id = this.curId;
Api.delete(id).then(r => { Api.delete(id).then(r => {
if (r.success) { if (r.success) {
this.$refs.grid.load(); this.$refs.grid.load();
...@@ -252,6 +291,7 @@ export default { ...@@ -252,6 +291,7 @@ export default {
cancel() { cancel() {
this.curId = 0; this.curId = 0;
this.modal = false; this.modal = false;
this.deletedlModal = false;
}, },
l(key) { l(key) {
/* /*
......
...@@ -126,7 +126,30 @@ ...@@ -126,7 +126,30 @@
padding: 0; padding: 0;
} }
} }
.card_body{
border: 1px solid #e4e6ed;
border-radius: 4px;
margin-bottom: 30px;
.title_i{
padding: 0 8px;
height: 35px;
line-height: 35px;
color: #fff;
background: #a7b8cc;
font-size: 15px;
}
.btn_click{
text-align: right;
}
.down_text{
background: #a7b8cc33;
padding: 5px 8px;
line-height: 32px;
i{
font-size: 62px;
}
}
}
.gd_box{ .gd_box{
.ivu-drawer-wrap{ .ivu-drawer-wrap{
.ivu-drawer-left{ .ivu-drawer-left{
......
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