Commit 5eb53bc9 authored by renjintao's avatar renjintao

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

parents 95355350 b6f1c961
......@@ -1427,6 +1427,21 @@ export default {
executive_branch: '执行部门',
},
remind:{//工艺提醒,工艺案例
title: '名称',
creator: '创建人',
creationTime:'创建时间',
content: '内容',
filePath: "上传文件", //文件路径
filePaths: "", //多个文件路径
dispatchId: '工单id',
routingDetailId: '工序id',
routingDetail:'工序',
routingHeaderId: '工艺规程id',
type: '类型(1工艺案例,2工艺提醒)',
status:'状态',
},
product_info: {
mmcode: '物料编号',
materialId: '物料',
......@@ -1674,5 +1689,17 @@ export default {
file:'文件',
status:'状态',
remark:'备注',
}
},
UserMessage:{
title:'标题',
creationTime:'接受时间',
content:'内容',
senderId:'发送人',
receiverId:'接受人',
status:'状态',
messageType:'类别',
content:'内容',
}
}
......@@ -2,7 +2,7 @@
<span class="i-layout-header-trigger i-layout-header-trigger-min">
<Dropdown transfer trigger="hover" @on-click="handleClickUserDropdown">
<span @click="openModelBugAdd">
<Badge :count="bugCount === 0 ? null : bugCount" :overflow-count="99" :offset="[20, 0]">
<Badge :count="bugCount === 0 ? null : bugCount" :overflow-count="99" :offset="[10, 0]">
<Icon type="ios-bug" size="18" />
</Badge>
</span>
......
<template>
<Tooltip :content="tooltipContent" transfer>
<span class="i-layout-header-trigger i-layout-header-trigger-min" @click="handleOpenLog">
<Badge :count="lengthError === 0 ? null : lengthError" :overflow-count="99" :dot="showDot" :offset="showDot ? [26, 2] : [20, 0]">
<Badge :count="lengthError === 0 ? null : lengthError" :overflow-count="99" :dot="showDot" :offset="showDot ? [10, 2] : [10, 2]">
<Icon custom="i-icon i-icon-record" />
</Badge>
</span>
......
<template>
<span
class="i-layout-header-trigger i-layout-header-trigger-min i-layout-header-trigger-in i-con"
class="i-layout-header-trigger i-layout-header-trigger-min i-layout-header-trigger-in i-con readmsg"
>
<Notification auto-count @on-load-more="handleLoadMore" @on-clear="handleClear">
<NotificationTab title="通知" name="message" :count="unreadMessage" :loading="messageLoading">
<Notification auto-count @on-clear="handleClear">
<NotificationTab title="通知" name="message" :count="unreadMessage">
<NotificationItem
v-for="(item, index) in messages"
v-for="(item, index) in messageList"
:key="index"
:class="item.msg?'con_bord':''"
:class="{read:item.status==1}"
:title="item.title"
:icon="item.icon||'md-mail'"
:icon-color="item.iconColor||'#2680eb'"
:icon-color="item.color||'#2680eb'"
:time="item.creationTime"
@click.native="clickItem(item,index)"
/>
<!-- :read="item.content" -->
<div slot="clear">历史消息</div>
</NotificationTab>
</Notification>
<Modal v-model="modal1" :title="msg.title">
<p class="content-in">发送时间:{{msg.creationTime}}</p>
<p class="content-in">{{msg.content}}</p>
<Modal v-model="modal1" :title="title" width="1200">
<component :is="detail" :eid="eid" />
<div slot="footer">
<Button type="primary" @click="modal1=false">取消</Button>
</div>
......@@ -39,8 +37,10 @@ export default {
badgeProps: {
offset: [20, 0],
},
detail: null,
modal1: false,
msg: {},
title: "消息",
eid: -1,
};
},
computed: {
......@@ -48,8 +48,8 @@ export default {
...mapState({ messages: "messages" }),
unreadMessage() {
let unread = 0;
this.messages.forEach((item) => {
if (!item.read) unread++;
this.messageList.forEach((item) => {
if (item.status != 1) unread++;
});
return unread;
},
......@@ -60,37 +60,33 @@ export default {
mounted() {
// this.messageList = [...this.messages];
// console.log(this.messages);
this.load();
setInterval(this.load, 60 * 1000);
},
methods: {
handleLoadMore(tab) {
this.loadMore(tab.name);
},
loadMore(type) {
if (this[`${type}Loading`]) return;
this[`${type}Loading`] = true;
setTimeout(() => {
this[`${type}List`] = this[`${type}List`].concat([
...this[`${type}BaseList`],
]);
this[`${type}Loading`] = false;
}, 1000);
load() {
this.$store.dispatch("loadMessages");
this.messageList = this.messages.filter((u) => {
return true;
});
console.log("message", this.messageList);
},
handleClear(tab) {
this.$router.push("/home/msgRecord");
},
clickItem(item, i) {
this.modal1 = true;
this.msg = item;
item.iconColor = "#ccc";
item.msg = true;
let url = `${systemUrl}/usermessage/read`;
this.$api.post(url, item).then((r) => {
//消息转为已读
// this.msg = r.result;
setInterval(() => {
this.$store.dispatch("loadMessages");
}, 30 * 1000);
});
item.color = "#ccc";
item.status = 1;
this.$set(this.messageList, i, item);
this.title = item.title || " ";
this.eid = item.id;
this.detail = () => import("./message");
},
},
};
......@@ -99,15 +95,17 @@ export default {
.i-con .ivu-badge-count {
top: 0 !important;
}
.content-in {
height: 30px;
}
.con_bord {
.ivu-time {
.readmsg {
min-height: 200px;
.readv {
.ivu-time,
h4 {
color: #ccc;
}
color: #ccc;
}
h4 {
color: #ccc;
.ivu-notifications-tab-loading {
display: none;
}
}
</style>
<template>
<div class="msg-main">
<p class="title">发送时间:{{msg.creationTime}} <span class="fr">发送人:<User :value="msg.senderId"/></span>
</p>
<div class="content" v-html="msg.content"></div>
<div v-if="msg.attachment" class="file">
附件:
</div>
</div>
</template>
<script>
export default {
name: '',
data() {
return {
msg:{}
}
},
mounted(){
this.load();
},
methods:{
load(){
this.$api.get(`${systemUrl}/usermessage/read`,{id:this.eid}).then(r=>{
this.msg=r.result;
})
}
},
props:["eid"],
watch:{
eid(v,o){
if(v){
this.load();
}
}
}
}
</script>
<style lang="less">
.msg-main{
.title{
font-size:14px;
line-height: 45px;
}
.content{
padding: 10px 20px;
}
.file{
padding: 10px 20px;
}
}
</style>
\ No newline at end of file
......@@ -72,8 +72,8 @@
<i-menu-head v-if="headerMenu && isMobile" />
<i-header-log v-if="isDesktop && showLog" />
<i-header-bug />
<i-header-fullscreen v-if="isDesktop && showFullscreen" />
<i-header-notice v-if="showNotice" />
<i-header-fullscreen v-if="isDesktop && showFullscreen" />
<i-header-user />
<!-- <i-header-i18n v-if="showI18n" />
<i-header-setting v-if="enableSetting && !isMobile" />-->
......
......@@ -18,12 +18,23 @@
<Modal v-model="modal" title="查看详情" width="1200" footer-hide>
<div class="detail">
<Row>
<Filed :span="12" name="标题">{{entity.title}}</Filed>
<Filed :span="12" name="接受时间">{{entity.creationTime}}</Filed>
<Filed :span="24" name="内容">{{entity.content}}</Filed>
<Filed :span="12" name="发送人">{{entity.senderId}}</Filed>
<Filed :span="12" name="接受人">{{entity.receiverId}}</Filed>
<Filed :span="24" name="状态" style="color:red">{{entity.messageType== 1 ? "已读" : ""}}</Filed>
<Filed :span="12" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('senderId')">
<User :value="entity.senderId"></User>
</Filed>
<Filed :span="12" :name="l('receiverId')">
<User :value="entity.receiverId"></User>
</Filed>
<Filed :span="12" :name="l('status')">
<state code="message.status" :value="entity.status+''" type="text" />
</Filed>
<Filed
:span="12"
:name="l('messageType')"
style="color:red"
>{{entity.messageType== 1 ? "已读" : ""}}</Filed>
<Filed :span="24" :name="l('content')">{{entity.content}}</Filed>
</Row>
</div>
</Modal>
......@@ -69,6 +80,7 @@ export default {
action: Api.index,
easySearch: {
keys: { op: "title", value: null },
receiverId: { op: "Equal", value: this.$store.state.userInfo.userId },
},
disabled: false,
entity: {},
......@@ -106,51 +118,48 @@ export default {
align: "center",
},
{
title: "标题",
key: "title",
width: 200,
title: this.l("status"),
key: "status",
width: 70,
code: "message.status",
},
{
title: this.l("messageType"),
key: "messageType",
width: 70,
code: "message.status",
},
{
title: "内容",
key: "content",
tooltip: true,
title: this.l("title"),
key: "title",
},
// {
// title: "内容",
// key: "content",
// tooltip: true,
// width: 200,
// },
{
key: "creationTime",
title: "接受时间",
title: this.l("creationTime"),
width: 200,
},
{
title: "发送人",
title: this.l("receiverId"),
key: "receiverId",
width: 120,
type: "user",
},
{
title: "接受人",
title: this.l("senderId"),
key: "senderId",
width: 120,
type: "user",
},
{
title: "状态",
key: "messageType",
width: 120,
render: (h, params) => {
return h(
"div",
{
style: {
color: "red",
},
},
params.row.messageType == 1 ? "已读" : ""
);
},
},
{
title: this.l("action"),
title: "操作",
key: "action",
width: 150,
align: "center",
......@@ -232,7 +241,7 @@ export default {
this.$refs.form.resetFields();
},
l(key) {
let vkey = "resource" + "." + key;
let vkey = "UserMessage" + "." + key;
return this.$t(vkey) || key;
},
search() {
......
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="24">
<Col :span="12">
<FormItem :label="l('title')" prop="title" style="width:95%">
<Input v-model="entity.title"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem label>
<Col span="12">
<FormItem :label="l('status')" prop="status">
<Select v-model="entity.status">
<Option :value="1">启用</Option>
<Option :value="0">禁用</Option>
</Select>
</FormItem>
</Col>
<Col span="24">
<FormItem :label="l('filePath')">
<!-- <files ref="refFile" :parms="parms" files /> -->
<files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" />
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<Col span="24">
<FormItem :label="l('content')" prop="content ">
<Input v-model="entity.content" type="textarea" :rows="5"></Input>
</FormItem>
<!-- <FormItem :label="l('filePath')" prop="filePath">
<InputFile v-model="entity.filePath"></InputFile>
</FormItem> -->
</Col>
</Row>
<FormItem>
......@@ -30,13 +40,7 @@ export default {
return {
disabled: false,
entity: {
// creationTime: null,
creatorUserId: this.$store.state.userInfo.userId,
// lastModificationTime: null,
// lastModifierUserId: null,
// isDeleted: null,
// deletionTime: null,
// deleterUserId: null,
title: "",
creator: this.$store.state.userInfo.userName,
content: "",
......@@ -45,35 +49,36 @@ export default {
dispatchId: this.$route.query.id,
routingDetailId: this.$route.query.headid,
routingHeaderId: this.$route.query.routid,
type: 1
type: 1,
},
rules: {
title: [{ required: true, message: "请填写案例名称", trigger: "blur" }]
title: [{ required: true, message: "请填写案例名称", trigger: "blur" }],
},
parms:{
app: 'technology', //服务
parms: {
app: "technology", //服务
eid: this.$u.guid(), //记录id
name: '', //表名process_case
field: '' //字段名
name: "", //表名process_case
field: "", //字段名
},
};
},
props: {
v: Object,
eid: Number
eid: Number,
},
created(){
created() {
// console.log(this.entity.creator)
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
this.$refs.refFile.intFiles()
this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles();
}
},
methods: {
handleSubmit() {
this.$refs.form.validate(v => {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
if (this.$refs.refFile.nameList.length > 0) {
......@@ -84,7 +89,7 @@ export default {
this.entity.filePaths = "";
}
Api.create(this.entity)
.then(r => {
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
......@@ -93,10 +98,10 @@ export default {
this.$Message.error("保存失败");
}
})
.catch(err => {
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
// console.warn(err);
});
}
});
......@@ -105,15 +110,15 @@ export default {
this.$emit("on-close");
},
load(v) {
Api.get({ id: v }).then(r => {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.entity.id = 0;
});
},
l(key) {
key = "process_case" + "." + key;
key = "remind" + "." + key;
return this.$t(key);
}
},
},
watch: {
v() {
......@@ -123,7 +128,7 @@ export default {
if (v > 0) {
this.load(v);
}
}
}
},
},
};
</script>
\ No newline at end of file
<template>
<div class="detail">
<Row>
<Filed :span="24" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="24" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="24" :name="l('creator')">{{entity.creator}}</Filed>
<Filed :span="24" :name="l('filePaths')">
<files
ref="refFile"
:parms="parms"
fileFormat
:Photos="true"
:showList="false"
@clickItem="clickData"
/></Filed>
<!-- <Filed :span="12" :name="l('filePaths')">{{entity.filePaths}}</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('creator')">{{entity.creator}}</Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="24" :name="l('content')">{{entity.content}}</Filed>
<Filed :span="24" :name="l('filePath')">
<files ref="refFile" :parms="parms" unClosable style="display:inline" /></Filed>
</Filed>
</Row>
</div>
</template>
......@@ -26,18 +21,18 @@ export default {
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }]
code: [{ required: true, message: "必填", trigger: "blur" }],
},
parms: {
app: "technology",
eid: "",
name: "",
field: ""
}
field: "",
},
};
},
props: {
eid: Number
eid: Number,
},
mounted() {
if (this.eid > 0) {
......@@ -45,13 +40,13 @@ export default {
}
},
methods: {
clickData(data,liUrl) {
clickData(data, liUrl) {
window.open(data, "_blank");
},
load(v) {
Api.get({ id: v }).then(r => {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.parms.eid = r.result.filePaths;
this.parms.eid = r.result.filePaths;
this.$emit("on-load");
});
},
......@@ -59,16 +54,16 @@ export default {
this.$emit("on-close");
},
l(key) {
key = "process_case" + "." + key;
key = "remind" + "." + key;
return this.$t(key);
}
},
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
}
}
},
},
};
</script>
\ No newline at end of file
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12"><FormItem :label="l('creationTime')" prop="creationTime"> <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>
</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>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem :label="l('title')" prop="title" style="width:95%">
<Input v-model="entity.title"></Input>
</FormItem>
</Form>
</Col>
<Col span="12">
<FormItem :label="l('status')" prop="status">
<Select v-model="entity.status">
<Option :value="1">启用</Option>
<Option :value="0">禁用</Option>
</Select>
</FormItem>
</Col>
<Col span="24">
<FormItem :label="l('filePath')">
<!-- <files ref="refFile" :parms="parms" files /> -->
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<Col span="24">
<FormItem :label="l('content')" prop="content ">
<Input v-model="entity.content" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Edit',
data() {
return {
disabled: false,
entity: {
},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
})
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.update(this.entity).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
}).catch(err => {
this.disabled = false;
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "process_case" + "." + key;
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
}
}
import Api from "./api";
export default {
name: "Edit",
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
parms: {
app: "technology", //服务
eid: "", //记录id
name: "", //表名process_case
field: "", //字段名
},
};
},
props: {
eid: Number,
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.parms.eid = r.result.filePaths;
});
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
if (this.$refs.refFile.nameList.length > 0) {
this.entity.filePaths = this.parms.eid;
} else {
this.entity.filePath = "";
this.entity.filePaths = "";
}
Api.update(this.entity)
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "remind" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
......@@ -28,36 +28,41 @@
</template>
<template slot="card" slot-scope="{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>
<Row class="title_i">
<Col :span="20">案例名称:{{row.title}}</Col>
<Col :span="4" 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">
<!-- <img :src="fileUrlDown +row.filePaths" /> -->
<!-- <Icon type="ios-paper" v-if="row.id%2==0" /> -->
<Icon type="ios-paper" v-if="row.filePaths" />
<Icon type="md-film" v-else />
</div>
</Col>
<Col span="18">
<p>创建时间:{{row.creationTime}}</p>
<p>创建人:{{row.creator}}</p>
<p>内容:{{row.content}}</p>
<p>
状态:
<state code="processCase.status" :value="row.status+''" type="text" />
</p>
</Col>
</Row>
<div class="down_text">
<Row :gutter="16">
<Col span="6">
<div class="file">
<!-- <img :src="fileUrlDown +row.filePaths" /> -->
<!-- <Icon type="ios-paper" v-if="row.id%2==0" /> -->
<Icon type="ios-paper" v-if="row.filePaths" />
<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>
<!-- <div class="card_box" @click="changeCards(row)">
<Row :gutter="16">
......@@ -75,13 +80,19 @@
<p>{{row.id}}{{row.creator}}</p>
</Col>
</Row>
</div> -->
</div>-->
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="800" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel" :mask-closable="false">
<Modal
v-model="deletelModal"
title="删除"
@on-ok="removeOk"
@on-cancel="cancel"
:mask-closable="false"
>
<p>确定删除?</p>
</Modal>
</div>
......@@ -92,7 +103,7 @@ import Search from "./search";
export default {
name: "list",
components: {
Search
Search,
},
head: {
title: "工艺案例",
......@@ -104,7 +115,7 @@ export default {
action: Api.index,
easySearch: {
keys: { op: "title", value: null },
type: { op: "Equal", value: 1 }
type: { op: "Equal", value: 1 },
},
modal: false,
deletelModal: false,
......@@ -112,94 +123,35 @@ export default {
detail: null,
curId: 0,
columns: [
{
key: "id",
title: this.$t("id"),
hide: true,
align: "left",
high: true
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
high: true
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "left",
high: true
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
align: "left",
high: true
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
align: "left",
high: true
},
{
key: "isDeleted",
title: this.l("isDeleted"),
align: "left",
high: true
},
{
key: "deletionTime",
title: this.l("deletionTime"),
align: "left",
high: true
},
{
key: "deleterUserId",
title: this.l("deleterUserId"),
align: "left",
high: true
},
{
key: "title",
title: this.l("title"),
align: "left",
easy: true,
high: true
},
{ key: "creator", title: this.l("creator"), align: "left", high: true },
{
key: "filePath",
title: this.l("filePath"),
key: "creator",
title: this.l("creator"),
align: "left",
high: true
type: "user",
},
{
key: "filePaths",
title: this.l("filePaths"),
key: "content",
title: this.l("content"),
align: "left",
high: true
},
{
key: "dispatchId",
title: this.l("dispatchId"),
align: "left",
high: true
},
{
key: "routingDetailId",
title: this.l("routingDetailId"),
key: "filePaths",
title: this.l("filePath"),
align: "left",
high: true
easy: true,
},
{
key: "routingHeaderId",
title: this.l("routingHeaderId"),
key: "status",
title: this.l("status"),
align: "left",
high: true
easy: true,
code: "process.status",
},
{ key: "type", title: this.l("type"), align: "left", high: true },
{
title: "操作",
key: "action",
......@@ -211,7 +163,7 @@ export default {
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) }
on: { click: () => this.view(params.row.id) },
},
"查看"
),
......@@ -219,7 +171,7 @@ export default {
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) }
on: { click: () => this.edit(params.row.id) },
},
"编辑"
),
......@@ -227,14 +179,14 @@ export default {
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) }
on: { click: () => this.remove(params.row.id) },
},
"删除"
)
),
]);
}
}
]
},
},
],
};
},
created() {},
......@@ -290,9 +242,9 @@ export default {
this.deletelModal = true;
this.curId = id;
},
removeOk(){
removeOk() {
let id = this.curId;
Api.delete(id).then(r => {
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
......@@ -325,10 +277,10 @@ export default {
type:'类型(工艺案例还是工艺提醒)',
}
*/
let vkey = "process_case" + "." + key;
let vkey = "remind" + "." + key;
return this.$t(vkey) || key;
}
}
},
},
};
</script>
<style lang="less">
......
......@@ -45,10 +45,21 @@
<Menu mode="horizontal" theme="light" active-name="0">
<MenuItem name="0" :to="'/technology/details?id='+headerId+'&headerStatus='+headerStatus">工序</MenuItem>
<!-- <MenuItem name="1" :to="'/technology/details/routingStep?id='+headerId">工步</MenuItem> -->
<MenuItem name="2" :to="'/technology/details/routingqccard?id='+headerId+'&headerStatus='+headerStatus">质控卡</MenuItem>
<MenuItem name="3" :to="'/technology/details/routingsupporting?id='+headerId+'&headerStatus='+headerStatus+'&productBomId='+productBomId">工艺BOM</MenuItem>
<MenuItem
name="2"
:to="'/technology/details/routingqccard?id='+headerId+'&headerStatus='+headerStatus"
>质控卡</MenuItem>
<MenuItem
name="3"
:to="'/technology/details/routingsupporting?id='+headerId+'&headerStatus='+headerStatus+'&productBomId='+productBomId"
>工艺BOM</MenuItem>
<!-- <MenuItem name="4" to="/technology/details/setup/setupDetails">生产准备</MenuItem> -->
<MenuItem name="5" :to="'/technology/details/routinghcorder?id='+headerId" v-show="headerStatus==1">工艺更改单</MenuItem>
<MenuItem
name="5"
:to="'/technology/details/routinghcorder?id='+headerId"
v-show="headerStatus==1"
>工艺更改单</MenuItem>
<MenuItem name="6" :to="'/technology/details/remind?id='+headerId">工艺提醒</MenuItem>
</Menu>
</div>
<div class="bottom_box">
......@@ -68,15 +79,14 @@ export default {
treeHeight: "",
actNum: "1",
headerId: -1,
headerStatus:-1,
productBomId:-1,
headerStatus: -1,
productBomId: -1,
};
},
created() {
this.headerId = this.$route.query.id;
this.headerStatus = this.$route.query.headerStatus;
this.productBomId = this.$route.query.productBomId;
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
......@@ -84,7 +94,7 @@ export default {
mounted() {},
computed: {},
methods: {},
watch: {}
watch: {},
};
</script>
<style>
......
<template>
<div>
<Form ref="form" :model="entity" :rules="rules" :label-width="110">
<Row>
<Col :span="12">
<FormItem :label="l('routingDetail')" prop="routingDetailId">
<Select v-model="entity.routingDetailId">
<Option
v-for="(item,index) in routingDetailList"
:value="item.value"
:key="index"
>{{ item.label }}</Option>
</Select>
</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('status')" prop="status">
<Select v-model="entity.status">
<Option :value="1">启用</Option>
<Option :value="0">禁用</Option>
</Select>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('filePath')" prop="filePaths">
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<Col span="24">
<FormItem :label="l('content')" prop="content">
<Input v-model="entity.content" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
</Row>
<Row>
<Col span="24" style="text-align:right">
<FormItem label>
<Button @click="handleClose" class="ml20">取消</Button>&nbsp;&nbsp;
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>&nbsp;&nbsp;
</FormItem>
</Col>
</Row>
</Form>
</div>
</template>
<script>
import Api from "./api";
import ApiDetail from "../api";
export default {
name: "Add",
data() {
return {
disabled: false,
submitShow: true, //送审按钮显隐
checked: true, //送审选择框
entity: {
creatorUserId: this.$store.state.userInfo.userId,
creator: this.$store.state.userInfo.userName,
routingHeaderId: this.eid, //工艺规程id
type: 2,
filePath: "", //文件路径
filePaths: "", //多个文件路径
},
rules: {
title: [{ required: true, message: "必填", trigger: "blur" }],
content: [{ required: true, message: "必填", trigger: "blur" }],
routingDetailId: [
{
required: true,
message: "请选择工序",
type: "number",
trigger: "change",
},
],
},
routingDetailList: [],
parms: {
app: "technology",
eid: null,
name: "",
field: "",
},
};
},
props: ["eid"],
mounted() {
this.loadDetails();
this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles();
},
methods: {
loadDetails() {
//获取工序列表
let parms = {
headerID: this.eid,
};
ApiDetail.pagedDetails(parms).then((r) => {
let tempDetails = r.result;
let tempD = [];
tempDetails.forEach((data) => {
let tempObj = {};
tempObj.value = data.id;
tempObj.label = data.taskSeq + " " + data.name;
tempD.push(tempObj);
});
this.routingDetailList = tempD;
});
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
if (this.$refs.refFile.nameList.length > 0) {
this.entity.filePaths = this.parms.eid;
} else {
this.entity.filePath = "";
this.entity.filePaths = "";
}
Api.create(this.entity)
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
this.$refs.refFile.intFiles();
})
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
});
}
});
},
handleClose() {
this.$emit("on-close");
},
ok() {
this.$emit("on-ok");
},
l(key) {
key = "remind" + "." + key;
return this.$t(key);
},
},
watch: {},
};
</script>
import Api from '@/plugins/request'
export default {
index:`${technologyUrl}processcase/paged`,
paged(params){
return Api.post(`${technologyUrl}processcase/paged`,params);
},
get(params){
return Api.get(`${technologyUrl}processcase/get`,params);
},
create(params){
return Api.post(`${technologyUrl}processcase/create`,params);
},
update(params){
return Api.post(`${technologyUrl}processcase/update`,params);
},
delete(id) {
return Api.delete(`${technologyUrl}processcase/delete`,{params:{id:id}});
},
deletes(params) {
return Api.post(`${technologyUrl}processcase/batchdelete`,params);
}
}
\ No newline at end of file
<template>
<div class="detail">
<Row>
<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('creator')">{{entity.creator}}</Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="24" :name="l('content')">{{entity.content}}</Filed>
<Filed :span="24" :name="l('filePath')">
<files ref="refFile" :parms="parms" unClosable style="display:inline" /></Filed>
</Filed>
</Row>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }],
},
parms: {
app: "technology",
eid: "",
name: "",
field: "",
},
};
},
props: {
eid: Number,
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
clickData(data, liUrl) {
window.open(data, "_blank");
},
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.parms.eid = r.result.filePaths;
this.$emit("on-load");
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "remind" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem :label="l('title')" prop="title" style="width:95%">
<Input v-model="entity.title"></Input>
</FormItem>
</Col>
<Col span="12">
<FormItem :label="l('status')" prop="status">
<Select v-model="entity.status">
<Option :value="1">启用</Option>
<Option :value="0">禁用</Option>
</Select>
</FormItem>
</Col>
<Col span="24">
<FormItem :label="l('filePath')">
<!-- <files ref="refFile" :parms="parms" files /> -->
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<Col span="24">
<FormItem :label="l('content')" prop="content ">
<Input v-model="entity.content" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Edit",
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
parms: {
app: "technology", //服务
eid: "", //记录id
name: "", //表名process_case
field: "", //字段名
},
};
},
props: {
eid: Number,
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.parms.eid = r.result.filePaths;
});
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
if (this.$refs.refFile.nameList.length > 0) {
this.entity.filePaths = this.parms.eid;
} else {
this.entity.filePath = "";
this.entity.filePaths = "";
}
Api.update(this.entity)
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "remind" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入关键字标题" v-model="easySearch.keys.value" clearable />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="800" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "",
data() {
return {
action: Api.index,
easySearch: {
keys: { op: "title", value: null },
type: { op: "Equal", value: 2 },
routingHeaderId: { op: "Equal", value: this.headerid },
},
modal: false,
title: "新增",
detail: null,
curId: 0,
columns: [
{
type: "index",
width: 60,
align: "center",
},
{
key: "routingDetail",
title: this.l("routingDetail"),
align: "left",
high: true,
tooltip: true,
},
{
key: "title",
title: this.l("title"),
align: "left",
},
{
key: "creator",
title: this.l("creator"),
align: "left",
type: "user",
},
{
key: "content",
title: this.l("content"),
align: "left",
},
{
key: "filePaths",
title: this.l("filePath"),
align: "left",
easy: true,
render: (h, params) => {
return h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) },
},
"查看"
);
},
},
{
key: "status",
title: this.l("status"),
align: "left",
easy: true,
code: "process.status",
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) },
},
"查看"
),
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) },
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) },
},
"删除"
),
]);
},
},
],
};
},
props: ["headerid"],
mounted() {
// console.log(this);
this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles();
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
add() {
this.curId = this.headerid;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
// this.modal = true;
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
cancel() {
this.curId = 0;
this.modal = false;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
l(key) {
key = "remind" + "." + key;
return this.$t(key);
},
},
};
</script>
<style lang="less">
</style>
\ No newline at end of file
......@@ -171,7 +171,7 @@ export default {
margin: 8,
maxSize: new go.Size(300, NaN),
wrap: go.TextBlock.WrapFit,
editable: true
editable: false
},
new go.Binding("text").makeTwoWay()
)
......@@ -207,7 +207,7 @@ export default {
margin: 8,
maxSize: new go.Size(60, NaN),
wrap: go.TextBlock.WrapFit,
editable: true
editable: false
},
new go.Binding("text").makeTwoWay()
)
......@@ -303,7 +303,7 @@ export default {
maxSize: new go.Size(200, NaN),
wrap: go.TextBlock.WrapFit,
textAlign: "center",
editable: true
editable: false
},
new go.Binding("text").makeTwoWay()
)
......@@ -381,7 +381,7 @@ export default {
textAlign: "center",
font: "10pt helvetica, arial, sans-serif",
stroke: "#333333",
editable: true
editable: false
},
new go.Binding("text").makeTwoWay()
)
......
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