Browse Source

设备添加 列表

master
1181364@qq.com 2 years ago
parent
commit
0df8036e94
  1. 44
      src/api/device/device.js
  2. 201
      src/views/shebeitaizhang/shebeitaizhangAdd.vue
  3. 791
      src/views/shebeitaizhang/shebeitaizhangList.vue

44
src/api/device/device.js

@ -0,0 +1,44 @@
import request from '@/utils/request'
// eslint-disable-next-line no-unused-vars
import qs from 'qs'
// 添加设备
export function createDevice(data) {
return request({ url: '/device/createDevice', method: 'post', params: data })
}
// 获取设备列表
export function getDevicePage(data) {
return request({ url: '/device/getDevicePage', method: 'GET', params: data })
}
// 子系统布防
export function getCallArm() {
return request({ url: '/call/getCallArm', method: 'GET', })
}
// 子系统撤防
export function getCallDisArm() {
return request({ url: '/call/getCallDisArm', method: 'GET', })
}
// 创建消息消费者
export function createCallConsumer() {
return request({ url: '/call/createCallConsumer', method: 'GET', })
}
// 获取消息列表
export function getCallMessageList(data) {
return request({ url: '/call/getCallMessageList', method: 'GET', params: data })
}
// 提交消息偏移量
export function doCallMessageOffsets(data) {
return request({ url: '/call/doCallMessageOffsets', method: 'GET', params: data })
}
// 获取所有防区状态
export function getCallZoneStatusList(data) {
return request({ url: '/call/getCallZoneStatusList', method: 'GET' })
}

201
src/views/shebeitaizhang/shebeitaizhangAdd.vue

@ -16,12 +16,11 @@
</div> </div>
<el-row> <el-row>
<el-col :span="4" class="tleftb"> <el-col :span="4" class="tleftb">
<span><span class="icon">*</span>设备</span> <span><span class="icon">*</span>设备验证</span>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop=""> <el-form-item prop="vCode">
<el-input v-model="addForm.manufacturerName" maxlength="20" placeholder="请填写设备编码" class="addinputw" <el-input v-model="addForm.vCode" maxlength="20" placeholder="请填写设备验证码" class="addinputw" clearable />
clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4" class="tleftb"> <el-col :span="4" class="tleftb">
@ -29,7 +28,7 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item> <el-form-item>
<el-input v-model="addForm.manufacturerAs" maxlength="20" placeholder="请填写设备位置 " class="addinputw" <el-input v-model="addForm.posotion" maxlength="20" placeholder="请填写设备位置 " class="addinputw"
clearable /> clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -39,53 +38,35 @@
<span><span class="icon">*</span>设备类型</span> <span><span class="icon">*</span>设备类型</span>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<!-- <el-form-item prop=""> <el-form-item prop="type">
<el-input v-model="addForm.manufacturerCode" :disabled="!isShow" maxlength="20" <el-select v-model="addForm.type" filterable clearable placeholder="请选择设备类型" style="width: 410px;">
placeholder="请填写金蝶供应商编码,如无请自己创建编码" class="addinputw" clearable />
</el-form-item> -->
<el-form-item>
<el-select v-model="addForm.manufacturerCode" filterable clearable placeholder="请选择设备类型"
style="width: 410px;">
<el-option v-for="item in supplierType_list" :key="item.id" :label="item.title" :value="item.id" <el-option v-for="item in supplierType_list" :key="item.id" :label="item.title" :value="item.id"
class="addinputw" /> class="addinputw" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4" class="tleftb"> <el-col :span="4" class="tleftb">
<span>安装时间</span> <span>备注</span>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop=""> <el-form-item prop="">
<!-- <el-input v-model="addForm.manufacturerCode" :disabled="!isShow" maxlength="20" <!-- <el-date-picker type="date" placeholder="选择日期" v-model="addForm.manufacturerCode" style="width: 410px;"
placeholder="请填写金蝶供应商编码,如无请自己创建编码" class="addinputw" clearable /> --> maxlength="20"></el-date-picker> -->
<el-date-picker type="date" placeholder="选择日期" v-model="addForm.manufacturerCode" style="width: 410px;" <el-input v-model="addForm.remarks" maxlength="20" placeholder="请填写备注" class="addinputw" clearable />
maxlength="20"></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="4" class="tleftb"> <el-col :span="4" class="tleftb">
<span><span class="icon">*</span>出厂时间</span> <span><span class="icon">*</span>设备名称</span>
</el-col>
<el-col :span="8">
<el-form-item prop="">
<!-- <el-input v-model="addForm.manufacturerCode" :disabled="!isShow" maxlength="20"
placeholder="请填写金蝶供应商编码,如无请自己创建编码" class="addinputw" clearable /> -->
<el-date-picker type="date" placeholder="选择日期" v-model="addForm.manufacturerCode" style="width: 410px;"
maxlength="20"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>供货商</span>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop=""> <el-form-item prop="name">
<el-input v-model="addForm.manufacturerCode" :disabled="!isShow" maxlength="20" placeholder="请填写供应商编码" <el-input v-model="addForm.name" maxlength="20" placeholder="请填写设备名称" class="addinputw" clearable />
class="addinputw" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <!-- <el-row>
<el-col :span="4" class="tleftb"> <el-col :span="4" class="tleftb">
<span>生产厂家</span> <span>生产厂家</span>
</el-col> </el-col>
@ -100,87 +81,11 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item> <el-form-item>
<!-- <el-input v-model="addForm.manufacturerFax" maxlength="20" placeholder="" class="addinputw" clearable /> -->
<el-date-picker type="date" placeholder="选择日期" v-model="addForm.manufacturerFax" style="width: 410px;" <el-date-picker type="date" placeholder="选择日期" v-model="addForm.manufacturerFax" style="width: 410px;"
maxlength="20"></el-date-picker> maxlength="20"></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<!-- <el-row> -->
<!-- <el-col :span="4" class="tleftb">
<span>所属仓库</span>
</el-col>
<el-col :span="8">
<el-form-item>
<el-input v-model="addForm.manufacturerTelePhone" maxlength="20" placeholder="请填写所属仓库"
class="addinputw" clearable />
</el-form-item>
</el-col> -->
<!-- <el-col :span="4" class="tleftb">
<span></span>
</el-col>
<el-col :span="8">
<el-form-item>
</el-form-item>
</el-col> -->
<!-- </el-row> -->
<!-- <el-row>
<el-col :span="4" class="tleftb">
<span><span class="icon">*</span>联系人姓名</span>
</el-col>
<el-col :span="8">
<el-form-item prop="contactName">
<el-input v-model="addForm.contactName" maxlength="5" placeholder="" class="addinputw" clearable />
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span><span class="icon">*</span>联系人手机号</span>
</el-col>
<el-col :span="8">
<el-form-item prop="contactMobile">
<el-input v-model="addForm.contactMobile" maxlength="11" placeholder="" class="addinputw" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>联系人办公电话</span>
</el-col>
<el-col :span="8">
<el-form-item>
<el-input v-model="addForm.contactTelePhone" maxlength="14" placeholder="例:010-88888888"
class="addinputw" clearable />
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>微信号</span>
</el-col>
<el-col :span="8">
<el-form-item prop="weChatID">
<el-input v-model="addForm.weChatID" maxlength="100" placeholder="" class="addinputw" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>邮编</span>
</el-col>
<el-col :span="8">
<el-form-item prop="">
<el-input v-model="addForm.zipCode" maxlength="20" placeholder="" class="addinputw" clearable />
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>邮箱</span>
</el-col>
<el-col :span="8">
<el-form-item>
<el-input v-model="addForm.email" maxlength="20" placeholder="" class="addinputw" clearable />
</el-form-item>
</el-col>
</el-row> --> </el-row> -->
</el-form> </el-form>
</div> </div>
</div> </div>
@ -190,6 +95,7 @@
<script> <script>
// import req from '@/api/shebeitaizhang/shebeitaizhang' // import req from '@/api/shebeitaizhang/shebeitaizhang'
// import { typeValues } from '@/api/cheliang/dictcommons' // import { typeValues } from '@/api/cheliang/dictcommons'
import { createDevice } from '@/api/device/device'
export default { export default {
name: 'shebeitaizhangAdd', name: 'shebeitaizhangAdd',
@ -222,65 +128,28 @@
sid: '', sid: '',
isShow: true, isShow: true,
supplierType_list: [ supplierType_list: [
{ title: '摄像头', id: '1' }, { title: '摄像头', id: '1' },
{ title: '电子围栏', id: '2' }, { title: '电子围栏', id: '2' },
{ title: '门禁', id: '3' }, { title: '门禁', id: '3' },
{ title: '机器人', id: '4' } { title: '机器人', id: '4' }
], ],
addForm: { addForm: {},
manufacturerName: '',
manufacturerAs: '',
manufacturerCode: '',
supplierType: '',
supplierTypeValue: '',
manufacturerAddress: '',
manufacturerTelePhone: '',
manufacturerFax: '',
contactName: '',
contactMobile: '',
contactTelePhone: '',
weChatID: '',
zipCode: '',
email: '',
createOrg: '',
useOrg: ''
},
baseManufacturerBankDto: [], baseManufacturerBankDto: [],
rules: { rules: {
manufacturerName: [{ name: [{
required: true,
message: '请填写供应商名称',
trigger: 'blur'
}],
supplierTypeValue: [{
required: true,
message: '请选择分类',
trigger: 'change'
}],
manufacturerAddress: [{
required: true,
message: '请填写供应商通讯地址',
trigger: 'blur'
}],
manufacturerFax: [{
required: true, required: true,
validator: checkChuanzhen, message: '请填写设备名称',
trigger: 'blur' trigger: 'blur'
}], }],
contactName: [{ vCode: [{
required: true, required: true,
message: '请填写联系人名字', message: '请填写验证码',
trigger: 'blur' trigger: 'blur'
}], }],
contactMobile: [{ type: [{
required: true, required: true,
validator: checkSubmit, message: '请选择设备类型',
trigger: 'blur' trigger: 'change'
}],
manufacturerCode: [{
required: true,
message: '编码不能为空',
trigger: 'blur'
}] }]
}, },
submitdisabled: false submitdisabled: false
@ -306,20 +175,24 @@
}) })
this.addForm.supplierType = bb.key this.addForm.supplierType = bb.key
}, },
showAdd(typeSubmit) {
this.dialogStatus = typeSubmit
},
handleSave() { handleSave() {
this.$refs['form_obj'].validate(valid => { this.$refs['form_obj'].validate(valid => {
if (valid) { if (valid) {
console.log(this.dialogStatus)
this.submitdisabled = true this.submitdisabled = true
const formobj = {
baseManufacturerBankDto: this.baseManufacturerBankDto,
addForm: this.addForm
}
if (this.dialogStatus === 'add') { if (this.dialogStatus === 'add') {
req.save(formobj).then(resp => { createDevice(this.addForm).then(resp => {
this.submitdisabled = false this.submitdisabled = false
if (resp.success) { console.log(resp)
this.$message({ showClose: true, type: 'success', message: resp.msg }) if (resp.code == 200) {
this.handleReturn('true') if (resp.data == true) {
this.$message({ showClose: true, type: 'success', message: resp.msg })
} else {
this.$message({ showClose: true, type: 'error', message: resp.data })
}
} }
}).catch(() => { }).catch(() => {
this.submitdisabled = false this.submitdisabled = false
@ -366,4 +239,4 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
</style> </style>

791
src/views/shebeitaizhang/shebeitaizhangList.vue

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="app-containerb" v-show="viewState == 1"> <div class="app-containerb" v-show="viewState == 1">
<!-- 饼图 --> <!-- 饼图 -->
<div class="tbars"> <div class="tbars">
<!-- 第1个图表 --> <!-- 第1个图表 -->
@ -16,7 +16,7 @@
<div class="tbar"> <div class="tbar">
<div class="bar"> <div class="bar">
<pie-chartrenyuan :chart-data="weixiu_Chart" ></pie-chartrenyuan> <pie-chartrenyuan :chart-data="weixiu_Chart"></pie-chartrenyuan>
<!-- <div class="zhongzi">15%</div> --> <!-- <div class="zhongzi">15%</div> -->
</div> </div>
<div class="title"><span class="iconfont icon-jiating greenzi"></span>维修率</div> <div class="title"><span class="iconfont icon-jiating greenzi"></span>维修率</div>
@ -30,7 +30,7 @@
<div class="title"><span class="iconfont icon-jiating greenzi"></span>损害率</div> <div class="title"><span class="iconfont icon-jiating greenzi"></span>损害率</div>
</div> </div>
</div> </div>
<div class="webye" > <div class="webye">
<button-bar view-title="设备台账" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle" /> <button-bar view-title="设备台账" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content"> <div class="main-content">
<div class="searchcon"> <div class="searchcon">
@ -38,27 +38,15 @@
<div v-show="isSearchShow" class="search"> <div v-show="isSearchShow" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="110px" class="tab-header"> <el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="110px" class="tab-header">
<el-form-item label="选择仓库"> <el-form-item label="选择仓库">
<el-select v-model="listQuery.params.cangku" filterable clearable placeholder="请选择仓库"> <el-select v-model="listQuery.cangku" filterable clearable placeholder="请选择仓库">
<el-option v-for="item in cangku_list" :key="item.id" :label="item.title" :value="item.id" /> <el-option v-for="item in cangku_list" :key="item.id" :label="item.title" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备类型"> <el-form-item label="设备类型">
<el-select v-model="listQuery.params.supplierType" filterable clearable placeholder="请选择设备类型"> <el-select v-model="listQuery.supplierType" filterable clearable placeholder="请选择设备类型">
<el-option v-for="item in supplierType_list" :key="item.id" :label="item.title" :value="item.id" /> <el-option v-for="item in supplierType_list" :key="item.id" :label="item.title" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="选择楼层">
<el-select v-model="listQuery.params.supplierType1" filterable clearable placeholder="请选择楼层">
<el-option v-for="item in floor_list" :key="item.id" :label="item.title" :value="item.id" />
</el-select>
</el-form-item> -->
<!-- <el-form-item label="厂商办公电话">
<el-input v-model="listQuery.params.manufacturerTelePhone" maxlength="130" placeholder="" class="addinputw" clearable/>
</el-form-item>
<el-form-item label="联系人">
<el-input v-model="listQuery.params.contactName" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item> -->
</el-form> </el-form>
<div class="btn"> <div class="btn">
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button> <el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button>
@ -154,30 +142,31 @@
</div> </div>
</div> </div>
</div> </div>
<shebeitaizhangAdd v-show="viewState == 2" ref="divadd" @doback="resetState" @reloadlist="handleFilter" /> <shebeitaizhangAdd v-show="viewState == 2" ref="divadd" @doback="resetState" @reloadlist="handleFilter" />
<shebeitaizhangInfo v-show="viewState == 4" ref="divinfo" @doback="resetState" /> <shebeitaizhangInfo v-show="viewState == 4" ref="divinfo" @doback="resetState" />
</div> </div>
</template> </template>
<script> <script>
import Pagination from '@/components/pagination' import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye' import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar' import ButtonBar from '@/components/ButtonBar'
// import { typeValues, getOrgSidByPath } from '@/api/cheliang/dictcommons' // import { typeValues, getOrgSidByPath } from '@/api/cheliang/dictcommons'
import shebeitaizhangAdd from './shebeitaizhangAdd' import shebeitaizhangAdd from './shebeitaizhangAdd'
import shebeitaizhangInfo from './shebeitaizhangInfo' import shebeitaizhangInfo from './shebeitaizhangInfo'
// import req from '@/api/shebeitaizhang/shebeitaizhang' import { getDevicePage } from '@/api/device/device'
import * as echarts from "echarts"; // import req from '@/api/shebeitaizhang/shebeitaizhang'
import PieChartrenyuan from '@/views/echarts/components/PieChartrenyuanb' import * as echarts from "echarts";
// 1.1 import PieChartrenyuan from '@/views/echarts/components/PieChartrenyuanb'
const wanhao_Chart = { // 1.1
const wanhao_Chart = {
// seriesName: '', // seriesName: '',
unit: '次', unit: '次',
color: ['#30e9ff', '#d9d9d9', '#fdc004'], color: ['#30e9ff', '#d9d9d9', '#fdc004'],
Data: { Data: {
seriesData: [ seriesData: [
{ value: 75, name: '完好' }, { value: 75, name: '完好' },
{ value: 25, name: '不完好' }, { value: 25, name: '不完好' },
// { value: 12, name: '' } // { value: 12, name: '' }
] ]
@ -191,14 +180,14 @@
// radius: ['50%', '55%'] // radius: ['50%', '55%']
} }
// 1.2 // 1.2
const weixiu_Chart = { const weixiu_Chart = {
// seriesName: '', // seriesName: '',
unit: '次', unit: '次',
color: ['#fe7f02', '#fdc004'], color: ['#fe7f02', '#fdc004'],
Data: { Data: {
seriesData: [ seriesData: [
{ value: 15, name: '维修' }, { value: 15, name: '维修' },
{ value: 85, name: '无维修' }, { value: 85, name: '无维修' },
// { value: 12, name: '' } // { value: 12, name: '' }
] ]
@ -212,14 +201,14 @@
// radius: ['50%', '55%'] // radius: ['50%', '55%']
} }
// 1.3 // 1.3
const sunhai_Chart = { const sunhai_Chart = {
// seriesName: '', // seriesName: '',
unit: '次', unit: '次',
color: [ '#d2cece','#ff0202', '#fdc004'], color: ['#d2cece', '#ff0202', '#fdc004'],
Data: { Data: {
seriesData: [ seriesData: [
{ value: 10, name: '损害' }, { value: 10, name: '损害' },
{ value: 90, name: '无损害' } { value: 90, name: '无损害' }
] ]
}, },
@ -233,369 +222,366 @@
// radius: ['50%', '55%'] // radius: ['50%', '55%']
} }
export default { export default {
name: 'shebeitaizhangList', name: 'shebeitaizhangList',
components: { components: {
Pagination, Pagination,
pageye, pageye,
ButtonBar, ButtonBar,
shebeitaizhangAdd, shebeitaizhangAdd,
shebeitaizhangInfo,PieChartrenyuan shebeitaizhangInfo, PieChartrenyuan
}, },
data() { data() {
return { return {
wanhao_Chart: wanhao_Chart, // 1.1 wanhao_Chart: wanhao_Chart, // 1.1
weixiu_Chart:weixiu_Chart, weixiu_Chart: weixiu_Chart,
sunhai_Chart: sunhai_Chart, sunhai_Chart: sunhai_Chart,
btndisabled: false, btndisabled: false,
btnList: [ btnList: [
{ {
type: 'primary', type: 'primary',
size: 'small', size: 'small',
icon: 'plus', icon: 'plus',
btnKey: 'toAdd', btnKey: 'toAdd',
btnLabel: '新增' btnLabel: '新增'
},
{
type: 'danger',
size: 'small',
icon: 'del',
btnKey: 'doDel',
btnLabel: '删除'
},
// {
// type: 'primary',
// size: 'small',
// icon: '',
// btnKey: 'toChangShang',
// btnLabel: ''
// },
// {
// type: 'primary',
// size: 'small',
// icon: '',
// btnKey: 'toChangShang',
// btnLabel: ''
// },
// {
// type: 'primary',
// size: 'small',
// icon: '',
// btnKey: 'toGain',
// btnLabel: ''
// },
{
type: 'success',
size: 'small',
icon: 'export',
btnKey: 'import',
btnLabel: '导入'
},
// {
// type: 'success',
// size: 'small',
// icon: 'export',
// btnKey: 'build',
// btnLabel: ''
// },
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
viewState: 1,
isSearchShow: false,
searchxianshitit: '显示查询条件',
sids: [],
// -----------
tableKey: 0,
list: [
{ bianma: 'KD-22', cangku: '库房1',supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-18', status: '1' },
{ bianma: 'KD-22', cangku: '库房2',supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-19', status: '1' },
{ bianma: 'KD-22', cangku: '库房3',supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-19', status: '2' },
{ bianma: 'KD-22', cangku: '库房4',supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-20', status: '2' },
{ bianma: 'KD-22', cangku: '库房5',supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-20', status: '2' },
{ bianma: 'KD-22', cangku: '库房1',supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-21', status: '1' },
{ bianma: 'KD-22', cangku: '库房1',supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-23', status: '1' },
{ bianma: 'KD-22', cangku: '库房1',supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-23', status: '3' },
{ bianma: 'KD-22', cangku: '库房1',supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-23', status: '3' },
{ bianma: 'KD-22', cangku: '库房1',supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-23', status: '3' },
],
listLoading: false,
listQuery: {
params: {
manufacturerName: '',
supplierType: '',
useOrgSid: '',
createOrgSid: '',
manufacturerTelePhone: '',
contactName: ''
},
current: 1,
size: 5,
total: 0
}, },
supplierType_list: [ {
{ title: '摄像机', id: '1' }, type: 'danger',
], size: 'small',
floor_list: [ icon: 'del',
{ title: '一层', id: '1' }, btnKey: 'doDel',
{ title: '二层', id: '2' }, btnLabel: '删除'
{ title: '三层', id: '3' }, },
{ title: '四层', id: '4' }, // {
], // type: 'primary',
cangku_list: [ // size: 'small',
{ title: '仓库1', id: '1' }, // icon: '',
{ title: '仓库2', id: '2' } // btnKey: 'toChangShang',
], // btnLabel: ''
status_list: [ // },
{ title: '已损坏', id: '1' }, // {
{ title: '已维修', id: '2' }, // type: 'primary',
{ title: '完好', id: '3' }, // size: 'small',
], // icon: '',
rules: {} // btnKey: 'toChangShang',
} // btnLabel: ''
}, // },
mounted() { // {
this.$refs['btnbar'].setButtonList(this.btnList) // type: 'primary',
}, // size: 'small',
created() { // icon: '',
// // btnKey: 'toGain',
// this.init() // btnLabel: ''
}, // },
methods: { {
getStatus(item) { type: 'success',
for (var i = 0; i < this.status_list.length; i++) { size: 'small',
if (this.status_list[i].id == item) { icon: 'export',
return this.status_list[i].title btnKey: 'import',
} btnLabel: '导入'
} },
}, // {
getSupplierType(item) { // type: 'success',
for (var i = 0; i < this.supplierType_list.length; i++) { // size: 'small',
if (this.supplierType_list[i].id == item) { // icon: 'export',
return this.supplierType_list[i].title // btnKey: 'build',
} // btnLabel: ''
// },
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
} }
],
viewState: 1,
isSearchShow: false,
searchxianshitit: '显示查询条件',
sids: [],
// -----------
tableKey: 0,
list: [
{ bianma: 'KD-22', cangku: '库房1', supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-18', status: '1' },
{ bianma: 'KD-22', cangku: '库房2', supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-19', status: '1' },
{ bianma: 'KD-22', cangku: '库房3', supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-19', status: '2' },
{ bianma: 'KD-22', cangku: '库房4', supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-20', status: '2' },
{ bianma: 'KD-22', cangku: '库房5', supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-20', status: '2' },
{ bianma: 'KD-22', cangku: '库房1', supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-21', status: '1' },
{ bianma: 'KD-22', cangku: '库房1', supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-23', status: '1' },
{ bianma: 'KD-22', cangku: '库房1', supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-23', status: '3' },
{ bianma: 'KD-22', cangku: '库房1', supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-23', status: '3' },
{ bianma: 'KD-22', cangku: '库房1', supplierTypeValue: '1', weizhi: '2F金陵文脉', time: '2023-02-26 12:00:00', anzhuangtime: '2023-02-26 16:00:00', gonghuashang: '大华', owner: '大华科技', policeTime: '2023-05-23', status: '3' },
],
listLoading: false,
listQuery: {
current: 1,
size: 5,
total: 0
}, },
resetState() { supplierType_list: [
this.viewState = 1 { title: '摄像机', id: '1' },
}, ],
btnHandle(btnKey) { floor_list: [
console.log('XXXXXXXXXXXXXXX ' + btnKey) { title: '一层', id: '1' },
switch (btnKey) { { title: '二层', id: '2' },
case 'toAdd': { title: '三层', id: '3' },
this.toAdd() { title: '四层', id: '4' },
break ],
case 'doDel': cangku_list: [
this.doDel() { title: '仓库1', id: '1' },
break { title: '仓库2', id: '2' }
case 'toChangShang': ],
this.toChangShang() status_list: [
break { title: '已损坏', id: '1' },
case 'toGain': { title: '已维修', id: '2' },
this.toGain() { title: '完好', id: '3' },
break ],
case 'doExport': rules: {}
this.doExport() }
break },
case 'doClose': mounted() {
this.doClose() this.$refs['btnbar'].setButtonList(this.btnList)
break },
default: created() {
break //
this.init()
},
methods: {
getStatus(item) {
for (var i = 0; i < this.status_list.length; i++) {
if (this.status_list[i].id == item) {
return this.status_list[i].title
} }
}, }
// },
clicksearchShow() { getSupplierType(item) {
this.isSearchShow = !this.isSearchShow for (var i = 0; i < this.supplierType_list.length; i++) {
if (this.isSearchShow) { if (this.supplierType_list[i].id == item) {
this.searchxianshitit = '隐藏查询条件' return this.supplierType_list[i].title
} else {
this.searchxianshitit = '显示查询条件'
} }
}, }
// init() { },
// getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => { resetState() {
// if (res.success) { this.viewState = 1
// this.listQuery.params.createOrgSid = res.data },
// this.getType() btnHandle(btnKey) {
// this.getList() console.log('XXXXXXXXXXXXXXX ' + btnKey)
// } switch (btnKey) {
// }) case 'toAdd':
// }, this.toAdd()
// getType() { break
// typeValues({ case 'doDel':
// type: 'supplierType' this.doDel()
// }).then((res) => { break
// if (res.code === '200') { case 'toChangShang':
// this.supplierType_list = res.data this.toChangShang()
// console.log('', this.supplierType_list) break
// } case 'toGain':
// }) this.toGain()
// }, break
// case 'doExport':
indexMethod(index) { this.doExport()
var pagestart = (this.listQuery.current - 1) * this.listQuery.size break
var pageindex = index + 1 + pagestart case 'doClose':
return pageindex this.doClose()
}, break
// default:
getList() { break
// this.listLoading = true }
// req.gysPagerList(this.listQuery).then((response) => { },
// this.listLoading = false //
// if (response.code === '200' && response.data && response.data.total > 0) { clicksearchShow() {
// this.list = response.data.records this.isSearchShow = !this.isSearchShow
// this.listQuery.total = response.data.total if (this.isSearchShow) {
// } else { this.searchxianshitit = '隐藏查询条件'
// this.list = [] } else {
// this.listQuery.total = 0 this.searchxianshitit = '显示查询条件'
// } }
// }) },
}, init() {
// this.getList()
handleFilter() { },
this.listQuery.current = 1 // getType() {
this.getList() // typeValues({
}, // type: 'supplierType'
handleReset() { // }).then((res) => {
// this.listQuery = { // if (res.code === '200') {
// params: { // this.supplierType_list = res.data
// manufacturerName: '', // console.log('', this.supplierType_list)
// supplierType: '', // }
// useOrgSid: '', // })
// createOrgSid: '', // },
// manufacturerTelePhone: '', //
// contactName: '' indexMethod(index) {
// }, var pagestart = (this.listQuery.current - 1) * this.listQuery.size
// current: 1, var pageindex = index + 1 + pagestart
// size: 5 return pageindex
},
//
getList() {
this.listLoading = true
console.log(this.listQuery)
getDevicePage(this.listQuery).then((response) => {
this.listLoading = false
console.log(response)
// if (response.code === '200' && response.data && response.data.total > 0) {
// this.list = response.data.records
// this.listQuery.total = response.data.total
// } else {
// this.list = []
// this.listQuery.total = 0
// } // }
// this.init() })
}, },
// //
toAdd() { handleFilter() {
this.viewState = 2 this.listQuery.current = 1
this.$refs['divadd'].showAdd(this.listQuery.params.createOrgSid) this.getList()
}, },
handleReset() {
// this.listQuery = {
// params: {
// manufacturerName: '',
// supplierType: '',
// useOrgSid: '',
// createOrgSid: '',
// manufacturerTelePhone: '',
// contactName: ''
// },
// current: 1,
// size: 5
// }
// this.init()
},
//
toAdd() {
this.listQuery.typeSubmit = 'add'
this.viewState = 2
this.$refs['divadd'].showAdd(this.listQuery.typeSubmit)
},
handleSelectionChange(row) { handleSelectionChange(row) {
const aa = [] const aa = []
row.forEach((element) => { row.forEach((element) => {
aa.push(element.sid) aa.push(element.sid)
}) })
this.sids = aa this.sids = aa
}, },
// ID // ID
doDel() { doDel() {
if (this.sids.length > 0) { if (this.sids.length > 0) {
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?' const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
this.$confirm(tip, '提示', { this.$confirm(tip, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
text: 'Loading', text: 'Loading',
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}) })
req.delBySids(this.sids.toString()).then(resp => { req.delBySids(this.sids.toString()).then(resp => {
if (resp.success) { if (resp.success) {
loading.close()
this.$message({ type: 'success', message: resp.msg, showClose: true })
this.getList()
} else {
loading.close()
}
}).catch(e => {
loading.close() loading.close()
}) this.$message({ type: 'success', message: resp.msg, showClose: true })
}).catch(() => { this.getList()
} else {
loading.close()
}
}).catch(e => {
loading.close()
}) })
} else { }).catch(() => {
this.$message({ type: 'error', message: '没有选择!!', showClose: true })
return
}
},
toChangShang() {
this.$router.push({
path: '/cangkuguanli/cangkuguanliList',
}) })
}, } else {
// toChangShang() { this.$message({ type: 'error', message: '没有选择!!', showClose: true })
// req.saveGysByOrgSid(this.listQuery.params.createOrgSid).then((resp) => { return
// if (resp.success) {
// this.$message({ showClose: true, type: 'success', message: '' })
// this.getList()
// }
// })
// },
// toGain() {
// req.saveAllByOrgSid({ orgSid: this.listQuery.params.createOrgSid }).then((resp) => {
// if (resp.success) {
// this.$message({ showClose: true, type: 'success', message: '' })
// this.getList()
// }
// })
// },
handleEdit(row) {
// this.viewState = 3
// this.$refs['divadd'].showEdit(row)
this.viewState = 2
this.$refs['divadd'].showAdd(this.listQuery.params.createOrgSid)
// if (row.supplierTypeValue !== '' && row.supplierTypeValue !== '') {
// this.viewState = 3
// this.$refs['divadd'].showEdit(row)
// } else {
// this.viewState = 5
// this.$refs['divHosts'].showInfo(row)
// }
},
//
handleCheck(row) {
this.viewState = 4
this.$refs['divinfo'].showInfo(row)
},
//
// doExport() {
// basefinbankExportExcel(this.sids).then((res) => {
// const blob = new Blob([res], {
// type: 'application/vnd.ms-excel'
// })
// const objectUrl = URL.createObjectURL(blob)
// window.location.href = objectUrl
// this.$notify({
// title: '',
// message: '',
// type: 'success',
// duration: 2000
// })
// })
// },
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
} }
},
toChangShang() {
this.$router.push({
path: '/cangkuguanli/cangkuguanliList',
})
},
// toChangShang() {
// req.saveGysByOrgSid(this.listQuery.params.createOrgSid).then((resp) => {
// if (resp.success) {
// this.$message({ showClose: true, type: 'success', message: '' })
// this.getList()
// }
// })
// },
// toGain() {
// req.saveAllByOrgSid({ orgSid: this.listQuery.params.createOrgSid }).then((resp) => {
// if (resp.success) {
// this.$message({ showClose: true, type: 'success', message: '' })
// this.getList()
// }
// })
// },
handleEdit(row) {
// this.viewState = 3
// this.$refs['divadd'].showEdit(row)
this.viewState = 2
this.$refs['divadd'].showAdd(this.listQuery.params.createOrgSid)
// if (row.supplierTypeValue !== '' && row.supplierTypeValue !== '') {
// this.viewState = 3
// this.$refs['divadd'].showEdit(row)
// } else {
// this.viewState = 5
// this.$refs['divHosts'].showInfo(row)
// }
},
//
handleCheck(row) {
this.viewState = 4
this.$refs['divinfo'].showInfo(row)
},
//
// doExport() {
// basefinbankExportExcel(this.sids).then((res) => {
// const blob = new Blob([res], {
// type: 'application/vnd.ms-excel'
// })
// const objectUrl = URL.createObjectURL(blob)
// window.location.href = objectUrl
// this.$notify({
// title: '',
// message: '',
// type: 'success',
// duration: 2000
// })
// })
// },
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
} }
} }
</script> }
</script>
<style scoped> <style scoped>
.app-containerb{ .app-containerb {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: nowrap; flex-wrap: nowrap;
justify-content: flex-start;align-items: flex-start; justify-content: flex-start;
align-items: flex-start;
}
.webye {
flex: 1;
text-align: left;
} }
.webye{flex: 1;text-align: left;}
/* 饼图部分 */ /* 饼图部分 */
.tbars {width: 250px;height: 100%; .tbars {
width: 250px;
height: 100%;
/* display: flex; /* display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: nowrap; flex-wrap: nowrap;
@ -603,8 +589,10 @@
margin: 0 20px 0 0; margin: 0 20px 0 0;
padding: 10px; padding: 10px;
background-color: #fff; background-color: #fff;
box-shadow:0px 0px 10px #E9E9E9;border-radius: 5px; box-shadow: 0px 0px 10px #E9E9E9;
border-radius: 5px;
} }
.tbar { .tbar {
/* width: 25%; */ /* width: 25%; */
margin: 0 0px 0 0; margin: 0 0px 0 0;
@ -612,22 +600,31 @@
box-shadow:0px 0px 10px #E9E9E9;border-radius: 5px; */ box-shadow:0px 0px 10px #E9E9E9;border-radius: 5px; */
padding: 10px; padding: 10px;
} }
.tbar:last-of-type { .tbar:last-of-type {
margin: 0; margin: 0;
} }
.tbar0 { .tbar0 {
border-bottom: 0px solid #032ab8; border-bottom: 0px solid #032ab8;
} }
.tbar .title { .tbar .title {
font-size: 20px; font-size: 20px;
padding: 0px 20px;text-align: center; padding: 0px 20px;
font-weight: bold; color: #333;font-size: 16px; text-align: center;
font-weight: bold;
color: #333;
font-size: 16px;
/* border-bottom: 1px solid #ececee; */ /* border-bottom: 1px solid #ececee; */
} }
.tbar .title span { .tbar .title span {
padding: 0 10px 0 0; padding: 0 10px 0 0;
} }
.tbar .bar {position: relative;
.tbar .bar {
position: relative;
/* display: flex; /* display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: nowrap; flex-wrap: nowrap;
@ -636,7 +633,17 @@
padding: 0px; padding: 0px;
height: 190px; height: 190px;
} }
.tbar .bar .zhongzi {position: absolute;top:0;bottom: 0;left: 0;right: 0;line-height: 240px;text-align: center;
font-weight: bold; color: #333;font-size: 18px; .tbar .bar .zhongzi {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
line-height: 240px;
text-align: center;
font-weight: bold;
color: #333;
font-size: 18px;
} }
</style> </style>
Loading…
Cancel
Save