恢复文件

master
lynn 8 months ago
parent 6a034d90cb
commit 33cbb00355

@ -1,33 +1,34 @@
<template> <template>
<div> <div>
<xy-dialog ref="dialog" :width='70' :is-show.sync="isShow" type="form" :title="type==='add'?'新增':'编辑'" <xy-dialog ref="dialog" :width='70' :is-show.sync="isShow" type="form" :title="type==='add'?'新增':'编辑'"
:form="form" :rules="rules" @submit="submit"> :form="form" :rules="rules" @submit="submit">
<template v-slot:cangkumingcheng> <template v-slot:cangkumingcheng>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>仓库名称 <span style="color: red;font-weight: 600;padding-right: 4px;">*</span>仓库名称
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-input style="width:300px" v-model="form.cangkumingcheng"></el-input> <el-input style="width:300px" v-model="form.cangkumingcheng"></el-input>
</div> </div>
</div> </div>
</template> </template>
<template v-slot:cangkubianma> <template v-slot:cangkubianma>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>仓库编码 <span style="color: red;font-weight: 600;padding-right: 4px;"></span>仓库编码
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-input style="width:300px" v-model="form.cangkubianma"></el-input> <el-input style="width:300px" v-model="form.cangkubianma"></el-input>
</div>
</div> </div>
</template> </div>
<template v-slot:suozaiquyu> </template>
<div class="xy-table-item"> <template v-slot:suozaiquyu>
<div class="xy-table-item-label"> <div class="xy-table-item">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>所在区域 <div class="xy-table-item-label">
</div> <span style="color: red;font-weight: 600;padding-right: 4px;"></span>所在区域
<div class="xy-table-item-content"> </div>
<div class="xy-table-item-content">
<el-select v-model="form.suozaiquyu" @change="changeQuyu" style="width:300px" placeholder="请选择"> <el-select v-model="form.suozaiquyu" @change="changeQuyu" style="width:300px" placeholder="请选择">
<el-option <el-option
v-for="item in areaList" v-for="item in areaList"
@ -35,150 +36,150 @@
:label="item.value" :label="item.value"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
</template> </template>
<template v-slot:jiansheniandai> <template v-slot:jiansheniandai>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>建设年代 <span style="color: red;font-weight: 600;padding-right: 4px;"></span>建设年代
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-date-picker style="width:300px" value-format="yyyy" format="yyyy" v-model="form.jiansheniandai" type="year" placeholder="选择年"> <el-date-picker style="width:300px" value-format="yyyy" format="yyyy" v-model="form.jiansheniandai" type="year" placeholder="选择年">
</el-date-picker> </el-date-picker>
</div> </div>
</div> </div>
</template> </template>
<template v-slot:cangkumianji> <template v-slot:cangkumianji>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>仓库面积 <span style="color: red;font-weight: 600;padding-right: 4px;"></span>仓库面积
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-input style="width:300px" v-model="form.cangkumianji"></el-input> <el-input style="width:300px" v-model="form.cangkumianji"></el-input>
</div>
</div> </div>
</template> </div>
<template v-slot:fuzeren> </template>
<div class="xy-table-item"> <template v-slot:fuzeren>
<div class="xy-table-item-label"> <div class="xy-table-item">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>负责人 <div class="xy-table-item-label">
</div> <span style="color: red;font-weight: 600;padding-right: 4px;"></span>负责人
<div class="xy-table-item-content"> </div>
<el-input style="width:300px" v-model="form.fuzeren"></el-input> <div class="xy-table-item-content">
</div> <el-input style="width:300px" v-model="form.fuzeren"></el-input>
</div> </div>
</template> </div>
<template v-slot:lianxidianhua> </template>
<div class="xy-table-item"> <template v-slot:lianxidianhua>
<div class="xy-table-item-label"> <div class="xy-table-item">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>联系电话 <div class="xy-table-item-label">
</div> <span style="color: red;font-weight: 600;padding-right: 4px;"></span>联系电话
<div class="xy-table-item-content"> </div>
<el-input style="width: 300px;" v-model="form.lianxidianhua"></el-input> <div class="xy-table-item-content">
</div> <el-input style="width: 300px;" v-model="form.lianxidianhua"></el-input>
</div> </div>
</template> </div>
<template v-slot:cangkudizhi> </template>
<div class="xy-table-item"> <template v-slot:cangkudizhi>
<div class="xy-table-item-label"> <div class="xy-table-item">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>仓库地址 <div class="xy-table-item-label">
</div> <span style="color: red;font-weight: 600;padding-right: 4px;"></span>仓库地址
<div class="xy-table-item-content"> </div>
<avue-input-map v-model="mapform" :params="mapparams" style="width:300px" <div class="xy-table-item-content">
placeholder="请选择地图"></avue-input-map> <avue-input-map v-model="mapform" :params="mapparams" style="width:300px"
</div> placeholder="请选择地图"></avue-input-map>
</div> </div>
</template> </div>
<template v-slot:jingdu> </template>
<div class="xy-table-item"> <template v-slot:jingdu>
<div class="xy-table-item-label"> <div class="xy-table-item">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>经度 <div class="xy-table-item-label">
</div> <span style="color: red;font-weight: 600;padding-right: 4px;"></span>经度
<div class="xy-table-item-content"> </div>
<el-input style="width: 300px;" v-model="form.jingdu"></el-input> <div class="xy-table-item-content">
</div> <el-input style="width: 300px;" v-model="form.jingdu"></el-input>
</div> </div>
</template> </div>
<template v-slot:weidu> </template>
<div class="xy-table-item"> <template v-slot:weidu>
<div class="xy-table-item-label"> <div class="xy-table-item">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>纬度 <div class="xy-table-item-label">
</div> <span style="color: red;font-weight: 600;padding-right: 4px;"></span>纬度
<div class="xy-table-item-content"> </div>
<el-input style="width: 300px;" v-model="form.weidu"></el-input> <div class="xy-table-item-content">
</div> <el-input style="width: 300px;" v-model="form.weidu"></el-input>
</div> </div>
</template> </div>
<template v-slot:cangkujianjie> </template>
<div class="xy-table-item"> <template v-slot:cangkujianjie>
<div class="xy-table-item-label"> <div class="xy-table-item">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>仓库简介 <div class="xy-table-item-label">
</div> <span style="color: red;font-weight: 600;padding-right: 4px;"></span>仓库简介
<div class="xy-table-item-content"> </div>
<el-input style="width: 300px;" type="textarea" v-model="form.cangkujianjie"></el-input> <div class="xy-table-item-content">
</div> <el-input style="width: 300px;" type="textarea" v-model="form.cangkujianjie"></el-input>
</div> </div>
</template> </div>
</xy-dialog> </template>
</xy-dialog>
</div>
</template> </div>
</template>
<script>
import { <script>
save, import {
show save,
show
} from "@/api/system/baseForm.js" } from "@/api/system/baseForm.js"
import { import {
getparameteritem getparameteritem
} from "@/api/system/dictionary.js" } from "@/api/system/dictionary.js"
import { import {
Message Message
} from 'element-ui' } from 'element-ui'
import { saveStorehouseType } from '@/api/system/storehouseType' export default {
export default {
data() {
data() { return {
return { isShow: false,
isShow: false, type: 'add',
type: 'add', id: '',
id: '',
tableName: 'materialstorages', tableName: 'materialstorages',
// flood_storages // flood_storages
areaList:[], areaList:[],
mapparams: { mapparams: {
zoom: 11, zoom: 11,
}, },
mapform: [], mapform: [],
form: { form: {
cangkumingcheng: '', cangkumingcheng: '',
cangkubianma: '', cangkubianma: '',
suozaiquyu: '', suozaiquyu: '',
jiansheniandai: '', jiansheniandai: '',
cangkumianji: '', cangkumianji: '',
fuzeren: '', fuzeren: '',
lianxidianhua: '', lianxidianhua: '',
cangkudizhi: '', cangkudizhi: '',
jingdu: '', jingdu: '',
weidu: '', weidu: '',
cangkujianjie: '', cangkujianjie: '',
quyu_id:'' quyu_id:''
}, },
rules: { rules: {
cangkumingcheng: [{ cangkumingcheng: [{
required: true, required: true,
message: '请填写仓库名称' message: '请填写仓库名称'
}] }]
}, },
} }
}, },
created() { created() {
this.getArea() this.getArea()
}, },
methods: { methods: {
getArea(){ getArea(){
getparameteritem("area").then(res=>{ getparameteritem("area").then(res=>{
this.areaList = res.detail this.areaList = res.detail
@ -199,61 +200,75 @@
}, },
setTableName(e){ setTableName(e){
this.tableName = e?e:'materialstorages' this.tableName = e?e:'materialstorages'
}, },
async getDetail() { async getDetail() {
const res = await show({ const res = await show({
id: this.id, id: this.id,
table_name: this.tableName table_name: this.tableName
}) })
this.$integrateData(this.form, res) this.$integrateData(this.form, res)
this.mapform = [res.jingdu, res.weidu, res.cangkudizhi] this.mapform = [res.jingdu, res.weidu, res.cangkudizhi]
}, },
submit() { submit() {
const params = { if (this.type === 'add') {
name: this.form.cangkumingcheng, save({
remark: this.form.cangkujianjie, table_name: this.tableName,
}; ...this.form
if (this.type === 'editor') { }).then(res => {
params.id = this.id; Message({
} type: 'success',
saveStorehouseType(params).then(res => { message: '新增成功'
Message({ })
type: 'success', this.$emit('refresh')
message: this.type === 'add' ? '新增成功' : '编辑成功' this.isShow = false
})
this.$emit('refresh') })
this.isShow = false return
}) }
}, if (this.type === 'editor') {
save({
}, id: this.id,
watch: { table_name: this.tableName,
isShow(newVal) { ...this.form
if (newVal) { }).then(res => {
if (this.type === 'editor') { Message({
this.getDetail() type: 'success',
} message: '编辑成功'
} else { })
this.id = '' this.$emit('refresh')
this.type = '' this.isShow = false
this.mapform = [] })
this.$refs['dialog'].reset() }
} },
},
mapform(newVal, oldVal) { },
console.log(newVal) watch: {
this.form.jingdu = newVal[0]; isShow(newVal) {
this.form.weidu = newVal[1]; if (newVal) {
this.form.cangkudizhi = newVal[2]; if (this.type === 'editor') {
}, this.getDetail()
} }
} else {
} this.id = ''
</script> this.type = ''
this.mapform = []
<style scoped lang="scss"> this.$refs['dialog'].reset()
::v-deep .xy-table-item-label { }
min-width: 160px !important },
} mapform(newVal, oldVal) {
console.log(newVal)
this.form.jingdu = newVal[0];
this.form.weidu = newVal[1];
this.form.cangkudizhi = newVal[2];
},
}
}
</script>
<style scoped lang="scss">
::v-deep .xy-table-item-label {
min-width: 160px !important
}
</style> </style>

Loading…
Cancel
Save