!12 合并功能

Merge pull request !12 from 打豆豆/master
This commit is contained in:
打豆豆 2023-12-29 09:16:07 +00:00 committed by Gitee
commit a263fb8f0c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
76 changed files with 3730 additions and 227 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "ktg-mes-ui", "name": "ktg-mes-ui",
"version": "3.8.2", "version": "3.8.2",
"description": "苦糖果MES", "description": "智造大师",
"author": "YinJinLu", "author": "YinJinLu",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {

53
src/api/ownerContract.js Normal file
View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 机构合同基本信息新增
export function addOwnerContBase(data) {
return request({
url: `/owner/contract/addOwnerContBase`,
method: 'post',
data
})
}
// 机构合同基本信息修改
export function modifyOwnerContBaseById(data) {
return request({
url: `/updateOrganInfo`,
method: 'post',
data
})
}
// 根据ID查看合同基本信息详情
export function findOwnById(id) {
return request({
url: `/owner/contract/findById/${id}`,
method: 'get'
})
}
// 根据ID查看合同基本信息详情
export function findByOrganId(organId) {
return request({
url: `/owner/contract/findByOrganId/${organId}`,
method: 'get'
})
}
// 获取登录用户机构信息
export function getOrganInfo(params) {
return request({
url: `/getOrganInfo`,
method: 'get',
params
})
}
export function updateLogoImg(params) {
return request({
url: ``,
method: 'get',
params
})
}

Binary file not shown.

7
src/assets/font/font.css Normal file
View File

@ -0,0 +1,7 @@
/* // 这是 font.css 可设置多种字体; */
/* // 注意font-family: 'XXX'; 将字体名字自定义为 XXX,使用时要用这个名字 */
@font-face {
font-family: 'Ayuthaya';
src: url('./Ayuthaya.ttf');
}

BIN
src/assets/images/close.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
src/assets/images/open.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -130,7 +130,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */

View File

@ -1,12 +1,39 @@
<template> <template>
<div class="navbar"> <div class="navbar">
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> <hamburger
id="hamburger-container"
:is-active="sidebar.opened"
class="hamburger-container"
@toggleClick="toggleSideBar"
/>
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/> <breadcrumb
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/> id="breadcrumb-container"
class="breadcrumb-container"
v-if="!topNav"
/>
<!--图片-->
<div
style="
display: inline-block;
width: 66%;
margin-left: 30px;
line-height: 40px;
"
>
<!--<el-image src="/images/logo.png" style="width:100%;height:40px"></el-image>-->
<el-image
v-show="this.companyImg != null || this.companyImg !=''"
:src="this.companyImg"
style="width: 100%; height: 46px"
></el-image>
</div>
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav" />
<div class="right-menu"> <div class="right-menu">
<template v-if="device!=='mobile'"> <template v-if="device !== 'mobile'">
<search id="header-search" class="right-menu-item" /> <search id="header-search" class="right-menu-item" />
<!-- <el-tooltip content="源码地址" effect="dark" placement="bottom"> <!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">
@ -22,12 +49,14 @@
<el-tooltip content="布局大小" effect="dark" placement="bottom"> <el-tooltip content="布局大小" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect" /> <size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip> </el-tooltip>
</template> </template>
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click"> <el-dropdown
class="avatar-container right-menu-item hover-effect"
trigger="click"
>
<div class="avatar-wrapper"> <div class="avatar-wrapper">
<img :src="avatar" class="user-avatar"> <img :src="avatar" class="user-avatar" />
<i class="el-icon-caret-bottom" /> <i class="el-icon-caret-bottom" />
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
@ -47,15 +76,17 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from "vuex";
import Breadcrumb from '@/components/Breadcrumb' import Breadcrumb from "@/components/Breadcrumb";
import TopNav from '@/components/TopNav' import TopNav from "@/components/TopNav";
import Hamburger from '@/components/Hamburger' import Hamburger from "@/components/Hamburger";
import Screenfull from '@/components/Screenfull' import Screenfull from "@/components/Screenfull";
import SizeSelect from '@/components/SizeSelect' import SizeSelect from "@/components/SizeSelect";
import Search from '@/components/HeaderSearch' import Search from "@/components/HeaderSearch";
import RuoYiGit from '@/components/RuoYi/Git' import RuoYiGit from "@/components/RuoYi/Git";
import RuoYiDoc from '@/components/RuoYi/Doc' import RuoYiDoc from "@/components/RuoYi/Doc";
import * as ownerServer from "@/api/ownerContract";
export default { export default {
components: { components: {
@ -66,48 +97,63 @@ export default {
SizeSelect, SizeSelect,
Search, Search,
RuoYiGit, RuoYiGit,
RuoYiDoc RuoYiDoc,
},
created() {
this.getOwnInfo();
},
data() {
return {
companyImg: null,
};
}, },
computed: { computed: {
...mapGetters([ ...mapGetters(["sidebar", "avatar", "device"]),
'sidebar',
'avatar',
'device'
]),
setting: { setting: {
get() { get() {
return this.$store.state.settings.showSettings return this.$store.state.settings.showSettings;
}, },
set(val) { set(val) {
this.$store.dispatch('settings/changeSetting', { this.$store.dispatch("settings/changeSetting", {
key: 'showSettings', key: "showSettings",
value: val value: val,
}) });
} },
}, },
topNav: { topNav: {
get() { get() {
return this.$store.state.settings.topNav return this.$store.state.settings.topNav;
} },
} },
}, },
methods: { methods: {
toggleSideBar() { toggleSideBar() {
this.$store.dispatch('app/toggleSideBar') this.$store.dispatch("app/toggleSideBar");
},
getOwnInfo() {
ownerServer.getOrganInfo().then((res) => {
if (res.code === 200 && res.data) {
this.companyImg = res.data.picture;
console.log(companyImg);
this.isEdit = true;
}
});
}, },
async logout() { async logout() {
this.$confirm('确定注销并退出系统吗?', '提示', { this.$confirm("确定注销并退出系统吗?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning",
}).then(() => { })
this.$store.dispatch('LogOut').then(() => { .then(() => {
location.href = '/index'; this.$store.dispatch("LogOut").then(() => {
location.href = "/index";
});
}) })
}).catch(() => {}); .catch(() => {});
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -116,18 +162,18 @@ export default {
overflow: hidden; overflow: hidden;
position: relative; position: relative;
background: #fff; background: #fff;
box-shadow: 0 1px 4px rgba(0,21,41,.08); box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
.hamburger-container { .hamburger-container {
line-height: 46px; line-height: 46px;
height: 100%; height: 100%;
float: left; float: left;
cursor: pointer; cursor: pointer;
transition: background .3s; transition: background 0.3s;
-webkit-tap-highlight-color:transparent; -webkit-tap-highlight-color: transparent;
&:hover { &:hover {
background: rgba(0, 0, 0, .025) background: rgba(0, 0, 0, 0.025);
} }
} }
@ -164,10 +210,10 @@ export default {
&.hover-effect { &.hover-effect {
cursor: pointer; cursor: pointer;
transition: background .3s; transition: background 0.3s;
&:hover { &:hover {
background: rgba(0, 0, 0, .025) background: rgba(0, 0, 0, 0.025);
} }
} }
} }

View File

@ -40,6 +40,13 @@ import DictData from '@/components/DictData'
import webSite from '@/config/website' import webSite from '@/config/website'
Vue.prototype.website = webSite Vue.prototype.website = webSite
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css' // 默认主题
//全局修改默认配置,点击空白处不能关闭弹窗
ElementUI.Dialog.props.closeOnClickModal.default = false
Vue.use(ElementUI)
// 全局方法挂载 // 全局方法挂载
Vue.prototype.getDicts = getDicts Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey Vue.prototype.getConfigKey = getConfigKey

View File

@ -260,3 +260,8 @@ export default new Router({
scrollBehavior: () => ({ y: 0 }), scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes, routes: constantRoutes,
}); });
export function resetRouter() {
const newRouter = createRouter()
Router.matcher = newRouter.matcher // 重制 router
}

View File

@ -0,0 +1,19 @@
const state = {
companyImg:localStorage.getItem("logo"),
isLogo:false
}
const mutations = {
SET_LOGO(state,img){
state.companyImg = img
},
SET_IS_LOGO(state,isLogo) {
state.isLogo = isLogo;
}
}
export default {
namespaced: true,
state,
mutations,
}

View File

@ -17,7 +17,7 @@ const service = axios.create({
// axios中请求配置有baseURL选项表示请求URL公共部分 // axios中请求配置有baseURL选项表示请求URL公共部分
baseURL: process.env.VUE_APP_BASE_API, baseURL: process.env.VUE_APP_BASE_API,
// 超时 // 超时
timeout: 10000 timeout: 30000
}) })
// request拦截器 // request拦截器

View File

@ -0,0 +1,519 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="" prop="subjectCode">
<el-input
v-model="queryParams.subjectCode"
placeholder="请输入设备编码/名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="异常报警类型" label-width="100px" prop="subjectType">
<el-select
v-model="queryParams.subjectType"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in dict.type.mes_alarm_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="处理状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in statusArr"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col style="width: 90%">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:dvsubject:export']"
>导出</el-button
>
</el-col>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="dvsubjectList"
@selection-change="handleSelectionChange"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
'text-align': 'center',
}"
stripe
style="width: 100%"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="设备编码"
align="center"
prop="machineryCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备名称"
align="center"
prop="machineryName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备类别"
align="center"
prop="machineryTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警类型"
align="center"
prop="warnType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警内容"
align="center"
prop="message"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警时间"
align="center"
prop="warnTime"
:show-overflow-tooltip="true"
/>
<el-table-column label="处理状态" align="center" prop="status">
<template slot-scope="scope">
<span class="el-table-column-span" v-if="scope.row.status == '0'"
>未处理</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '1'"
>已处理未解决</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '2'"
>已处理已完成</span
>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleExportArr(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>查看</el-button
>
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>处理</el-button
>
<el-button
size="mini"
type="text"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:dv:dvsubject:remove']"
>置顶</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
center
width="400px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-row>
<el-col>
<el-form-item prop="abnormal" label="设备是否异常:">
<el-radio-group v-model="form.abnormal">
<el-radio :label="1">异常</el-radio>
<el-radio :label="2">无异常</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item prop="status" label="是否解决:">
<el-radio-group v-model="form.status">
<el-radio :label="1">已解决</el-radio>
<el-radio :label="2">未解决</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 置顶 -->
<el-dialog
title="置顶"
:visible.sync="openTop"
center
width="400px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-row>
<el-col>
<el-form-item prop="top" label="设备是否异常:">
<el-radio-group v-model="form.top">
<el-radio :label="0">不置顶</el-radio>
<el-radio :label="1">置顶</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleForm"> </el-button>
<el-button @click="openopenTop"> </el-button>
</div>
</el-dialog>
<!-- 查看 -->
<el-dialog
:title="title"
:visible.sync="openQuery"
center
width="800px"
append-to-body
>
<el-form ref="form" :model="formQuery" label-width="130px">
<el-row>
<el-col :span="11">
<el-form-item prop="" label="设备编码:">
{{ formQuery.machineryCode }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="设备名称:">
{{ formQuery.machineryName }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="" label="设备类型:">
{{ formQuery.machineryTypeName }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="异常报警类型:">
{{ formQuery.warnType }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="" label="异常报警内容:">
{{ formQuery.message }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="异常报警时间:">
{{ formQuery.warnTime }}
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelQuery"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { list, edit } from "@/api/abnormalityAlarm/machineTool";
import { getToken } from "@/utils/auth";
export default {
// name: "Dvsubject",
dicts: ["sys_yes_no", "mes_alarm_type"],
components: {},
data() {
return {
//
headers: { Authorization: "Bearer " + getToken() },
autoGenFlag: false,
//
loading: false,
// s
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dvsubjectList: [],
//
title: "",
//
open: false,
//
openQuery: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
},
//
form: {
abnormal: 1,
status: "",
top: 0,
},
//
formQuery: {},
//
openTop: false,
statusArr: [
{
label: "未处理",
value: 0,
},
{
label: "已处理未解决",
value: 1,
},
{
label: "已处理已完成",
value: 2,
},
],
//
rules: {
abnormal: [
{ required: true, message: "设备是否异常不能为空", trigger: "blur" },
],
status: [
{ required: true, message: "是否解决不能为空", trigger: "blur" },
],
top: [{ required: true, message: "是否置顶不能为空", trigger: "blur" }],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询设备点检保养项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
console.log(response);
this.dvsubjectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
cancelQuery() {
this.openQuery = false;
this.reset();
},
//
openopenTop() {
this.openTop = false;
this.reset();
},
//
reset() {
this.form = {
abnormal: 1,
status: "",
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
console.log(selection);
this.ids = selection.map((item) => item.codeId);
console.log(this.ids);
this.queryParams.ids = this.ids.join(",");
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 查看 **/
handleExportArr(row) {
console.log(row);
this.formQuery = row;
this.openQuery = true;
this.title = "查看";
},
/** 处理 */
handleUpdate(row) {
console.log(row);
this.reset();
this.open = true;
this.title = "处理";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
edit(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "处理成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
}
});
},
/** 置顶操作 */
handleDelete(row) {
console.log(row);
this.reset();
this.openTop = true;
},
/** 置顶提交按钮 */
handleForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
edit(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "处理成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
}
});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/cad/code/export",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-card .el-card__header {
padding: 10px 20px;
background: #f3f2f2;
}
::v-deep .el-table {
.cell {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
</style>

View File

@ -0,0 +1,366 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="" prop="subjectCode">
<el-input
v-model="queryParams.subjectCode"
placeholder="请输入设备编码/名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="异常报警类型" label-width="100px" prop="subjectType">
<el-select
v-model="queryParams.subjectType"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in dict.type.mes_alarm_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col style="width: 90%">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:dvsubject:export']"
>导出</el-button
>
</el-col>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="dvsubjectList"
@selection-change="handleSelectionChange"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
'text-align': 'center',
}"
stripe
style="width: 100%"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="设备编码"
align="center"
prop="machineryCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备名称"
align="center"
prop="machineryName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备类别"
align="center"
prop="machineryTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警类型"
align="center"
prop="warnType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警内容"
align="center"
prop="message"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警时间"
align="center"
prop="warnTime"
:show-overflow-tooltip="true"
/>
<el-table-column label="处理状态" align="center" prop="status">
<template slot-scope="scope">
<span class="el-table-column-span" v-if="scope.row.status == '0'"
>未处理</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '1'"
>已处理未解决</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '2'"
>已处理已完成</span
>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleExportArr(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>查看</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 查看 -->
<el-dialog
:title="title"
:visible.sync="openQuery"
center
width="800px"
append-to-body
>
<el-form ref="form" :model="formQuery" label-width="130px">
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备编码:">
{{ formQuery.machineryCode }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备名称:">
{{ formQuery.machineryName }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备类型:">
{{ formQuery.machineryTypeName }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警类型:">
{{ formQuery.warnType }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警内容:">
{{ formQuery.message }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警时间:">
{{ formQuery.warnTime }}
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelQuery"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { list, edit } from "@/api/abnormalityAlarm/machineTool";
import { getToken } from "@/utils/auth";
export default {
// name: "Dvsubject",
dicts: ["sys_yes_no", "mes_alarm_type"],
components: {},
data() {
return {
//
headers: { Authorization: "Bearer " + getToken() },
autoGenFlag: false,
//
loading: false,
// s
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dvsubjectList: [],
//
title: "",
//
openQuery: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
},
//
form: {
abnormal: 1,
status: "",
top: 0,
},
//
formQuery: {},
statusArr: [
{
label: "未处理",
value: 0,
},
{
label: "已处理未解决",
value: 1,
},
{
label: "已处理已完成",
value: 2,
},
],
//
rules: {
abnormal: [
{ required: true, message: "设备是否异常不能为空", trigger: "blur" },
],
status: [
{ required: true, message: "是否解决不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询设备点检保养项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
console.log(response);
this.dvsubjectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancelQuery() {
this.openQuery = false;
this.reset();
},
//
reset() {
this.form = {
abnormal: 1,
status: "",
top: 0,
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
console.log(selection);
this.ids = selection.map((item) => item.codeId);
console.log(this.ids);
this.queryParams.ids = this.ids.join(",");
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 查看 **/
handleExportArr(row) {
console.log(row);
this.formQuery = row;
this.openQuery = true;
this.title = "查看";
},
/** 置顶操作 */
handleDelete(row) {
console.log(row);
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/cad/code/export",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-card .el-card__header {
padding: 10px 20px;
background: #f3f2f2;
}
::v-deep .el-table {
.cell {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
</style>

View File

@ -0,0 +1,41 @@
<template>
<div class="app-container">
<!-- 切换 -->
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="异常报警" name="1">
<abnormalAGV />
</el-tab-pane>
<el-tab-pane label="历史异常报警" name="2">
<historicalAGV />
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import abnormalAGV from "./abnormalAGV.vue";
import historicalAGV from "./historicalAGV.vue";
export default {
components: { abnormalAGV, historicalAGV },
data() {
return {
//tab1
activeName: "1",
};
},
methods: {
//tab
handleClick() {
this.activeName = "2";
},
},
};
</script>
<style scoped lang="scss">
.clearfix {
line-height: 40px;
display: flex;
}
</style>

View File

@ -221,6 +221,32 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 置顶 -->
<el-dialog
title="置顶"
:visible.sync="openTop"
center
width="400px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-row>
<el-col>
<el-form-item prop="top" label="设备是否异常:">
<el-radio-group v-model="form.top">
<el-radio :label="0">不置顶</el-radio>
<el-radio :label="1">置顶</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleForm"> </el-button>
<el-button @click="openopenTop"> </el-button>
</div>
</el-dialog>
<!-- 查看 --> <!-- 查看 -->
<el-dialog <el-dialog
:title="title" :title="title"
@ -232,36 +258,36 @@
<el-form ref="form" :model="formQuery" label-width="130px"> <el-form ref="form" :model="formQuery" label-width="130px">
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item prop="abnormal" label="设备编码:"> <el-form-item prop="" label="设备编码:">
{{ formQuery.machineryCode }} {{ formQuery.machineryCode }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="11"> <el-col :span="11">
<el-form-item prop="abnormal" label="设备名称:"> <el-form-item prop="" label="设备名称:">
{{ formQuery.machineryName }} {{ formQuery.machineryName }}
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item prop="abnormal" label="设备类型:"> <el-form-item prop="" label="设备类型:">
{{ formQuery.machineryTypeName }} {{ formQuery.machineryTypeName }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="11"> <el-col :span="11">
<el-form-item prop="abnormal" label="异常报警类型:"> <el-form-item prop="" label="异常报警类型:">
{{ formQuery.warnType }} {{ formQuery.warnType }}
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item prop="abnormal" label="异常报警内容:"> <el-form-item prop="" label="异常报警内容:">
{{ formQuery.message }} {{ formQuery.message }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="11"> <el-col :span="11">
<el-form-item prop="abnormal" label="异常报警时间:"> <el-form-item prop="" label="异常报警时间:">
{{ formQuery.warnTime }} {{ formQuery.warnTime }}
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -299,26 +325,7 @@ export default {
// //
total: 0, total: 0,
// //
dvsubjectList: [ dvsubjectList: [],
{
machineryCode: 1,
abnormal: 1,
status: "",
top: 0,
},
{
machineryCode: 2,
abnormal: 1,
status: "",
top: 0,
},
{
machineryCode: 3,
abnormal: 1,
status: "",
top: 0,
},
],
// //
title: "", title: "",
// //
@ -329,7 +336,6 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
status: 1,
}, },
// //
form: { form: {
@ -339,6 +345,8 @@ export default {
}, },
// //
formQuery: {}, formQuery: {},
//
openTop: false,
statusArr: [ statusArr: [
{ {
@ -362,6 +370,7 @@ export default {
status: [ status: [
{ required: true, message: "是否解决不能为空", trigger: "blur" }, { required: true, message: "是否解决不能为空", trigger: "blur" },
], ],
top: [{ required: true, message: "是否置顶不能为空", trigger: "blur" }],
}, },
}; };
}, },
@ -374,7 +383,7 @@ export default {
this.loading = true; this.loading = true;
list(this.queryParams).then((response) => { list(this.queryParams).then((response) => {
console.log(response); console.log(response);
// this.dvsubjectList = response.rows; this.dvsubjectList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
@ -389,14 +398,19 @@ export default {
this.openQuery = false; this.openQuery = false;
this.reset(); this.reset();
}, },
//
openopenTop() {
this.openTop = false;
this.reset();
},
// //
reset() { reset() {
this.form = { this.form = {
abnormal: 1, abnormal: 1,
status: "", status: "",
top: 0,
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -435,35 +449,56 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
// this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
// if (valid) { if (valid) {
// edit(this.form).then((response) => { edit(this.form).then((response) => {
// if (response.code === 200) { if (response.code === 200) {
// this.$notify({ this.$notify({
// title: "", title: "处理成功",
// message: response.msg, message: response.msg,
// type: "success", type: "success",
// }); });
// this.open = false; this.open = false;
// this.getList(); this.getList();
// } }
// }); });
// } }
// }); });
}, },
/** 置顶操作 */ /** 置顶操作 */
handleDelete(row) { handleDelete(row) {
console.log(row); console.log(row);
this.reset();
this.openTop = true;
},
/** 置顶提交按钮 */
handleForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
edit(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "处理成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
}
});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// this.download( this.download(
// "/cad/code/export", "/cad/code/export",
// { {
// ...this.queryParams, ...this.queryParams,
// }, },
// `calplan_${new Date().getTime()}.xlsx` `calplan_${new Date().getTime()}.xlsx`
// ); );
}, },
}, },
}; };

View File

@ -233,26 +233,7 @@ export default {
// //
total: 0, total: 0,
// //
dvsubjectList: [ dvsubjectList: [],
{
machineryCode: 1,
abnormal: 1,
status: "",
top: 0,
},
{
machineryCode: 2,
abnormal: 1,
status: "",
top: 0,
},
{
machineryCode: 3,
abnormal: 1,
status: "",
top: 0,
},
],
// //
title: "", title: "",
// //
@ -305,7 +286,7 @@ export default {
this.loading = true; this.loading = true;
list(this.queryParams).then((response) => { list(this.queryParams).then((response) => {
console.log(response); console.log(response);
// this.dvsubjectList = response.rows; this.dvsubjectList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
@ -322,7 +303,7 @@ export default {
status: "", status: "",
top: 0, top: 0,
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -358,13 +339,13 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// this.download( this.download(
// "/cad/code/export", "/cad/code/export",
// { {
// ...this.queryParams, ...this.queryParams,
// }, },
// `calplan_${new Date().getTime()}.xlsx` `calplan_${new Date().getTime()}.xlsx`
// ); );
}, },
}, },
}; };

View File

@ -0,0 +1,366 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="" prop="subjectCode">
<el-input
v-model="queryParams.subjectCode"
placeholder="请输入设备编码/名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="异常报警类型" label-width="100px" prop="subjectType">
<el-select
v-model="queryParams.subjectType"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in dict.type.mes_alarm_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col style="width: 90%">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:dvsubject:export']"
>导出</el-button
>
</el-col>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="dvsubjectList"
@selection-change="handleSelectionChange"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
'text-align': 'center',
}"
stripe
style="width: 100%"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="设备编码"
align="center"
prop="machineryCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备名称"
align="center"
prop="machineryName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备类别"
align="center"
prop="machineryTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警类型"
align="center"
prop="warnType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警内容"
align="center"
prop="message"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警时间"
align="center"
prop="warnTime"
:show-overflow-tooltip="true"
/>
<el-table-column label="处理状态" align="center" prop="status">
<template slot-scope="scope">
<span class="el-table-column-span" v-if="scope.row.status == '0'"
>未处理</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '1'"
>已处理未解决</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '2'"
>已处理已完成</span
>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleExportArr(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>查看</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 查看 -->
<el-dialog
:title="title"
:visible.sync="openQuery"
center
width="800px"
append-to-body
>
<el-form ref="form" :model="formQuery" label-width="130px">
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备编码:">
{{ formQuery.machineryCode }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备名称:">
{{ formQuery.machineryName }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备类型:">
{{ formQuery.machineryTypeName }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警类型:">
{{ formQuery.warnType }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警内容:">
{{ formQuery.message }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警时间:">
{{ formQuery.warnTime }}
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelQuery"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { list, edit } from "@/api/abnormalityAlarm/machineTool";
import { getToken } from "@/utils/auth";
export default {
// name: "Dvsubject",
dicts: ["sys_yes_no", "mes_alarm_type"],
components: {},
data() {
return {
//
headers: { Authorization: "Bearer " + getToken() },
autoGenFlag: false,
//
loading: false,
// s
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dvsubjectList: [],
//
title: "",
//
openQuery: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
},
//
form: {
abnormal: 1,
status: "",
top: 0,
},
//
formQuery: {},
statusArr: [
{
label: "未处理",
value: 0,
},
{
label: "已处理未解决",
value: 1,
},
{
label: "已处理已完成",
value: 2,
},
],
//
rules: {
abnormal: [
{ required: true, message: "设备是否异常不能为空", trigger: "blur" },
],
status: [
{ required: true, message: "是否解决不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询设备点检保养项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
console.log(response);
this.dvsubjectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancelQuery() {
this.openQuery = false;
this.reset();
},
//
reset() {
this.form = {
abnormal: 1,
status: "",
top: 0,
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
console.log(selection);
this.ids = selection.map((item) => item.codeId);
console.log(this.ids);
this.queryParams.ids = this.ids.join(",");
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 查看 **/
handleExportArr(row) {
console.log(row);
this.formQuery = row;
this.openQuery = true;
this.title = "查看";
},
/** 置顶操作 */
handleDelete(row) {
console.log(row);
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/cad/code/export",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-card .el-card__header {
padding: 10px 20px;
background: #f3f2f2;
}
::v-deep .el-table {
.cell {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
</style>

View File

@ -0,0 +1,41 @@
<template>
<div class="app-container">
<!-- 切换 -->
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="异常报警" name="1">
<roboticAlarm />
</el-tab-pane>
<el-tab-pane label="历史异常报警" name="2">
<historicalAlarm />
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import roboticAlarm from "./roboticAlarm.vue";
import historicalAlarm from "./historicalAlarm.vue";
export default {
components: { roboticAlarm, historicalAlarm },
data() {
return {
//tab1
activeName: "1",
};
},
methods: {
//tab
handleClick() {
this.activeName = "2";
},
},
};
</script>
<style scoped lang="scss">
.clearfix {
line-height: 40px;
display: flex;
}
</style>

View File

@ -0,0 +1,519 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="" prop="subjectCode">
<el-input
v-model="queryParams.subjectCode"
placeholder="请输入设备编码/名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="异常报警类型" label-width="100px" prop="subjectType">
<el-select
v-model="queryParams.subjectType"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in dict.type.mes_alarm_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="处理状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in statusArr"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col style="width: 90%">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:dvsubject:export']"
>导出</el-button
>
</el-col>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="dvsubjectList"
@selection-change="handleSelectionChange"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
'text-align': 'center',
}"
stripe
style="width: 100%"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="设备编码"
align="center"
prop="machineryCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备名称"
align="center"
prop="machineryName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备类别"
align="center"
prop="machineryTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警类型"
align="center"
prop="warnType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警内容"
align="center"
prop="message"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警时间"
align="center"
prop="warnTime"
:show-overflow-tooltip="true"
/>
<el-table-column label="处理状态" align="center" prop="status">
<template slot-scope="scope">
<span class="el-table-column-span" v-if="scope.row.status == '0'"
>未处理</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '1'"
>已处理未解决</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '2'"
>已处理已完成</span
>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleExportArr(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>查看</el-button
>
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>处理</el-button
>
<el-button
size="mini"
type="text"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:dv:dvsubject:remove']"
>置顶</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
center
width="400px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-row>
<el-col>
<el-form-item prop="abnormal" label="设备是否异常:">
<el-radio-group v-model="form.abnormal">
<el-radio :label="1">异常</el-radio>
<el-radio :label="2">无异常</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item prop="status" label="是否解决:">
<el-radio-group v-model="form.status">
<el-radio :label="1">已解决</el-radio>
<el-radio :label="2">未解决</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 置顶 -->
<el-dialog
title="置顶"
:visible.sync="openTop"
center
width="400px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-row>
<el-col>
<el-form-item prop="top" label="设备是否异常:">
<el-radio-group v-model="form.top">
<el-radio :label="0">不置顶</el-radio>
<el-radio :label="1">置顶</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleForm"> </el-button>
<el-button @click="openopenTop"> </el-button>
</div>
</el-dialog>
<!-- 查看 -->
<el-dialog
:title="title"
:visible.sync="openQuery"
center
width="800px"
append-to-body
>
<el-form ref="form" :model="formQuery" label-width="130px">
<el-row>
<el-col :span="11">
<el-form-item prop="" label="设备编码:">
{{ formQuery.machineryCode }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="设备名称:">
{{ formQuery.machineryName }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="" label="设备类型:">
{{ formQuery.machineryTypeName }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="异常报警类型:">
{{ formQuery.warnType }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="" label="异常报警内容:">
{{ formQuery.message }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="异常报警时间:">
{{ formQuery.warnTime }}
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelQuery"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { list, edit } from "@/api/abnormalityAlarm/machineTool";
import { getToken } from "@/utils/auth";
export default {
// name: "Dvsubject",
dicts: ["sys_yes_no", "mes_alarm_type"],
components: {},
data() {
return {
//
headers: { Authorization: "Bearer " + getToken() },
autoGenFlag: false,
//
loading: false,
// s
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dvsubjectList: [],
//
title: "",
//
open: false,
//
openQuery: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
},
//
form: {
abnormal: 1,
status: "",
top: 0,
},
//
formQuery: {},
//
openTop: false,
statusArr: [
{
label: "未处理",
value: 0,
},
{
label: "已处理未解决",
value: 1,
},
{
label: "已处理已完成",
value: 2,
},
],
//
rules: {
abnormal: [
{ required: true, message: "设备是否异常不能为空", trigger: "blur" },
],
status: [
{ required: true, message: "是否解决不能为空", trigger: "blur" },
],
top: [{ required: true, message: "是否置顶不能为空", trigger: "blur" }],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询设备点检保养项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
console.log(response);
this.dvsubjectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
cancelQuery() {
this.openQuery = false;
this.reset();
},
//
openopenTop() {
this.openTop = false;
this.reset();
},
//
reset() {
this.form = {
abnormal: 1,
status: "",
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
console.log(selection);
this.ids = selection.map((item) => item.codeId);
console.log(this.ids);
this.queryParams.ids = this.ids.join(",");
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 查看 **/
handleExportArr(row) {
console.log(row);
this.formQuery = row;
this.openQuery = true;
this.title = "查看";
},
/** 处理 */
handleUpdate(row) {
console.log(row);
this.reset();
this.open = true;
this.title = "处理";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
edit(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "处理成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
}
});
},
/** 置顶操作 */
handleDelete(row) {
console.log(row);
this.reset();
this.openTop = true;
},
/** 置顶提交按钮 */
handleForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
edit(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "处理成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
}
});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/cad/code/export",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-card .el-card__header {
padding: 10px 20px;
background: #f3f2f2;
}
::v-deep .el-table {
.cell {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
</style>

View File

@ -238,7 +238,7 @@ export default {
// // // //
// nowList: [], // nowList: [],
// //
selectList: this.inputValue, selectList: [],
// isshow=1,2 // isshow=1,2
isshow: 2, isshow: 2,
// //
@ -275,14 +275,14 @@ export default {
this.$nextTick(() => {}); this.$nextTick(() => {});
}, },
mounted() { mounted() {
// this.$nextTick(() => { this.$nextTick(() => {
// this.inputValue.forEach((item) => { this.inputValue.forEach((item) => {
// this.selectList.push(item); this.selectList.push(item);
// }); });
// if (this.show) { // if (this.show) {
// this.isshow = this.show; // this.isshow = this.show;
// } // }
// }); });
}, },
computed: { computed: {
user() { user() {
@ -394,7 +394,6 @@ export default {
} }
} }
} }
this.$emit("getSelectList", this.selectList); this.$emit("getSelectList", this.selectList);
}, },
// //
@ -417,7 +416,6 @@ export default {
this.selectList.splice(this.selectList.indexOf(item), 1); this.selectList.splice(this.selectList.indexOf(item), 1);
}); });
} }
this.submit(); this.submit();
}, },
submit() { submit() {

View File

@ -0,0 +1,721 @@
<template>
<div class="app-container">
<el-row :gutter="20">
<el-col :span="5"
><div class="grid-content bg-purple">
<div class="grid-content three" style="height: 750px">
<!-- 选择设备 -->
<el-container style="padding: 0">
<el-header
class="smallHeader"
style="height: 40px; line-height: 40px"
>选择设备
</el-header>
<el-main class="smallmain tableBox">
<p v-if="intelligent.length == 0" class="nodata">暂无数据</p>
<div class="tagBox" v-else>
<el-button
style="width: 100%"
v-for="item in intelligent"
:key="item"
@click="handleClose(item)"
>{{ item.machineryName }}</el-button
>
</div>
</el-main>
</el-container>
</div>
</div></el-col
>
<el-col :span="18" class="myfont"
><div class="content">
<div style="height: 100px">
<div style="width: 31px; margin-left: 9%">
<el-image
v-if="imgdata"
:src="img"
style="margin-top: 25px"
></el-image>
<el-image v-else :src="imgs" style="margin-top: 25px"></el-image>
</div>
</div>
<div style="height: 440px">
<div style="height: 105px">
<el-row
type="flex"
class="row-bg"
justify="center"
style="height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 22%">
{{ intelligentData.feedSpeed }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 25%">
{{ intelligentData.spindleSpeed }}
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-top: 6px; height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 22%">
{{ intelligentData.rapidOverride }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 25%">
{{ intelligentData.spindle }}
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-top: 7px; height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 22%">
{{ intelligentData.feedRate }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 25%">
{{ intelligentData.handWheel }}
</div></el-col
>
</el-row>
</div>
<div style="height: 158px">
<el-row
type="flex"
class="row-bg"
justify="center"
style="height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 60%">
{{ intelligentData.relativeX }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 65%">
{{ intelligentData.machineX }}
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-top: 10px; height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 60%">
{{ intelligentData.relativeY }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 65%">
{{ intelligentData.machineY }}
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-top: 15px; height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 60%">
{{ intelligentData.relativeZ }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 65%">
{{ intelligentData.machineZ }}
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-top: 12px; height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 60%">
{{ intelligentData.relativeA }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 65%">
{{ intelligentData.machineA }}
</div></el-col
>
</el-row>
</div>
<div>
<el-row
type="flex"
class="row-bg"
justify="center"
style="height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 60%">
{{ intelligentData.absoluteX }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 65%">
{{ intelligentData.residualX }}
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-top: 10px; height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 60%">
{{ intelligentData.absoluteY }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 65%">
{{ intelligentData.residualY }}
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-top: 15px; height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 60%">
{{ intelligentData.absoluteZ }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 65%">
{{ intelligentData.residualZ }}
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-top: 12px; height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 60%">
{{ intelligentData.absoluteA }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 65%">
{{ intelligentData.residualA }}
</div></el-col
>
</el-row>
</div>
</div>
<div style="height: 350px">
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-bottom: 15px; height: 50px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 40%">
<!-- {{1}} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 20%"
>
<!-- {{ 2 }} -->
</div></el-col
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 35%">
<!-- {{ 3 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 8%"
>
<!-- {{ 4 }} -->
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-bottom: 15px; height: 50px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 40%">
<!-- {{ 1 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 20%"
>
<!-- {{ 2 }} -->
</div></el-col
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 35%">
<!-- {{ 3 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 8%"
>
<!-- {{ 4 }} -->
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-bottom: 15px; height: 50px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 40%">
<!-- {{ 1 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 20%"
>
<!-- {{ 2 }} -->
</div></el-col
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 35%">
<!-- {{ 3 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 8%"
>
<!-- {{ 4 }} -->
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-bottom: 15px; height: 50px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 40%">
<!-- {{ 1 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 20%"
>
<!-- {{ 2 }} -->
</div></el-col
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 35%">
<!-- {{ 3 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 8%"
>
<!-- {{ 4 }} -->
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-bottom: 15px; height: 50px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 40%">
<!-- {{ 1 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 20%"
>
<!-- {{ 2 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 35%"
></div
></el-col>
<el-col :span="12"
><div
class="grid-content bg-purple-light"
style="margin-left: 59%"
>
<el-button
type="danger"
style="margin-top: 17%; height: 40px"
@click="off"
></el-button>
<el-button
type="success"
style="margin-top: 17%; height: 40px; margin-left: 18%"
@click="on"
></el-button></div
></el-col>
</el-row>
</div></div
></el-col>
</el-row>
</div>
</template>
<script>
import { listMachinery } from "@/api/mes/dv/machinery";
import { listMachinerytype } from "@/api/mes/dv/machinerytype";
import axios from "axios";
import "@/assets/font/font.css";
export default {
data() {
return {
intelligent: [],
intelligentData: {},
//
loading: true,
id: "",
imgdata: true,
timer: null,
img: require("../../../assets/images/close.png"),
imgs: require("../../../assets/images/open.png"),
machineryTypeOptions: [],
machinerydata: {
pageNum: 1,
pageSize: 10,
machineryTypeId: "",
},
};
},
created() {
this.getList();
},
mounted() {
//
this.timer = setInterval(() => {
if (this.id != "") {
this.setInterval();
}
}, 1500);
// $oncebeforeDestroy
this.$once("hook:beforeDestroy", () => {
clearInterval(this.timer);
});
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// axios
// .get("http://192.168.3.53:8077/manage/device/devices")
// .then((res) => {
// this.intelligent = res.data.data;
// this.loading = false;
// });
listMachinerytype().then((response) => {
var data = "";
response.data.forEach((item) => {
if (item.machineryTypeCode == "M_TYPE_001") {
data = item.machineryTypeId;
}
});
this.machinerydata.machineryTypeId = data;
this.listMachineryitem();
});
},
listMachineryitem() {
listMachinery(this.machinerydata).then((response) => {
response.rows.forEach((item) => {
if (item.ip != null) {
this.intelligent.push(item);
}
});
this.loading = false;
});
},
handleClose(item) {
this.id = item.machineryId;
this.setInterval();
},
setInterval() {
axios
.get("http://192.168.3.53:8077/manage/modbus/data", {
params: {
id: this.id,
},
})
.then((res) => {
this.intelligentData = res.data.data;
});
},
off() {
if (this.id != "") {
axios
.get("http://192.168.3.53:8077/manage/modbus/operate", {
params: {
id: this.id,
type: 2,
},
})
.then((res) => {
this.imgdata = true;
this.$modal.msgSuccess("停止成功");
});
} else {
this.$message({
message: "请选择设备",
type: "warning",
});
}
},
on() {
if (this.id != "") {
axios
.get("http://192.168.3.53:8077/manage/modbus/operate", {
params: {
id: this.id,
type: 1,
},
})
.then((res) => {
this.imgdata = false;
this.$modal.msgSuccess("启动成功");
});
} else {
this.$message({
message: "请选择设备",
type: "warning",
});
}
},
},
};
</script>
<style lang="scss" scoped>
.myfont {
font-family: "Ayuthaya"; // Ayuthaya
}
::-webkit-scrollbar {
width: 0 !important;
}
::-webkit-scrollbar {
width: 0 !important;
height: 0;
}
.el-button + .el-button {
margin-left: 0px !important;
}
.app-containers ::-webkit-scrollbar {
display: none;
}
.image {
width: 300px;
height: 200px;
}
.one,
.three,
.two {
height: 510px;
width: 100%;
overflow: scroll;
border: solid 1px #dadada;
}
.one {
width: 95%;
}
.two {
border: 1px solid transparent;
}
.three {
width: 99%;
box-sizing: border-box;
margin-left: 5%;
}
.title {
line-height: 24px;
font-size: 18px;
color: #302933;
padding-bottom: 5px;
border-bottom: solid 1px #dadada;
margin-bottom: 15px;
margin-top: -23px;
}
.el-main,
.smallmain {
padding: 0;
}
.smallHeader {
background-color: #e0e8f0;
position: relative;
color: #7a8289;
font-weight: 700;
}
.content {
position: relative;
width: 70%;
margin: 0 auto 20px;
background: url("../../../assets/images/machine.png") no-repeat center;
background-size: 100% 100%;
}
.but1 {
position: absolute;
right: 20px;
top: 4px;
}
.open,
.smallmain >>> .el-tree-node:focus > .el-tree-node__content {
background-color: #83bff8 !important;
}
.smallmain >>> .el-tree-node__content:hover {
background-color: #dadada;
}
.smallmain
>>> .el-tree--highlight-current
.el-tree-node.is-current
> .el-tree-node__content {
background-color: #83bff8;
}
.tableBox >>> .el-table {
margin: 0;
}
.radio {
position: relative;
}
.nodata {
width: 100%;
text-align: center;
line-height: 40px;
height: 40px;
}
.tagBox {
width: 100%;
}
.tag {
width: 100%;
height: 38px;
}
.tagItem {
display: inline-block;
width: calc(100% / 3.2);
text-align: center;
margin-top: 5px;
/* 单行文本溢出省略号 */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-tag .el-icon-close {
top: -9px;
}
.wrapBox >>> .el-table__body tr.current-row > td {
background-color: #83bff8 !important;
}
.wrapBox >>> .el-table tbody tr:hover > td {
background-color: #dadada;
}
::v-deep .el-tag {
margin-left: 0px;
}
</style>

View File

@ -0,0 +1,407 @@
<template>
<div class="app-container">
<el-row :gutter="20">
<el-col :span="5"
><div class="grid-content bg-purple">
<div class="grid-content three" style="height: 750px">
<!-- 选择设备 -->
<el-container style="padding: 0">
<el-header
class="smallHeader"
style="height: 40px; line-height: 40px"
>选择设备
</el-header>
<el-main class="smallmain tableBox">
<p v-if="intelligent.length == 0" class="nodata">暂无数据</p>
<div class="tagBox" v-else>
<el-button
style="width: 100%"
v-for="item in intelligent"
:key="item"
@click="handleClose(item)"
>{{ item.machineryName }}</el-button
>
</div>
</el-main>
</el-container>
</div>
</div></el-col
>
<el-col :span="14"
><div class="grid-content bg-purple">
<div>
<el-image :src="img"></el-image>
</div>
<div
style="
border: 1px solid rgb(217 216 216);
height: 60px;
width: 30%;
border-radius: 30px;
margin-left: 32%;
"
></div>
<div
style="
border: 1px solid rgb(217, 216, 216);
height: 100px;
width: 30%;
border-radius: 50px;
margin-left: 32%;
margin-top: 2%;
background: rgba(204, 204, 221, 0.2);
"
>
<div style="margin-top: 9%">
<el-row type="flex" class="row-bg" justify="center">
<el-col :span="4"
><div class="grid-content bg-purple">
<div v-if="elimage">
<el-button @click="elbutton"
><el-image
:src="sd"
style="width: 20px; height: 20px"
></el-image
></el-button>
<p
style="
margin: auto;
margin-left: 25%;
font-size: 14px;
color: #9e9e9e;
"
>
上电
</p>
</div>
<div v-else>
<el-button @click="buttonto">
<el-image
:src="xd"
style="width: 20px; height: 20px"
></el-image>
</el-button>
<p
style="
margin: auto;
margin-left: 25%;
font-size: 14px;
color: #9e9e9e;
"
>
下电
</p>
</div>
</div></el-col
>
<el-col :span="6"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="5"
><div class="grid-content bg-purple">
<div>
<el-button>
<el-image
:src="fw"
style="width: 20px; height: 20px"
></el-image>
</el-button>
<p
style="
margin: auto;
margin-left: 25%;
font-size: 14px;
color: #9e9e9e;
"
>
复位
</p>
</div>
</div>
</el-col>
</el-row>
</div>
</div>
</div></el-col
>
<el-col :span="4"><div class="grid-content bg-purple">2</div></el-col>
</el-row>
</div>
</template>
<script>
import { listMachinery } from "@/api/mes/dv/machinery";
import { listMachinerytype } from "@/api/mes/dv/machinerytype";
import axios from "axios";
export default {
data() {
return {
intelligent: [],
intelligentData: {},
//
loading: true,
id: "",
imgdata: true,
timer: null,
machineryTypeOptions: [],
machinerydata: {
pageNum: 1,
pageSize: 10,
machineryTypeId: "",
},
elimage: true,
img: require("../../../assets/images/robotic.png"),
sd: require("../../../assets/images/shangdian.png"),
xd: require("../../../assets/images/weishangdian.png"),
fw: require("../../../assets/images/fuwei-02.png"),
};
},
created() {
this.getList();
},
mounted() {
//
this.timer = setInterval(() => {
if (this.id != "") {
this.setInterval();
}
}, 1500);
// $oncebeforeDestroy
this.$once("hook:beforeDestroy", () => {
clearInterval(this.timer);
});
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// axios
// .get("http://192.168.3.53:8077/manage/device/devices")
// .then((res) => {
// this.intelligent = res.data.data;
// this.loading = false;
// });
listMachinerytype().then((response) => {
var data = "";
response.data.forEach((item) => {
if (item.machineryTypeCode == "M_TYPE_002") {
data = item.machineryTypeId;
}
});
this.machinerydata.machineryTypeId = data;
this.listMachineryitem();
});
},
listMachineryitem() {
listMachinery(this.machinerydata).then((response) => {
response.rows.forEach((item) => {
if (item.ip != null) {
this.intelligent.push(item);
}
});
console.log(this.intelligent);
this.loading = false;
});
},
handleClose(item) {
this.id = item.machineryId;
this.setInterval();
},
setInterval() {
// axios
// .get("http://192.168.3.53:8077/manage/modbus/data", {
// params: {
// id: this.id,
// },
// })
// .then((res) => {
// console.log(res.data.data);
// this.intelligentData = res.data.data;
// });
},
elbutton() {
this.elimage = false;
},
buttonto() {
this.elimage = true;
},
off() {
// if (this.id != "") {
// axios
// .get("http://192.168.3.53:8077/manage/modbus/operate", {
// params: {
// id: this.id,
// type: 2,
// },
// })
// .then((res) => {
// this.imgdata = true;
// this.$modal.msgSuccess("");
// });
// } else {
// this.$message({
// message: "",
// type: "warning",
// });
// }
},
on() {
// if (this.id != "") {
// axios
// .get("http://192.168.3.53:8077/manage/modbus/operate", {
// params: {
// id: this.id,
// type: 1,
// },
// })
// .then((res) => {
// this.imgdata = false;
// this.$modal.msgSuccess("");
// });
// } else {
// this.$message({
// message: "",
// type: "warning",
// });
// }
},
},
};
</script>
<style lang="scss" scoped>
.app-containers ::-webkit-scrollbar {
display: none;
}
::-webkit-scrollbar {
width: 0 !important;
}
::-webkit-scrollbar {
width: 0 !important;
height: 0;
}
.el-button + .el-button {
margin-left: 0px !important;
}
.image {
width: 300px;
height: 200px;
}
.one,
.three,
.two {
height: 510px;
width: 100%;
overflow: scroll;
border: solid 1px #dadada;
}
.one {
width: 95%;
}
.two {
border: 1px solid transparent;
}
.three {
width: 99%;
box-sizing: border-box;
margin-left: 5%;
}
.title {
line-height: 24px;
font-size: 18px;
color: #302933;
padding-bottom: 5px;
border-bottom: solid 1px #dadada;
margin-bottom: 15px;
margin-top: -23px;
}
.el-main,
.smallmain {
padding: 0;
}
.smallHeader {
background-color: #e0e8f0;
position: relative;
color: #7a8289;
font-weight: 700;
}
.content {
position: relative;
width: 70%;
margin: 0 auto 20px;
background: url("../../../assets/images/machine.png") no-repeat center;
background-size: 100% 100%;
}
.but1 {
position: absolute;
right: 20px;
top: 4px;
}
.open,
.smallmain >>> .el-tree-node:focus > .el-tree-node__content {
background-color: #83bff8 !important;
}
.smallmain >>> .el-tree-node__content:hover {
background-color: #dadada;
}
.smallmain
>>> .el-tree--highlight-current
.el-tree-node.is-current
> .el-tree-node__content {
background-color: #83bff8;
}
.tableBox >>> .el-table {
margin: 0;
}
.radio {
position: relative;
}
.nodata {
width: 100%;
text-align: center;
line-height: 40px;
height: 40px;
}
.tagBox {
width: 100%;
}
.tag {
width: 100%;
height: 38px;
}
.tagItem {
display: inline-block;
width: calc(100% / 3.2);
text-align: center;
margin-top: 5px;
/* 单行文本溢出省略号 */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-tag .el-icon-close {
top: -9px;
}
.wrapBox >>> .el-table__body tr.current-row > td {
background-color: #83bff8 !important;
}
.wrapBox >>> .el-table tbody tr:hover > td {
background-color: #dadada;
}
::v-deep .el-tag {
margin-left: 0px;
}
</style>

View File

@ -411,7 +411,7 @@ export default {
machineryIds: "", machineryIds: "",
machineryTypeName: "", machineryTypeName: "",
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */

View File

@ -461,7 +461,7 @@ export default {
url: null, url: null,
originalName: null, originalName: null,
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */

View File

@ -296,7 +296,7 @@ export default {
active: 0, active: 0,
remark: null, remark: null,
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */

View File

@ -191,7 +191,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -294,6 +294,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加班组"; this.title = "添加班组";
this.optType = "add"; this.optType = "add";
genCode('CAL_TEAM_CODE').then(response =>{
this.form.teamCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -386,7 +386,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */

View File

@ -329,6 +329,40 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="12">
<el-form-item label="ip地址" prop="ip">
<el-input
v-model="form.ip"
maxlength="255"
readonly="readonly"
v-if="optType == 'view'"
/>
<el-input
v-model="form.ip"
placeholder="请输入ip地址"
maxlength="255"
v-else
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="端口号" prop="port">
<el-input
v-model="form.port"
maxlength="255"
readonly="readonly"
v-if="optType == 'view'"
/>
<el-input
v-model="form.port"
placeholder="请输入端口号"
maxlength="255"
v-else
/>
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="规格型号" prop="machinerySpec"> <el-form-item label="规格型号" prop="machinerySpec">
@ -612,6 +646,8 @@ export default {
inputName: "", inputName: "",
queryParamsdata:{},
// //
rules: { rules: {
machineryCode: [ machineryCode: [
@ -690,6 +726,7 @@ export default {
handleNodeClick(data) { handleNodeClick(data) {
console.log(data); console.log(data);
this.queryParams.machineryTypeId = data.machineryTypeId; this.queryParams.machineryTypeId = data.machineryTypeId;
this.queryParamsdata = data;
this.handleQuery(); this.handleQuery();
}, },
// //
@ -719,7 +756,7 @@ export default {
updateTime: null, updateTime: null,
idList: "", idList: "",
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -758,17 +795,19 @@ export default {
this.getWorkshops(); this.getWorkshops();
this.userName = ""; this.userName = "";
this.inputName = ""; this.inputName = "";
if (this.queryParams.machineryTypeId != 0) { if (this.queryParamsdata.machineryTypeId != 0) {
this.form.machineryTypeId = this.queryParams.machineryTypeId; this.form = this.queryParamsdata;
} }
this.optType = "add"; this.optType = "add";
this.open = true; this.open = true;
this.title = "新增设备"; this.title = "新增设备";
genCode("MACHINERY_CODE").then((response) => {
this.form.machineryCode = response;
});
}, },
saveInvolvedUserId() { saveInvolvedUserId() {
this.addInvolvedUserIdVisible = false; this.addInvolvedUserIdVisible = false;
// this.$emit("getSelectList", this.selectList); // this.$emit("getSelectList", this.selectList);
}, },
@ -901,7 +940,6 @@ export default {
// //
getSelectList(value) { getSelectList(value) {
console.log(value);
this.userName = ""; this.userName = "";
this.userName = value.map((item) => item.nickName); this.userName = value.map((item) => item.nickName);
this.UserAdd.userIds = value.map((item) => item.userId); this.UserAdd.userIds = value.map((item) => item.userId);

View File

@ -294,7 +294,7 @@ export default {
components: {Repairline,MachinerySelectSingle}, components: {Repairline,MachinerySelectSingle},
data() { data() {
return { return {
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -427,6 +427,9 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加设备维修单"; this.title = "添加设备维修单";
genCode('REPAIR_CODE').then(response =>{
this.form.repairCode = response;
});
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {

View File

@ -281,7 +281,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */

View File

@ -464,7 +464,7 @@ export default {
maxStock: 0, maxStock: 0,
remark: undefined remark: undefined
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */

View File

@ -353,7 +353,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -485,7 +485,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -510,6 +510,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加客户"; this.title = "添加客户";
this.optType = "add"; this.optType = "add";
genCode('CLIENT_CODE').then(response =>{
this.form.clientCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -531,7 +531,7 @@ export default {
optType: undefined, optType: undefined,
remark: undefined remark: undefined
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -572,6 +572,9 @@ export default {
this.optType = "add"; this.optType = "add";
this.open = true; this.open = true;
this.title = "新增物料/产品"; this.title = "新增物料/产品";
genCode('ITEM_CODE').then(response =>{
this.form.itemCode = response;
});
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {

View File

@ -346,7 +346,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -459,7 +459,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -484,6 +484,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加供应商"; this.title = "添加供应商";
this.optType = "add"; this.optType = "add";
genCode('VENDOR_CODE').then(response =>{
this.form.vendorCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -188,7 +188,7 @@ export default {
dicts: ['sys_yes_no'], dicts: ['sys_yes_no'],
data() { data() {
return { return {
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -271,7 +271,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -296,6 +296,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加车间"; this.title = "添加车间";
this.optType = "add"; this.optType = "add";
genCode('WORKSHOP_CODE').then(response =>{
this.form.workshopCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -301,7 +301,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
warehouseInfo:[], warehouseInfo:[],
warehouseOptions:[], warehouseOptions:[],
@ -454,7 +454,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -497,6 +497,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加工作站"; this.title = "添加工作站";
this.optType = "add"; this.optType = "add";
genCode('WORKSTATION_CODE').then(response =>{
this.form.workstationCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -202,7 +202,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -278,7 +278,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -303,6 +303,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加生产工序"; this.title = "添加生产工序";
this.optType = "add"; this.optType = "add";
genCode('PROCESS_CODE').then(response =>{
this.form.processCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -210,7 +210,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -287,7 +287,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -312,6 +312,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加工艺路线"; this.title = "添加工艺路线";
this.optType = "add"; this.optType = "add";
genCode('ROUTE_CODE').then(response =>{
this.form.routeCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -119,10 +119,10 @@
<el-form-item label="与下一道工序关系" prop="linkType"> <el-form-item label="与下一道工序关系" prop="linkType">
<el-tooltip effect="dark" placement="right"> <el-tooltip effect="dark" placement="right">
<div slot="content"> <div slot="content">
S-to-S当前工序开始生产下一道工序才可开始生产 </br> F-to-S当前工序结束生产下一道工序才可开始生产 </br>
F-to-F当前工序结束生产下一道工序才可结束生产 </br>
S-to-F当前工序开始生产下一道工序才可结束生产 </br> S-to-F当前工序开始生产下一道工序才可结束生产 </br>
F-to-S当前工序结束生产下一道工序才可开始生产 F-to-F当前工序结束生产下一道工序才可结束生产 </br>
S-to-S当前工序开始生产下一道工序才可开始生产 </br>
</div> </div>
<el-select v-model="form.linkType" placeholder="请选择与下一道工序关系"> <el-select v-model="form.linkType" placeholder="请选择与下一道工序关系">
<el-option <el-option
@ -359,6 +359,8 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加工艺组成"; this.title = "添加工艺组成";
var arr = Object.values(this.routeprocessList).pop()
this.form.orderNum = arr.orderNum + 1;
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {

View File

@ -261,7 +261,7 @@
</el-step> </el-step>
</el-steps> </el-steps>
<el-card v-for=" (item,index) in processOptions " :key="index" v-if="activeProcess == index && form.workorderId !=null"> <el-card v-for=" (item,index) in processOptions " :key="index" v-if="activeProcess == index && form.workorderId !=null">
<ProTask :workorderId="form.workorderId" :routeId="item.routeId" :processId="item.processId" :colorCode="item.colorCode" :optType="optType"></ProTask> <ProTask :workorderId="form.workorderId" :routeId="item.routeId" :processId="item.processId" :colorCode="item.colorCode" :optType="optType" :recordId="item.recordId"></ProTask>
</el-card> </el-card>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancel" v-if="optType =='view' || form.status !='PREPARE' ">返回</el-button> <el-button type="primary" @click="cancel" v-if="optType =='view' || form.status !='PREPARE' ">返回</el-button>
@ -293,7 +293,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
activeProcess: 0, activeProcess: 0,
// //
@ -437,7 +437,7 @@ export default {
updateTime: null updateTime: null
}; };
this.activeProcess =0; this.activeProcess =0;
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
// //
@ -491,6 +491,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加生产工单"; this.title = "添加生产工单";
this.optType="add"; this.optType="add";
genCode('WORKORDER_CODE').then(response =>{
this.form.workorderCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -245,7 +245,8 @@ export default {
colorCode: null, colorCode: null,
routeId: null, routeId: null,
processId: null, processId: null,
optType: null optType: null,
recordId:null
}, },
created() { created() {
this.getList(); this.getList();
@ -295,6 +296,7 @@ export default {
reset() { reset() {
this.form = { this.form = {
taskId: null, taskId: null,
recordId: this.recordId,
taskCode: null, taskCode: null,
taskName: null, taskName: null,
workorderId: this.workorderId, workorderId: this.workorderId,

View File

@ -431,7 +431,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -581,7 +581,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -627,6 +627,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加生产工单"; this.title = "添加生产工单";
this.optType="add"; this.optType="add";
genCode('WORKORDER_CODE').then(response =>{
this.form.workorderCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -394,7 +394,7 @@ export default {
dicts: ['mes_ipqc_type','mes_qc_result','mes_order_status'], dicts: ['mes_ipqc_type','mes_qc_result','mes_order_status'],
data() { data() {
return { return {
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -544,7 +544,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -569,6 +569,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加过程检验单"; this.title = "添加过程检验单";
this.optType = "add"; this.optType = "add";
genCode('IPQC_CODE').then(response =>{
this.form.ipqcCode = response;
});
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {

View File

@ -413,7 +413,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
acceptImg: require('@/assets/images/accept.png'), acceptImg: require('@/assets/images/accept.png'),
rejectImg: require('@/assets/images/reject.png'), rejectImg: require('@/assets/images/reject.png'),
@ -563,7 +563,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -588,6 +588,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加来料检验单"; this.title = "添加来料检验单";
this.optType = 'add'; this.optType = 'add';
genCode('QC_IQC_CODE').then(response =>{
this.form.iqcCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -388,7 +388,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -531,7 +531,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -567,6 +567,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加出货检验单"; this.title = "添加出货检验单";
this.optType = "add"; this.optType = "add";
genCode('OQC_CODE').then(response =>{
this.form.oqcCode = response;
});
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {

View File

@ -95,7 +95,7 @@
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,

View File

@ -286,7 +286,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 提交按钮 */ /** 提交按钮 */

View File

@ -196,7 +196,7 @@ export default {
data(){ data(){
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
form: {}, form: {},
@ -277,7 +277,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 提交按钮 */ /** 提交按钮 */

View File

@ -320,7 +320,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 提交按钮 */ /** 提交按钮 */

View File

@ -186,7 +186,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -267,7 +267,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -292,6 +292,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加检测项"; this.title = "添加检测项";
this.optType = "add"; this.optType = "add";
genCode('QC_INDEX_CODE').then(response =>{
this.form.indexCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -225,7 +225,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -305,7 +305,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -330,6 +330,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加检测模板"; this.title = "添加检测模板";
this.optType = "add"; this.optType = "add";
genCode('QC_TEMPLATE_CODE').then(response =>{
this.form.templateCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -313,7 +313,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -415,7 +415,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
onToolTypeChanged(){ onToolTypeChanged(){
@ -460,6 +460,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加工装夹具清单"; this.title = "添加工装夹具清单";
this.optType = "add"; this.optType = "add";
genCode('TOOL_CODE').then(response =>{
this.form.toolCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -223,7 +223,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -302,7 +302,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -327,6 +327,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加工装夹具类型"; this.title = "添加工装夹具类型";
this.optType = "add"; this.optType = "add";
genCode('TOOL_TYPE_CODE').then(response =>{
this.form.toolTypeCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -253,7 +253,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
locationId: undefined, locationId: undefined,
// //
@ -345,7 +345,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -370,6 +370,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加库位"; this.title = "添加库位";
this.optType = "add"; this.optType = "add";
genCode('AREA_CODE').then(response =>{
this.form.areaCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -272,7 +272,7 @@ export default {
components: {Issueline,WorkstationSelect,WorkorderSelect}, components: {Issueline,WorkstationSelect,WorkorderSelect},
data() { data() {
return { return {
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
warehouseInfo:[], warehouseInfo:[],
warehouseOptions:[], warehouseOptions:[],
@ -420,7 +420,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -445,6 +445,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加生产领料单"; this.title = "添加生产领料单";
this.optType = "add"; this.optType = "add";
genCode('ISSUE_CODE').then(response =>{
this.form.issueCode = response;
});
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {

View File

@ -266,7 +266,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
warehouseInfo:[], warehouseInfo:[],
warehouseOptions:[], warehouseOptions:[],
@ -407,7 +407,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -433,6 +433,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加物料入库单"; this.title = "添加物料入库单";
this.optType = "add"; this.optType = "add";
genCode('ITEMRECPT_CODE').then(response =>{
this.form.recptCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -157,7 +157,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
warehouseId: undefined, warehouseId: undefined,
// //
@ -242,7 +242,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -267,6 +267,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加库区设置"; this.title = "添加库区设置";
this.optType = "add"; this.optType = "add";
genCode('LOCATION_CODE').then(response =>{
this.form.locationCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -250,7 +250,7 @@ export default {
components: {Issueline,WorkorderSelect}, components: {Issueline,WorkorderSelect},
data() { data() {
return { return {
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
warehouseInfo:[], warehouseInfo:[],
warehouseOptions:[], warehouseOptions:[],
@ -376,7 +376,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -401,6 +401,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加外协发料单头"; this.title = "添加外协发料单头";
this.optType = "add"; this.optType = "add";
genCode('OUTSOURCE_ISSUE_CODE').then(response =>{
this.form.issueCode = response;
});
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {

View File

@ -258,7 +258,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
warehouseInfo:[], warehouseInfo:[],
warehouseOptions:[], warehouseOptions:[],
@ -347,7 +347,7 @@ export default {
areaId: null, areaCode: null, areaName: null, recptDate: new Date(), areaId: null, areaCode: null, areaName: null, recptDate: new Date(),
status: "PREPARE", remark: null, attr1: null, attr2: null, attr3: null, attr4: null, createBy: null, createTime: null, updateBy: null, updateTime: null status: "PREPARE", remark: null, attr1: null, attr2: null, attr3: null, attr4: null, createBy: null, createTime: null, updateBy: null, updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -372,6 +372,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加外协入库单"; this.title = "添加外协入库单";
this.optType = "add"; this.optType = "add";
genCode('OUTSOURCE_RECPT_CODE').then(response =>{
this.form.recptCode = response;
});
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {

View File

@ -290,7 +290,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -430,7 +430,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -467,6 +467,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加装箱单"; this.title = "添加装箱单";
this.optType="add"; this.optType="add";
genCode('PACKAGE_CODE').then(response =>{
this.form.packageCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -223,7 +223,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
warehouseInfo:[], warehouseInfo:[],
warehouseOptions:[], warehouseOptions:[],
@ -359,7 +359,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -383,6 +383,9 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加产品入库单"; this.title = "添加产品入库单";
genCode('PRODUCTRECPT_CODE').then(response =>{
this.form.recptCode = response;
});
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {

View File

@ -253,7 +253,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
warehouseInfo:[], warehouseInfo:[],
warehouseOptions:[], warehouseOptions:[],
@ -403,7 +403,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -442,6 +442,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加销售出库单"; this.title = "添加销售出库单";
this.optType = "add"; this.optType = "add";
genCode('PRODUCTSALSE_CODE').then(response =>{
this.form.salseCode = response;
});
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {

View File

@ -220,7 +220,7 @@ export default {
}, },
data() { data() {
return { return {
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
warehouseInfo:[], warehouseInfo:[],
warehouseOptions:[], warehouseOptions:[],
@ -349,7 +349,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -374,6 +374,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加生产退料单头"; this.title = "添加生产退料单头";
this.optType = "add"; this.optType = "add";
genCode('RTISSUE_CODE').then(response =>{
this.form.rtCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -276,7 +276,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
warehouseInfo:[], warehouseInfo:[],
warehouseOptions:[], warehouseOptions:[],
@ -434,7 +434,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -471,6 +471,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加产品销售退货单"; this.title = "添加产品销售退货单";
this.optType = "add"; this.optType = "add";
genCode('RTSALSE_CODE').then(response =>{
this.form.rtCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -249,7 +249,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -363,6 +363,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加供应商退货"; this.title = "添加供应商退货";
this.optType = "add"; this.optType = "add";
genCode('WM_RTVENDOR_CODE').then(response =>{
this.form.rtCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -297,7 +297,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -401,7 +401,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -426,6 +426,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加转移单"; this.title = "添加转移单";
this.optType = "add"; this.optType = "add";
genCode('TRANSFER_CODE').then(response =>{
this.form.transferCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -182,7 +182,7 @@ export default {
data() { data() {
return { return {
// //
autoGenFlag:false, autoGenFlag:true,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -262,7 +262,7 @@ export default {
updateBy: null, updateBy: null,
updateTime: null updateTime: null
}; };
this.autoGenFlag = false; this.autoGenFlag = true;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -287,6 +287,9 @@ export default {
this.open = true; this.open = true;
this.title = "添加仓库设置"; this.title = "添加仓库设置";
this.optType = "add"; this.optType = "add";
genCode('WAREHOUSE_CODE').then(response =>{
this.form.warehouseCode = response;
});
}, },
// //
handleView(row){ handleView(row){

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="register"> <div class="register">
<el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form"> <el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form">
<h3 class="title">苦糖果MES</h3> <h3 class="title">智造大师</h3>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号"> <el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" /> <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />

View File

@ -0,0 +1,234 @@
<template>
<div class="app-container">
<el-card header="工厂信息维护" shadow="never" style="min-height:600px">
<div style="width: 98%;margin:0 auto">
<el-form ref="contractForm" :model="contractForm" :rules="contractRules" label-width="110px">
<el-row>
<el-col :span="12">
<el-form-item prop="organName" label="工厂名称:" label-width="165px">
<el-input v-model="contractForm.organName" :disabled="isEdit" maxlength="20" style="width: 350pxpx" placeholder="请录入工厂名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="organJurPerson" label="法定代表人:">
<el-input v-model="contractForm.organJurPerson" style="width: 350pxpx" maxlength="10" placeholder="请录入法人" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="organPhone" label="工厂联系方式:" label-width="165px">
<el-input v-model="contractForm.organPhone" style="width: 350pxpx" maxlength="15" placeholder="请录入工厂联系方式" />
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item prop="userName" label="用户名:" >
<el-input v-model="contractForm.userName" style="width: 350pxpx" maxlength="30" placeholder="请录入用户名" />
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item prop="taxNumber" label="统一社会信用代码:" label-width="165px">
<el-input v-model="contractForm.taxNumber" :disabled="isEdit" style="width: 350pxpx" maxlength="20" placeholder="请录入统一社会信用代码" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="工厂顶图:" label-width="165px">
<el-upload
class="inline-block"
action="/prod-api/common/uploadMinio"
list-type="picture-card"
:headers="headers"
:auto-upload="false"
:on-success="handlerSuccess"
:on-change="changeLogo"
:on-remove="showLogo"
accept="jpeg,jpg,png"
name="file"
ref="upload"
:limit="1"
>
<img
v-show="isShow"
width="100%"
:src="this.contractForm.picture"
/>
<!-- <i slot="default" class="el-icon-plus"></i> -->
</el-upload>
<span style="display:inline-block;position: relative;top: 60px;left:20px"><el-button plain @click="uploadImg" >上传</el-button></span>
<div style="color: red"> 您最多只能上传一张图片,图片尺寸为1000px*40px,并且图片大小不能超过2M</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24" style="text-align:center;">
<el-button type="primary" @click="confirm"> </el-button>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
</div>
</template>
<script>
import * as ownerServer from '@/api/ownerContract'
import { getToken } from "@/utils/auth";
export default {
data() {
return {
headers: {
Authorization: "Bearer " + getToken()
},
isShow:true,
contractForm: {
id: '',
organName: '',
contControlId: 'HT001',
address: '',
postCode: '',
jurPerson: '',
agentPerson: '',
telFax: '',
bankName: '',
bankNo: '',
taxNumber: ''
},
isEdit: false,
contractRules: {
organName: [{ required: true, message: '请录入工厂名称', trigger: 'blur' }],
organJurPerson: [{ required: true, message: '请录入法定代表人', trigger: 'blur' }],
organPhone: [{ required: true, message: '请录入工厂联系方式', trigger: 'blur' }],
userName: [{ required: true, message: '请录入用户名', trigger: 'blur' }],
},
fileFormats:["jpep","png","jpg"],
}
},
created() {
this.getOwnInfo()
},
methods: {
changeLogo(file){
const isLt2M = file.size / 1024 / 1024 < 2;
let suffixFile=file.name.substring(file.name.lastIndexOf("\.")+1);
if (!this.fileFormats.includes(suffixFile)){
this.$refs.upload.clearFiles();
this.$message.error('上传图片格式只能是.jpg,.jpeg,.png');
}else if(!isLt2M){
this.$refs.upload.clearFiles();
this.$message.error('上传头像图片大小不能超过 2MB!');
}else{
let vue=this;
let url = window.URL || window.webkitURL;
let img = new Image();
img.src = url.createObjectURL(file.raw);
img.onload=function () {
if(!(this.width==1000&&this.height==40)){
vue.$refs.upload.clearFiles();
vue.$message.error('图片尺寸必须是1000*40的图片');
}else{
vue.isShow=false;
}
}
}
},
showLogo(){
this.isShow=true;
},
handlerSuccess(companyImg) {
console.log(companyImg);
this.contractForm.picture = companyImg.fileName;
},
uploadImg() {
if (this.$refs.upload.uploadFiles.length>0){
this.$refs.upload.submit()
}else{
this.$message.error('请先选择图片');
}
},
beforeLogoUpload(file) {
// console.log(file);
// const isJPG = file.type === 'image/jpeg';
// const isLt2M = file.size / 1024 / 1024 < 2;
//
// if (!isJPG) {
// this.$message.error(' JPG !');
// }
// if (!isLt2M) {
// this.$message.error(' 2MB!');
// }
// return isJPG && isLt2M;
},
getOwnInfo() {
ownerServer.getOrganInfo().then(res => {
if (res.code === 200 && res.data) {
this.contractForm = res.data;
this.$store.commit("companyImg/SET_LOGO",this.$store.getters.sysBaseUrl + '/reportImg/' + this.contractForm.picture);
this.$store.commit("companyImg/SET_IS_LOGO",true);
this.isEdit = true;
}
})
},
confirm() {
this.$refs.contractForm.validate(valid => {
if (valid) {
this.contractForm.contControlId = 'HT001'
if (!this.isEdit) {
ownerServer.modifyOwnerContBaseById(this.contractForm).then(result => {
if (result.code === 200) {
this.$notify({
title: '成功',
message: result.message,
type: 'success'
})
this.getOwnInfo()
} else {
this.$notify({
title: '失败',
message: result.message,
type: 'error'
})
}
})
} else {
ownerServer.modifyOwnerContBaseById(this.contractForm).then(result => {
console.log(this.contractForm);
if (result.code === 200) {
this.$notify({
title: '成功',
message: result.msg,
type: 'success'
})
} else {
this.$notify({
title: '失败',
message: result.msg,
type: 'error'
})
}
})
}
} else {
this.$message.error('请录入完整信息')
}
})
}
}
}
</script>
<style scoped>
::v-deep .el-card .el-card__header {
padding: 15px 20px;
background: #F3F2F2;
}
.inline-block {
display: inline-block;
/*border: 1px solid black;*/
}
/*::v-deep .el-upload{*/
/*width: 500px;*/
/*}*/
</style>