Browse Source

修改列表

master
1181364@qq.com 2 years ago
parent
commit
4e4a3173a5
  1. 659
      src/views/baojingchaxun/baojingchaxunList.vue
  2. 661
      src/views/shebeirizhi/shebeirizhiList.vue
  3. 415
      src/views/shebeitaizhang/shebeitaizhangAdd.vue
  4. 172
      src/views/shebeitaizhang/shebeitaizhangInfo.vue
  5. 658
      src/views/shebeitaizhang/shebeitaizhangList.vue
  6. 665
      src/views/shebeizhuangtai/shebeizhuangtaiList.vue

659
src/views/baojingchaxun/baojingchaxunList.vue

@ -1,20 +1,37 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div v-show="viewState == 1"> <div v-show="viewState == 1">
<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">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button> <el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<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-input v-model="listQuery.params.manufacturerName" clearable placeholder="" class="addinputw"></el-input> <el-input v-model="listQuery.params.manufacturerName" clearable placeholder=""
class="addinputw"></el-input>
</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.params.supplierType" filterable clearable placeholder="请选择设备类型">
<el-option v-for="item in supplierType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/> <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-date-picker v-model="listQuery.params.time1" type="date" placeholder="选择日期"
maxlength="20"></el-date-picker>
<!-- <el-select v-model="listQuery.params.time1" filterable clearable placeholder="请选择设备类型">
<el-option v-for="item in supplierType_list" :key="item.id" :label="item.title" :value="item.id" />
</el-select> -->
</el-form-item>
<el-form-item label="结束时间">
<el-date-picker v-model="listQuery.params.time2" type="date" placeholder="选择日期"
maxlength="20"></el-date-picker>
<!-- <el-select v-model="listQuery.params.time2" filterable clearable placeholder="请选择设备类型">
<el-option v-for="item in supplierType_list" :key="item.id" :label="item.title" :value="item.id" />
</el-select> -->
</el-form-item>
<!-- <el-form-item label="厂商办公电话"> <!-- <el-form-item label="厂商办公电话">
<el-input v-model="listQuery.params.manufacturerTelePhone" maxlength="130" placeholder="" class="addinputw" clearable/> <el-input v-model="listQuery.params.manufacturerTelePhone" maxlength="130" placeholder="" class="addinputw" clearable/>
</el-form-item> </el-form-item>
@ -31,12 +48,14 @@
<div class="listtop"> <div class="listtop">
<div class="tit">报警查询信息列表</div> <div class="tit">报警查询信息列表</div>
<!-- 翻页分页 --> <!-- 翻页分页 -->
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> <pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="getList" />
</div> </div>
<div> <div>
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange"> <el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;"
<el-table-column type="selection" align="center" width="50"/> @selection-change="handleSelectionChange">
<el-table-column label="序号" fixed type="index" width="80" :index="indexMethod" align="center"/> <el-table-column type="selection" align="center" width="50" />
<el-table-column label="序号" fixed type="index" width="80" :index="indexMethod" align="center" />
<!-- <el-table-column label="操作" fixed align="center" width="160px" class-name="small-padding fixed-width"> <!-- <el-table-column label="操作" fixed align="center" width="160px" class-name="small-padding fixed-width">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-button size="mini" type="primary" :disabled="!row.isShow && (row.supplierTypeValue === '主机厂' || row.supplierTypeValue === '分公司')" @click="handleEdit(row)">编辑</el-button> <el-button size="mini" type="primary" :disabled="!row.isShow && (row.supplierTypeValue === '主机厂' || row.supplierTypeValue === '分公司')" @click="handleEdit(row)">编辑</el-button>
@ -48,14 +67,24 @@
<span class="bluezi" @click="handleCheck(scope.row)">{{ scope.row.bianma }}</span> <span class="bluezi" @click="handleCheck(scope.row)">{{ scope.row.bianma }}</span>
</template> </template>
</el-table-column> --> </el-table-column> -->
<el-table-column prop="jc" label="设备编码" header-align="center" align="center"> <!-- <el-table-column prop="jc" label="设备编码" header-align="center" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.bianma }}</span> <span>{{ scope.row.bianma }}</span>
</template> </template>
</el-table-column> -->
<!-- <el-table-column label="设备类型" width="110" align="center">
<template slot-scope="scope">
<span>{{ getSupplierType(scope.row.supplierTypeValue) }}</span>
</template>
</el-table-column> -->
<el-table-column label="报警时间" align="center">
<template slot-scope="scope">
<span>{{ scope.row.policeTime }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column label="设备类型" width="110" align="center"> <el-table-column label="设备名称" width="" header-align="center" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.supplierTypeValue }}</span> <span>{{ scope.row.name }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="设备位置" width="" header-align="center" align="center"> <el-table-column label="设备位置" width="" header-align="center" align="center">
@ -63,7 +92,7 @@
<span>{{ scope.row.weizhi }}</span> <span>{{ scope.row.weizhi }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="出厂时间" align="center"> <!-- <el-table-column label="出厂时间" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.time }}</span> <span>{{ scope.row.time }}</span>
</template> </template>
@ -80,24 +109,20 @@
</el-table-column> </el-table-column>
<el-table-column label="生产厂家" align="center"> <el-table-column label="生产厂家" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.gonghuashang }}</span> <span>{{ scope.row.owner }}</span>
</template>
</el-table-column>
<el-table-column label="保修截止日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.gonghuashang }}</span>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column label="状态" align="center"> <el-table-column label="状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.gonghuashang }}</span> <span>{{ getSupplierType(scope.row.supplierTypeValue) }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="pages"> <div class="pages">
<!-- 翻页 --> <!-- 翻页 -->
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> <pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="getList" />
</div> </div>
</div> </div>
</div> </div>
@ -107,303 +132,325 @@
</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 baojingchaxunAdd from './baojingchaxunAdd' // import baojingchaxunAdd from './baojingchaxunAdd'
// import baojingchaxunInfo from './baojingchaxunInfo' // import baojingchaxunInfo from './baojingchaxunInfo'
// import req from '@/api/baojingchaxun/baojingchaxun' // import req from '@/api/baojingchaxun/baojingchaxun'
export default { export default {
name: 'baojingchaxunList', name: 'baojingchaxunList',
components: { components: {
Pagination, Pagination,
pageye, pageye,
ButtonBar, ButtonBar,
// baojingchaxunAdd, // baojingchaxunAdd,
// baojingchaxunInfo, // baojingchaxunInfo,
}, },
data() { data() {
return { return {
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', // type: 'danger',
// size: 'small', // size: 'small',
// icon: 'del', // icon: 'del',
// btnKey: 'doDel', // btnKey: 'doDel',
// btnLabel: '' // btnLabel: ''
// }, // },
// { // {
// type: 'primary', // type: 'primary',
// size: 'small', // size: 'small',
// icon: '', // icon: '',
// btnKey: 'toChangShang', // btnKey: 'toChangShang',
// btnLabel: '' // btnLabel: ''
// }, // },
// { // {
// type: 'primary', // type: 'primary',
// size: 'small', // size: 'small',
// icon: '', // icon: '',
// btnKey: 'toGain', // btnKey: 'toGain',
// btnLabel: '' // btnLabel: ''
// }, // },
// { // {
// type: 'success', // type: 'success',
// size: 'small', // size: 'small',
// icon: 'export', // icon: 'export',
// btnKey: 'build', // btnKey: 'build',
// btnLabel: '' // btnLabel: ''
// }, // },
{ {
type: 'info', type: 'info',
size: 'small', size: 'small',
icon: 'cross', icon: 'cross',
btnKey: 'doClose', btnKey: 'doClose',
btnLabel: '关闭' btnLabel: '关闭'
} }
], ],
viewState: 1, viewState: 1,
isSearchShow: false, isSearchShow: false,
searchxianshitit: '显示查询条件', searchxianshitit: '显示查询条件',
sids: [], sids: [],
// ----------- // -----------
tableKey: 0, tableKey: 0,
list: [{bianma:'212233433',supplierTypeValue:'222',weizhi:'212233433',time:'2023-02-26',anzhuangtime:'2023-02-26',gonghuashang:'222' list: [
,supplierTypeValue:'222',zhuangtai:'222'} { bianma: 'ZYR2060801', supplierTypeValue: '1', name: '电梯系统', weizhi: '库房', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-18 06:00:00', isElse: '待处理' },
], { bianma: 'ZYR2060802', supplierTypeValue: '1', name: '电梯系统', weizhi: '观察', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-19 06:00:00', isElse: '已处理' },
listLoading: false, { bianma: 'ZYR2060803', supplierTypeValue: '2', name: '电梯系统', weizhi: '后院', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-19 06:00:00', isElse: '待处理' },
listQuery: { { bianma: 'ZYR2060804', supplierTypeValue: '2', name: '电梯系统', weizhi: '铁皮', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-20 06:00:00', isElse: '已处理' },
params: { { bianma: 'ZYR2060805', supplierTypeValue: '2', name: '电梯系统', weizhi: '盲点', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-20 06:00:00', isElse: '待处理' },
manufacturerName: '', { bianma: 'ZYR2060806', supplierTypeValue: '3', name: '电梯系统', weizhi: '凉亭', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-21 06:00:00', isElse: '待处理' },
supplierType: '', { bianma: 'ZYR2060807', supplierTypeValue: '3', name: '电梯系统', weizhi: '书房', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-23 06:00:00', isElse: '已处理' },
useOrgSid: '', { bianma: 'ZYR2060808', supplierTypeValue: '4', name: '电梯系统', weizhi: '藏经阁', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-23 06:00:00', isElse: '待处理' },
createOrgSid: '', { bianma: 'ZYR2060809', supplierTypeValue: '4', name: '电梯系统', weizhi: '车库', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-23 06:00:00', isElse: '已处理' },
manufacturerTelePhone: '', { bianma: 'ZYR2060810', supplierTypeValue: '5', name: '电梯系统', weizhi: '斜坡', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-23 06:00:00', isElse: '待处理' },
contactName: '' ],
listLoading: false,
listQuery: {
params: {
manufacturerName: '',
supplierType: '',
useOrgSid: '',
createOrgSid: '',
manufacturerTelePhone: '',
contactName: ''
},
current: 1,
size: 5,
total: 10
}, },
current: 1, supplierType_list: [
size: 5, { title: '入侵报警', id: '1' },
total: 0 { title: '电子围栏', id: '2' },
}, { title: '门禁报警', id: '3' },
supplierType_list: [], { title: '监控报警', id: '4' },
rules: {} { title: '设备离线', id: '5' },
} ],
}, rules: {}
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
//
// this.init()
},
methods: {
resetState() {
this.viewState = 1
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doDel':
this.doDel()
break
case 'toChangShang':
this.toChangShang()
break
case 'toGain':
this.toGain()
break
case 'doExport':
this.doExport()
break
case 'doClose':
this.doClose()
break
default:
break
} }
}, },
// mounted() {
clicksearchShow() { this.$refs['btnbar'].setButtonList(this.btnList)
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
// init() {
// getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => {
// if (res.success) {
// this.listQuery.params.createOrgSid = res.data
// this.getType()
// this.getList()
// }
// })
// },
// getType() {
// typeValues({
// type: 'supplierType'
// }).then((res) => {
// if (res.code === '200') {
// this.supplierType_list = res.data
// console.log('', this.supplierType_list)
// }
// })
// },
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
getList() {
// this.listLoading = true
// req.gysPagerList(this.listQuery).then((response) => {
// this.listLoading = false
// 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
// }
// })
}, },
// created() {
handleFilter() { //
this.listQuery.current = 1
this.getList()
},
handleReset() {
// this.listQuery = {
// params: {
// manufacturerName: '',
// supplierType: '',
// useOrgSid: '',
// createOrgSid: '',
// manufacturerTelePhone: '',
// contactName: ''
// },
// current: 1,
// size: 5
// }
// this.init() // this.init()
}, },
// methods: {
toAdd() { getSupplierType(item) {
this.viewState = 2 for (var i = 0; i < this.supplierType_list.length; i++) {
this.$refs['divadd'].showAdd(this.listQuery.params.createOrgSid) if (this.supplierType_list[i].id == item) {
}, return this.supplierType_list[i].title
}
}
},
resetState() {
this.viewState = 1
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doDel':
this.doDel()
break
case 'toChangShang':
this.toChangShang()
break
case 'toGain':
this.toGain()
break
case 'doExport':
this.doExport()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
// init() {
// getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => {
// if (res.success) {
// this.listQuery.params.createOrgSid = res.data
// this.getType()
// this.getList()
// }
// })
// },
// getType() {
// typeValues({
// type: 'supplierType'
// }).then((res) => {
// if (res.code === '200') {
// this.supplierType_list = res.data
// console.log('', this.supplierType_list)
// }
// })
// },
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
getList() {
// this.listLoading = true
// req.gysPagerList(this.listQuery).then((response) => {
// this.listLoading = false
// 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
// }
// })
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
handleReset() {
// this.listQuery = {
// params: {
// manufacturerName: '',
// supplierType: '',
// useOrgSid: '',
// createOrgSid: '',
// manufacturerTelePhone: '',
// contactName: ''
// },
// current: 1,
// size: 5
// }
// this.init()
},
//
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd(this.listQuery.params.createOrgSid)
},
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() loading.close()
this.$message({ type: 'success', message: resp.msg, showClose: true }) this.$message({ type: 'success', message: resp.msg, showClose: true })
this.getList() this.getList()
} else { } else {
loading.close()
}
}).catch(e => {
loading.close() loading.close()
} })
}).catch(e => { }).catch(() => {
loading.close()
}) })
}).catch(() => { } else {
}) this.$message({ type: 'error', message: '没有选择!!', showClose: true })
} else { return
this.$message({ type: 'error', message: '没有选择!!', showClose: true }) }
return },
// 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)
// 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() {
// 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)
// 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>
</style> </style>

661
src/views/shebeirizhi/shebeirizhiList.vue

@ -1,20 +1,30 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div v-show="viewState == 1"> <div v-show="viewState == 1">
<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">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button> <el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<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-input v-model="listQuery.params.manufacturerName" clearable placeholder="" class="addinputw"></el-input> <el-date-picker v-model="listQuery.params.supplierType" type="date" placeholder="选择日期"
maxlength="20"></el-date-picker>
</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.params.supplierType" filterable clearable placeholder="请选择设备名称">
<el-option v-for="item in supplierType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/> <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-input v-model="listQuery.params.ress" clearable placeholder="" class="addinputw" placeholder="请填写地点名称"></el-input>
</el-form-item>
<el-form-item label="名称">
<el-input v-model="listQuery.params.name" clearable placeholder="" class="addinputw" placeholder="请填写名称"></el-input>
</el-form-item>
<el-form-item label="卡号">
<el-input v-model="listQuery.params.code" clearable placeholder="" class="addinputw" placeholder="请填写卡号"></el-input>
</el-form-item>
<!-- <el-form-item label="厂商办公电话"> <!-- <el-form-item label="厂商办公电话">
<el-input v-model="listQuery.params.manufacturerTelePhone" maxlength="130" placeholder="" class="addinputw" clearable/> <el-input v-model="listQuery.params.manufacturerTelePhone" maxlength="130" placeholder="" class="addinputw" clearable/>
</el-form-item> </el-form-item>
@ -31,12 +41,14 @@
<div class="listtop"> <div class="listtop">
<div class="tit">设备日志信息列表</div> <div class="tit">设备日志信息列表</div>
<!-- 翻页分页 --> <!-- 翻页分页 -->
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> <pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="getList" />
</div> </div>
<div> <div>
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange"> <el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;"
<el-table-column type="selection" align="center" width="50"/> @selection-change="handleSelectionChange">
<el-table-column label="序号" fixed type="index" width="80" :index="indexMethod" align="center"/> <el-table-column type="selection" align="center" width="50" />
<el-table-column label="序号" fixed type="index" width="80" :index="indexMethod" align="center" />
<!-- <el-table-column label="操作" fixed align="center" width="160px" class-name="small-padding fixed-width"> <!-- <el-table-column label="操作" fixed align="center" width="160px" class-name="small-padding fixed-width">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-button size="mini" type="primary" :disabled="!row.isShow && (row.supplierTypeValue === '主机厂' || row.supplierTypeValue === '分公司')" @click="handleEdit(row)">编辑</el-button> <el-button size="mini" type="primary" :disabled="!row.isShow && (row.supplierTypeValue === '主机厂' || row.supplierTypeValue === '分公司')" @click="handleEdit(row)">编辑</el-button>
@ -48,56 +60,37 @@
<span class="bluezi" @click="handleCheck(scope.row)">{{ scope.row.bianma }}</span> <span class="bluezi" @click="handleCheck(scope.row)">{{ scope.row.bianma }}</span>
</template> </template>
</el-table-column> --> </el-table-column> -->
<el-table-column prop="jc" label="设备编码" header-align="center" align="center"> <el-table-column prop="jc" label="时间" header-align="center" align="center">
<template slot-scope="scope">
<span>{{ scope.row.bianma }}</span>
</template>
</el-table-column>
<el-table-column label="设备类型" width="110" align="center">
<template slot-scope="scope">
<span>{{ scope.row.supplierTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="设备位置" width="" header-align="center" align="center">
<template slot-scope="scope">
<span>{{ scope.row.weizhi }}</span>
</template>
</el-table-column>
<el-table-column label="出厂时间" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.time }}</span> <span>{{ scope.row.time }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="安装时间" align="center"> <el-table-column label="设备名称" width="" header-align="center" align="center">
<template slot-scope="scope">
<span>{{ scope.row.anzhuangtime }}</span>
</template>
</el-table-column>
<el-table-column label="供货商" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.gonghuashang }}</span> <span>{{ scope.row.deviceName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="生产厂家" align="center"> <el-table-column label="地点名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.gonghuashang }}</span> <span>{{ scope.row.position }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="保修截止日期" align="center"> <el-table-column label="名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.gonghuashang }}</span> <span>{{ scope.row.name }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center"> <el-table-column label="卡号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.gonghuashang }}</span> <span>{{ scope.row.code }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="pages"> <div class="pages">
<!-- 翻页 --> <!-- 翻页 -->
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> <pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="getList" />
</div> </div>
</div> </div>
</div> </div>
@ -107,303 +100,325 @@
</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 baojingchaxunAdd from './baojingchaxunAdd' // import baojingchaxunAdd from './baojingchaxunAdd'
// import baojingchaxunInfo from './baojingchaxunInfo' // import baojingchaxunInfo from './baojingchaxunInfo'
// import req from '@/api/baojingchaxun/baojingchaxun' // import req from '@/api/baojingchaxun/baojingchaxun'
export default { export default {
name: 'baojingchaxunList', name: 'baojingchaxunList',
components: { components: {
Pagination, Pagination,
pageye, pageye,
ButtonBar, ButtonBar,
// baojingchaxunAdd, // baojingchaxunAdd,
// baojingchaxunInfo, // baojingchaxunInfo,
}, },
data() { data() {
return { return {
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', // type: 'danger',
// size: 'small', // size: 'small',
// icon: 'del', // icon: 'del',
// btnKey: 'doDel', // btnKey: 'doDel',
// btnLabel: '' // btnLabel: ''
// }, // },
// { // {
// type: 'primary', // type: 'primary',
// size: 'small', // size: 'small',
// icon: '', // icon: '',
// btnKey: 'toChangShang', // btnKey: 'toChangShang',
// btnLabel: '' // btnLabel: ''
// }, // },
// { // {
// type: 'primary', // type: 'primary',
// size: 'small', // size: 'small',
// icon: '', // icon: '',
// btnKey: 'toGain', // btnKey: 'toGain',
// btnLabel: '' // btnLabel: ''
// }, // },
// { // {
// type: 'success', // type: 'success',
// size: 'small', // size: 'small',
// icon: 'export', // icon: 'export',
// btnKey: 'build', // btnKey: 'build',
// btnLabel: '' // btnLabel: ''
// }, // },
{ {
type: 'info', type: 'info',
size: 'small', size: 'small',
icon: 'cross', icon: 'cross',
btnKey: 'doClose', btnKey: 'doClose',
btnLabel: '关闭' btnLabel: '关闭'
} }
], ],
viewState: 1, viewState: 1,
isSearchShow: false, isSearchShow: false,
searchxianshitit: '显示查询条件', searchxianshitit: '显示查询条件',
sids: [], sids: [],
// ----------- // -----------
tableKey: 0, tableKey: 0,
list: [{bianma:'212233433',supplierTypeValue:'222',weizhi:'212233433',time:'2023-02-26',anzhuangtime:'2023-02-26',gonghuashang:'222' list: [
,supplierTypeValue:'222',zhuangtai:'222'} { time: '2023-05-23 16:10:20', deviceName: '巡更点1', position: '东岸广场西侧东门', name: '闫永军', code: 'KTIO00065' },
], { time: '2023-05-23 16:10:20', deviceName: '巡更点1', position: '东岸广场西侧东门', name: '闫永军', code: 'KTIO00065' },
listLoading: false, { time: '2023-05-23 16:10:20', deviceName: '巡更点2', position: '东岸广场西侧走廊', name: '冷柠', code: 'KTIO00065' },
listQuery: { { time: '2023-05-23 16:10:20', deviceName: '巡更点4', position: '东岸广场东侧东门', name: '冷柠', code: 'KTIO00065' },
params: { { time: '2023-05-23 16:10:20', deviceName: '巡更点3', position: '2F走廊西侧', name: '冷柠', code: 'KTIO00065' },
manufacturerName: '', { time: '2023-05-23 16:10:20', deviceName: '巡更点5', position: '2F大厅', name: '冷柠', code: 'KTIO00065' },
supplierType: '', { time: '2023-05-23 16:10:20', deviceName: '巡更点2', position: '2F206控制系统门口', name: '冷柠', code: 'KTIO00065' },
useOrgSid: '', { time: '2023-05-23 16:10:20', deviceName: '巡更点4', position: '2F206控制系统门口', name: '冷柠', code: 'KTIO00065' },
createOrgSid: '', { time: '2023-05-23 16:10:20', deviceName: '巡更点1', position: '2F走廊西侧', name: '闫阵', code: 'KTIO00065' },
manufacturerTelePhone: '', ],
contactName: '' listLoading: false,
listQuery: {
params: {
manufacturerName: '',
supplierType: '',
useOrgSid: '',
createOrgSid: '',
manufacturerTelePhone: '',
contactName: ''
},
current: 1,
size: 5,
total: 0
}, },
current: 1, supplierType_list: [
size: 5, { title: '巡更点1', id: '1' },
total: 0 { title: '巡更点2', id: '2' },
}, { title: '巡更点3', id: '3' },
supplierType_list: [], { title: '巡更点4', id: '4' },
rules: {} { title: '巡更点5', id: '5' },
}
}, ],
mounted() { rules: {}
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
//
// this.init()
},
methods: {
resetState() {
this.viewState = 1
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doDel':
this.doDel()
break
case 'toChangShang':
this.toChangShang()
break
case 'toGain':
this.toGain()
break
case 'doExport':
this.doExport()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
} }
}, },
// init() { mounted() {
// getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => { this.$refs['btnbar'].setButtonList(this.btnList)
// if (res.success) {
// this.listQuery.params.createOrgSid = res.data
// this.getType()
// this.getList()
// }
// })
// },
// getType() {
// typeValues({
// type: 'supplierType'
// }).then((res) => {
// if (res.code === '200') {
// this.supplierType_list = res.data
// console.log('', this.supplierType_list)
// }
// })
// },
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
}, },
// created() {
getList() { //
// this.listLoading = true
// req.gysPagerList(this.listQuery).then((response) => {
// this.listLoading = false
// 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
// }
// })
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
handleReset() {
// this.listQuery = {
// params: {
// manufacturerName: '',
// supplierType: '',
// useOrgSid: '',
// createOrgSid: '',
// manufacturerTelePhone: '',
// contactName: ''
// },
// current: 1,
// size: 5
// }
// this.init() // this.init()
}, },
// methods: {
toAdd() { getPosition(item) {
this.viewState = 2 for (var i = 0; i < this.supplierType_list.length; i++) {
this.$refs['divadd'].showAdd(this.listQuery.params.createOrgSid) if (this.supplierType_list[i].id == item) {
}, return this.supplierType_list[i].title
}
}
},
resetState() {
this.viewState = 1
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doDel':
this.doDel()
break
case 'toChangShang':
this.toChangShang()
break
case 'toGain':
this.toGain()
break
case 'doExport':
this.doExport()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
// init() {
// getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => {
// if (res.success) {
// this.listQuery.params.createOrgSid = res.data
// this.getType()
// this.getList()
// }
// })
// },
// getType() {
// typeValues({
// type: 'supplierType'
// }).then((res) => {
// if (res.code === '200') {
// this.supplierType_list = res.data
// console.log('', this.supplierType_list)
// }
// })
// },
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
getList() {
// this.listLoading = true
// req.gysPagerList(this.listQuery).then((response) => {
// this.listLoading = false
// 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
// }
// })
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
handleReset() {
// this.listQuery = {
// params: {
// manufacturerName: '',
// supplierType: '',
// useOrgSid: '',
// createOrgSid: '',
// manufacturerTelePhone: '',
// contactName: ''
// },
// current: 1,
// size: 5
// }
// this.init()
},
//
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd(this.listQuery.params.createOrgSid)
},
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() loading.close()
this.$message({ type: 'success', message: resp.msg, showClose: true }) this.$message({ type: 'success', message: resp.msg, showClose: true })
this.getList() this.getList()
} else { } else {
loading.close()
}
}).catch(e => {
loading.close() loading.close()
} })
}).catch(e => { }).catch(() => {
loading.close()
}) })
}).catch(() => { } else {
}) this.$message({ type: 'error', message: '没有选择!!', showClose: true })
} else { return
this.$message({ type: 'error', message: '没有选择!!', showClose: true }) }
return },
// 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)
// 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() {
// 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)
// 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>
</style> </style>

415
src/views/shebeitaizhang/shebeitaizhangAdd.vue

@ -16,77 +16,103 @@
</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="manufacturerName"> <el-form-item prop="">
<el-input v-model="addForm.manufacturerName" maxlength="20" placeholder="" class="addinputw" clearable/> <el-input v-model="addForm.manufacturerName" maxlength="20" placeholder="请填写设备编码" class="addinputw"
clearable />
</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> <el-form-item>
<el-input v-model="addForm.manufacturerAs" maxlength="20" placeholder="" class="addinputw" clearable/> <el-input v-model="addForm.manufacturerAs" maxlength="20" placeholder="请填写设备位置 " 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 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="manufacturerCode"> <!-- <el-form-item prop="">
<el-input v-model="addForm.manufacturerCode" :disabled="!isShow" maxlength="20" placeholder="请填写金蝶供应商编码,如无请自己创建编码" class="addinputw" clearable/> <el-input v-model="addForm.manufacturerCode" :disabled="!isShow" maxlength="20"
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"
class="addinputw" />
</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 class="icon">*</span>分类</span> <span>安装时间</span>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="supplierTypeValue"> <el-form-item prop="">
<el-select v-model="addForm.supplierTypeValue" class="addinputw" placeholder="" @change="changeSupplierType"> <!-- <el-input v-model="addForm.manufacturerCode" :disabled="!isShow" maxlength="20"
<el-option v-for="item in supplierType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue" :disabled="item.dictValue === '主机厂' || item.dictValue === '分公司'"/> placeholder="请填写金蝶供应商编码,如无请自己创建编码" class="addinputw" clearable /> -->
</el-select> <el-date-picker type="date" placeholder="选择日期" v-model="addForm.manufacturerCode" style="width: 410px;"
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="20"> <el-col :span="8">
<el-form-item prop="manufacturerAddress"> <el-form-item prop="">
<el-input v-model="addForm.manufacturerAddress" maxlength="80" placeholder="" class="addinputw addinputw01" clearable/> <el-input v-model="addForm.manufacturerCode" :disabled="!isShow" maxlength="20" placeholder="请填写供应商编码"
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>
<el-col :span="8"> <el-col :span="8">
<el-form-item> <el-form-item>
<el-input v-model="addForm.manufacturerTelePhone" maxlength="20" placeholder="例:010-88888888" class="addinputw" clearable/> <el-input v-model="addForm.manufacturerTelePhone" maxlength="20" placeholder="请填写生产厂家编码"
class="addinputw" clearable />
</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> <el-form-item>
<el-input v-model="addForm.manufacturerFax" maxlength="20" placeholder="例:010-88888888" class="addinputw" clearable/> <!-- <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;"
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>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="contactName"> <el-form-item prop="contactName">
<el-input v-model="addForm.contactName" maxlength="5" placeholder="" class="addinputw" clearable/> <el-input v-model="addForm.contactName" maxlength="5" placeholder="" class="addinputw" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4" class="tleftb"> <el-col :span="4" class="tleftb">
@ -94,7 +120,7 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="contactMobile"> <el-form-item prop="contactMobile">
<el-input v-model="addForm.contactMobile" maxlength="11" placeholder="" class="addinputw" clearable/> <el-input v-model="addForm.contactMobile" maxlength="11" placeholder="" class="addinputw" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -104,7 +130,8 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item> <el-form-item>
<el-input v-model="addForm.contactTelePhone" maxlength="14" placeholder="例:010-88888888" class="addinputw" clearable/> <el-input v-model="addForm.contactTelePhone" maxlength="14" placeholder="例:010-88888888"
class="addinputw" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4" class="tleftb"> <el-col :span="4" class="tleftb">
@ -112,7 +139,7 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item prop="weChatID"> <el-form-item prop="weChatID">
<el-input v-model="addForm.weChatID" maxlength="100" placeholder="" class="addinputw" clearable/> <el-input v-model="addForm.weChatID" maxlength="100" placeholder="" class="addinputw" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -122,7 +149,7 @@
</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.zipCode" maxlength="20" placeholder="" class="addinputw" clearable/> <el-input v-model="addForm.zipCode" maxlength="20" placeholder="" class="addinputw" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4" class="tleftb"> <el-col :span="4" class="tleftb">
@ -130,10 +157,10 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item> <el-form-item>
<el-input v-model="addForm.email" maxlength="20" placeholder="" class="addinputw" clearable/> <el-input v-model="addForm.email" maxlength="20" placeholder="" class="addinputw" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row> -->
</el-form> </el-form>
</div> </div>
@ -142,177 +169,183 @@
</template> </template>
<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'
export default { export default {
name: 'shebeitaizhangAdd', name: 'shebeitaizhangAdd',
data() { data() {
var checkSubmit = (rule, value, callback) => { var checkSubmit = (rule, value, callback) => {
const Submit = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/ const Submit = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
if (Submit.test(value)) { if (Submit.test(value)) {
return callback() return callback()
}
callback(new Error('请输入手机号'))
}
var checkChuanzhen = (rule, value, callback) => {
const BanGongDianHua = /\d{3}-\d{8}|\d{4}-\d{7}/
if (value) {
//
if (!BanGongDianHua.test(value)) {
callback(new Error('请输入正确的传真格式'))
} }
callback() callback(new Error('请输入手机号'))
} else {
callback()
} }
} var checkChuanzhen = (rule, value, callback) => {
return { const BanGongDianHua = /\d{3}-\d{8}|\d{4}-\d{7}/
tableKey: 0, if (value) {
index: 0, //
viewState: 1, if (!BanGongDianHua.test(value)) {
viewTitle: '', callback(new Error('请输入正确的传真格式'))
dialogStatus: '',
sid: '',
isShow: true,
supplierType_list: [],
addForm: {
manufacturerName: '',
manufacturerAs: '',
manufacturerCode: '',
supplierType: '',
supplierTypeValue: '',
manufacturerAddress: '',
manufacturerTelePhone: '',
manufacturerFax: '',
contactName: '',
contactMobile: '',
contactTelePhone: '',
weChatID: '',
zipCode: '',
email: '',
createOrg: '',
useOrg: ''
},
baseManufacturerBankDto: [],
rules: {
manufacturerName: [{
required: true,
message: '请填写供应商名称',
trigger: 'blur'
}],
supplierTypeValue: [{
required: true,
message: '请选择分类',
trigger: 'change'
}],
manufacturerAddress: [{
required: true,
message: '请填写供应商通讯地址',
trigger: 'blur'
}],
manufacturerFax: [{
required: true,
validator: checkChuanzhen,
trigger: 'blur'
}],
contactName: [{
required: true,
message: '请填写联系人名字',
trigger: 'blur'
}],
contactMobile: [{
required: true,
validator: checkSubmit,
trigger: 'blur'
}],
manufacturerCode: [{
required: true,
message: '编码不能为空',
trigger: 'blur'
}]
},
submitdisabled: false
}
},
methods: {
init() {
typeValues({ type: 'supplierType' }).then((res) => {
if (res.success) {
this.supplierType_list = res.data
}
})
},
changeSupplierType(value) {
let bb = null
this.supplierType_list.forEach((e) => {
if (e.dictValue === value) {
bb = {
key: e.dictKey,
value: e.dictValue
} }
callback()
} else {
callback()
} }
}) }
this.addForm.supplierType = bb.key return {
tableKey: 0,
index: 0,
viewState: 1,
viewTitle: '',
dialogStatus: '',
sid: '',
isShow: true,
supplierType_list: [
{ title: '入侵报警', id: '1' },
{ title: '电子围栏', id: '2' },
{ title: '门禁报警', id: '3' },
{ title: '监控报警', id: '4' },
{ title: '设备离线', id: '5' },
],
addForm: {
manufacturerName: '',
manufacturerAs: '',
manufacturerCode: '',
supplierType: '',
supplierTypeValue: '',
manufacturerAddress: '',
manufacturerTelePhone: '',
manufacturerFax: '',
contactName: '',
contactMobile: '',
contactTelePhone: '',
weChatID: '',
zipCode: '',
email: '',
createOrg: '',
useOrg: ''
},
baseManufacturerBankDto: [],
rules: {
manufacturerName: [{
required: true,
message: '请填写供应商名称',
trigger: 'blur'
}],
supplierTypeValue: [{
required: true,
message: '请选择分类',
trigger: 'change'
}],
manufacturerAddress: [{
required: true,
message: '请填写供应商通讯地址',
trigger: 'blur'
}],
manufacturerFax: [{
required: true,
validator: checkChuanzhen,
trigger: 'blur'
}],
contactName: [{
required: true,
message: '请填写联系人名字',
trigger: 'blur'
}],
contactMobile: [{
required: true,
validator: checkSubmit,
trigger: 'blur'
}],
manufacturerCode: [{
required: true,
message: '编码不能为空',
trigger: 'blur'
}]
},
submitdisabled: false
}
}, },
handleSave() { methods: {
this.$refs['form_obj'].validate(valid => { init() {
if (valid) { typeValues({ type: 'supplierType' }).then((res) => {
this.submitdisabled = true if (res.success) {
const formobj = { this.supplierType_list = res.data
baseManufacturerBankDto: this.baseManufacturerBankDto,
addForm: this.addForm
} }
if (this.dialogStatus === 'add') { })
req.save(formobj).then(resp => { },
this.submitdisabled = false changeSupplierType(value) {
if (resp.success) { let bb = null
this.$message({ showClose: true, type: 'success', message: resp.msg }) this.supplierType_list.forEach((e) => {
this.handleReturn('true') if (e.dictValue === value) {
} bb = {
}).catch(() => { key: e.dictKey,
this.submitdisabled = false value: e.dictValue
}) }
} else if (this.dialogStatus === 'edit') {
req.update(formobj, this.sid).then(resp => {
this.submitdisabled = false
if (resp.success) {
this.$message({ showClose: true, type: 'success', message: resp.msg })
this.handleReturn('true')
}
}).catch(() => {
this.submitdisabled = false
})
} }
} else { })
return false this.addForm.supplierType = bb.key
} },
}) handleSave() {
}, this.$refs['form_obj'].validate(valid => {
handleReturn(isreload) { if (valid) {
if (isreload === 'true') this.$emit('reloadlist') this.submitdisabled = true
this.dialogStatus = '' const formobj = {
this.sid = '' baseManufacturerBankDto: this.baseManufacturerBankDto,
this.addForm = {} addForm: this.addForm
this.baseManufacturerBankDto = [] }
this.isShow = true if (this.dialogStatus === 'add') {
this.$refs['form_obj'].resetFields() req.save(formobj).then(resp => {
this.$emit('doback') this.submitdisabled = false
if (resp.success) {
this.$message({ showClose: true, type: 'success', message: resp.msg })
this.handleReturn('true')
}
}).catch(() => {
this.submitdisabled = false
})
} else if (this.dialogStatus === 'edit') {
req.update(formobj, this.sid).then(resp => {
this.submitdisabled = false
if (resp.success) {
this.$message({ showClose: true, type: 'success', message: resp.msg })
this.handleReturn('true')
}
}).catch(() => {
this.submitdisabled = false
})
}
} else {
return false
}
})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.dialogStatus = ''
this.sid = ''
this.addForm = {}
this.baseManufacturerBankDto = []
this.isShow = true
this.$refs['form_obj'].resetFields()
this.$emit('doback')
}
} }
} }
}
</script> </script>
<style scoped> <style scoped>
.divStyle { .divStyle {
padding: 7px; padding: 7px;
font-weight: bold; font-weight: bold;
font-size: 16px; font-size: 16px;
background-color: #0294d7; background-color: #0294d7;
text-align: left; text-align: left;
color: #ffffff; color: #ffffff;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
</style> </style>

172
src/views/shebeitaizhang/shebeitaizhangInfo.vue

@ -14,7 +14,7 @@
</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>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item> <el-form-item>
@ -22,7 +22,7 @@
</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> <el-form-item>
@ -32,15 +32,15 @@
</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>
<el-col :span="8"> <el-col :span="8">
<el-form-item> <el-form-item>
<span>{{ infoForm.manufacturerCode }}</span> <span>{{ getSupplierType(infoForm.manufacturerCode) }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4" class="tleftb"> <el-col :span="4" class="tleftb">
<span><span class="icon">*</span>分类</span> <span>安装时间</span>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item> <el-form-item>
@ -50,83 +50,55 @@
</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>
</el-col>
<el-col :span="20">
<el-form-item>
<span>{{ infoForm.manufacturerAddress }}</span>
</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>
<span>{{ infoForm.manufacturerTelePhone }}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>传真</span>
</el-col>
<el-col :span="8">
<el-form-item>
<span>{{ infoForm.manufacturerFax }}</span>
</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>
<el-col :span="8"> <el-col :span="8">
<el-form-item> <el-form-item>
<span>{{ infoForm.contactName }}</span> <span>{{ infoForm.manufacturer }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4" class="tleftb"> <el-col :span="4" class="tleftb">
<span><span class="icon">*</span>联系人手机号</span> <span>供货商</span>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item> <el-form-item>
<span>{{ infoForm.contactMobile }}</span> <span>{{ infoForm.manufacturerAddress }}</span>
</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>
<el-col :span="8"> <el-col :span="8">
<el-form-item> <el-form-item>
<span>{{ infoForm.contactTelePhone }}</span> <span>{{ infoForm.manufacturerTelePhone }}</span>
</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> <el-form-item>
<span>{{ infoForm.weChatID }}</span> <span>{{ infoForm.manufacturerFax }}</span>
</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>
<el-col :span="8"> <el-col :span="8">
<el-form-item> <el-form-item>
<span>{{ infoForm.zipCode }}</span> <span>{{ getStatus(infoForm.status) }}</span>
</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> <el-form-item>
<span>{{ infoForm.email }}</span> <span></span>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -155,58 +127,72 @@
</template> </template>
<script> <script>
// import req from '@/api/shebeitaizhang/shebeitaizhang' // import req from '@/api/shebeitaizhang/shebeitaizhang'
export default { export default {
name: 'shebeitaizhangInfo', name: 'shebeitaizhangInfo',
data() { data() {
return { return {
// tableKey: 0, // tableKey: 0,
// index: 0, // index: 0,
viewTitle: '', viewTitle: '',
// supplierType_list: [], supplierType_list: [
infoForm: { { title: '摄像机', id: '1' },
manufacturerName: '111', ],
manufacturerAs: '222', status_list: [
manufacturerCode: '333', { title: '已损坏', id: '1' },
supplierType: '444', { title: '已维修', id: '2' },
supplierTypeValue: '455', { title: '完好', id: '3' },
manufacturerAddress: '666', ],
manufacturerTelePhone: '777', infoForm: {
manufacturerFax: '888', manufacturerName: 'KD-22',
contactName: '999', manufacturerAs: '2F金陵文脉',
contactMobile: '12', manufacturerCode: '1',
contactTelePhone: '133', supplierTypeValue: '2023-02-26 16:00:00',
weChatID: '1112222', manufacturerAddress: '大华',
zipCode: '1555', manufacturer: '2023-02-26 12:00:00',
email: '166', manufacturerTelePhone: '大华科技',
createOrg: '1777', manufacturerFax: '2023-05-23',
useOrg: '1888' status:'1'
}, },
// baseManufacturerBankDto: [], // baseManufacturerBankDto: [],
rules: {}, rules: {},
// submitdisabled: false // submitdisabled: false
} }
},
methods: {
showInfo(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.viewTitle = '设备台账详情'
// req.fetchBySid(row.sid).then(resp => {
// this.infoForm = resp.data.infoForm
// this.baseManufacturerBankDto = resp.data.baseManufacturerBankDto
// }).catch(e => {
// this.formobj = row
// })
}, },
handleReturn() { methods: {
this.$emit('doback') 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
}
}
},
getSupplierType(item) {
for (var i = 0; i < this.supplierType_list.length; i++) {
if (this.supplierType_list[i].id == item) {
return this.supplierType_list[i].title
}
}
},
showInfo(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.viewTitle = '设备台账详情'
// req.fetchBySid(row.sid).then(resp => {
// this.infoForm = resp.data.infoForm
// this.baseManufacturerBankDto = resp.data.baseManufacturerBankDto
// }).catch(e => {
// this.formobj = row
// })
},
handleReturn() {
this.$emit('doback')
}
} }
} }
}
</script> </script>
<style scoped> <style scoped>
</style> </style>

658
src/views/shebeitaizhang/shebeitaizhangList.vue

@ -1,18 +1,20 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div v-show="viewState == 1"> <div v-show="viewState == 1">
<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">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button> <el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<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-input v-model="listQuery.params.manufacturerName" clearable placeholder="" class="addinputw"></el-input> <el-select v-model="listQuery.params.supplierType" filterable clearable placeholder="请选择设备类型">
<el-option v-for="item in supplierType_list" :key="item.id" :label="item.title" :value="item.id" />
</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.params.supplierType" filterable clearable placeholder="请选择楼层">
<el-option v-for="item in supplierType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/> <el-option v-for="item in floor_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="厂商办公电话">
@ -31,16 +33,21 @@
<div class="listtop"> <div class="listtop">
<div class="tit">设备台账信息列表</div> <div class="tit">设备台账信息列表</div>
<!-- 翻页分页 --> <!-- 翻页分页 -->
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> <pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="getList" />
</div> </div>
<div> <div>
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange"> <el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;"
<el-table-column type="selection" align="center" width="50"/> @selection-change="handleSelectionChange">
<el-table-column label="序号" fixed type="index" width="80" :index="indexMethod" align="center"/> <el-table-column type="selection" align="center" width="50" />
<el-table-column label="序号" fixed type="index" width="80" :index="indexMethod" align="center" />
<el-table-column label="操作" fixed align="center" width="160px" class-name="small-padding fixed-width"> <el-table-column label="操作" fixed align="center" width="160px" class-name="small-padding fixed-width">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-button size="mini" type="primary" :disabled="!row.isShow && (row.supplierTypeValue === '主机厂' || row.supplierTypeValue === '分公司')" @click="handleEdit(row)">编辑</el-button> <el-button size="mini" type="primary"
:disabled="!row.isShow && (row.supplierTypeValue === '主机厂' || row.supplierTypeValue === '分公司')"
@click="handleEdit(row)">编辑</el-button>
<el-button size="mini" type="primary" @click="handleCheck(row)">详情</el-button> <el-button size="mini" type="primary" @click="handleCheck(row)">详情</el-button>
<!-- <el-button size="mini" type="primary">处理</el-button> -->
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="jc" label="设备" width="220" header-align="center" align="center"> <!-- <el-table-column prop="jc" label="设备" width="220" header-align="center" align="center">
@ -55,7 +62,7 @@
</el-table-column> </el-table-column>
<el-table-column label="设备类型" width="110" align="center"> <el-table-column label="设备类型" width="110" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.supplierTypeValue }}</span> <span>{{ getSupplierType(scope.row.supplierTypeValue) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="设备位置" width="" header-align="center" align="center"> <el-table-column label="设备位置" width="" header-align="center" align="center">
@ -80,336 +87,377 @@
</el-table-column> </el-table-column>
<el-table-column label="生产厂家" align="center"> <el-table-column label="生产厂家" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.gonghuashang }}</span> <span>{{ scope.row.owner }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="保修截止日期" align="center"> <el-table-column label="保修截止日期" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.gonghuashang }}</span> <span>{{ scope.row.policeTime }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center"> <el-table-column label="状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.gonghuashang }}</span> <span v-if="scope.row.status == 1" style="color:red">{{ getStatus(scope.row.status) }}</span>
<span v-if="scope.row.status == 2" style="color:orange">{{ getStatus(scope.row.status) }}</span>
<span v-if="scope.row.status == 3" style="color:green">{{ getStatus(scope.row.status) }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="pages"> <div class="pages">
<!-- 翻页 --> <!-- 翻页 -->
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> <pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="getList" />
</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 req from '@/api/shebeitaizhang/shebeitaizhang'
export default { export default {
name: 'shebeitaizhangList', name: 'shebeitaizhangList',
components: { components: {
Pagination, Pagination,
pageye, pageye,
ButtonBar, ButtonBar,
shebeitaizhangAdd, shebeitaizhangAdd,
shebeitaizhangInfo, shebeitaizhangInfo,
},
data() {
return {
btndisabled: false,
btnList: [
{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'danger',
size: 'small',
icon: 'del',
btnKey: 'doDel',
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:'212233433',supplierTypeValue:'222',weizhi:'212233433',time:'2023-02-26',anzhuangtime:'2023-02-26',gonghuashang:'222'
,supplierTypeValue:'222',zhuangtai:'222'}
],
listLoading: false,
listQuery: {
params: {
manufacturerName: '',
supplierType: '',
useOrgSid: '',
createOrgSid: '',
manufacturerTelePhone: '',
contactName: ''
},
current: 1,
size: 5,
total: 0
},
supplierType_list: [],
rules: {}
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
//
// this.init()
},
methods: {
resetState() {
this.viewState = 1
}, },
btnHandle(btnKey) { data() {
console.log('XXXXXXXXXXXXXXX ' + btnKey) return {
switch (btnKey) { btndisabled: false,
case 'toAdd': btnList: [
this.toAdd() {
break type: 'primary',
case 'doDel': size: 'small',
this.doDel() icon: 'plus',
break btnKey: 'toAdd',
case 'toChangShang': btnLabel: '新增'
this.toChangShang() },
break {
case 'toGain': type: 'danger',
this.toGain() size: 'small',
break icon: 'del',
case 'doExport': btnKey: 'doDel',
this.doExport() btnLabel: '删除'
break },
case 'doClose': // {
this.doClose() // type: 'primary',
break // size: 'small',
default: // icon: '',
break // btnKey: 'toChangShang',
} // btnLabel: ''
}, // },
// // {
clicksearchShow() { // type: 'primary',
this.isSearchShow = !this.isSearchShow // size: 'small',
if (this.isSearchShow) { // icon: '',
this.searchxianshitit = '隐藏查询条件' // btnKey: 'toGain',
} else { // btnLabel: ''
this.searchxianshitit = '显示查询条件' // },
{
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', 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', 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', 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', 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', 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', 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', 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', 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', 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', 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' },
],
floor_list: [
{ title: '一层', id: '1' },
{ title: '二层', id: '2' },
{ title: '三层', id: '3' },
{ title: '四层', id: '4' },
],
status_list: [
{ title: '已损坏', id: '1' },
{ title: '已维修', id: '2' },
{ title: '完好', id: '3' },
],
rules: {}
} }
}, },
// init() { mounted() {
// getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => { this.$refs['btnbar'].setButtonList(this.btnList)
// if (res.success) {
// this.listQuery.params.createOrgSid = res.data
// this.getType()
// this.getList()
// }
// })
// },
// getType() {
// typeValues({
// type: 'supplierType'
// }).then((res) => {
// if (res.code === '200') {
// this.supplierType_list = res.data
// console.log('', this.supplierType_list)
// }
// })
// },
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
}, },
// created() {
getList() { //
// this.listLoading = true
// req.gysPagerList(this.listQuery).then((response) => {
// this.listLoading = false
// 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
// }
// })
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
handleReset() {
// this.listQuery = {
// params: {
// manufacturerName: '',
// supplierType: '',
// useOrgSid: '',
// createOrgSid: '',
// manufacturerTelePhone: '',
// contactName: ''
// },
// current: 1,
// size: 5
// }
// this.init() // this.init()
}, },
// methods: {
toAdd() { getStatus(item) {
this.viewState = 2 for (var i = 0; i < this.status_list.length; i++) {
this.$refs['divadd'].showAdd(this.listQuery.params.createOrgSid) if (this.status_list[i].id == item) {
}, return this.status_list[i].title
}
}
},
getSupplierType(item) {
for (var i = 0; i < this.supplierType_list.length; i++) {
if (this.supplierType_list[i].id == item) {
return this.supplierType_list[i].title
}
}
},
resetState() {
this.viewState = 1
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doDel':
this.doDel()
break
case 'toChangShang':
this.toChangShang()
break
case 'toGain':
this.toGain()
break
case 'doExport':
this.doExport()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
// init() {
// getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => {
// if (res.success) {
// this.listQuery.params.createOrgSid = res.data
// this.getType()
// this.getList()
// }
// })
// },
// getType() {
// typeValues({
// type: 'supplierType'
// }).then((res) => {
// if (res.code === '200') {
// this.supplierType_list = res.data
// console.log('', this.supplierType_list)
// }
// })
// },
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
getList() {
// this.listLoading = true
// req.gysPagerList(this.listQuery).then((response) => {
// this.listLoading = false
// 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
// }
// })
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
handleReset() {
// this.listQuery = {
// params: {
// manufacturerName: '',
// supplierType: '',
// useOrgSid: '',
// createOrgSid: '',
// manufacturerTelePhone: '',
// contactName: ''
// },
// current: 1,
// size: 5
// }
// this.init()
},
//
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd(this.listQuery.params.createOrgSid)
},
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() loading.close()
this.$message({ type: 'success', message: resp.msg, showClose: true }) this.$message({ type: 'success', message: resp.msg, showClose: true })
this.getList() this.getList()
} else { } else {
loading.close()
}
}).catch(e => {
loading.close() loading.close()
} })
}).catch(e => { }).catch(() => {
loading.close()
}) })
}).catch(() => { } else {
}) this.$message({ type: 'error', message: '没有选择!!', showClose: true })
} else { return
this.$message({ type: 'error', message: '没有选择!!', showClose: true }) }
return },
// 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)
} }
},
// 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)
// 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>
</style> </style>

665
src/views/shebeizhuangtai/shebeizhuangtaiList.vue

@ -1,18 +1,19 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div v-show="viewState == 1"> <div v-show="viewState == 1">
<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">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button> <el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<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-input v-model="listQuery.params.manufacturerName" clearable placeholder=""
class="addinputw"></el-input>
</el-form-item> -->
<el-form-item label="设备类型"> <el-form-item label="设备类型">
<el-input v-model="listQuery.params.manufacturerName" clearable placeholder="" class="addinputw"></el-input> <el-select v-model="listQuery.params.supplierType" filterable clearable placeholder="请选择设备类型">
</el-form-item> <el-option v-for="item in supplierType_list" :key="item.id" :label="item.title" :value="item.id" />
<el-form-item label="选择楼层">
<el-select v-model="listQuery.params.supplierType" filterable clearable placeholder="请选择楼层">
<el-option v-for="item in supplierType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="厂商办公电话"> <!-- <el-form-item label="厂商办公电话">
@ -29,14 +30,16 @@
</div> </div>
</div> </div>
<div class="listtop"> <div class="listtop">
<div class="tit">设备状态信息列表</div> <div class="tit">报警查询信息列表</div>
<!-- 翻页分页 --> <!-- 翻页分页 -->
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> <pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="getList" />
</div> </div>
<div> <div>
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange"> <el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;"
<el-table-column type="selection" align="center" width="50"/> @selection-change="handleSelectionChange">
<el-table-column label="序号" fixed type="index" width="80" :index="indexMethod" align="center"/> <el-table-column type="selection" align="center" width="50" />
<el-table-column label="序号" fixed type="index" width="80" :index="indexMethod" align="center" />
<!-- <el-table-column label="操作" fixed align="center" width="160px" class-name="small-padding fixed-width"> <!-- <el-table-column label="操作" fixed align="center" width="160px" class-name="small-padding fixed-width">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-button size="mini" type="primary" :disabled="!row.isShow && (row.supplierTypeValue === '主机厂' || row.supplierTypeValue === '分公司')" @click="handleEdit(row)">编辑</el-button> <el-button size="mini" type="primary" :disabled="!row.isShow && (row.supplierTypeValue === '主机厂' || row.supplierTypeValue === '分公司')" @click="handleEdit(row)">编辑</el-button>
@ -48,22 +51,39 @@
<span class="bluezi" @click="handleCheck(scope.row)">{{ scope.row.bianma }}</span> <span class="bluezi" @click="handleCheck(scope.row)">{{ scope.row.bianma }}</span>
</template> </template>
</el-table-column> --> </el-table-column> -->
<!--
<el-table-column label="报警时间" align="center">
<template slot-scope="scope">
<span>{{ scope.row.policeTime }}</span>
</template>
</el-table-column>
<el-table-column label="设备位置" width="" header-align="center" align="center">
<template slot-scope="scope">
<span>{{ scope.row.weizhi }}</span>
</template>
</el-table-column> -->
<el-table-column label="设备类型" align="center">
<template slot-scope="scope">
<span>{{ getDeviceType(scope.row.deviceType) }}</span>
</template>
</el-table-column>
<el-table-column prop="jc" label="设备编码" header-align="center" align="center"> <el-table-column prop="jc" label="设备编码" header-align="center" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.bianma }}</span> <span>{{ scope.row.bianma }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="设备类型" width="110" align="center"> <el-table-column label="IP地址" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.supplierTypeValue }}</span> <span>{{ scope.row.ipAddress }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="设备位置" width="" header-align="center" align="center"> <el-table-column label="当前状态" width="110" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.weizhi }}</span> <span v-if="scope.row.supplierTypeValue == 1" style="color:green">{{ getSupplierType(scope.row.supplierTypeValue) }}</span>
<span v-if="scope.row.supplierTypeValue == 2" style="color:red">{{ getSupplierType(scope.row.supplierTypeValue) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="出厂时间" align="center"> <!-- <el-table-column label="出厂时间" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.time }}</span> <span>{{ scope.row.time }}</span>
</template> </template>
@ -80,24 +100,15 @@
</el-table-column> </el-table-column>
<el-table-column label="生产厂家" align="center"> <el-table-column label="生产厂家" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.gonghuashang }}</span> <span>{{ scope.row.owner }}</span>
</template>
</el-table-column>
<el-table-column label="保修截止日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.gonghuashang }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<span>{{ scope.row.gonghuashang }}</span>
</template> </template>
</el-table-column> </el-table-column> -->
</el-table> </el-table>
</div> </div>
<div class="pages"> <div class="pages">
<!-- 翻页 --> <!-- 翻页 -->
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> <pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="getList" />
</div> </div>
</div> </div>
</div> </div>
@ -107,303 +118,333 @@
</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 baojingchaxunAdd from './baojingchaxunAdd' // import baojingchaxunAdd from './baojingchaxunAdd'
// import baojingchaxunInfo from './baojingchaxunInfo' // import baojingchaxunInfo from './baojingchaxunInfo'
// import req from '@/api/baojingchaxun/baojingchaxun' // import req from '@/api/baojingchaxun/baojingchaxun'
export default { export default {
name: 'baojingchaxunList', name: 'baojingchaxunList',
components: { components: {
Pagination, Pagination,
pageye, pageye,
ButtonBar, ButtonBar,
// baojingchaxunAdd, // baojingchaxunAdd,
// baojingchaxunInfo, // baojingchaxunInfo,
}, },
data() { data() {
return { return {
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', // type: 'danger',
// size: 'small', // size: 'small',
// icon: 'del', // icon: 'del',
// btnKey: 'doDel', // btnKey: 'doDel',
// btnLabel: '' // btnLabel: ''
// }, // },
// { // {
// type: 'primary', // type: 'primary',
// size: 'small', // size: 'small',
// icon: '', // icon: '',
// btnKey: 'toChangShang', // btnKey: 'toChangShang',
// btnLabel: '' // btnLabel: ''
// }, // },
// { // {
// type: 'primary', // type: 'primary',
// size: 'small', // size: 'small',
// icon: '', // icon: '',
// btnKey: 'toGain', // btnKey: 'toGain',
// btnLabel: '' // btnLabel: ''
// }, // },
// { // {
// type: 'success', // type: 'success',
// size: 'small', // size: 'small',
// icon: 'export', // icon: 'export',
// btnKey: 'build', // btnKey: 'build',
// btnLabel: '' // btnLabel: ''
// }, // },
{ {
type: 'info', type: 'info',
size: 'small', size: 'small',
icon: 'cross', icon: 'cross',
btnKey: 'doClose', btnKey: 'doClose',
btnLabel: '关闭' btnLabel: '关闭'
} }
], ],
viewState: 1, viewState: 1,
isSearchShow: false, isSearchShow: false,
searchxianshitit: '显示查询条件', searchxianshitit: '显示查询条件',
sids: [], sids: [],
// ----------- // -----------
tableKey: 0, tableKey: 0,
list: [{bianma:'212233433',supplierTypeValue:'222',weizhi:'212233433',time:'2023-02-26',anzhuangtime:'2023-02-26',gonghuashang:'222' list: [
,supplierTypeValue:'222',zhuangtai:'222'} { bianma: 'Pro2160901', supplierTypeValue: '1', weizhi: '库房', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-18', deviceType: '1', ipAddress: '192.168.5.12' },
], { bianma: 'Pro2160902', supplierTypeValue: '1', weizhi: '观察', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-19', deviceType: '1', ipAddress: '192.168.5.13' },
listLoading: false, { bianma: 'Pro2160903', supplierTypeValue: '2', weizhi: '后院', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-19', deviceType: '2', ipAddress: '192.168.5.14' },
listQuery: { { bianma: 'Pro2160904', supplierTypeValue: '2', weizhi: '铁皮', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-20', deviceType: '2', ipAddress: '192.168.5.15' },
params: { { bianma: 'Pro2160905', supplierTypeValue: '2', weizhi: '盲点', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-20', deviceType: '2', ipAddress: '192.168.5.16' },
manufacturerName: '', { bianma: 'Pro2160906', supplierTypeValue: '1', weizhi: '凉亭', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-21', deviceType: '1', ipAddress: '192.168.5.17' },
supplierType: '', { bianma: 'Pro2160907', supplierTypeValue: '1', weizhi: '书房', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-23', deviceType: '1', ipAddress: '192.168.5.18' },
useOrgSid: '', { bianma: 'Pro2160908', supplierTypeValue: '2', weizhi: '藏经阁', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-23', deviceType: '2', ipAddress: '192.168.5.19' },
createOrgSid: '', { bianma: 'Pro2160909', supplierTypeValue: '1', weizhi: '车库', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-23', deviceType: '1', ipAddress: '192.168.5.20' },
manufacturerTelePhone: '', { bianma: 'ZYR2060810', supplierTypeValue: '2', weizhi: '斜坡', time: '2023-02-26', anzhuangtime: '2023-02-26', gonghuashang: 'Pepsi Cola', owner: 'Owner Peer', policeTime: '2023-05-23', deviceType: '1', ipAddress: '192.168.5.21' },
contactName: '' ],
listLoading: false,
listQuery: {
params: {
manufacturerName: '',
supplierType: '',
useOrgSid: '',
createOrgSid: '',
manufacturerTelePhone: '',
contactName: ''
},
current: 1,
size: 5,
total: 10
}, },
current: 1, supplierType_list: [
size: 5, { title: '在线', id: '1' },
total: 0 { title: '离线', id: '2' },
}, ],
supplierType_list: [], deviceType_list: [
rules: {} { title: '普通设备', id: '1' },
} { title: '人脸设备', id: '2' },
}, ],
mounted() { rules: {}
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
//
// this.init()
},
methods: {
resetState() {
this.viewState = 1
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doDel':
this.doDel()
break
case 'toChangShang':
this.toChangShang()
break
case 'toGain':
this.toGain()
break
case 'doExport':
this.doExport()
break
case 'doClose':
this.doClose()
break
default:
break
} }
}, },
// mounted() {
clicksearchShow() { this.$refs['btnbar'].setButtonList(this.btnList)
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
}, },
// init() { created() {
// getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => { //
// if (res.success) {
// this.listQuery.params.createOrgSid = res.data
// this.getType()
// this.getList()
// }
// })
// },
// getType() {
// typeValues({
// type: 'supplierType'
// }).then((res) => {
// if (res.code === '200') {
// this.supplierType_list = res.data
// console.log('', this.supplierType_list)
// }
// })
// },
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
getList() {
// this.listLoading = true
// req.gysPagerList(this.listQuery).then((response) => {
// this.listLoading = false
// 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
// }
// })
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
handleReset() {
// this.listQuery = {
// params: {
// manufacturerName: '',
// supplierType: '',
// useOrgSid: '',
// createOrgSid: '',
// manufacturerTelePhone: '',
// contactName: ''
// },
// current: 1,
// size: 5
// }
// this.init() // this.init()
}, },
// methods: {
toAdd() { getSupplierType(item) {
this.viewState = 2 for (var i = 0; i < this.supplierType_list.length; i++) {
this.$refs['divadd'].showAdd(this.listQuery.params.createOrgSid) if (this.supplierType_list[i].id == item) {
}, return this.supplierType_list[i].title
}
}
},
getDeviceType(item) {
for (var i = 0; i < this.deviceType_list.length; i++) {
if (this.deviceType_list[i].id == item) {
return this.deviceType_list[i].title
}
}
},
resetState() {
this.viewState = 1
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doDel':
this.doDel()
break
case 'toChangShang':
this.toChangShang()
break
case 'toGain':
this.toGain()
break
case 'doExport':
this.doExport()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
// init() {
// getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => {
// if (res.success) {
// this.listQuery.params.createOrgSid = res.data
// this.getType()
// this.getList()
// }
// })
// },
// getType() {
// typeValues({
// type: 'supplierType'
// }).then((res) => {
// if (res.code === '200') {
// this.supplierType_list = res.data
// console.log('', this.supplierType_list)
// }
// })
// },
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
getList() {
// this.listLoading = true
// req.gysPagerList(this.listQuery).then((response) => {
// this.listLoading = false
// 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
// }
// })
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
handleReset() {
// this.listQuery = {
// params: {
// manufacturerName: '',
// supplierType: '',
// useOrgSid: '',
// createOrgSid: '',
// manufacturerTelePhone: '',
// contactName: ''
// },
// current: 1,
// size: 5
// }
// this.init()
},
//
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd(this.listQuery.params.createOrgSid)
},
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() loading.close()
this.$message({ type: 'success', message: resp.msg, showClose: true }) this.$message({ type: 'success', message: resp.msg, showClose: true })
this.getList() this.getList()
} else { } else {
loading.close()
}
}).catch(e => {
loading.close() loading.close()
} })
}).catch(e => { }).catch(() => {
loading.close()
}) })
}).catch(() => { } else {
}) this.$message({ type: 'error', message: '没有选择!!', showClose: true })
} else { return
this.$message({ type: 'error', message: '没有选择!!', showClose: true }) }
return },
// 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)
// 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() {
// 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)
// 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>
</style> </style>
Loading…
Cancel
Save