|
|
@@ -160,6 +160,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { Message } from 'element-ui'
|
|
|
import { isValidIDCard, checkPhone } from '@/utils/index.js'
|
|
|
import SelectTree from '@/components/SelectTree';
|
|
|
import { addFarmer,editFarmer, getAreaInfo } from '@/api/farmer/list.js'
|
|
|
@@ -203,6 +204,7 @@ export default {
|
|
|
yieldPer: '0',
|
|
|
residualWaterRight: '0',
|
|
|
areasizeResidue: '0',
|
|
|
+ currentItem: {},
|
|
|
rules: {
|
|
|
areaId: [
|
|
|
{ required: true, message: '请选择所属区域', trigger: 'blur' }
|
|
|
@@ -265,7 +267,8 @@ export default {
|
|
|
if (+value < 0) { callback(new Error('水权不能为负数')); return }
|
|
|
if (isNaN(value)) { callback(new Error('请正确输入您的水权')); return }
|
|
|
if (this.isEdit) {
|
|
|
- if (+value > (+this.residualWaterRight) + (+this.editFarmerData.farmerWrbalance)) {
|
|
|
+ if (+value > (+this.residualWaterRight) + (+this.editFarmerData.farmerWramount)) {
|
|
|
+ console.log(22222 , (+this.residualWaterRight) , (+this.editFarmerData.farmerWramount))
|
|
|
callback(new Error('输入的水权不能大于剩余水权'))
|
|
|
return
|
|
|
} else {
|
|
|
@@ -349,6 +352,7 @@ export default {
|
|
|
waterrightYear: new Date().getFullYear(),
|
|
|
areaId: item.areaId
|
|
|
})
|
|
|
+ this.currentItem = item
|
|
|
const value = res?.data
|
|
|
this.cusareaName = item?.cusareaName
|
|
|
const areaId = item?.areaId || ''
|
|
|
@@ -361,6 +365,10 @@ export default {
|
|
|
this.cusareaName = ''
|
|
|
},
|
|
|
async handlerAddFarmer() {
|
|
|
+ if (this.currentItem?.children?.length > 0) {
|
|
|
+ Message.warning('请选择最小行政区块')
|
|
|
+ return
|
|
|
+ }
|
|
|
if(!this.isEdit){
|
|
|
const res = await addFarmer(this.baseForm)
|
|
|
if(res?.code === "000000") {
|