master
lion 5 months ago
parent 21c865a602
commit 8596d31738

@ -6,15 +6,23 @@
<span>在册人员:{{ totalPerson }}</span> <span>在册人员:{{ totalPerson }}</span>
</div> </div>
<div class="tabs"> <div class="tabs">
<div :class="!addCur?'tabcur':''" @click="changeMask(1)">抢险队伍</div> <div :class="activeTab === 'teams' ? 'tabcur' : ''" @click="changeMask('teams')">抢险队伍</div>
<div :class="addCur?'tabcur':''"> <div
v-for="item in chubeileixingList"
:key="item.id"
:class="String(activeTab) === String(item.id) ? 'tabcur' : ''"
>
<el-dropdown :show-timeout="100" @command="clickQuyu"> <el-dropdown :show-timeout="100" @command="clickQuyu">
<span class="el-dropdown-link" @click="changeMask(2)"> <span class="el-dropdown-link" @click="selectChubeileixingTab(item)">
防汛仓库<i class="el-icon-arrow-down el-icon--right" /> {{ item.value }}<i class="el-icon-arrow-down el-icon--right" />
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="item in areaList" :command="item.id">{{ item.value }}</el-dropdown-item> <el-dropdown-item
v-for="area in areaList"
:key="area.id"
:command="{ areaId: area.id, chubeileixingId: item.id }"
>{{ area.value }}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
@ -94,13 +102,15 @@ export default {
storages: [] storages: []
}, },
areaList: [], areaList: [],
chubeileixingList: [],
activeTab: 'teams',
currentChubeileixing: '',
infoWindow: null, infoWindow: null,
openData: [], openData: [],
materList: [], materList: [],
quyu_id: '', quyu_id: '',
loading: true, loading: true,
total: 0, total: 0,
addCur: false,
loadingFull: null, loadingFull: null,
myicon:require('@/assets/icon1.png'), myicon:require('@/assets/icon1.png'),
table: [{ table: [{
@ -222,10 +232,11 @@ export default {
}) })
}, },
methods: { methods: {
getArea() { async getArea() {
getparameteritem('area').then(res => { const areaRes = await getparameteritem('area')
this.areaList = res.detail this.areaList = areaRes.detail || []
}) const chubeiRes = await getparameteritem('ck_chubeileixing')
this.chubeileixingList = chubeiRes.detail || []
}, },
initHeight() { initHeight() {
const winHeight = document.body.clientHeight const winHeight = document.body.clientHeight
@ -257,14 +268,20 @@ export default {
// this.setMapMarker() // this.setMapMarker()
}, },
changeMask(type) { changeMask(type) {
if (type == 1) { if (type === 'teams') {
this.addCur = false this.activeTab = 'teams'
this.currentChubeileixing = ''
this.setMapMarker('teams', this.makerObj.teams) this.setMapMarker('teams', this.makerObj.teams)
} else if (type == 2) { }
this.addCur = true },
this.quyu_id = '' selectChubeileixingTab(item) {
this.activeTab = String(item.id)
this.currentChubeileixing = item.id
if (this.quyu_id) {
this.getStorages() this.getStorages()
// this.setMapMarker("storages", this.makerObj.storages) } else {
this.makerObj.storages = []
this.setMapMarker('storages', [])
} }
}, },
async getTeams() { async getTeams() {
@ -296,12 +313,16 @@ export default {
this.loadingFull.close() this.loadingFull.close()
}) })
}, },
clickQuyu(e) { clickQuyu({ areaId, chubeileixingId }) {
console.log('e', e) this.activeTab = String(chubeileixingId)
this.quyu_id = e this.currentChubeileixing = chubeileixingId
this.quyu_id = areaId
this.getStorages() this.getStorages()
}, },
async getStorages() { async getStorages() {
if (!this.quyu_id || !this.currentChubeileixing) {
return
}
this.loadingFull = this.$loading({ this.loadingFull = this.$loading({
lock: true, lock: true,
text: '', text: '',
@ -309,30 +330,36 @@ export default {
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}) })
this.makerObj.storages = [] this.makerObj.storages = []
await index({ try {
page: 1, const res = await index({
page_size: 9999, page: 1,
table_name: 'materialstorages', page_size: 9999,
filter: [{ table_name: 'materialstorages',
key: 'quyu_id', filter: [{
op: 'eq', key: 'quyu_id',
value: this.quyu_id op: 'eq',
}] value: this.quyu_id
}).then(res => { }, {
const markers = [] key: 'chubeileixing',
if (res.data.length < 1) { op: 'eq',
return value: this.currentChubeileixing
} }]
res.data.map(item => {
this.makerObj.storages.push({
type: 'storages',
name: item.cangkumingcheng,
...item
})
}) })
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
this.makerObj.storages.push({
type: 'storages',
name: item.cangkumingcheng,
...item
})
})
}
this.setMapMarker('storages', this.makerObj.storages) this.setMapMarker('storages', this.makerObj.storages)
this.loadingFull.close() } finally {
}) if (this.loadingFull) {
this.loadingFull.close()
}
}
}, },
async getMater(id) { async getMater(id) {
const res = await index({ const res = await index({

@ -453,3 +453,5 @@
height: 300px; height: 300px;
} }
</style> </style>

@ -45,6 +45,30 @@
</div> </div>
</div> </div>
</template> </template>
<template v-slot:chubeileixing>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;" />储备类型:
</div>
<div class="xy-table-item-content">
<el-select v-model="form.chubeileixing" style="width:300px" placeholder="请选择储备类型" clearable>
<el-option v-for="item in chubeileixingList" :key="item.id" :label="item.value" :value="item.id" />
</el-select>
</div>
</div>
</template>
<template v-slot:chubeidengji>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;" />储备等级:
</div>
<div class="xy-table-item-content">
<el-select v-model="form.chubeidengji" style="width:300px" placeholder="请选择储备等级" clearable>
<el-option v-for="item in chubeidengjiList" :key="item.id" :label="item.value" :value="item.id" />
</el-select>
</div>
</div>
</template>
<template v-slot:shifouzili> <template v-slot:shifouzili>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
@ -276,7 +300,8 @@ import {
show show
} from '@/api/system/baseForm.js' } from '@/api/system/baseForm.js'
import { import {
getparameteritem getparameteritem,
getparameteritemMore
} from '@/api/system/dictionary.js' } from '@/api/system/dictionary.js'
import { import {
Message Message
@ -293,6 +318,8 @@ export default {
tableName: 'materialstorages', tableName: 'materialstorages',
// flood_storages // flood_storages
areaList: [], areaList: [],
chubeileixingList: [],
chubeidengjiList: [],
typelist: [], typelist: [],
mapparams: { mapparams: {
zoom: 11 zoom: 11
@ -302,6 +329,8 @@ export default {
storehouses_id: '', storehouses_id: '',
cangkumingcheng: '', cangkumingcheng: '',
cangkubianma: '', cangkubianma: '',
chubeileixing: '',
chubeidengji: '',
shifouzili: '否', shifouzili: '否',
shifouxunihuojia: '否', // 是否显示虚拟货架 shifouxunihuojia: '否', // 是否显示虚拟货架
sort: 0, sort: 0,
@ -359,6 +388,7 @@ export default {
}, },
created() { created() {
this.getArea() this.getArea()
this.getDictOptions()
}, },
methods: { methods: {
getArea() { getArea() {
@ -366,6 +396,20 @@ export default {
this.areaList = res.detail this.areaList = res.detail
}) })
}, },
async getDictOptions() {
const res = await getparameteritemMore({
'number[0]': 'ck_chubeileixing',
'number[1]': 'ck_chubeidengji'
})
res.forEach(item => {
if (item.number === 'ck_chubeileixing') {
this.chubeileixingList = item.detail || []
}
if (item.number === 'ck_chubeidengji') {
this.chubeidengjiList = item.detail || []
}
})
},
changeQuyu(e) { changeQuyu(e) {
if (e) { if (e) {
this.areaList.map(item => { this.areaList.map(item => {

@ -17,6 +17,12 @@
<Select v-model="select.shifouxunihuojia" style="width: 200px;margin-right: 10px;" placeholder="是否显示虚拟货架" clearable> <Select v-model="select.shifouxunihuojia" style="width: 200px;margin-right: 10px;" placeholder="是否显示虚拟货架" clearable>
<Option v-for="item in [{id:'是',value:'是'},{id:'否',value:'否'}]" :key="item.id" :value="item.id">{{ item.value }}</Option> <Option v-for="item in [{id:'是',value:'是'},{id:'否',value:'否'}]" :key="item.id" :value="item.id">{{ item.value }}</Option>
</Select> </Select>
<Select v-model="select.chubeileixing" style="width: 200px;margin-right: 10px;" placeholder="储备类型" clearable>
<Option v-for="item in chubeileixingList" :key="item.id" :value="item.id">{{ item.value }}</Option>
</Select>
<Select v-model="select.chubeidengji" style="width: 200px;margin-right: 10px;" placeholder="储备等级" clearable>
<Option v-for="item in chubeidengjiList" :key="item.id" :value="item.id">{{ item.value }}</Option>
</Select>
<Button type="primary" @click="select.page=1,getList()">查询</Button> <Button type="primary" @click="select.page=1,getList()">查询</Button>
<Button <Button
type="primary" type="primary"
@ -83,7 +89,8 @@ import {
import { getStorehouseTypeList } from '@/api/system/storehouseType' import { getStorehouseTypeList } from '@/api/system/storehouseType'
import addStorage from './components/addStorage.vue' import addStorage from './components/addStorage.vue'
import { import {
getparameteritem getparameteritem,
getparameteritemMore
} from '@/api/system/dictionary.js' } from '@/api/system/dictionary.js'
import shelf from './components/shelf.vue' import shelf from './components/shelf.vue'
export default { export default {
@ -101,9 +108,13 @@ export default {
area: '', area: '',
storehouses_id: '', storehouses_id: '',
shifouzili: '', shifouzili: '',
shifouxunihuojia: '' shifouxunihuojia: '',
chubeileixing: '',
chubeidengji: ''
}, },
areaList: [], areaList: [],
chubeileixingList: [],
chubeidengjiList: [],
total: 0, total: 0,
list: [], list: [],
typelist: [], typelist: [],
@ -131,6 +142,18 @@ export default {
align: 'left', align: 'left',
width: 120 width: 120
}, },
{
label: '储备类型',
prop: 'chubeileixing_parameter_details_id_relation.value',
align: 'center',
width: 120
},
{
label: '储备等级',
prop: 'chubeidengji_parameter_details_id_relation.value',
align: 'center',
width: 120
},
{ {
label: '是否纳入物资管理', label: '是否纳入物资管理',
prop: 'shifouzili', prop: 'shifouzili',
@ -183,6 +206,7 @@ export default {
}, },
created() { created() {
this.getArea() this.getArea()
this.getDictOptions()
this.getTypeList() this.getTypeList()
this.getList() this.getList()
}, },
@ -192,6 +216,20 @@ export default {
this.areaList = res.detail this.areaList = res.detail
}) })
}, },
async getDictOptions() {
const res = await getparameteritemMore({
'number[0]': 'ck_chubeileixing',
'number[1]': 'ck_chubeidengji'
})
res.forEach(item => {
if (item.number === 'ck_chubeileixing') {
this.chubeileixingList = item.detail || []
}
if (item.number === 'ck_chubeidengji') {
this.chubeidengjiList = item.detail || []
}
})
},
clearArea(e) { clearArea(e) {
if (e) { if (e) {
this.select.area = e this.select.area = e
@ -240,6 +278,14 @@ export default {
key: 'shifouxunihuojia', key: 'shifouxunihuojia',
op: 'eq', op: 'eq',
value: this.select.shifouxunihuojia ? this.select.shifouxunihuojia : '' value: this.select.shifouxunihuojia ? this.select.shifouxunihuojia : ''
}, {
key: 'chubeileixing',
op: 'eq',
value: this.select.chubeileixing ? this.select.chubeileixing : ''
}, {
key: 'chubeidengji',
op: 'eq',
value: this.select.chubeidengji ? this.select.chubeidengji : ''
}] }]
}) })

Loading…
Cancel
Save