Commit 21918f08 authored by renjintao's avatar renjintao

remind 工艺提醒

parent bdef2da3
<template> <template>
<div> <div>
<Form ref="form" :model="entity" :rules="rules" :label-width="110"> <Form ref="form" :model="entity" :rules="rules" :label-width="110">
<Row> <Row>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('routingDetail')" prop="routingDetailId"> <FormItem :label="l('routingDetail')" prop="routingDetailId">
<Select v-model="entity.routingDetailId"> <Select v-model="entity.routingDetailId">
<Option <Option v-for="(item,index) in routingDetailList" :value="item.value" :key="index">{{ item.label }}</Option>
v-for="(item,index) in routingDetailList"
:value="item.value"
:key="index"
>{{ item.label }}</Option>
</Select> </Select>
</FormItem> </FormItem>
</Col> </Col>
...@@ -33,7 +29,7 @@ ...@@ -33,7 +29,7 @@
</Col> </Col>
<Col span="24"> <Col span="24">
<FormItem :label="l('content')" prop="content"> <FormItem :label="l('content')" prop="content">
<Input v-model="entity.content" type="textarea" :rows="5"></Input> <i-quill v-model="entity.content" :height="260" v-paste="handleImg" border />
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
...@@ -47,14 +43,18 @@ ...@@ -47,14 +43,18 @@
</Col> </Col>
</Row> </Row>
</Form> </Form>
</div> </div>
</template> </template>
<script>
<script>
import Api from "./api"; import Api from "./api";
import ApiDetail from "../api"; import ApiDetail from "../api";
import iQuill from "@/components/quill";
export default { export default {
name: "Add", name: "Add",
components: {
iQuill
},
data() { data() {
return { return {
submitShow: true, //送审按钮显隐 submitShow: true, //送审按钮显隐
...@@ -68,16 +68,22 @@ export default { ...@@ -68,16 +68,22 @@ export default {
filePaths: "", //多个文件路径 filePaths: "", //多个文件路径
}, },
rules: { rules: {
title: [{ required: true, message: "必填", trigger: "blur" }], title: [{
content: [{ required: true, message: "必填", trigger: "blur" }], required: true,
routingDetailId: [ message: "必填",
{ trigger: "blur"
}],
content: [{
required: true,
message: "必填",
trigger: "blur"
}],
routingDetailId: [{
required: true, required: true,
message: "请选择工序", message: "请选择工序",
type: "number", type: "number",
trigger: "change", trigger: "change",
}, }, ],
],
}, },
routingDetailList: [], routingDetailList: [],
parms: { parms: {
...@@ -137,6 +143,26 @@ export default { ...@@ -137,6 +143,26 @@ export default {
} }
}); });
}, },
handleImg(e) {
let file = null;
if (
e.clipboardData &&
e.clipboardData.items[0] &&
e.clipboardData.items[0].type &&
e.clipboardData.items[0].type.indexOf("image") > -1
) {
//这里就是判断是否有粘贴进来的文件且文件为图片格式
file = e.clipboardData.items[0].getAsFile();
let reader = new FileReader();
reader.readAsDataURL(file);
setTimeout(() => {
var img = '<img src="' + reader.result + '" alt=""/>';
this.entity.content += img;
}, 1000);
// new R
}
},
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
}, },
......
<template> <template>
<div class="detail"> <div class="detail">
<Row> <Row>
<Filed :span="12" :name="l('title')">{{entity.title}}</Filed> <Filed :span="12" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="12" :name="l('status')"><state code="processCase.status" :value="entity.status+''" type="text" /></Filed> <Filed :span="12" :name="l('status')">
<state code="processCase.status" :value="entity.status+''" type="text" />
</Filed>
<Filed :span="12" :name="l('creator')">{{entity.creator}}</Filed> <Filed :span="12" :name="l('creator')">{{entity.creator}}</Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed> <Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="24" :name="l('content')">{{entity.content}}</Filed> <Filed :span="24" :name="l('content')">
<div v-html="entity.content" class="tohtml"></div>
</Filed>
<Filed :span="24" :name="l('filePath')"> <Filed :span="24" :name="l('filePath')">
<files ref="refFile" :parms="parms" unClosable style="display:inline" /></Filed> <files ref="refFile" :parms="parms" unClosable style="display:inline" />
</Filed>
</Filed> </Filed>
</Row> </Row>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
export default { export default {
...@@ -20,8 +26,16 @@ export default { ...@@ -20,8 +26,16 @@ export default {
return { return {
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{
code: [{ required: true, message: "必填", trigger: "blur" }], required: true,
message: "必填",
trigger: "blur"
}],
code: [{
required: true,
message: "必填",
trigger: "blur"
}],
}, },
parms: { parms: {
app: "technology", app: "technology",
...@@ -44,7 +58,9 @@ export default { ...@@ -44,7 +58,9 @@ export default {
window.open(data, "_blank"); window.open(data, "_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.parms.eid = r.result.filePaths; this.parms.eid = r.result.filePaths;
this.$emit("on-load"); this.$emit("on-load");
......
<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="12">
<FormItem :label="l('title')" prop="title" style="width:95%"> <FormItem :label="l('title')" prop="title" style="width:95%">
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</Col> </Col>
<Col span="24"> <Col span="24">
<FormItem :label="l('content')" prop="content "> <FormItem :label="l('content')" prop="content ">
<Input v-model="entity.content" type="textarea" :rows="5"></Input> <i-quill v-model="entity.content" :height="260" v-paste="handleImg" border />
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
...@@ -30,17 +30,26 @@ ...@@ -30,17 +30,26 @@
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</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";
import iQuill from "@/components/quill";
export default { export default {
name: "Edit", name: "Edit",
components: {
iQuill
},
data() { data() {
return { return {
entity: {}, entity: {},
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{
required: true,
message: "必填",
trigger: "blur"
}],
}, },
parms: { parms: {
app: "technology", //服务 app: "technology", //服务
...@@ -60,7 +69,9 @@ export default { ...@@ -60,7 +69,9 @@ export default {
}, },
methods: { methods: {
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.parms.eid = r.result.filePaths; this.parms.eid = r.result.filePaths;
}); });
...@@ -93,6 +104,26 @@ export default { ...@@ -93,6 +104,26 @@ export default {
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
}, },
handleImg(e) {
let file = null;
if (
e.clipboardData &&
e.clipboardData.items[0] &&
e.clipboardData.items[0].type &&
e.clipboardData.items[0].type.indexOf("image") > -1
) {
//这里就是判断是否有粘贴进来的文件且文件为图片格式
file = e.clipboardData.items[0].getAsFile();
let reader = new FileReader();
reader.readAsDataURL(file);
setTimeout(() => {
var img = '<img src="' + reader.result + '" alt=""/>';
this.entity.content += img;
}, 1000);
// new R
}
},
l(key) { l(key) {
key = "remind" + "." + key; key = "remind" + "." + key;
return this.$t(key); return this.$t(key);
......
<template> <template>
<div> <div>
<DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch"> <DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch">
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
...@@ -18,8 +18,9 @@ ...@@ -18,8 +18,9 @@
<Modal v-model="modal" :title="title" width="800" footer-hide> <Modal v-model="modal" :title="title" width="800" 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>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
export default { export default {
...@@ -29,16 +30,24 @@ export default { ...@@ -29,16 +30,24 @@ export default {
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { op: "title", value: null }, keys: {
type: { op: "Equal", value: 2 }, op: "title",
routingHeaderId: { op: "Equal", value: this.headerid }, value: null
},
type: {
op: "Equal",
value: 2
},
routingHeaderId: {
op: "Equal",
value: this.headerid
},
}, },
modal: false, modal: false,
title: "新增", title: "新增",
detail: null, detail: null,
curId: 0, curId: 0,
columns: [ columns: [{
{
type: "index", type: "index",
width: 60, width: 60,
align: "center", align: "center",
...@@ -61,11 +70,6 @@ export default { ...@@ -61,11 +70,6 @@ export default {
align: "left", align: "left",
type: "user", type: "user",
}, },
{
key: "content",
title: this.l("content"),
align: "left",
},
{ {
key: "filePaths", key: "filePaths",
title: this.l("filePath"), title: this.l("filePath"),
...@@ -73,10 +77,13 @@ export default { ...@@ -73,10 +77,13 @@ export default {
easy: true, easy: true,
render: (h, params) => { render: (h, params) => {
return h( return h(
"op", "op", {
{ attrs: {
attrs: { oprate: "detail" }, oprate: "detail"
on: { click: () => this.view(params.row.id) }, },
on: {
click: () => this.view(params.row.id)
},
}, },
"查看" "查看"
); );
...@@ -95,28 +102,39 @@ export default { ...@@ -95,28 +102,39 @@ export default {
width: 140, width: 140,
align: "center", align: "center",
render: (h, params) => { render: (h, params) => {
return h("div", { class: "action" }, [ return h("div", {
class: "action"
}, [
h( h(
"op", "op", {
{ attrs: {
attrs: { oprate: "detail" }, oprate: "detail"
on: { click: () => this.view(params.row.id) }, },
on: {
click: () => this.view(params.row.id)
},
}, },
"查看" "查看"
), ),
h( h(
"op", "op", {
{ attrs: {
attrs: { oprate: "edit" }, oprate: "edit"
on: { click: () => this.edit(params.row.id) }, },
on: {
click: () => this.edit(params.row.id)
},
}, },
"编辑" "编辑"
), ),
h( h(
"op", "op", {
{ attrs: {
attrs: { oprate: "delete" }, oprate: "delete"
on: { click: () => this.remove(params.row.id) }, },
on: {
click: () => this.remove(params.row.id)
},
}, },
"删除" "删除"
), ),
...@@ -132,7 +150,10 @@ export default { ...@@ -132,7 +150,10 @@ export default {
this.parms.eid = this.$u.guid(); this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles(); this.$refs.refFile.intFiles();
}, },
async fetch({ store, params }) { async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
...@@ -182,5 +203,6 @@ export default { ...@@ -182,5 +203,6 @@ export default {
}, },
}; };
</script> </script>
<style lang="less"> <style lang="less">
</style> </style>
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