Sfoglia il codice sorgente

地块接口对接

rongxin_prod
QI_YUJIE 1 anno fa
parent
commit
c0cae56e97
6 ha cambiato i file con 516 aggiunte e 181 eliminazioni
  1. +44
    -0
      src/api/contracted/dk.js
  2. +10
    -2
      src/views/contracted/village/contractor/contractor.vue
  3. +5
    -5
      src/views/contracted/village/contractor/contractorDetailAdd.vue
  4. +6
    -13
      src/views/contracted/village/contractor/contractorLandDetail.vue
  5. +125
    -23
      src/views/contracted/village/massif/massif.vue
  6. +326
    -138
      src/views/contracted/village/massif/massifDetail.vue

+ 44
- 0
src/api/contracted/dk.js Vedi File

@@ -8,3 +8,47 @@ export function listDk(params) {
params: params
});
}

// 地块信息详情
export function getDk(id) {
return request({
url: '/service/dk/get/' + id,
method: 'get'
});
}

// 新增地块属性信息
export function addDk(data) {
return request({
url: '/service/dk/add',
method: 'post',
data: data
})
}

// 修改地块属性信息
export function updateDk(data) {
return request({
url: '/service/dk/edit',
method: 'post',
data: data
})
}

// 删除地块信息
export function deleteDk(id) {
return request({
url: '/service/dk/remove/' + id,
method: 'get'
});
}


// 生成地块编码
export function generateLandCode(params) {
return request({
url: '/service/dk/generateCode',
method: 'get',
params: params
});
}

+ 10
- 2
src/views/contracted/village/contractor/contractor.vue Vedi File

@@ -166,8 +166,16 @@
// on confirm
deleteCbf(id).then(res => {
if(res.code == 200){
this.$toast.success('删除成功');
this.cbfList.splice(index, 1);
this.$toast({
icon: 'success',
message: '删除成功',
duration: "1000",
onClose: () => {
this.cbfList.splice(index, 1);
this.totalNum = this.totalNum - 1;
}
});

}
});
}).catch(() => {


+ 5
- 5
src/views/contracted/village/contractor/contractorDetailAdd.vue Vedi File

@@ -10,12 +10,12 @@
</van-nav-bar>

<div class="list_main">
<van-field v-model="form.cbfbm" label="代码:" placeholder="请输入代码" required :rules="[{ required: true }]" :border="false" input-align="left">
<template #button>
<van-button size="mini" type="primary" native-type="button" @click="generateCode">生成代码</van-button>
</template>
</van-field>
<van-form ref="formData">
<van-field v-model="form.cbfbm" label="代码:" placeholder="请输入代码" required :rules="[{ required: true }]" :border="false" input-align="left">
<template #button>
<van-button size="mini" type="primary" native-type="button" @click="generateCode">生成代码</van-button>
</template>
</van-field>
<van-field
v-model="cbflxText"
label="类型:"


+ 6
- 13
src/views/contracted/village/contractor/contractorLandDetail.vue Vedi File

@@ -304,18 +304,6 @@
});
}
});
/* updateJtcy(this.form).then(response => {
if (response.code == 200) {
this.$toast({
icon: 'success',
message: '保存成功',
duration:"1000",
onClose: () => {
this.goBack();
}
});
}
}); */
} else {
this.form.deptId = this.$route.params.deptId;
this.form.cbfbm = this.$route.params.cbfbm;
@@ -337,7 +325,12 @@
});
},
onMapDrawFinished(data) {
this.form.theGeom = JSON.stringify(data);
if (data) {
this.form.theGeom = JSON.stringify(data);
} else {
this.form.theGeom = null;
}

},
},
};


+ 125
- 23
src/views/contracted/village/massif/massif.vue Vedi File

@@ -16,68 +16,170 @@
v-model="value"
shape="round"
background="transparent"
placeholder="请输入姓名搜索"
placeholder="请输入地块代码搜索"
@search="onSearch"
></van-search>

<div class="search_btn">
<div class="search_btn" @click="goDetail()">
<p class="active"> + 新增</p>
</div>

</div>

<div class="second_tap">
<p class="active">承包</p>
<!-- <p class="active">承包</p>
<p>自留</p>
<p>机动</p>
<p>开荒</p>
<p>其他</p>
<p>其他</p> -->
<p v-for="dict in dklbOptions" :key="dict.dictValue" :class="{active: landCategory === dict.dictValue}" @click="landCategoryChange(dict.dictValue, dict.dictLabel)">{{dict.dictLabel}}</p>
</div>

<p class="page_tab">自留地 <span>5153亩</span></p>
<p class="page_tab">{{ tagName }} <span>{{ totalNum }}块</span></p>
<div class="list_main">
<van-row style="color: #888888;font-size: 14px;">
<van-col span="9">地块代码</van-col>
<van-col span="10">地块名称</van-col>
<van-col span="5">面积(亩)</van-col>
</van-row>
<van-swipe-cell v-for="(item,index) in 50">
<van-row @click="goDetail">
<van-col span="9">45412353553</van-col>
<van-col span="10">西湖地地块名称</van-col>
<van-col span="5" style="color: #f78200">7</van-col>
</van-row>
<template #right>
<van-button square type="danger" text="删除" />
</template>
</van-swipe-cell>
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
:immediate-check="false"
@load="getList"
>
<van-swipe-cell v-for="(item,index) in landList">
<van-row @click="goDetail(item.id)">
<van-col span="9">{{ item.dkbm }}</van-col>
<van-col span="10">{{ item.dkmc }}</van-col>
<van-col span="5" style="color: #f78200">{{ item.scmjm }}</van-col>
</van-row>
<template #right>
<van-button square type="danger" text="删除" native-type="button" @click="deleteLand(item.id, index)" />
</template>
</van-swipe-cell>
</van-list>
</div>

</div>
</template>
<script>
import Cookies from "js-cookie";
import { listDk, deleteDk } from "@/api/contracted/dk";

export default {
name: "contractedVillageContractor",
data() {
return {
loading:false,
finished:true,
value:''
finished:false,
value:'',
// 查询参数
queryParams: {
deptId: null,
dkbm: null,
dklb: null,
pageNum:1,
pageSize:20,
},
// 地块类别字典
dklbOptions: [],
// 地块类别
landCategory: null,
// 当前选中的地块类别
tagName: null,
// 当前调查状态下的地块总数
totalNum: 0,
// 地块列表
landList: [],
};
},
created() {

this.queryParams.deptId = this.$route.query.deptId;
this.getDicts("land_type").then(response => {
this.dklbOptions = response.data;
if (this.dklbOptions.length > 0) {
this.queryParams.dklb = this.dklbOptions[0].dictValue;
this.landCategory = this.dklbOptions[0].dictValue;
this.tagName = this.dklbOptions[0].dictLabel;
}
this.getList();
});
},
methods: {
getList(){

this.loading = true;
listDk(this.queryParams).then(response => {
response.rows.forEach(item => {
this.landList.push(item);
});
this.totalNum = response.total;
if (this.landList.length >= response.total) {
this.finished = true;
return;
} else {
this.loading = false;
this.queryParams.pageNum += 1;
}
});
},
onSearch(){

this.queryParams.dkbm = this.value;
this.queryData();
},
landCategoryChange(dictValue, dictLabel) {
this.landCategory = dictValue;
this.queryParams.dklb = dictValue;
this.tagName = dictLabel;
this.totalNum = 0;
this.queryData();
},
queryData() {
this.queryParams.pageNum = 1;
this.finished = false;
this.landList = [];
this.getList();
},
goDetail(id){
if (id) {
this.$router.push({
path:'/contracted/village/massifDetail',
query: {
deptId: this.$route.query.deptId,
id: id
}
});
} else {
this.$router.push({
path:'/contracted/village/massifDetail',
query: {
deptId: this.$route.query.deptId
}
});
}
},
goDetail(){
this.$router.push({path:'/contracted/village/massifDetail', query: { deptId: this.$route.query.deptId, deptName: this.$route.query.deptName }});
deleteLand(id, index) {
this.$dialog.confirm({
message: '是否确认删除此地块?',
}).then(() => {
// on confirm
deleteDk(id).then(res => {
if (res.code == 200) {
this.$toast({
icon: 'success',
message: '删除成功',
duration: "1000",
onClose: () => {
this.landList.splice(index, 1);
this.totalNum = this.totalNum - 1;
}
});
}
});
}).catch(() => {
// on cancel
});
}
},
};
@@ -162,7 +264,7 @@
background: #dbf1ea;
border: 1px solid #cdcdcd;
color: #5f5f5f;
padding: 5PX 15PX;
padding: 5PX 8PX;
margin-right: 3vw;
border-radius: 50PX;
}


+ 326
- 138
src/views/contracted/village/massif/massifDetail.vue Vedi File

@@ -1,149 +1,151 @@
<template>
<div class="app-container">

<van-nav-bar left-arrow fixed placeholder @click-left="onClickLeft" >
<van-nav-bar left-arrow fixed placeholder @click-left="goBack" >
<template #title>
<div class="tb_main">
{{$route.query.deptName}}
{{ titleName }}
</div>
</template>
</van-nav-bar>

<div class="tap_block">
<!-- <div class="tap_block">
<p @click="$router.push({path:'/contracted/village/contractor', query: { deptId: $route.query.deptId, deptName: $route.query.deptName }})">承包方</p>
<p @click="$router.push({path:'/contracted/village/employer', query: { deptId: $route.query.deptId, deptName: $route.query.deptName }})">发包方</p>
<p class="active">地块</p>
<p @click="$router.push({path:'/contracted/village/map', query: { deptId: $route.query.deptId, deptName: $route.query.deptName }})">地图</p>
</div>
</div> -->

<div class="list_main">
<van-field v-model="value" label="地块代码:" placeholder="请输入地块代码" required :border="false" input-align="right" label-width="auto" />
<van-field v-model="value" label="地块名称:" placeholder="请输入地块名称" required :border="false" input-align="right" label-width="auto" />

<van-field v-model="value" label="所有权性质:"
placeholder="请选择所有权性质"
required
:border="false"
input-align="right"
right-icon="arrow-down"
label-width="auto"
readonly
clickable
@click="showType = true"
/>
<van-popup v-model="showSYQXZ" position="bottom">
<van-picker
show-toolbar
:columns="typeOptions"
value-key="dictLabel"
@confirm="onConfirmTypeOptions"
@cancel="showSYQXZ = false"
<van-form ref="formData">
<van-field v-model="form.dkbm" label="地块代码:" placeholder="请输入地块代码" required :rules="[{ required: true }]" :border="false" input-align="right" label-width="auto" :disabled="isDisabled">
<template #button v-if="!$route.query.id">
<van-button size="mini" type="primary" native-type="button" @click="generateCode">生成代码</van-button>
</template>
</van-field>
<van-field v-model="form.dkmc" label="地块名称:" placeholder="请输入地块名称" required :rules="[{ required: true }]" :border="false" input-align="right" />
<van-field v-model="syqxzText" label="所有权性质:"
placeholder="请选择所有权性质"
required
:rules="[{ required: true }]"
:border="false"
input-align="right"
right-icon="arrow-down"
readonly
clickable
@click="showOwnership = true"
/>
</van-popup>

<van-field v-model="value" label="地块类别:"
placeholder="请选择地块类别"
required
:border="false"
input-align="right"
right-icon="arrow-down"
label-width="auto"
readonly
clickable
@click="showZjType = true"
/>
<van-popup v-model="showDKLB" position="bottom">
<van-picker
show-toolbar
:columns="zjTypeOptions"
value-key="dictLabel"
@confirm="onConfirmZjTypeOptions"
@cancel="showDKLB = false"
<van-popup v-model="showOwnership" position="bottom">
<van-picker
show-toolbar
:columns="syqxzOptions"
value-key="dictLabel"
@confirm="onConfirmOwnershipOptions"
@cancel="showOwnership = false"
/>
</van-popup>
<van-field v-model="dklbText" label="地块类别:"
placeholder="请选择地块类别"
required
:rules="[{ required: true }]"
:border="false"
input-align="right"
right-icon="arrow-down"
readonly
clickable
@click="showLandCategory = true"
/>
</van-popup>

<van-field v-model="value" label="土地利用类型:"
placeholder="请选择土地利用类型"
required
:border="false"
input-align="right"
right-icon="arrow-down"
label-width="auto"
readonly
clickable
@click="showType = true"
/>
<van-popup v-model="showType" position="bottom">
<van-picker
show-toolbar
:columns="typeOptions"
value-key="dictLabel"
@confirm="onConfirmTypeOptions"
@cancel="showType = false"
<van-popup v-model="showLandCategory" position="bottom">
<van-picker
show-toolbar
:columns="dklbOptions"
value-key="dictLabel"
@confirm="onConfirmLandCategoryOptions"
@cancel="showLandCategory = false"
/>
</van-popup>
<van-field v-model="tdlylxText" label="土地利用类型:"
placeholder="请选择土地利用类型"
required
:rules="[{ required: true }]"
:border="false"
input-align="right"
right-icon="arrow-down"
readonly
clickable
@click="showLandType = true"
/>
</van-popup>

<van-field v-model="value" label="地力等级:"
placeholder="请选择地力等级"
required
:border="false"
input-align="right"
right-icon="arrow-down"
label-width="auto"
readonly
clickable
@click="showZjType = true"
/>
<van-popup v-model="showZjType" position="bottom">
<van-picker
show-toolbar
:columns="zjTypeOptions"
value-key="dictLabel"
@confirm="onConfirmZjTypeOptions"
@cancel="showZjType = false"
<van-popup v-model="showLandType" position="bottom">
<van-picker
show-toolbar
:columns="tdlylxOptions"
value-key="dictLabel"
@confirm="onConfirmLandTypeOptions"
@cancel="showLandType = false"
/>
</van-popup>
<van-field v-model="dldjText" label="地力等级:"
placeholder="请选择地力等级"
required
:rules="[{ required: true }]"
:border="false"
input-align="right"
right-icon="arrow-down"
readonly
clickable
@click="showLandGrade = true"
/>
</van-popup>

<van-field v-model="value" label="土地用途:"
placeholder="请选择土地用途"
required
:border="false"
input-align="right"
right-icon="arrow-down"
label-width="auto"
readonly
clickable
@click="showTDYT = true"
/>
<van-popup v-model="showTDYT" position="bottom">
<van-picker
show-toolbar
:columns="TDYTOptions"
value-key="dictLabel"
@confirm="onConfirmTDYTOptions"
@cancel="showTDYT = false"
<van-popup v-model="showLandGrade" position="bottom">
<van-picker
show-toolbar
:columns="dldjOptions"
value-key="dictLabel"
@confirm="onConfirmLandGradeOptions"
@cancel="showLandGrade = false"
/>
</van-popup>
<van-field v-model="tdytText" label="土地用途:"
placeholder="请选择土地用途"
required
:rules="[{ required: true }]"
:border="false"
input-align="right"
right-icon="arrow-down"
readonly
clickable
@click="showLandPurpose = true"
/>
</van-popup>

<van-field v-model="value" label="基本农田:" required :border="false" input-align="right" >
<template #input>
<van-radio-group v-model="radio" direction="horizontal">
<van-radio name="1">是</van-radio>
<van-radio name="2">否</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field v-model="value" label="实测面积(亩):" placeholder="请输入实测面积(亩)" required :border="false" input-align="right" label-width="auto" />
<van-field v-model="value" label="指界人:" placeholder="请输入指界人" required :border="false" input-align="right" label-width="auto" />
<van-field v-model="value" label="东面:" placeholder="请输入东面" required :border="false" input-align="right" label-width="auto" />
<van-field v-model="value" label="西面:" placeholder="请输入西面" required :border="false" input-align="right" label-width="auto" />
<van-field v-model="value" label="南面:" placeholder="请输入南面" required :border="false" input-align="right" label-width="auto" />
<van-field v-model="value" label="北面:" placeholder="请输入北面" required :border="false" input-align="right" label-width="auto" />
<van-field v-model="value" label="备注:" placeholder="请输入备注" :border="false" input-align="right" label-width="auto" />

<div class="mapBox"></div>

<p class="btn">保存</p>
<van-popup v-model="showLandPurpose" position="bottom">
<van-picker
show-toolbar
:columns="tdytOptions"
value-key="dictLabel"
@confirm="onConfirmLandPurposeOptions"
@cancel="showLandPurpose = false"
/>
</van-popup>
<van-field v-model="form.sfjbnt" label="基本农田:" required :rules="[{ required: true }]" :border="false" input-align="right" >
<template #input>
<van-radio-group v-model="form.sfjbnt" direction="horizontal">
<!-- <van-radio name="1">是</van-radio>
<van-radio name="2">否</van-radio> -->
<van-radio v-for="dict in sfjbntOptions" :ke="dict.dictValue" :name="dict.dictValue">{{ dict.dictLabel }}</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field v-model="form.scmjm" type="number" label="实测面积(亩):" placeholder="请输入实测面积(亩)" required :rules="[{ required: true }]" :border="false" input-align="right" />
<van-field v-model="form.zjrxm" label="指界人姓名:" placeholder="请输入指界人姓名" required :rules="[{ required: true }]" :border="false" input-align="right" />
<van-field v-model="form.dkdz" label="地块东至:" placeholder="请输入地块东至" required :rules="[{ required: true }]" :border="false" input-align="right" />
<van-field v-model="form.dkxz" label="地块西至:" placeholder="请输入地块西至" required :rules="[{ required: true }]" :border="false" input-align="right" />
<van-field v-model="form.dknz" label="地块南至:" placeholder="请输入地块南至" required :rules="[{ required: true }]" :border="false" input-align="right" />
<van-field v-model="form.dkbz" label="地块北至:" placeholder="请输入地块北至" required :rules="[{ required: true }]" :border="false" input-align="right" />
<van-field v-model="form.dkbzxx" label="地块备注信息:" placeholder="请输入地块备注信息" :border="false" input-align="right" />

<div class="mapBox">
<common-map ref="landMap" :minMapZoom="15" :maxMapZoom="18" :allowDraw="true" @drawFinished="onMapDrawFinished" />
</div>
</van-form>
<p class="btn" @click="submitForm">保存</p>
</div>


@@ -151,8 +153,15 @@
</template>
<script>
import Cookies from "js-cookie";
import { getDk, addDk, updateDk, generateLandCode } from "@/api/contracted/dk";
import { getDept } from "@/api/contracted";
import CommonMap from "@/components/house/CommonMap";

export default {
name: "contractedVillageContractor",
components: {
CommonMap
},
data() {
return {
loading:false,
@@ -179,28 +188,199 @@
minDate: new Date(2020, 0, 1),
maxDate: new Date(2025, 10, 1),
currentDate: new Date(2021, 0, 17),

titleName: '', // 标题信息
isDisabled: false, // 是否禁用
form: {}, // 地块信息表单
syqxzOptions: [], // 所有权性质字典
syqxzText: null, // 所有权性质标签名
showOwnership: false, // 控制所有权性质字典弹出层的显示和隐藏
dklbOptions: [], // 地块类别字典
dklbText: null, // 地块类别标签名
showLandCategory: false, // 控制的地块类别字典弹出层的显示和隐藏
dldjOptions: [], // 地力等级字典
dldjText: null, // 地力等级标签名
showLandGrade: false, // 控制地力等级字典弹出层的显示和隐藏
tdytOptions: [], // 土地用途字典
tdytText: null, // 土地用途标签名
showLandPurpose: false, // 控制土地用途字典弹出层的显示和隐藏
tdlylxOptions: [], // 土地利用类型
tdlylxText: null, // 土地利用类型标签名
showLandType: false, // 控制土地利用类型字典弹出层的显示和隐藏
sfjbntOptions: [], // 是否基本农田字典
};
},
created() {

this.getDicts("land_ownership").then(response => {
this.syqxzOptions = response.data;
});
this.getDicts("land_type").then(response => {
this.dklbOptions = response.data;
});
this.getDicts("land_grade").then(response => {
this.dldjOptions = response.data;
});
this.getDicts("use_code").then(response => {
this.tdytOptions = response.data;
});
this.getDicts("land_use").then(response => {
this.tdlylxOptions = response.data;
});
this.getDicts("is_common").then(response => {
this.sfjbntOptions = response.data;
});
},
mounted() {
if (this.$route.query.id) {
this.titleName = '修改地块信息';
this.isDisabled = true;
this.getDetail();
} else {
this.titleName = '新增地块信息';
this.resetForm();
this.getCoordinates();
}
},
methods: {
getList(){

getDetail() {
getDk(this.$route.query.id).then(response => {
const data = response.data;
this.form = data;
this.syqxzText = this.selectDictLabel(this.syqxzOptions, data.syqxz);
this.dklbText = this.selectDictLabel(this.dklbOptions, data.dklb);
this.dldjText = this.selectDictLabel(this.dldjOptions, data.dldj);
this.tdytText = this.selectDictLabel(this.tdytOptions, data.tdyt);
this.tdlylxText = this.selectDictLabel(this.tdlylxOptions, data.tdlylx);
if (response.data.theGeomJson) {
this.form.theGeom = JSON.stringify(JSON.parse(response.data.theGeomJson).coordinates);
this.$nextTick(() => {
this.$refs.landMap.setLayer('_Draw_layer', response.data.theGeomJson);
});
} else {
this.getCoordinates();
}
});
},
onSearch(){

resetForm() {
this.form = {
deptId: null,
dkbm: null,
dkmc: null,
syqxz: null,
dklb: null,
tdlylx: null,
dldj: null,
tdyt: null,
sfjbnt: '1',
scmjm: null,
zjrxm: null,
dkdz: null,
dkxz: null,
dknz: null,
dkbz: null,
dkbzxx: null,
theGeom: null
};
},
onConfirmTypeOptions(){

getCoordinates() {
getDept(this.$route.query.deptId).then(response => {
const lng = response.data.lng;
const lat = response.data.lat;
if (lng && lat) {
this.$nextTick(() => {
this.$refs.landMap.setCoord(lng, lat);
});
}
});
},
onConfirmZjTypeOptions(){

onConfirmOwnershipOptions(value){
this.form.syqxz = value.dictValue;
this.syqxzText = value.dictLabel;
this.showOwnership = false;
},
onConfirmTDYTOptions(){

onConfirmLandCategoryOptions(value){
this.form.dklb = value.dictValue;
this.dklbText = value.dictLabel;
this.showLandCategory = false;
},

onConfirmLandTypeOptions(value) {
this.form.tdlylx = value.dictValue;
this.tdlylxText = value.dictLabel;
this.showLandType = false;
},
onConfirmLandGradeOptions(value) {
this.form.dldj = value.dictValue
this.dldjText = value.dictLabel;
this.showLandGrade = false;
},
onConfirmLandPurposeOptions(value){
this.form.tdyt = value.dictValue;
this.tdytText = value.dictLabel;
this.showLandPurpose = false;
},
submitForm() {
this.$refs.formData.validate().then(() => {
if (this.$route.query.id) {
updateDk(this.form).then(response => {
if (response.code == 200) {
this.$toast({
icon: 'success',
message: '保存成功',
duration:"1000",
onClose: () => {
this.goBack();
}
});
}
});
} else {
this.form.deptId = this.$route.query.deptId;
addDk(this.form).then(response => {
if (response.code == 200) {
this.$toast({
icon: 'success',
message: '保存成功',
duration:"1000",
onClose: () => {
this.goBack();
}
});
}
});
/* this.form.deptId = this.$route.params.deptId;
this.form.cbfbm = this.$route.params.cbfbm;
addCbdkxx(this.form).then(response => {
if (response.code == 200) {
this.$toast({
icon: 'success',
message: '保存成功',
duration:"1000",
onClose: () => {
this.goBack();
}
});
}
}); */
}
}).catch(() => {
this.$notify({ type: 'danger', message: '请填写完整的表单项' });
});
},
onMapDrawFinished(data) {
if (data) {
this.form.theGeom = JSON.stringify(data);
} else {
this.form.theGeom = null;
}
},
generateCode() {
generateLandCode({deptId: this.$route.query.deptId}).then(response => {
this.$set(this.form, 'dkbm', response.data);
});
},
goBack() {
history.back(-1);
}
},
};
</script>
@@ -238,6 +418,14 @@
overflow: initial;
}

/deep/ .van-field--disabled .van-field__label {
color: #646566;
}

/deep/ .van-field__label {
width: 7em;
}

.tb_main{
position: relative;
p{


Caricamento…
Annulla
Salva