防汛仓库物资

master
lion 2 years ago
parent bc12430b3b
commit ff994cbefd

@ -2,15 +2,15 @@
ENV='development'
# base api
#VUE_APP_BASE_API = http://192.168.60.99:9004/
#VUE_APP_UPLOAD_API = http://192.168.60.99:9004/api/admin/upload-file
#VUE_APP_OA_URL = http://192.168.60.18:2021
#VUE_APP_OA_URL_TYPE = '{"领用":"37","处置":"38","应急":"39"}'
VUE_APP_BASE_API = http://192.168.60.99:9004/
VUE_APP_UPLOAD_API = http://192.168.60.99:9004/api/admin/upload-file
VUE_APP_OA_URL = http://192.168.60.18:2021
VUE_APP_OA_URL_TYPE = '{"领用":"37","处置":"38","应急":"39"}'
VUE_APP_BASE_API = http://hd-wuziguanli-test.ali251.langye.net/
VUE_APP_UPLOAD_API = http://hd-wuziguanli-test.ali251.langye.net/api/admin/upload-file
VUE_APP_OA_URL= http://suzhouhedaooa.langye.net
VUE_APP_OA_URL_TYPE = '{"领用":"31","处置":"32","应急":"33"}'
#VUE_APP_BASE_API = http://hd-wuziguanli-test.ali251.langye.net/
#VUE_APP_UPLOAD_API = http://hd-wuziguanli-test.ali251.langye.net/api/admin/upload-file
#VUE_APP_OA_URL= http://suzhouhedaooa.langye.net
#VUE_APP_OA_URL_TYPE = '{"领用":"31","处置":"32","应急":"33"}'

@ -5,4 +5,13 @@ export function listlog(params) {
method: 'get',
params:params
})
}
}
export function desChuku(params) {
return request({
url: '/api/admin/other/chuku_des',
method: 'get',
params:params
})
}

@ -1,7 +1,7 @@
<template>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" text="基础信息" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<lx-header icon="md-apps" text="花名册" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="搜索姓名" />

@ -1,6 +1,6 @@
<template>
<div>
<xy-dialog ref="dialog" :width='40' :is-show.sync="isShow" type="form" :title="type==='add'?'新增巡查计划':'编辑巡查计划'" :form="form"
<xy-dialog ref="dialog" :width='40' :is-show.sync="isShow" type="form" :title="type==='add'?'新增花名册':'编辑花名册'" :form="form"
:rules="rules" @submit="submit">
<template v-slot:suozaiduiwu>
<div class="xy-table-item">
@ -39,6 +39,26 @@
<el-input style="width:300px" v-model="form.lianxidianhua"></el-input>
</div>
</div>
</template>
<template v-slot:gongzhong>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>工种
</div>
<div class="xy-table-item-content">
<el-input style="width:300px" v-model="form.gongzhong"></el-input>
</div>
</div>
</template>
<template v-slot:beizhu>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>备注
</div>
<div class="xy-table-item-content">
<el-input style="width:300px" type="textarea" rows="8" v-model="form.beizhu"></el-input>
</div>
</div>
</template>
</xy-dialog>
@ -67,7 +87,9 @@
team_id:'',
suozaiduiwu:'',
xingming:'',
lianxidianhua:'',
lianxidianhua:'',
gongzhong:'',
beizhu:''
},
rules: {
suozaiduiwu:[{

@ -2,21 +2,50 @@
<div>
<div class="map" id="map" :style="{'height':mapHeight+'px'}"></div>
<div ref='infoWindow' id="infoWindow">
<i @click='closeWin' class="el-icon-close"></i>
<div v-for="item in openData">
<template v-if="item.type=='teams'">
<p>名称<span>{{item.mingcheng}}</span></p>
<p>队长<span>{{item.duizhang?item.duizhang:''}}</span></p>
<p>联系电话<span>{{item.lianxidianhua?item.lianxidianhua:''}}</span></p>
<p>人数<span>{{item.renshu?item.renshu:''}}</span></p>
</template>
<template v-if="item.type=='storages'">
<p>名称<span>{{item.cangkumingcheng}}</span></p>
<p>所在区域<span>{{item.suozaiquyu?item.suozaiquyu:''}}</span></p>
<p>建设年代<span>{{item.jiansheniandai?item.jiansheniandai:''}}</span></p>
<p>仓库面积<span>{{item.cangkumianji?item.cangkumianji:''}}</span></p>
<p>负责人<span>{{item.fuzeren?item.fuzeren:''}}</span></p>
<p>联系电话<span>{{item.lianxidianhua?item.lianxidianhua:''}}</span></p>
<div class="iconClose">
<i @click='closeWin' class="el-icon-close"></i>
</div>
<div v-for="item in openData">
<template v-if="item.type=='teams'">
<div class="teams">
<p>名称<span>{{item.mingcheng}}</span></p>
<p>负责人<span>{{item.fuzeren?item.fuzeren:''}}</span></p>
<p>联系电话<span>{{item.lianxidianhua?item.lianxidianhua:''}}</span></p>
<p>队长<span>{{item.duizhang?item.duizhang:''}}</span></p>
<p>人数<span>{{item.renshu?item.renshu:''}}</span></p>
</div>
</template>
<template v-if="item.type=='storages'">
<div class="storages">
<div>
<div>
<p>名称<span>{{item.cangkumingcheng}}</span></p>
<p>所在区域<span>{{item.suozaiquyu?item.suozaiquyu:''}}</span></p>
</div>
<div>
<p>建设年代<span>{{item.jiansheniandai?item.jiansheniandai:''}}</span></p>
<p>仓库面积<span>{{item.cangkumianji?item.cangkumianji:''}}</span></p>
</div>
<div>
<p>负责人<span>{{item.fuzeren?item.fuzeren:''}}</span></p>
<p>联系电话<span>{{item.lianxidianhua?item.lianxidianhua:''}}</span></p>
</div>
<div>
<p>仓库现存物资<span>{{total?total:0}}</span></p>
</div>
</div>
<div>
<xy-table :list="materList" :height="300" :isPage="false" v-loading="loading" :table-item="table">
<template v-slot:btns>
<div></div>
</template>
</xy-table>
</div>
</div>
</template>
</div>
@ -35,11 +64,135 @@
zoom: 10,
center: [120.585294, 31.299758],
mapHeight: 0,
map: null,
makerList: [],
infoWindow: null,
openData: [],
mapList:[]
map: null,
makerList: [],
infoWindow: null,
openData: [],
mapList: [],
materList: [],
loading: true,
total: 0,
table: [{
label: '序号',
type: 'index',
fixed: 'left',
width: 80
},
// {
// label: "",
// width: 120,
// prop: 'guanliancangku',
// align: 'center',
// },
// {
// label: "",
// width: 220,
// prop: 'cangkumingcheng',
// 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'
}
]
}
},
created() {
@ -58,17 +211,19 @@
center: this.center,
mapStyle: "amap://styles/bfb1bb3feb0db7082367abca96b8d214", //
zoom: this.zoom
});
this.infoWindow = new AMap.InfoWindow({
isCustom: true,
autoMove: true,
avoid: [20, 20, 20, 20],
content: this.$refs.infoWindow,
closeWhenClickMap: true,
offset: new AMap.Pixel(-10, -10)
})
this.getTeams()
this.getStorages()
});
this.infoWindow = new AMap.InfoWindow({
isCustom: true,
autoMove: true,
avoid: [20, 20, 20, 20],
content: this.$refs.infoWindow,
closeWhenClickMap: true,
offset: new AMap.Pixel(-10, -10)
})
this.getTeams()
this.getStorages()
// this.setMapMarker()
},
async getTeams() {
@ -76,117 +231,159 @@
page: 1,
page_size: 9999,
table_name: 'teams'
}).then(res => {
let markers = []
if(res.data.length<1){
return
}
res.data.map(item=>{
this.mapList.push({
type:'teams',
name:item.mingcheng,
...item
})
})
this.setMapMarker()
// this.mapList = res.data
}).then(res => {
let markers = []
if (res.data.length < 1) {
return
}
res.data.map(item => {
this.mapList.push({
type: 'teams',
name: item.mingcheng,
...item
})
})
this.setMapMarker()
// this.mapList = res.data
})
// this.list = res.data
},
async getStorages() {
await index({
page: 1,
page_size: 9999,
table_name: 'flood_storages'
}).then(res => {
let markers = []
if(res.data.length<1){
return
}
res.data.map(item=>{
this.mapList.push({
type:'storages',
name:item.cangkumingcheng,
...item
})
})
this.setMapMarker()
})
// this.list = res.data
},
//
setMapMarker() {
var that = this
// that.map.remove(that.makerList)
// that.makerList = []
console.log("this.mapList",this.mapList)
// let list = this.mapList.map((m) => {
// return {
// id: m.id, //id
// name: m.name, //
// // reside: m.reside,
// // lnglat: [m.lon, m.lat],//
// lnglat: [parseFloat(m.jingdu), m.weidu],
// style: 0, //
// };
// });
this.mapList.forEach((item, index) => {
//
console.log("item",item)
if (!item.jingdu || !item.weidu) {
return
}
let marker = new AMap.Text({
map: this.map,
text: item.name,
zIndex: 9999999,
offset: new AMap.Pixel(-13, -30),
position: [parseFloat(item.jingdu), parseFloat(item.weidu)],
clickable: true,
extData: item.id,
style: {
'border': item.type==='teams'?'1px solid red':'1px solid blue',
'padding': '0px 5px'
}
})
marker.on('click', (e) => {
this.openData = []
if (e.target.w.extData === item.id) {
this.openData.push(item)
}
this.infoWindow.open(this.map, e.target.getPosition())
}),
this.makerList.push(marker)
});
console.log("this.makerList",this.makerList)
this.map.add(this.makerList)
},
closeWin() {
this.infoWindow.close()
},
async getStorages() {
await index({
page: 1,
page_size: 9999,
table_name: 'flood_storages'
}).then(res => {
let markers = []
if (res.data.length < 1) {
return
}
res.data.map(item => {
this.mapList.push({
type: 'storages',
name: item.cangkumingcheng,
...item
})
})
this.setMapMarker()
})
// this.list = res.data
},
async getMater(id) {
const res = await index({
page: 1,
page_size: 9999,
table_name: "flood_materials",
filter: [{
"key": "guanliancangku",
"op": "eq",
"value": id
}],
})
this.materList = res.data
this.total = res.total
this.loading = false
},
//
setMapMarker() {
var that = this
this.mapList.forEach((item, index) => {
//
if (!item.jingdu || !item.weidu) {
return
}
let marker = new AMap.Text({
map: this.map,
text: item.name,
zIndex: 9999999,
offset: new AMap.Pixel(-13, -30),
position: [parseFloat(item.jingdu), parseFloat(item.weidu)],
clickable: true,
extData: item.id,
style: {
'border': item.type === 'teams' ? '1px solid red' : '1px solid blue',
'padding': '0px 5px'
}
})
marker.on('click', (e) => {
this.openData = []
this.loading = true
this.total = 0
this.materList = []
if (e.target.w.extData === item.id) {
this.openData.push(item)
if (item.type == 'storages') {
this.getMater(item.id)
}
}
this.infoWindow.open(this.map, e.target.getPosition())
}),
this.makerList.push(marker)
});
console.log("this.makerList", this.makerList)
this.map.add(this.makerList)
},
closeWin() {
this.infoWindow.close()
},
},
}
</script>
<style>
#infoWindow {
position: relative;
}
#infoWindow>div {
background: #fff;
border: 1px solid red;
padding: 10px;
width: 180px;
}
/deep/ #infoWindow .el-icon-close {
position: absolute;
top: 5px;
right: 5px;
cursor: pointer;
<style>
#infoWindow {
position: relative;
}
#infoWindow .iconClose {
background: #000;
border: none;
padding: 0;
width: 20px;
height: 20px;
border-radius: 20px;
color: #fff;
text-align: center;
position: absolute;
right: -10px;
top: -10px;
}
#infoWindow>div {
background: #fff;
border: 1px solid red;
padding: 10px;
}
#infoWindow div.teams {
width: 180px;
}
#infoWindow div.storages {
width: 650px;
}
#infoWindow div.storages>div:first-child {
display: flex;
align-items: flex-start;
flex-wrap: wrap;
justify-content: space-between;
margin-bottom: 10px;
}
#infoWindow div.storages>div:first-child div {
width: 50%
}
/deep/ #infoWindow .el-icon-close {
position: absolute;
top: 5px;
right: 5px;
cursor: pointer;
}
</style>

@ -137,6 +137,7 @@ export default {
title: i.name,
};
});
console.log("this.table",this.table)
}
},
},

@ -248,7 +248,11 @@
index,
show,
destroy
} from "@/api/system/baseForm.js"
} from "@/api/system/baseForm.js"
import {
desChuku
} from "@/api/system/log.js"
import {
Message
} from 'element-ui'
@ -680,7 +684,14 @@
Message({
type: 'success',
message: '编辑成功'
})
})
if(this.form.zhuangtai = '已出库'){
desChuku({
outbound_id:this.id
}).then(res=>{
})
}
this.isShow = false
this.$emit('refresh')
})

@ -249,6 +249,16 @@
})
return
}
console.log(row)
// return
let wuzimingcheng = ''
let shuliang = ''
let guigexinghao = ''
row.id_outbounds_items_outbounds_id_relation.map(item=>{
wuzimingcheng+=item.zichanmingcheng+'、'
shuliang+=item.jieyongshuliang+'、'
guigexinghao+=item.guigexinghao+'、'
})
let default_json = {
// 'yewukeshi':row.jieyongbumen,
@ -261,6 +271,9 @@
// 'beizhu':row.beizhu,
// 'gudingzichanbianhao':row.gudingzichanbianhao,
// 'baofeiyuanyin':row.baofeiyuanyin,
"wuzimingcheng":wuzimingcheng,
"shuliang":shuliang,
"guigexinghao":guigexinghao,
'yewukeshi':row.jieyongbumen,
'bianhao':row.chukushijian+'-'+row.id,
'lingyongshijian':row.chukushijian,

@ -0,0 +1,433 @@
<template>
<div>
<xy-dialog ref="dialog" :width='70' :is-show.sync="isShow" type="form" :title="titleName" :form="form"
:rules="rules" @submit="submit">
<template v-slot:cangkumingcheng>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>仓库名称
</div>
<div class="xy-table-item-content">
<el-select v-model="form.cangkumingcheng" @change="changeCk" style="width: 300px;" placeholder="请选择仓库">
<el-option
v-for="item in cangkuList"
:key="item.id"
:label="item.cangkumingcheng"
:value="item.cangkumingcheng">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:wuzidaima>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>物资代码
</div>
<div class="xy-table-item-content">
<el-input v-model="form.wuzidaima" placeholder="请填写物资代码" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:xianwuzimingcheng>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>现物资名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.xianwuzimingcheng" placeholder="请填写现物资名称" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:yuanwuzimingcheng>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>原物资名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.yuanwuzimingcheng" placeholder="请填写原物资名称" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:guigexinghao>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>规格型号
</div>
<div class="xy-table-item-content">
<el-input v-model="form.guigexinghao" placeholder="请填写规格型号" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:shuliang>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>数量
</div>
<div class="xy-table-item-content">
<el-input v-model="form.shuliang" placeholder="请填写数量" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:danwei>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>单位
</div>
<div class="xy-table-item-content">
<el-input v-model="form.danwei" placeholder="请填写单位" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:jiazhiyuan>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>价值()
</div>
<div class="xy-table-item-content">
<el-input v-model="form.jiazhiyuan" placeholder="请填写价值(元)" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:shengchanriqi>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>生产日期
</div>
<div class="xy-table-item-content">
<el-input v-model="form.shengchanriqi" placeholder="请填写生产日期" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:rukuriqi>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>入库日期
</div>
<div class="xy-table-item-content">
<el-input v-model="form.rukuriqi" placeholder="请填写入库日期" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:chubeinianxian>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>储备年限
</div>
<div class="xy-table-item-content">
<el-input v-model="form.chubeinianxian" placeholder="请填写储备年限" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:zhuangtai>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>状态
</div>
<div class="xy-table-item-content">
<el-input v-model="form.zhuangtai" placeholder="请填写状态" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:zijinlaiyuan>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>资金来源
</div>
<div class="xy-table-item-content">
<el-input v-model="form.zijinlaiyuan" placeholder="请填写资金来源" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:chubeifangshi>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>储备方式
</div>
<div class="xy-table-item-content">
<el-input v-model="form.chubeifangshi" placeholder="请填写储备方式" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:chubeididian>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>储备地点
</div>
<div class="xy-table-item-content">
<el-input v-model="form.chubeididian" placeholder="请填写储备地点" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:beizhu>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>备注
</div>
<div class="xy-table-item-content">
<el-input v-model="form.beizhu" placeholder="请输入储备层级" clearable
style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:chubeicengji>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>储备层级
</div>
<div class="xy-table-item-content">
<el-input v-model="form.chubeicengji" placeholder="请输入储备层级" clearable
style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:shifouzhanshi>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>是否展示
</div>
<div class="xy-table-item-content">
<el-input v-model="form.shifouzhanshi" placeholder="请输入是否展示" clearable
style="width: 300px;"></el-input>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
index,
show
} from "@/api/system/baseForm.js"
import {
getWzbm
} from "@/api/mater.js"
import {
Message
} from 'element-ui'
export default {
data() {
return {
isShow: false,
type: 'add',
id: '',
titleName: '',
tableName: 'flood_materials',
cangkuList:[],
form: {
guanliancangku:'',
cangkumingcheng:'',
wuzidaima:'',
xianwuzimingcheng:'',
yuanwuzimingcheng:'',
guigexinghao:'',
shuliang:'',
danwei:'',
jiazhiyuan:'',
shengchanriqi:'',
rukuriqi:'',
chubeinianxian:'',
zhuangtai:'',
zijinlaiyuan:'',
chubeifangshi:'',
chubeididian:'',
beizhu:'',
chubeicengji:'',
shifouzhanshi:''
},
rules: {
cangkumingcheng: [{
required: true,
message: '请选择仓库'
}]
}
}
},
created() {
},
methods: {
setCkList(e){
if(e){
this.cangkuList = e
}
},
changeCk(e){
if(e){
this.cangkuList.map(item=>{
if(e===item.cangkumingcheng){
this.form.guanliancangku = item.id
}
})
console.log(this.form.guanliancangku)
}
},
async getDetail() {
const res = await show({
id: this.id,
table_name: this.tableName
})
this.form = {
guanliancangku:res?.guanliancangku,
cangkumingcheng:res?.cangkumingcheng,
wuzidaima:res?.wuzidaima,
xianwuzimingcheng:res?.xianwuzimingcheng,
yuanwuzimingcheng:res?.yuanwuzimingcheng,
guigexinghao:res?.guigexinghao,
shuliang:res?.shuliang,
danwei:res?.danwei,
jiazhiyuan:res?.jiazhiyuan,
shengchanriqi:res?.shengchanriqi,
rukuriqi:res?.rukuriqi,
chubeinianxian:res?.chubeinianxian,
zhuangtai:res?.zhuangtai,
zijinlaiyuan:res?.zijinlaiyuan,
chubeifangshi:res?.chubeifangshi,
chubeididian:res?.chubeididian,
beizhu:res?.beizhu,
chubeicengji:res?.chubeicengji,
shifouzhanshi:res?.shifouzhanshi
}
},
submit() {
console.log("this.form",this.form)
// return
if (this.type === 'add') {
save({
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '新增成功'
})
this.isShow = false
this.$emit('refresh')
})
return
}
if (this.type === 'editor') {
save({
id: this.id,
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '编辑成功'
})
this.isShow = false
this.$emit('refresh')
})
}
},
},
watch: {
isShow(newVal) {
if (newVal) {
this.titleName = this.type === 'add' ? `新增物资` : `编辑物资`
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.type = ''
this.$refs['dialog'].reset()
}
}
}
}
</script>
<style scoped lang="scss">
.mingxiwrap {
display: flex;
flex-wrap: wrap;
}
.mingxiwrap .xy-table-item {
margin-bottom: 10px
}
.searchCompanys {
display: flex;
justify-content: space-between;
margin-bottom: 15px;
}
::v-deep .searchCompanys .el-input {
width: 82%
}
.xy-table-item-label {
width: 160px;
}
.img__delete {
transform: scale(0.8, 0.8);
position: absolute;
top: 4px;
right: 4px;
}
::v-deep .avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
::v-deep .avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
::v-deep .el-upload--picture-card {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar {
width: 80px !important;
display: block;
border-radius: 6px;
}
::v-deep .xy-table-item-label {
width: 160px !important;
}
::v-deep .el-date-editor .el-range-separator {
width: auto !important;
}
::v-deep .el-input-number .el-input__inner {
text-align: left !important;
}
</style>

@ -0,0 +1,291 @@
<template>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" text="防汛物资管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="关键词搜索" />
<!-- <el-select v-model="select.guanliancangku" @change="changeCk" style="width: 200px;" placeholder="请选择仓库">
<el-option v-for="item in cangkuList" :key="item.id" :label="item.cangkumingcheng"
:value="item.cangkumingcheng">
</el-option>
</el-select> -->
<Select v-model="select.guanliancangku" style="width:200px;margin-right: 10px;">
<Option v-for="item in cangkuList" :value="item.id" :key="item.value">{{ item.cangkumingcheng }}</Option>
</Select>
<Button type="primary" @click="getindex"></Button>
<Button type="primary" style="margin-left: 10px;"
@click="$refs['addMater'].isShow = true,$refs['addMater'].type = 'add',$refs['addMater'].setCkList(cangkuList)">添加</Button>
<Button type="primary" style="margin-left: 10px;"
@click="$refs['imports'].show()">导入</Button>
<!-- <Button type="primary" style="margin-left: 10px;"
@click="exportExcel(new Date().getTime().toString())">导出</Button> -->
</div>
</slot>
</lx-header>
</div>
<xy-table :list="list" :total="total" v-loading="loading" @pageSizeChange="e => select.pageSize = e"
@pageIndexChange="pageChange" :table-item="table">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="180" header-align="center">
<template slot-scope="scope">
<div>
<Button type="primary" size="small" style="margin-left: 10px;"
@click="editorMater(scope.row.id,'editor')">编辑</Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteMater(scope.row)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</div>
</template>
</el-table-column>
</template>
</xy-table>
<addMater ref="addMater" @refresh="getindex"></addMater>
<imports :table-name="customForm.tableName" :form-info="importForm" ref="imports" @refresh="getindex"></imports>
</div>
</template>
<script>
import {
index,
destroy,
} from "@/api/system/baseForm.js"
import addMater from "./components/addMater.vue"
import {
Message
} from 'element-ui'
import imports from "@/views/component/imports.vue"
export default {
components: {
addMater,
imports
},
data() {
return {
loading: false,
select: {
pageSize: 10,
pageIndex: 1,
keyword: "",
guanliancangku:''
},
customForm: {
tableName: "flood_materials"
},
form: [],
importForm: [],
total: 0,
list: [],
cangkuList: [],
table: [{
label: '序号',
type: 'index',
fixed: 'left',
width: 80
},
// {
// label: "",
// width: 120,
// prop: 'guanliancangku',
// align: 'center',
// },
{
label: "仓库名称",
width: 220,
prop: 'cangkumingcheng',
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'
}
]
}
},
mounted() {
this.getCangku()
this.getindex()
this.table.map(item => {
this.importForm.push({
field: item.prop,
name: item.label
})
})
console.log("importForm", this.importForm)
},
methods: {
async getCangku() {
let res = await index({
page_size: 999,
page: 1,
table_name: 'flood_storages',
})
this.cangkuList = res.data
},
async getindex() {
this.loading = true
const res = await index({
page_size: this.select.pageSize,
page: this.select.pageIndex,
table_name: this.customForm.tableName,
filter: [{
"key": "xianwuzimingcheng",
"op": "like",
"value": this.select.keyword
},{
"key": "guanliancangku",
"op": "eq",
"value": this.select.guanliancangku
}],
})
this.list = res.data
this.total = res.total
this.loading = false
},
pageChange(e) {
this.select.pageIndex = e
this.getindex()
},
editorMater(id, type) {
this.$refs['addMater'].id = id
this.$refs['addMater'].type = type
this.$refs['addMater'].setCkList(this.cangkuList)
this.$refs['addMater'].isShow = true
},
deleteMater(row) {
destroy({
id: row.id,
table_name: this.customForm.tableName
}).then(res => {
Message({
type: 'success',
message: '删除成功'
})
this.getindex()
})
},
},
}
</script>
<style scoped>
/deep/ .draw {
padding-left: 20px;
}
/deep/ .draw>div {
font-size: 20px;
margin: 15px 0
}
/deep/ .el-timeline-item {
list-style: none;
}
</style>

@ -72,12 +72,14 @@
width: 240,
align: 'left',
fixed: 'left'
}, {
label: '仓库编码',
prop: 'cangkubianma',
align: 'left',
width: 240
}, {
},
// {
// label: '',
// prop: 'cangkubianma',
// align: 'left',
// width: 240
// },
{
label: '所在区域',
prop: 'suozaiquyu',
width: 120,

@ -1,108 +1,115 @@
<template>
<div>
<xy-dialog ref="dialog" :width='70' :is-show.sync="isShow" type="form" :title="type==='add'?'新增防汛队伍':'编辑防汛队伍'" :form="form"
:rules="rules" @submit="submit">
<template v-slot:mingcheng>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>队伍名称
</div>
<div class="xy-table-item-content">
<el-input style="width:300px" v-model="form.mingcheng"></el-input>
</div>
</div>
</template>
<template v-slot:gongsi>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>公司
</div>
<div class="xy-table-item-content">
<el-input style="width:300px" v-model="form.gongsi"></el-input>
</div>
</div>
</template>
<template v-slot:fuzeren>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>负责人
</div>
<div class="xy-table-item-content">
<el-input style="width:300px" v-model="form.fuzeren"></el-input>
</div>
</div>
</template>
<template v-slot:duizhang>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>队长
</div>
<div class="xy-table-item-content">
<el-input style="width:300px" v-model="form.duizhang"></el-input>
</div>
</div>
</template>
<template v-slot:lianxidianhua>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>联系电话
</div>
<div class="xy-table-item-content">
<el-input style="width:300px" v-model="form.lianxidianhua"></el-input>
</div>
</div>
</template>
<template v-slot:renshu>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>人数
</div>
<div class="xy-table-item-content">
<el-input style="width:300px" v-model="form.renshu"></el-input>
</div>
</div>
</template>
<template v-slot:quyu>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>区域
</div>
<div class="xy-table-item-content">
<el-input style="width: 300px;" v-model="form.quyu" ></el-input>
</div>
</div>
</template>
<template v-slot:dizhi>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>地址
</div>
<div class="xy-table-item-content">
<avue-input-map v-model="mapform" :params="mapparams" style="width:300px" placeholder="请选择地图"></avue-input-map>
</div>
</div>
<xy-dialog ref="dialog" :width='70' :is-show.sync="isShow" type="form" :title="type==='add'?'新增防汛队伍':'编辑防汛队伍'"
:form="form" :rules="rules" @submit="submit">
<template v-slot:mingcheng>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>队伍名称
</div>
<div class="xy-table-item-content">
<el-input style="width:300px" v-model="form.mingcheng"></el-input>
</div>
</div>
</template>
<template v-slot:jingdu>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>经度
</div>
<div class="xy-table-item-content">
<el-input style="width: 300px;" disabled v-model="form.jingdu" ></el-input>
</div>
</div>
</template>
<template v-slot:weidu>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>纬度
</div>
<template v-slot:gongsi>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>公司
</div>
<div class="xy-table-item-content">
<el-input style="width:300px" v-model="form.gongsi"></el-input>
</div>
</div>
</template>
<template v-slot:fuzeren>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>负责人
</div>
<div class="xy-table-item-content">
<el-select style="width:300px" v-model="form.fuzeren" @change="changeFuzeren" placeholder="请选择">
<el-option v-for="item in bookList" :key="item.id" :label="item.xingming" :value="item.xingming">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:duizhang>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>队长
</div>
<div class="xy-table-item-content">
<el-input style="width: 300px;" disabled v-model="form.weidu" ></el-input>
</div>
</div>
<el-select style="width:300px" v-model="form.duizhang"placeholder="请选择">
<el-option v-for="item in bookList" :key="item.id" :label="item.xingming" :value="item.xingming">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:lianxidianhua>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>联系电话
</div>
<div class="xy-table-item-content">
<el-input style="width:300px" v-model="form.lianxidianhua"></el-input>
</div>
</div>
</template>
<template v-slot:renshu>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>人数
</div>
<div class="xy-table-item-content">
<el-input style="width:300px" v-model="form.renshu"></el-input>
</div>
</div>
</template>
<template v-slot:quyu>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>区域
</div>
<div class="xy-table-item-content">
<el-input style="width: 300px;" v-model="form.quyu"></el-input>
</div>
</div>
</template>
<template v-slot:dizhi>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>地址
</div>
<div class="xy-table-item-content">
<avue-input-map v-model="mapform" :params="mapparams" style="width:300px"
placeholder="请选择地图"></avue-input-map>
</div>
</div>
</template>
<template v-slot:jingdu>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>经度
</div>
<div class="xy-table-item-content">
<el-input style="width: 300px;" disabled v-model="form.jingdu"></el-input>
</div>
</div>
</template>
<template v-slot:weidu>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>纬度
</div>
<div class="xy-table-item-content">
<el-input style="width: 300px;" disabled v-model="form.weidu"></el-input>
</div>
</div>
</template>
</xy-dialog>
@ -112,8 +119,9 @@
<script>
import {
save,
show
} from "@/api/system/baseForm.js"
show,
index
} from "@/api/system/baseForm.js"
import {
Message
} from 'element-ui'
@ -123,50 +131,65 @@
return {
isShow: false,
type: 'add',
id: '',
tableName:'teams',
mapparams:{
zoom: 11,
},
mapform:[] ,
id: '',
tableName: 'teams',
mapparams: {
zoom: 11,
},
mapform: [],
form: {
mingcheng:'',
gongsi:'',
fuzeren:'',
duizhang:'',
lianxidianhua:'',
renshu:'',
quyu:'',
dizhi:'',
jingdu:'',
weidu:'',
duiyuan:[]
mingcheng: '',
gongsi: '',
fuzeren: '',
duizhang: '',
lianxidianhua: '',
renshu: '',
quyu: '',
dizhi: '',
jingdu: '',
weidu: '',
duiyuan: []
},
bookList: [],
rules: {
mingcheng:[{
required:true,
message:'请填写队伍名称'
mingcheng: [{
required: true,
message: '请填写队伍名称'
}]
},
}
},
created() {
created() {
this.getBooks()
},
methods: {
async getBooks() {
const res = await index({
table_name: 'books',
page: 1,
page_size: 999
})
this.bookList = res.data
},
changeFuzeren(e){
this.bookList.map(item=>{
if(e==item.xingming){
this.form.lianxidianhua = item.lianxidianhua
}
})
},
async getDetail() {
const res = await show({
id: this.id,
table_name: this.tableName
})
this.$integrateData(this.form,res)
this.mapform = [res.jingdu,res.weidu,res.dizhi]
},
})
this.$integrateData(this.form, res)
this.mapform = [res.jingdu, res.weidu, res.dizhi]
},
submit() {
if (this.type === 'add') {
submit() {
if (this.type === 'add') {
save({
table_name: this.tableName,
...this.form
@ -174,7 +197,7 @@
Message({
type: 'success',
message: '新增成功'
})
})
this.$emit('refresh')
this.isShow = false
@ -190,7 +213,7 @@
Message({
type: 'success',
message: '编辑成功'
})
})
this.$emit('refresh')
this.isShow = false
})
@ -206,16 +229,16 @@
}
} else {
this.id = ''
this.type = ''
this.type = ''
this.mapform = []
this.$refs['dialog'].reset()
}
},
mapform(newVal, oldVal) {
console.log(newVal)
this.form.jingdu = newVal[0];
this.form.weidu = newVal[1];
this.form.dizhi = newVal[2];
},
mapform(newVal, oldVal) {
console.log(newVal)
this.form.jingdu = newVal[0];
this.form.weidu = newVal[1];
this.form.dizhi = newVal[2];
},
}
@ -223,7 +246,7 @@
</script>
<style scoped lang="scss">
::v-deep .xy-table-item-label{
min-width:160px!important
::v-deep .xy-table-item-label {
min-width: 160px !important
}
</style>

Loading…
Cancel
Save