@@ -71,6 +71,14 @@ export function delShyqr(id) { | |||
method: 'get' | |||
}) | |||
} | |||
// 删除数据调查-使用权人 | |||
export function deleleShyqr(nhdm) { | |||
return request({ | |||
url: '/home/homesteadshyqr/removeMobile/' + nhdm, | |||
method: 'get' | |||
}) | |||
} | |||
// 设为户主-使用权人 | |||
export function setSyqrInfo(data) { | |||
@@ -105,7 +105,7 @@ | |||
</template> | |||
<script> | |||
import {getShyqrs,addShyqr,updateShyqr,delShyqr,setSyqrInfo} from "@/api/homesteadSurvey/shyqr"; | |||
import {getShyqrs,addShyqr,updateShyqr,deleleShyqr,setSyqrInfo} from "@/api/homesteadSurvey/shyqr"; | |||
import {listZjdzd,getZjdzd,updateZjdzd,addZjdzd,uploadFile,getQueryLand,submitOnly} from "@/api/homesteadSurvey/zjdzd"; | |||
import MapGisDrawing from "@/components/Map/MapGisDrawing"; | |||
import {listZrz,addZrz,updateZrz,getZrzZjdDmList,delZrz,updateZrzStatus} from "@/api/homesteadSurvey/zrz"; | |||
@@ -202,7 +202,8 @@ export default { | |||
// } | |||
}, | |||
deleteshyqr(val){ | |||
const ids = val.id || this.ids; | |||
const nhdm = val.nhdm | |||
console.info(val.id); | |||
Dialog.confirm({ | |||
title: '系统提示', | |||
message: '是否确认删除使用权人数据项?', | |||
@@ -210,7 +211,7 @@ export default { | |||
cancelButtonText: '取消' | |||
}) | |||
.then(function() { | |||
return delShyqr(ids); | |||
return deleleShyqr(nhdm); | |||
}).then(() => { | |||
this.$notify({ type: 'success' , message: "删除成功" }); | |||
location.reload(true); | |||
@@ -599,21 +599,73 @@ | |||
}, | |||
//删除户主 | |||
deletenh(item,index){ | |||
Dialog.confirm({ | |||
title: '警告', | |||
message: '确认删除户内成员么?', | |||
}) | |||
.then(() => { | |||
// on confirm | |||
delNhhncy(item.id).then(res => { | |||
if(res.code=="200"){ | |||
this.hncylist.splice(index,1); | |||
} | |||
if(item.yhzgx !== "02"){ | |||
Dialog.confirm({ | |||
title: '警告', | |||
message: '确认删除此户内成员?', | |||
}) | |||
}) | |||
.catch(() => { | |||
// on cancel | |||
.then(() => { | |||
// on confirm | |||
delNhhncy(item.id).then(res => { | |||
if(res.code=="200"){ | |||
this.getNh(this.shyqrData.nhdm); | |||
} | |||
}) | |||
}) | |||
.catch(() => { | |||
// on cancel | |||
}); | |||
}else{ | |||
let yes = true | |||
let params={ | |||
nhdm : item.nhdm, | |||
deptId: item.deptId | |||
} | |||
listNhhncy(params).then((res) => { | |||
if(res.rows.length>1){ | |||
yes = false | |||
this.$toast({ | |||
icon: 'error', // 找到自己需要的图标 | |||
message: '无法删除,此户主存在户内成员!', | |||
duration:"1000", | |||
onClose:function(){ | |||
} | |||
}) | |||
}else{ | |||
listShyqr(params).then((res) => { | |||
if(res.rows.length>0){ | |||
yes = false | |||
this.$toast({ | |||
icon: 'error', // 找到自己需要的图标 | |||
message: '无法删除,此户主已经成为使用权人!', | |||
duration:"1000", | |||
onClose:function(){ | |||
} | |||
}) | |||
}else{ | |||
if(yes){ | |||
Dialog.confirm({ | |||
title: '警告', | |||
message: '确认删除此农户么?', | |||
}) | |||
.then(() => { | |||
// on confirm | |||
delNhhncy(item.id).then(res => { | |||
if(res.code=="200"){ | |||
this.getNh(this.shyqrData.nhdm); | |||
} | |||
}) | |||
}) | |||
.catch(() => { | |||
// on cancel | |||
}); | |||
} | |||
} | |||
}); | |||
} | |||
}); | |||
} | |||
}, | |||
// 设为户主 | |||
@@ -83,7 +83,7 @@ | |||
<p style="display: flex;align-items: center;margin-top: 5px;"><img src="../../assets/images/housesteadSurvey/list05.png" alt="" style="margin-right: 5px;">农户代码:<span style="margin-left: auto;">{{item.nhdm}}</span></p> | |||
</div> | |||
<template #right> | |||
<van-button square type="danger" class="delete-button" @click="deletenh(item.id)"><img width="10px" src="../../assets/images/sunVillage_info/list_icon_7.png" alt=""> 删除</van-button> | |||
<van-button square type="danger" class="delete-button" @click="deletenh(item)"><img width="10px" src="../../assets/images/sunVillage_info/list_icon_7.png" alt=""> 删除</van-button> | |||
</template> | |||
</van-swipe-cell> | |||
</van-list> | |||
@@ -595,7 +595,7 @@ | |||
} | |||
listNhhncy(params).then((res) => { | |||
console.log(res.rows.length) | |||
if(res.rows.length>0){ | |||
if(res.rows.length>1){ | |||
yes = false | |||
this.$toast({ | |||
icon: 'error', // 找到自己需要的图标 | |||
@@ -619,15 +619,13 @@ | |||
if(yes){ | |||
Dialog.confirm({ | |||
title: '警告', | |||
message: '确认删除此使用权人么?', | |||
message: '确认删除此农户么?', | |||
}) | |||
.then(() => { | |||
// on confirm | |||
delNh(item.id).then(res => { | |||
if(res.code=="200"){ | |||
this.nhlist.splice(index,1); | |||
this.totalH-- | |||
this.totalR-- | |||
this.getNh(); | |||
} | |||
}) | |||
}) | |||
@@ -84,7 +84,7 @@ | |||
</div> | |||
</div> | |||
<template #right> | |||
<van-button v-if="permission == 'true'" square text="删除" type="danger" class="delete-button" @click="deletehncy(item.id,index)"><img width="10px" src="../../assets/images/sunVillage_info/list_icon_7.png" alt="">删除</van-button> | |||
<van-button v-if="permission == 'true' && item.yhzgx != '02'" square text="删除" type="danger" class="delete-button" @click="deletehncy(item.id,index)"><img width="10px" src="../../assets/images/sunVillage_info/list_icon_7.png" alt="">删除</van-button> | |||
</template> | |||
</van-swipe-cell> | |||
<van-dialog v-model="guohuData.visible" title="成员移户" show-cancel-button confirmButtonText="确认" cancelButtonText="关闭" @confirm="guohu" @cancel="show=false"> | |||