master
lion 5 days ago
parent 21c865a602
commit 8596d31738

@ -6,15 +6,23 @@
<span>在册人员{{ totalPerson }}</span>
</div>
<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">
<span class="el-dropdown-link" @click="changeMask(2)">
防汛仓库<i class="el-icon-arrow-down el-icon--right" />
<span class="el-dropdown-link" @click="selectChubeileixingTab(item)">
{{ item.value }}<i class="el-icon-arrow-down el-icon--right" />
</span>
<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>
</div>
@ -94,14 +102,16 @@ export default {
storages: []
},
areaList: [],
chubeileixingList: [],
activeTab: 'teams',
currentChubeileixing: '',
infoWindow: null,
openData: [],
materList: [],
quyu_id: '',
loading: true,
total: 0,
addCur: false,
loadingFull: null,
loadingFull: null,
myicon:require('@/assets/icon1.png'),
table: [{
label: '序号',
@ -109,107 +119,107 @@ export default {
fixed: 'left',
width: 80
},
{
label: '物资代码',
width: 120,
prop: 'wuzidaima',
align: 'left'
},
{
label: '现物资名称',
width: 120,
prop: 'xianwuzimingcheng',
align: 'center'
},
{
label: '原物资名称',
width: 120,
prop: 'yuanwuzimingcheng',
align: 'left'
},
{
label: '物资型号',
width: 120,
prop: 'guigexinghao',
align: 'center'
},
{
label: '数量',
width: 80,
prop: 'shuliang',
align: 'center'
},
{
label: '单位',
width: 80,
prop: 'danwei',
align: 'center'
},
{
label: '价值(元)',
width: 80,
prop: 'jiazhiyuan',
align: 'center'
},
{
label: '生产日期',
width: 120,
prop: 'shengchanriqi',
align: 'center'
},
{
label: '入库日期',
width: 120,
prop: 'rukuriqi',
align: 'center'
},
{
label: '储备年限',
width: 80,
prop: 'chubeinianxian',
align: 'center'
},
{
label: '状态',
width: 80,
prop: 'zhuangtai',
align: 'center'
},
{
label: '资金来源',
width: 120,
prop: 'zijinlaiyuan',
align: 'center'
},
{
label: '储备方式',
width: 120,
prop: 'chubeifangshi',
align: 'center'
},
{
label: '储备地点',
width: 180,
prop: 'chubeididian',
align: 'left'
},
{
label: '备注',
width: 180,
prop: 'beizhu',
align: 'left'
},
{
label: '储备层级',
width: 120,
prop: 'chubeicengji',
align: 'left'
},
{
label: '是否展示',
width: 120,
prop: 'shifouzhanshi',
align: 'left'
{
label: '物资代码',
width: 120,
prop: 'wuzidaima',
align: 'left'
},
{
label: '现物资名称',
width: 120,
prop: 'xianwuzimingcheng',
align: 'center'
},
{
label: '原物资名称',
width: 120,
prop: 'yuanwuzimingcheng',
align: 'left'
},
{
label: '物资型号',
width: 120,
prop: 'guigexinghao',
align: 'center'
},
{
label: '数量',
width: 80,
prop: 'shuliang',
align: 'center'
},
{
label: '单位',
width: 80,
prop: 'danwei',
align: 'center'
},
{
label: '价值(元)',
width: 80,
prop: 'jiazhiyuan',
align: 'center'
},
{
label: '生产日期',
width: 120,
prop: 'shengchanriqi',
align: 'center'
},
{
label: '入库日期',
width: 120,
prop: 'rukuriqi',
align: 'center'
},
{
label: '储备年限',
width: 80,
prop: 'chubeinianxian',
align: 'center'
},
{
label: '状态',
width: 80,
prop: 'zhuangtai',
align: 'center'
},
{
label: '资金来源',
width: 120,
prop: 'zijinlaiyuan',
align: 'center'
},
{
label: '储备方式',
width: 120,
prop: 'chubeifangshi',
align: 'center'
},
{
label: '储备地点',
width: 180,
prop: 'chubeididian',
align: 'left'
},
{
label: '备注',
width: 180,
prop: 'beizhu',
align: 'left'
},
{
label: '储备层级',
width: 120,
prop: 'chubeicengji',
align: 'left'
},
{
label: '是否展示',
width: 120,
prop: 'shifouzhanshi',
align: 'left'
}
]
}
@ -222,10 +232,11 @@ export default {
})
},
methods: {
getArea() {
getparameteritem('area').then(res => {
this.areaList = res.detail
})
async getArea() {
const areaRes = await getparameteritem('area')
this.areaList = areaRes.detail || []
const chubeiRes = await getparameteritem('ck_chubeileixing')
this.chubeileixingList = chubeiRes.detail || []
},
initHeight() {
const winHeight = document.body.clientHeight
@ -257,25 +268,31 @@ export default {
// this.setMapMarker()
},
changeMask(type) {
if (type == 1) {
this.addCur = false
if (type === 'teams') {
this.activeTab = 'teams'
this.currentChubeileixing = ''
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.setMapMarker("storages", this.makerObj.storages)
} else {
this.makerObj.storages = []
this.setMapMarker('storages', [])
}
},
async getTeams() {
await index({
page: 1,
page_size: 9999,
table_name: 'teams',
filter:[{
'key':'duiwushuxing',
'op':'eq',
'value':'自管队伍'
table_name: 'teams',
filter:[{
'key':'duiwushuxing',
'op':'eq',
'value':'自管队伍'
}]
}).then(res => {
const markers = []
@ -296,12 +313,16 @@ export default {
this.loadingFull.close()
})
},
clickQuyu(e) {
console.log('e', e)
this.quyu_id = e
clickQuyu({ areaId, chubeileixingId }) {
this.activeTab = String(chubeileixingId)
this.currentChubeileixing = chubeileixingId
this.quyu_id = areaId
this.getStorages()
},
async getStorages() {
if (!this.quyu_id || !this.currentChubeileixing) {
return
}
this.loadingFull = this.$loading({
lock: true,
text: '',
@ -309,32 +330,38 @@ export default {
background: 'rgba(0, 0, 0, 0.7)'
})
this.makerObj.storages = []
await index({
page: 1,
page_size: 9999,
table_name: 'materialstorages',
filter: [{
key: 'quyu_id',
op: 'eq',
value: this.quyu_id
}]
}).then(res => {
const markers = []
if (res.data.length < 1) {
return
}
res.data.map(item => {
this.makerObj.storages.push({
type: 'storages',
name: item.cangkumingcheng,
...item
})
try {
const res = await index({
page: 1,
page_size: 9999,
table_name: 'materialstorages',
filter: [{
key: 'quyu_id',
op: 'eq',
value: this.quyu_id
}, {
key: 'chubeileixing',
op: 'eq',
value: this.currentChubeileixing
}]
})
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.loadingFull.close()
})
} finally {
if (this.loadingFull) {
this.loadingFull.close()
}
}
},
async getMater(id) {
async getMater(id) {
const res = await index({
page: 1,
page_size: 9999,
@ -360,14 +387,14 @@ export default {
if (!item.jingdu || !item.weidu) {
return
}
const icon = new AMap.Icon({
size: new AMap.Size(40, 50), //
image: this.myicon, // Icon
imageOffset: new AMap.Pixel(0, 0), //
imageSize: new AMap.Size(30, 30) //
const icon = new AMap.Icon({
size: new AMap.Size(40, 50), //
image: this.myicon, // Icon
imageOffset: new AMap.Pixel(0, 0), //
imageSize: new AMap.Size(30, 30) //
});
const marker = new AMap.Marker({
map: this.map,
map: this.map,
icon:icon,
// text: item.name,
zIndex: 9999999,
@ -392,7 +419,7 @@ export default {
}
}
this.infoWindow.open(this.map, e.target.getPosition())
})
})
console.log("marker",marker)
// if(item.type == 'storages'){
// this.makerObj.storages.push(marker)
@ -404,7 +431,7 @@ export default {
console.log('this.makerObj', this.makerObj)
// this.map.add(this.makerObj['teams'])
},
closeWin() {
closeWin() {
this.infoWindow.close()
}
}
@ -425,10 +452,10 @@ export default {
align-items: center;
background: #fff;
padding: 20px 40px;
border-radius: 40px;
font-size: 18px;
&>span{
margin:0px 20px;
border-radius: 40px;
font-size: 18px;
&>span{
margin:0px 20px;
}
}
@ -522,4 +549,4 @@ export default {
right: 5px;
cursor: pointer;
}
</style>
</style>

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

@ -45,6 +45,30 @@
</div>
</div>
</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>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -276,7 +300,8 @@ import {
show
} from '@/api/system/baseForm.js'
import {
getparameteritem
getparameteritem,
getparameteritemMore
} from '@/api/system/dictionary.js'
import {
Message
@ -293,6 +318,8 @@ export default {
tableName: 'materialstorages',
// flood_storages
areaList: [],
chubeileixingList: [],
chubeidengjiList: [],
typelist: [],
mapparams: {
zoom: 11
@ -302,6 +329,8 @@ export default {
storehouses_id: '',
cangkumingcheng: '',
cangkubianma: '',
chubeileixing: '',
chubeidengji: '',
shifouzili: '否',
shifouxunihuojia: '否', //
sort: 0,
@ -359,6 +388,7 @@ export default {
},
created() {
this.getArea()
this.getDictOptions()
},
methods: {
getArea() {
@ -366,6 +396,20 @@ export default {
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) {
if (e) {
this.areaList.map(item => {

@ -17,6 +17,12 @@
<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>
</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"
@ -83,7 +89,8 @@ import {
import { getStorehouseTypeList } from '@/api/system/storehouseType'
import addStorage from './components/addStorage.vue'
import {
getparameteritem
getparameteritem,
getparameteritemMore
} from '@/api/system/dictionary.js'
import shelf from './components/shelf.vue'
export default {
@ -101,9 +108,13 @@ export default {
area: '',
storehouses_id: '',
shifouzili: '',
shifouxunihuojia: ''
shifouxunihuojia: '',
chubeileixing: '',
chubeidengji: ''
},
areaList: [],
chubeileixingList: [],
chubeidengjiList: [],
total: 0,
list: [],
typelist: [],
@ -131,6 +142,18 @@ export default {
align: 'left',
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: '是否纳入物资管理',
prop: 'shifouzili',
@ -183,6 +206,7 @@ export default {
},
created() {
this.getArea()
this.getDictOptions()
this.getTypeList()
this.getList()
},
@ -192,6 +216,20 @@ export default {
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) {
if (e) {
this.select.area = e
@ -240,6 +278,14 @@ export default {
key: 'shifouxunihuojia',
op: 'eq',
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