Commit b336bb64 by zhuxiaomei

地点的添加

parent c83ebf77
......@@ -8,6 +8,7 @@ export default {
page: data => http.post('/drs/v1/sampling_place/page', data).then(res => res),
pageApp: data => http.post('/drs/v1/sampling_place/page_app', data).then(res => res),
edit: data => http.put('/drs/v1/sampling_place/' + data.id, data.obj).then(res => res),
add:data=>http.post('/drs/v1/sampling_place/', data).then(res=>res),
deleteByIds:ids=>http.delete('/drs/v1/sampling_place/?ids=' + ids).then(res=>res),
listPlaces: data => http.post('/drs/v1/sampling_place/list_places', data).then(res => res),
addMulti: data => http.put('/drs/v1/sampling_place/update_multi_selected', data).then(res => res),
......
......@@ -188,8 +188,6 @@
.box-c-2 {
> div:nth-child(1) {
background-image: linear-gradient(45deg, #536DFE, #00B0Ff)
/*background-image: linear-gradient(45deg, #10239e,#87e8de)*/
}
> div:nth-child(2) {
......
......@@ -65,6 +65,8 @@
<div>产品:{{item.product}}</div>
</div>
<template #right v-if="item.progress==='草稿'||item.progress==='审批驳回'">
<van-button square color="#75b7bd" text="提交 " class="swipe-cell-btn"
@click="_submit([item.id])"></van-button>
<van-button square type="info" text="编辑" class="swipe-cell-btn"
@click="_edit(item)"></van-button>
<van-button square type="primary" text="管理人员" class="swipe-cell-btn"
......
<template>
<div>
<div class="layout-cont-btn">
<van-form ref="form" @submit="onSubmit">
<van-field
v-model="formObj.name"
name="name"
required
label="地点"
placeholder="请输入地点"
:rules="[{ required: true, message: '' }]">
</van-field>
<van-field
v-model="formObj.address"
name="address"
label="地址"
placeholder="请输入地址">
</van-field>
<van-field
v-model="formObj.longitude"
name="longitude"
label="经度"
placeholder="请输入经度">
</van-field>
<van-field
v-model="formObj.latitude"
name="latitude"
label="纬度"
placeholder="请输入纬度">
</van-field>
</van-form>
</div>
<div class="bottom-btn">
<van-button type="info" block @click="_save">保存</van-button>
</div>
</div>
</template>
<script>
import {samplingPlace} from '../../../api'
export default {
name: "LocAdd",
data() {
return {
formObj: {
name: '',
address: '',
longitude: '',
latitude: '',
},
planId: ''
}
},
mounted() {
this.planId = this.$route.query.planId
},
methods: {
_save(){
this.$refs.form.submit()
},
onSubmit(){
this._saveOk()
},
_saveOk: async function () {
let obj = {...this.formObj, ...{planId: this.planId}}
let result = await samplingPlace.add(this.$serializeForm(obj))
if (result) {
this.$toast('操作成功!')
this.$router.go(-1)
}
}
}
}
</script>
<style scoped>
</style>
......@@ -25,6 +25,7 @@
</div>
<div class="bottom-btn">
<van-button type="info" square block @click="_add">添加</van-button>
<van-button type="warning" square block @click="_mapAdd">地图选取</van-button>
<van-button type="primary" square block @click="_create">随机生成抽样地点</van-button>
</div>
</div>
......@@ -80,9 +81,12 @@
this.page = this.page + 1;
this._getData()
},
_add() {
_mapAdd() {
this.$router.push({path: '/sampling_plan/select_loc', query: {planId: this.planId}})
},
_add() {
this.$router.push({path: '/sampling_plan/loc_add', query: {planId: this.planId}})
},
_del: async function (id) {
let result = await samplingPlace.deleteByIds([id])
if (result) {
......
......@@ -8,6 +8,7 @@ import CreateSampler from '@/page/sampling-plan/sampler/CreateSampler.vue'
import LocChecked from '@/page/sampling-plan/loc/LocChecked.vue'
import SelectLoc from '@/page/sampling-plan/loc/SelectLoc.vue'
import CreateLoc from '@/page/sampling-plan/loc/CreateLoc.vue'
import LocAdd from '@/page/sampling-plan/loc/LocAdd.vue'
import File from '@/page/sampling-plan/file/File.vue'
import FileDownLoad from '@/page/sampling-plan/file/FileDownLoad.vue'
......@@ -24,6 +25,7 @@ export default [
{path: 'loc_checked', component: LocChecked, meta: {title: '管理抽样地点'}},
{path: 'select_loc', component: SelectLoc, meta: {title: '选择抽样地点'}},
{path: 'create_loc', component: CreateLoc, meta: {title: '生成抽样地点'}},
{path: 'loc_add', component: LocAdd, meta: {title: '添加地点'}},
{path: 'file', component: File, meta: {title: '附件'}},
{path: 'file_upload', component: FileUpload, meta: {title: '添加附件'}},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment