Browse Source

2024-05-23设备信息采集

master
zelian_wu 2 years ago
parent
commit
fbb7ca2e2b
  1. 20
      src/api/cdc/collect.js
  2. 9
      src/api/cdc/device.js
  3. 2
      src/main.js
  4. 6
      src/utils/system.js
  5. 725
      src/views/modules/cdc/collect.vue
  6. 303
      src/views/modules/cdc/collect/collectError.vue
  7. 334
      src/views/modules/cdc/collectHistory.vue
  8. 250
      src/views/modules/cdc/collectRecord.vue
  9. 425
      src/views/modules/cdc/device.vue
  10. 299
      src/views/modules/quotation/sellForQuotation/customerContact.vue
  11. 168
      src/views/modules/quotation/sellForQuotation/customerInfo.vue

20
src/api/cdc/collect.js

@ -0,0 +1,20 @@
import {createAPI} from "../../utils/httpRequest";
export const selectCollectList = (data)=>createAPI(`/collect/info/list`,'post',data)
export const saveCollect = (data)=>createAPI(`/collect/info/save`,'post',data)
export const removeCollect = (data)=>createAPI(`/collect/info/remove`,'post',data)
export const editCollect = (data)=>createAPI(`/collect/info/edit`,'post',data)
export const selectCollectListDetail = (data)=>createAPI(`/collect/detail/list`,'post',data)
export const saveCollectDetail = (data)=>createAPI(`/collect/detail/save`,'post',data)
export const removeCollectDetail = (data)=>createAPI(`/collect/detail/remove`,'post',data)
export const editCollectDetail = (data)=>createAPI(`/collect/detail/edit`,'post',data)
export const selectCollectRecordList = (data)=>createAPI(`/collect/record/list`,'post',data)
export const selectCollectHistoryList = (data)=>createAPI(`/collect/history/list`,'post',data)
export const selectCollectHistoryDetailList = (data)=>createAPI(`/collect/history/detail/list`,'post',data)

9
src/api/cdc/device.js

@ -0,0 +1,9 @@
import {createAPI} from "../../utils/httpRequest";
export const selectDeviceList = (data)=>createAPI(`/device/info/list`,'post',data)
export const saveDevice = (data)=>createAPI(`/device/info/save`,'post',data)
export const removeDevice = (data)=>createAPI(`/device/info/remove`,'post',data)
export const editDevice = (data)=>createAPI(`/device/info/edit`,'post',data)

2
src/main.js

@ -21,6 +21,7 @@ import getLodop from '@/utils/LodopFuncs.js'
import pdf from 'vue-pdf'
import { debounce,throttle} from '@/utils/common.js'
import selectDiv from '@/views/common/selectDiv.vue'
import {resetForm} from "./utils/system";
Vue.component('downloadExcel', JsonExcel)
Vue.component('pdf', pdf)
@ -34,6 +35,7 @@ if (process.env.NODE_ENV !== 'production') {
}
// 挂载全局
Vue.prototype.resetForm = resetForm
Vue.prototype.$http = httpRequest // ajax请求方法
Vue.prototype.isAuth = isAuth // 权限方法
Vue.prototype.accessField = accessField // 权限方法

6
src/utils/system.js

@ -0,0 +1,6 @@
// 表单重置
export function resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
}

725
src/views/modules/cdc/collect.vue

@ -0,0 +1,725 @@
<script>
import {
selectCollectList,
editCollect,
removeCollect,
saveCollect,
selectCollectListDetail
} from "../../../api/cdc/collect";
import dayjs from "dayjs";
import CollectError from "./collect/collectError.vue";
const tableId = "2000002"
const tableName = "采集数据定义"
const table1 = "2000002Table1"
const table2 = "2000002Table2"
const table3 = "2000002Table3"
export default {
name: "collect",
components: {CollectError},
props:{
height:{
type:Number,
default:700
},
component:{
type:Boolean,
default: false
}
},
data(){
return{
//
errorVisible: false,
//
loading: true,
//
infoList: [],
//
title: tableName,
//
open: false,
//
queryParams: {
collectId: '',
collectDesc: null,
active: "",
},
//
form: {},
//
rules: {
collectDesc: [
{ required: true, message: "数据标识描述不能为空", trigger: "blur" }
],
collectId: [
{ required: true, message: "数据标识ID不能为空", trigger: "blur" }
],
maxValue: [
{ required: true, message: "上限值不能为空", trigger: "blur" }
],
minValue: [
{ required: true, message: "下限值不能为空", trigger: "blur" }
],
},
deviceColumns:[
{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}CollectId`,
tableId: table1,
tableName: tableName,
columnProp: 'collectId',
headerAlign: 'center',
align: 'left',
columnLabel: '数据标识ID',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}CollectDesc`,
tableId: table1,
tableName: tableName,
columnProp: 'collectDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '数据标识描述',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}MaxValue`,
tableId: table1,
tableName: tableName,
columnProp: 'maxValue',
headerAlign: 'center',
align: 'right',
columnLabel: '上限值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}MinValue`,
tableId: table1,
tableName: tableName,
columnProp: 'minValue',
headerAlign: 'center',
align: 'right',
columnLabel: '下限值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}PhoneInfoFlag`,
tableId: table1,
tableName: tableName,
columnProp: 'phoneInfoFlag',
headerAlign: 'center',
align: 'center',
columnLabel: '短信预警',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}MailInfoFlag`,
tableId: table1,
tableName: tableName,
columnProp: 'mailInfoFlag',
headerAlign: 'center',
align: 'center',
columnLabel: '邮箱预警',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}Remark`,
tableId: table1,
tableName: tableName,
columnProp: 'remark',
headerAlign: 'center',
align: 'left',
columnLabel: '备注',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}Active`,
tableId: table1,
tableName: tableName,
columnProp: 'active',
headerAlign: 'center',
align: 'left',
columnLabel: '在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
],
// header
header:{},
detailList:[],
mailColumns:[
{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table2}Username`,
tableId: table2,
tableName: tableName,
columnProp: 'username',
headerAlign: 'center',
align: 'left',
columnLabel: '人员',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table2}itemValue`,
tableId: table2,
tableName: tableName,
columnProp: 'itemValue',
headerAlign: 'center',
align: 'left',
columnLabel: '邮箱',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table2}Active`,
tableId: table2,
tableName: tableName,
columnProp: 'active',
headerAlign: 'center',
align: 'left',
columnLabel: '在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table2}CreateBy`,
tableId: table2,
tableName: tableName,
columnProp: 'createBy',
headerAlign: 'center',
align: 'left',
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table2}CreateTime`,
tableId: table2,
tableName: tableName,
columnProp: 'createTime',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table2}UpdateBy`,
tableId: table2,
tableName: tableName,
columnProp: 'updateBy',
headerAlign: 'center',
align: 'left',
columnLabel: '修改人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table2}UpdateTime`,
tableId: table2,
tableName: tableName,
columnProp: 'updateTime',
headerAlign: 'center',
align: 'center',
columnLabel: '修改时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
],
phoneColumns:[
{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table3}Username`,
tableId: table3,
tableName: tableName,
columnProp: 'username',
headerAlign: 'center',
align: 'left',
columnLabel: '人员',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table3}itemValue`,
tableId: table3,
tableName: tableName,
columnProp: 'itemValue',
headerAlign: 'center',
align: 'left',
columnLabel: '手机号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table3}Active`,
tableId: table3,
tableName: tableName,
columnProp: 'active',
headerAlign: 'center',
align: 'left',
columnLabel: '在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table3}CreateBy`,
tableId: table3,
tableName: tableName,
columnProp: 'createBy',
headerAlign: 'center',
align: 'left',
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table3}CreateTime`,
tableId: table3,
tableName: tableName,
columnProp: 'createTime',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table3}UpdateBy`,
tableId: table3,
tableName: tableName,
columnProp: 'updateBy',
headerAlign: 'center',
align: 'left',
columnLabel: '修改人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table3}UpdateTime`,
tableId: table3,
tableName: tableName,
columnProp: 'updateTime',
headerAlign: 'center',
align: 'center',
columnLabel: '修改时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
],
}
},
methods:{
/** 查询设备信息列表 */
getList() {
let params = {
...this.queryParams,
site:this.$store.state.user.site
}
this.loading = true;
selectCollectList(params).then(({data}) => {
if (data && data.code === 0){
this.infoList = data.rows;
}
this.loading = false;
}).catch(() => {
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
collectId: '',
site: null,
collectDesc: null,
minValue: null,
maxValue: null,
phoneInfoFlag: 'N',
mailInfoFlag: 'N',
remark: null,
active: 'Y',
createBy: null,
createTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.form = {...row}
this.form.newCollectId = this.form.collectId;
this.open = true;
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid,obj) => {
if (valid) {
if (!this.form.newCollectId) {
this.form.site = this.$store.state.user.site;
this.form.createBy = this.$store.state.user.name;
this.form.createTime = dayjs().format("YYYY-MM-DD HH:mm:ss");
saveCollect(this.form).then(({data}) => {
this.form.site = null;
if (data && data.code === 0){
this.$message.success(data.msg);
this.open = false;
this.getList();
}else {
this.$message.warning(data.msg);
}
}).catch((error)=>{
this.$message.error(error);
});
} else {
editCollect(this.form).then(({data}) => {
if (data && data.code === 0){
this.$message.success(data.msg);
this.open = false;
this.getList();
}else {
this.$message.warning(data.msg);
}
}).catch((error)=>{
this.$message.error(error);
});
}
}else {
Object.keys(obj).forEach((key)=>{
this.$message.warning(obj[key][0].message);
return
})
}
});
},
handleDelete(row) {
this.$confirm('此操作将永久删除该数据标识, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
removeCollect(row).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
this.getList();
}else {
this.$message.success(data.msg);
}
}).catch((error)=>{
this.$message.error(error);
})
}).catch(() => {
});
},
handleError(row){
this.header = {...row}
this.getDetailList();
this.errorVisible = true;
},
getDetailList(){
this.detailList = [];
selectCollectListDetail(this.header).then(({data})=>{
if (data && data.code === 0){
this.detailList = data.rows;
}
})
}
},
computed:{
mailList:{
get(){
return this.detailList.filter(item => item.type === 'mail')
}
},
phoneList: {
get() {
return this.detailList.filter(item => item.type === 'phone')
}
}
},
watch:{
"queryParams.collectId"(newVal, oldVal){
this.queryParams.collectId = newVal.toUpperCase();
},
"form.collectId"(newVal, oldVal){
this.form.collectId = newVal.toUpperCase();
},
},
created() {
this.getList();
}
}
</script>
<template>
<div class="app-container">
<el-form :model="queryParams" label-position="top" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="数据标识ID" prop="collectId">
<el-input
v-model="queryParams.collectId"
placeholder=" "
clearable
/>
</el-form-item>
<el-form-item label="数据标识描述" prop="collectDesc">
<el-input
v-model="queryParams.collectDesc"
placeholder=" "
clearable
/>
</el-form-item>
<el-form-item label="在用" prop="active">
<el-select v-model="queryParams.active" placeholder="请选择在用" >
<el-option label="全部" value=""/>
<el-option label="在用" value="Y"/>
<el-option label="停用" value="N"/>
</el-select>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="handleQuery" plain>查询</el-button>
<el-button type="primary" @click="handleAdd" v-if="!component">新增</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" border :data="infoList" :height="height">
<el-table-column label="操作" align="center" v-if="!component">
<template slot-scope="scope">
<el-link @click="handleUpdate(scope.row)">编辑</el-link>
<el-link @click="handleDelete(scope.row)">删除</el-link>
<el-link @click="handleError(scope.row)">异常预警</el-link>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in deviceColumns" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed === ''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改设备信息对话框 -->
<el-dialog :title="title" v-if="!component" v-drag :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" label-position="top" :model="form" :rules="rules" label-width="80px">
<el-row :gutter="10">
<el-col :span="6">
<el-form-item label="数据标识ID" prop="collectId" :show-message="false">
<el-input v-model="form.collectId" :disabled="form.newCollectId" placeholder=" " />
</el-form-item>
</el-col>
<el-col :span="14">
<el-form-item label="数据标识描述" prop="collectDesc" :show-message="false">
<el-input v-model="form.collectDesc" placeholder=" " />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label=" " prop="phoneInfoFlag" :show-message="false">
<el-checkbox v-model="form.phoneInfoFlag" true-label="Y" false-label="N">短信预警</el-checkbox>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="上限值" prop="maxValue" :show-message="false">
<el-input-number :controls="false" :step="0" v-model="form.maxValue" placeholder=" " />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="下限值" prop="minValue" :show-message="false">
<el-input-number :controls="false" :step="0" v-model="form.minValue" placeholder=" " />
</el-form-item>
</el-col>
<el-col :span="6" :offset="2">
<el-form-item label=" " prop="active" :show-message="false">
<el-checkbox v-model="form.active" true-label="Y" false-label="N">在用</el-checkbox>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label=" " prop="mailInfoFlag" :show-message="false">
<el-checkbox v-model="form.mailInfoFlag" true-label="Y" false-label="N">邮箱预警</el-checkbox>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark" :show-message="false">
<el-input v-model="form.remark"></el-input>
</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>
<collect-error v-if="errorVisible"
:visible.sync="errorVisible"
:collect="header"
:mail-data-list="mailList" :mail-columns="mailColumns"
:phone-data-list="phoneList" :phone-columns="phoneColumns"
@refresh="getDetailList"></collect-error>
</div>
</template>
<style scoped>
</style>

303
src/views/modules/cdc/collect/collectError.vue

@ -0,0 +1,303 @@
<script>
import {
selectCollectListDetail,
editCollectDetail,
removeCollectDetail,
saveCollectDetail,
removeCollect
} from "../../../../api/cdc/collect";
export default {
name: "collectError",
props:{
collect:{
type: Object,
default: () => {},
},
phoneColumns:{
type:Array,
default: () => [],
},
phoneDataList:{
type:Array,
default: () => [],
},
mailColumns:{
type:Array,
default: () => [],
},
mailDataList:{
type:Array,
default: () => [],
},
visible:{
type:Boolean,
default: false,
},
height:{
type:Number,
default: 400,
}
},
data(){
return{
active:'mail',
title:'',
//
form: {},
//
open: false,
//
rules: {
username: [
{ required: true, message: "人员不能为空", trigger: "blur" }
],
itemValue: [
{ required: true, message: "不能为空", trigger: "blur" }
],
},
}
},
methods:{
handleBeforeClose(done){
this.$emit("update:visible",false);
done();
},
handleAdd(type){
if(type === 'phone') {
this.title = '短信';
}else {
this.title = '邮件';
}
this.reset();
this.form.type = type;
this.open = true;
},
//
reset() {
this.form = {
type: null,
collectId: this.collect.collectId,
site:this.collect.site,
username: null,
active: 'Y',
itemNo: null,
itemValue: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
}
this.resetForm("form");
},
//
cancel() {
this.open = false;
this.reset();
},
submitForm(){
this.$refs.form.validate((valid,obj)=>{
if (valid){
if (!this.form.itemNo){
this.form.createBy = this.$store.state.user.name;
saveCollectDetail(this.form).then(({data})=>{
if (data && data.code === 0){
this.$emit("refresh")
this.open = false;
this.$message.success(data.msg)
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
}else {
this.form.updateBy = this.$store.state.user.name;
editCollectDetail(this.form).then(({data})=>{
if (data && data.code === 0){
this.$emit("refresh")
this.open = false;
this.$message.success(data.msg)
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
}
}else {
Object.keys(obj).forEach(key => {
let msg = obj[key][0].message;
if (key === 'itemValue'){
msg = (this.title==='短信'?'手机号':'邮箱') + msg
}
this.$message.warning(msg)
return
});
}
})
},
handleUpdate(row){
this.reset();
this.form = {...row}
this.open = true;
},
handleDelete(row) {
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
removeCollectDetail(row).then(({data})=>{
if (data && data.code === 0){
this.$emit("refresh")
this.$message.success(data.msg);
}else {
this.$message.success(data.msg);
}
}).catch((error)=>{
this.$message.error(error);
})
}).catch(() => {
});
},
handleRefresh(){
this.$emit("refresh")
}
},
created() {
this.active = this.collect.mailInfoFlag === 'Y'?'mail' : 'phone';
}
}
</script>
<template>
<div>
<el-dialog title="预警配置" :visible.sync="visible" append-to-body :before-close="handleBeforeClose" width="1100px" v-drag>
<el-form label-position="top">
<el-row :gutter="10">
<el-col :span="4">
<el-form-item label="数据标识ID">
<el-input disabled v-model="collect.collectId" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="数据标识描述">
<el-input disabled v-model="collect.collectDesc" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="上限值">
<el-input-number disabled :controls="false" v-model="collect.maxValue" readonly></el-input-number>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="下限值">
<el-input-number disabled :controls="false" v-model="collect.minValue" readonly></el-input-number>
</el-form-item>
</el-col>
<el-col :span="2">
<el-form-item label=" " prop="phoneInfoFlag" :show-message="false">
<el-checkbox disabled v-model="collect.phoneInfoFlag" true-label="Y" false-label="N">短信预警</el-checkbox>
</el-form-item>
</el-col>
<el-col :span="2">
<el-form-item label=" " prop="mailInfoFlag" :show-message="false">
<el-checkbox disabled v-model="collect.mailInfoFlag" true-label="Y" false-label="N">邮箱预警</el-checkbox>
</el-form-item>
</el-col>
<el-col :span="2" >
<el-form-item label=" " :show-message="false">
<el-button type="primary" @click="handleRefresh">刷新</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-tabs v-model="active" v-if="collect.mailInfoFlag === 'Y' || collect.phoneInfoFlag === 'Y'">
<el-tab-pane label="邮件" name="mail" v-if="collect.mailInfoFlag === 'Y'">
<el-button size="small" @click="handleAdd('mail')">添加</el-button>
<el-table :data="mailDataList" border style="margin-top: 5px" :height="height">
<el-table-column label="操作" align="center" v-if="!component">
<template slot-scope="scope">
<el-link @click="handleUpdate(scope.row)">编辑</el-link>
<el-link @click="handleDelete(scope.row)">删除</el-link>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in mailColumns" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed === ''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="短信" name="phone" v-if="collect.phoneInfoFlag === 'Y'">
<el-button size="small" @click="handleAdd('phone')">添加</el-button>
<el-table :data="phoneDataList" border style="margin-top: 5px" :height="height">
<el-table-column label="操作" align="center" v-if="!component">
<template slot-scope="scope">
<el-link @click="handleUpdate(scope.row)">编辑</el-link>
<el-link @click="handleDelete(scope.row)">删除</el-link>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in phoneColumns" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed === ''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</el-dialog>
<el-dialog :title="`${title}-异常预警`" v-drag append-to-body :visible.sync="open" width="500px" top="25vh">
<el-form :model="form" ref="form" :rules="rules" label-position="top">
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="人员" prop="username" :show-message="false">
<el-input v-model="form.username" placeholder=" "></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="16" >
<el-form-item :label="title==='短信'?'手机号':'邮箱'" prop="itemValue" :show-message="false">
<el-input v-model="form.itemValue" placeholder=" "></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label=" " prop="active" :show-message="false">
<el-checkbox v-model="form.active" true-label="Y" false-label="N">在用</el-checkbox>
</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>
</div>
</template>
<style scoped>
</style>

334
src/views/modules/cdc/collectHistory.vue

@ -0,0 +1,334 @@
<script>
import {selectCollectHistoryDetailList, selectCollectHistoryList} from "../../../api/cdc/collect";
const tableId = "2000004"
const table1 = tableId + "Table1"
const tableName = "数据预警历史"
export default {
name: "collectRecord",
props:{
height:{
type:Number,
default:700
},
component:{
type:Boolean,
default:false
}
},
data(){
return{
//
loading: true,
//
infoList: [],
//
title: tableName,
//
open: false,
//
queryParams: {
deviceNo: '',
deviceDesc: null,
deviceType: "",
collectType: "",
startDate: "",
endDate: "",
},
form:{
},
collectHistoryColumns:[
{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}CollectType`,
tableId: table1,
tableName: tableName,
columnProp: 'collectType',
headerAlign: 'center',
align: 'center',
columnLabel: '预警类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}CreateTime`,
tableId: table1,
tableName: tableName,
columnProp: 'createTime',
headerAlign: 'center',
align: 'center',
columnLabel: '预警时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}DeviceNo`,
tableId: table1,
tableName: tableName,
columnProp: 'deviceNo',
headerAlign: 'center',
align: 'left',
columnLabel: '设备号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}DeviceDesc`,
tableId: table1,
tableName: tableName,
columnProp: 'deviceDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '设备描述',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}CollectId`,
tableId: table1,
tableName: tableName,
columnProp: 'collectId',
headerAlign: 'center',
align: 'left',
columnLabel: '数据标识ID',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}CollectDesc`,
tableId: table1,
tableName: tableName,
columnProp: 'collectDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '数据标识描述',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}ItemValue`,
tableId: table1,
tableName: tableName,
columnProp: 'itemValue',
headerAlign: 'center',
align: 'right',
columnLabel: '数据实测值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
],
detailList:[],
}
},
methods:{
handleQuery(){
let params = {
...this.queryParams,
site:this.$store.state.user.site,
}
this.loading = true
this.infoList = []
selectCollectHistoryList(params).then(({data})=>{
if (data && data.code === 0){
this.infoList = data.rows
}else {
this.$message.warning(data.msg)
}
this.loading = false
}).catch(error=>{
this.loading = false
this.$message.error(error)
})
},
handleDetail(row){
this.form = {...row}
let params = {
...row,
collectHistoryId: row.itemNo,
}
this.detailList = [];
selectCollectHistoryDetailList(params).then(({data})=>{
if (data && data.code === 0){
this.open = true
this.detailList = data.rows
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
},
},
watch:{
"queryParams.deviceNo"(newVal, oldVal){
this.queryParams.deviceNo = newVal.toUpperCase()
}
},
created() {
this.handleQuery();
}
}
</script>
<template>
<div class="app-container">
<el-form :model="queryParams" label-position="top" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" >
<el-option label="全部" value=""/>
<el-option label="涂布机器" value="涂布机器"/>
<el-option label="配胶间设备" value="配胶间设备"/>
</el-select>
</el-form-item>
<el-form-item label="设备号" prop="deviceNo">
<el-input
v-model="queryParams.deviceNo"
placeholder=" "
clearable
/>
</el-form-item>
<el-form-item label="设备描述" prop="deviceDesc">
<el-input
v-model="queryParams.deviceDesc"
style="width: 200px"
placeholder=" "
clearable
/>
</el-form-item>
<el-form-item label="采集日期" prop="startDate">
<el-date-picker
type="date"
style="width: 100%"
value-format="yyyy-MM-dd"
v-model="queryParams.startDate"
placeholder=" "
/>
</el-form-item>
<el-form-item label=" ">
<i class="el-icon-right"></i>
</el-form-item>
<el-form-item label=" " prop="endDate">
<el-date-picker
type="date"
style="width: 100%"
v-model="queryParams.endDate"
value-format="yyyy-MM-dd"
placeholder=" "
/>
</el-form-item>
<el-form-item label="预警类型" prop="endDate">
<el-select v-model="queryParams.collectType" placeholder=" ">
<el-option label="全部" value=""/>
<el-option label="手机短信" value="手机短信"/>
<el-option label="邮箱" value="邮箱"/>
</el-select>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="handleQuery" plain>查询</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" border :data="infoList" :height="height">
<el-table-column
v-for="(item,index) in collectHistoryColumns" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed === ''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column label="操作" width="100" align="center">
<template slot-scope="scope">
<el-link @click="handleDetail(scope.row)">人员</el-link>
</template>
</el-table-column>
</el-table>
<el-dialog :title="title+'-人员'" v-drag :visible.sync="open" width="600px">
<el-form :model="form" label-position="top" ref="form">
<el-row :gutter="10">
<el-col :span="5">
<el-form-item label="数据标识ID">
<el-input v-model="form.collectId" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="数据标识描述">
<el-input v-model="form.collectDesc" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="上限值">
<el-input-number :controls="false" v-model="form.maxValue" disabled></el-input-number>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="下限值">
<el-input-number :controls="false" v-model="form.minValue" disabled></el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table :data="detailList" border :height="300">
<el-table-column label="人员" min-width="100" header-align="center" align="left" prop="username"></el-table-column>
<el-table-column label="邮件/手机号" min-width="200" header-align="center" align="left" prop="itemValue"></el-table-column>
<el-table-column label="类型" min-width="100" header-align="center" align="left" prop="collectType"></el-table-column>
</el-table>
</el-dialog>
</div>
</template>
<style scoped>
</style>

250
src/views/modules/cdc/collectRecord.vue

@ -0,0 +1,250 @@
<script>
import {selectCollectRecordList} from "../../../api/cdc/collect";
const tableId = "2000003"
const table1 = tableId + "Table1"
const tableName = "数据采集历史"
export default {
name: "collectRecord",
props:{
height:{
type:Number,
default:700
},
component:{
type:Boolean,
default:false
}
},
data(){
return{
//
loading: true,
//
infoList: [],
//
title: "数据采集历史",
//
open: false,
//
queryParams: {
deviceNo: '',
deviceDesc: null,
deviceType: "",
startDate: "",
endDate: "",
},
collectRecordColumns:[
{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}CreateTime`,
tableId: table1,
tableName: tableName,
columnProp: 'createTime',
headerAlign: 'center',
align: 'center',
columnLabel: '录入时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}DeviceNo`,
tableId: table1,
tableName: tableName,
columnProp: 'deviceNo',
headerAlign: 'center',
align: 'left',
columnLabel: '设备号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}DeviceDesc`,
tableId: table1,
tableName: tableName,
columnProp: 'deviceDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '设备描述',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}CollectId`,
tableId: table1,
tableName: tableName,
columnProp: 'collectId',
headerAlign: 'center',
align: 'left',
columnLabel: '数据标识ID',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}CollectDesc`,
tableId: table1,
tableName: tableName,
columnProp: 'collectDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '数据标识描述',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}ItemValue`,
tableId: table1,
tableName: tableName,
columnProp: 'itemValue',
headerAlign: 'center',
align: 'right',
columnLabel: '数据实测值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
],
}
},
methods:{
handleQuery(){
let params = {
...this.queryParams,
site:this.$store.state.user.site,
}
this.loading = true
this.infoList = []
selectCollectRecordList(params).then(({data})=>{
if (data && data.code === 0){
this.infoList = data.rows
}else {
this.$message.warning(data.msg)
}
this.loading = false
}).catch(error=>{
this.loading = false
this.$message.error(error)
})
}
},
watch:{
"queryParams.deviceNo"(newVal, oldVal){
this.queryParams.deviceNo = newVal.toUpperCase()
}
},
created() {
this.handleQuery();
}
}
</script>
<template>
<div class="app-container">
<el-form :model="queryParams" label-position="top" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" >
<el-option label="全部" value=""/>
<el-option label="涂布机器" value="涂布机器"/>
<el-option label="配胶间设备" value="配胶间设备"/>
</el-select>
</el-form-item>
<el-form-item label="设备号" prop="deviceNo">
<el-input
v-model="queryParams.deviceNo"
placeholder=" "
clearable
/>
</el-form-item>
<el-form-item label="设备描述" prop="deviceDesc">
<el-input
v-model="queryParams.deviceDesc"
style="width: 200px"
placeholder=" "
clearable
/>
</el-form-item>
<el-form-item label="采集日期" prop="startDate">
<el-date-picker
type="date"
style="width: 100%"
value-format="yyyy-MM-dd"
v-model="queryParams.startDate"
placeholder=" "
/>
</el-form-item>
<el-form-item label=" ">
<i class="el-icon-right"></i>
</el-form-item>
<el-form-item label=" " prop="endDate">
<el-date-picker
type="date"
style="width: 100%"
v-model="queryParams.endDate"
value-format="yyyy-MM-dd"
placeholder=" "
/>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="handleQuery" plain>查询</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" border :data="infoList" :height="height">
<el-table-column
v-for="(item,index) in collectRecordColumns" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed === ''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
</div>
</template>
<style scoped>
</style>

425
src/views/modules/cdc/device.vue

@ -0,0 +1,425 @@
<script>
import {selectDeviceList,editDevice, removeDevice, saveDevice} from "../../../api/cdc/device";
import dayjs from "dayjs";
const tableId = "2000001"
const tableName = "设备信息"
const table1 = "2000001Table1"
export default {
name: "device",
props:{
height:{
type:Number,
default:700
},
component:{
type:Boolean,
default: false
}
},
data(){
return{
//
loading: true,
//
infoList: [],
//
title: "设备信息",
//
open: false,
//
queryParams: {
deviceNo: '',
deviceDesc: null,
deviceType: "",
},
//
form: {},
//
rules: {
deviceDesc: [
{ required: true, message: "设备描述不能为空", trigger: "blur" }
],
deviceType: [
{ required: true, message: "设备类型不能为空", trigger: "change" }
],
deviceIp: [
{ required: true, message: "采集HTTP信息不能为空", trigger: "blur" }
],
deviceNo: [
{ required: true, message: "设备号不能为空", trigger: "blur" }
],
},
deviceColumns:[
{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}DeviceNo`,
tableId: table1,
tableName: tableName,
columnProp: 'deviceNo',
headerAlign: 'center',
align: 'left',
columnLabel: '设备号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}DeviceDesc`,
tableId: table1,
tableName: tableName,
columnProp: 'deviceDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '设备描述',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}DeviceType`,
tableId: table1,
tableName: tableName,
columnProp: 'deviceType',
headerAlign: 'center',
align: 'left',
columnLabel: '设备类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}AddressDesc`,
tableId: table1,
tableName: tableName,
columnProp: 'addressDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '位置描述',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}DeviceIp`,
tableId: table1,
tableName: tableName,
columnProp: 'deviceIp',
headerAlign: 'center',
align: 'left',
columnLabel: '采集HTTP信息',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}Active`,
tableId: table1,
tableName: tableName,
columnProp: 'active',
headerAlign: 'center',
align: 'center',
columnLabel: '在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}CreateBy`,
tableId: table1,
tableName: tableName,
columnProp: 'createBy',
headerAlign: 'center',
align: 'left',
columnLabel: '录入人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: tableId,
serialNumber: `${table1}CreateTime`,
tableId: table1,
tableName: tableName,
columnProp: 'createTime',
headerAlign: 'center',
align: 'center',
columnLabel: '录入时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
],
}
},
methods:{
/** 查询设备信息列表 */
getList() {
let params = {
...this.queryParams,
site:this.$store.state.user.site
}
this.loading = true;
selectDeviceList(params).then(({data}) => {
if (data && data.code === 0){
this.infoList = data.rows;
}
this.loading = false;
}).catch(() => {
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
deviceNo: '',
site: null,
deviceDesc: null,
deviceType: '涂布机器',
addressDesc: null,
deviceIp: null,
deviceAddress: null,
active: 'Y',
createBy: null,
createTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.form = {...row}
this.form.newDeviceNo = this.form.deviceNo;
this.open = true;
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid,obj) => {
if (valid) {
if (!this.form.newDeviceNo) {
this.form.site = this.$store.state.user.site;
this.form.createBy = this.$store.state.user.name;
this.form.createTime = dayjs().format("YYYY-MM-DD HH:mm:ss");
saveDevice(this.form).then(({data}) => {
this.form.site = null;
if (data && data.code === 0){
this.$message.success(data.msg);
this.open = false;
this.getList();
}else {
this.$message.warning(data.msg);
}
}).catch((error)=>{
this.$message.error(error);
});
} else {
editDevice(this.form).then(({data}) => {
if (data && data.code === 0){
this.$message.success(data.msg);
this.open = false;
this.getList();
}else {
this.$message.warning(data.msg);
}
}).catch((error)=>{
this.$message.error(error);
});
}
}else {
Object.keys(obj).forEach((key)=>{
this.$message.warning(obj[key][0].message);
return
})
}
});
},
handleDelete(row) {
this.$confirm('此操作将永久删除该设备信息, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
removeDevice(row).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
this.getList();
}else {
this.$message.success(data.msg);
}
}).catch((error)=>{
this.$message.error(error);
})
}).catch(() => {
});
},
},
watch:{
"queryParams.deviceNo"(newVal, oldVal){
this.queryParams.deviceNo = newVal.toUpperCase();
},
"form.deviceNo"(newVal, oldVal){
this.form.deviceNo = newVal.toUpperCase();
},
},
created() {
this.getList();
}
}
</script>
<template>
<div class="app-container">
<el-form :model="queryParams" label-position="top" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="设备号" prop="deviceNo">
<el-input
v-model="queryParams.deviceNo"
placeholder="请输入设备号"
clearable
/>
</el-form-item>
<el-form-item label="设备描述" prop="deviceDesc">
<el-input
v-model="queryParams.deviceDesc"
placeholder="请输入设备描述"
clearable
/>
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" >
<el-option label="全部" value=""/>
<el-option label="涂布机器" value="涂布机器"/>
<el-option label="配胶间设备" value="配胶间设备"/>
</el-select>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="handleQuery" plain>查询</el-button>
<el-button type="primary" @click="handleAdd" v-if="!component">新增</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" border :data="infoList" :height="height">
<el-table-column label="操作" align="center" v-if="!component">
<template slot-scope="scope">
<el-link @click="handleUpdate(scope.row)">编辑</el-link>
<el-link @click="handleDelete(scope.row)">删除</el-link>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in deviceColumns" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed === ''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改设备信息对话框 -->
<el-dialog :title="title" v-if="!component" v-drag :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" label-position="top" :model="form" :rules="rules" label-width="80px">
<el-row :gutter="10">
<el-col :span="6">
<el-form-item label="设备号" prop="deviceNo" :show-message="false">
<el-input v-model="form.deviceNo" :disabled="form.newDeviceNo" placeholder="请输入设备号" />
</el-form-item>
</el-col>
<el-col :span="18">
<el-form-item label="设备描述" prop="deviceDesc" :show-message="false">
<el-input v-model="form.deviceDesc" placeholder="请输入设备描述" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="设备类型" prop="deviceType" :show-message="false">
<el-select v-model="form.deviceType" placeholder="请选择设备类型">
<el-option label="涂布机器" value="涂布机器"/>
<el-option label="配胶间设备" value="配胶间设备"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="18">
<el-form-item label="位置描述" prop="addressDesc" :show-message="false">
<el-input v-model="form.addressDesc" placeholder="请输入位置描述" />
</el-form-item>
</el-col>
<el-col :span="18">
<el-form-item label="采集HTTP信息" prop="deviceIp" :show-message="false">
<el-input v-model="form.deviceIp" placeholder="请输入采集HTTP信息" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label=" " prop="active" :show-message="false">
<el-checkbox v-model="form.active" true-label="Y" false-label="N">在用</el-checkbox>
</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>
</div>
</template>
<style scoped>
</style>

299
src/views/modules/quotation/sellForQuotation/customerContact.vue

@ -0,0 +1,299 @@
<template>
<div class="mode-config">
<el-row>
<el-col>
<el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
<el-form :inline="true" label-position="top" style="margin-top: 0px">
<download-excel
:fields="fields2()"
:data="exportData2"
type="xls"
:name="exportName2"
:header="exportHeader2"
:footer="exportFooter2"
:fetch="createExportData2"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ '导出' }}
</download-excel>
</el-form>
</el-form>
</el-col>
</el-row>
<el-table
:data="dataList"
:height="height"
border
v-loading="dataListLoading"
style="width: 100%;margin-top: 10px ">
<el-table-column
v-for="(item,index) in columnList2" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import {
getCustomerContactData,
} from "@/api/project/project.js"
export default {
name: "customerContact",
props: {
height: {
type: Number,
default: 300
},
dataList:{
type: Array,
default: () => []
}
},
data(){
return{
quotationData: {},
exportData2: [],
exportName2: "项目客户联系人" + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader2: ["项目客户联系人"],
exportFooter2: [],
exportList2:[],
dataListLoading: false,
columnList2: [
{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table99ContactName',
tableId: '102003Table99',
tableName: '项目联系人表',
columnProp: 'contactName',
headerAlign: 'center',
align: 'center',
columnLabel: '联系人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table99ContactPhoneNumber1',
tableId: '102003Table99',
tableName: '项目联系人表',
columnProp: 'contactPhoneNumber1',
headerAlign: 'center',
align: 'center',
columnLabel: '联系电话',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table99ContactLandlineNumber',
tableId: '102003Table99',
tableName: '项目联系人表',
columnProp: 'contactLandlineNumber',
headerAlign: 'center',
align: 'center',
columnLabel: '座机',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table99Position',
tableId: '102003Table99',
tableName: '项目联系人表',
columnProp: 'position',
headerAlign: 'center',
align: 'center',
columnLabel: '公司职务',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table99Mailbox',
tableId: '102003Table99',
tableName: '项目联系人表',
columnProp: 'mailbox',
headerAlign: 'center',
align: 'center',
columnLabel: '邮箱',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table99PrimaryContact',
tableId: '102003Table99',
tableName: '项目联系人表',
columnProp: 'primaryContact',
headerAlign: 'center',
align: 'center',
columnLabel: '默认联系人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 40
},
{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table99ContactStatus',
tableId: '102003Table99',
tableName: '项目联系人表',
columnProp: 'contactStatus',
headerAlign: 'center',
align: 'center',
columnLabel: '状态',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 40
},
{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table99CreateDate',
tableId: '102003Table99',
tableName: '项目联系人表',
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table99CreateBy',
tableId: '102003Table99',
tableName: '项目联系人表',
columnProp: 'createBy',
headerAlign: 'center',
align: 'center',
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table99UpdateDate',
tableId: '102003Table99',
tableName: '项目联系人表',
columnProp: 'updateDate',
headerAlign: 'center',
align: 'center',
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table99UpdateBy',
tableId: '102003Table99',
tableName: '项目联系人表',
columnProp: 'updateBy',
headerAlign: 'center',
align: 'center',
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
}
],
}
},
methods:{
//excel
async createExportData2() {
return this.dataList;
},
fields2() {
let json = "{"
this.columnList2.forEach((item, index) => {
if (index == this.columnList2.length - 1) {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
} else {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
}
})
json += "}"
let s = eval("(" + json + ")")
return s
},
},
}
</script>
<style scoped>
</style>

168
src/views/modules/quotation/sellForQuotation/customerInfo.vue

@ -0,0 +1,168 @@
<template>
<div class="mode-config">
<el-form label-position="top" :model="customer" style="margin-left: 10px;margin-top: 5px;margin-right: 10px;width: 60%">
<el-row :gutter="20">
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="客户代码">
<el-input v-model="customer.customerNo" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="客户名称">
<el-input v-model="customer.customerDesc" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="重要程度">
<el-input v-model="customer.importantCustomer" readonly></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="客户币种">
<el-input v-model="customer.customerCurrency" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="年营业额">
<el-input v-model="customer.turnoverOfYear" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="年潜在投入">
<el-input v-model="customer.potentialRevenueOfYear" readonly></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="客户状态">
<el-input v-model="customer.customerStatus" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="行业">
<el-input v-model="customer.customerIndustry" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="公司名称">
<el-input v-model="customer.companyName" readonly></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="客户联系人">
<el-input v-model="customer.contactName" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="联系人电话">
<el-input v-model="customer.contactPhoneNumber1" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="联系人职务">
<el-input v-model="customer.position" readonly></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<div class="grid-content bg-purple">
<el-form-item label="客户描述">
<el-input v-model="customer.customerDescription" readonly></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<div class="grid-content bg-purple">
<el-form-item label="客户联系地址">
<el-input v-model="customer.addressName" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="12">
<div class="grid-content bg-purple">
<el-form-item label="地址类型">
<el-input v-model="customer.addressType" readonly></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<div class="grid-content bg-purple">
<el-form-item label="创建时间">
<el-input v-model="customer.createDate" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="6">
<div class="grid-content bg-purple">
<el-form-item label="创建人">
<el-input v-model="customer.createBy" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="6">
<div class="grid-content bg-purple">
<el-form-item label="更新时间">
<el-input v-model="customer.updateDate" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="6">
<div class="grid-content bg-purple">
<el-form-item label="更新人">
<el-input v-model="customer.updateBy" readonly></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
</el-form>
</div>
</template>
<script>
export default {
name: "customerInfo",
props: {
customer:{
type: Object,
default: () => {}
}
},
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save