Commit 993b49ed authored by kangzhenfei's avatar kangzhenfei

工艺案例&工艺提醒

parent 9d41ddb6
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<FormItem label> <FormItem label>
<files ref="refFile" :parms="parms" files /> <files ref="refFile" :parms="parms" files />
</FormItem> </FormItem>
</Row> </Row>
</Form> </Form>
</div> </div>
</template> </template>
......
<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> </Row>
<Col :span="12"><FormItem :label="l('title')" prop="title"> <Input v-model="entity.title"> </Input> <FormItem>
</FormItem></Col> <Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Col :span="12"><FormItem :label="l('creator')" prop="creator"> <Input v-model="entity.creator"> </Input> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem></Col> </FormItem>
<Col :span="12"><FormItem :label="l('content')" prop="content"> <Input v-model="entity.content"> </Input> </Form>
</FormItem></Col> </template>
<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>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</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,
rules: { type: 1
name: [{ required: true, message: '必填', trigger: 'blur' }] },
} rules: {
} name: [{ required: true, message: "必填", trigger: "blur" }]
}, },
props: { parms:{
v: Object,
eid: Number },
}, };
mounted() { },
if (this.eid > 0) { props: {
this.load(this.eid); v: Object,
} eid: Number
}, },
methods: { created(){
handleSubmit() { console.log(this.entity.creator)
this.$refs.form.validate((v) => { },
if (v) { mounted() {
this.disabled = true; if (this.eid > 0) {
Api.create(this.entity).then((r) => { this.load(this.eid);
this.disabled = false; }
if (r.success) { },
this.$Message.success('保存成功') methods: {
this.$emit('on-ok') handleSubmit() {
} else { this.$refs.form.validate(v => {
this.$Message.error('保存失败') if (v) {
} this.disabled = true;
}).catch(err => { Api.create(this.entity)
this.disabled = false; .then(r => {
this.$Message.error('保存失败') this.disabled = false;
console.warn(err) if (r.success) {
}) this.$Message.success("保存成功");
} this.$emit("on-ok");
}) } else {
}, this.$Message.error("保存失败");
handleClose() { }
this.$emit('on-close') })
}, .catch(err => {
load(v) { this.disabled = false;
Api.get({ id: v }).then(r => { this.$Message.error("保存失败");
this.entity = r.result; console.warn(err);
this.entity.id = 0; });
});
},
l(key) {
key = "process_case" + "." + key;
return this.$t(key)
}
},
watch: {
v() {
this.entity = this.$u.clone(this.v)
},
eid(v) {
if (v > 0) {
this.load(v);
}
}
} }
});
},
handleClose() {
this.$emit("on-close");
},
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
this.entity.id = 0;
});
},
l(key) {
key = "process_case" + "." + key;
return this.$t(key);
}
},
watch: {
v() {
this.entity = this.$u.clone(this.v);
},
eid(v) {
if (v > 0) {
this.load(v);
}
} }
</script> }
\ No newline at end of file };
</script>
\ 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