优化
This commit is contained in:
parent
ae253bcbc6
commit
a9e8bc72f1
@ -2,27 +2,27 @@
|
|||||||
<view class="component">
|
<view class="component">
|
||||||
<view class="title">地区信息</view>
|
<view class="title">地区信息</view>
|
||||||
<u--form labelPosition="left" :model="formData" :rules="rules" ref="districtForm">
|
<u--form labelPosition="left" :model="formData" :rules="rules" ref="districtForm">
|
||||||
<u-form-item label="省" required prop="province" @click="changeCity('province')" borderBottom>
|
<u-form-item v-if="!readonly" label="省" :required="!readonly" prop="province" @click="changeCity('province')" borderBottom>
|
||||||
<u--input :value="formDataText.province" disabled disabledColor="#fff" placeholder="请选择省"></u--input>
|
<u--input :value="formDataText.province" disabled disabledColor="#fff" placeholder="请选择省"></u--input>
|
||||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="市" required prop="city" @click="changeCity('city')" borderBottom>
|
<u-form-item v-if="!readonly" label="市" :required="!readonly" prop="city" @click="changeCity('city')" borderBottom>
|
||||||
<u--input :value="formDataText.city" disabled disabledColor="#fff" placeholder="请选择市"></u--input>
|
<u--input :value="formDataText.city" disabled disabledColor="#fff" placeholder="请选择市"></u--input>
|
||||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="区县" required prop="area" @click="changeCity('area')" borderBottom>
|
<u-form-item label="区县" :required="!readonly" prop="area" @click="changeCity('area')" borderBottom>
|
||||||
<u--input :value="formDataText.area" disabled disabledColor="#fff" placeholder="请选择区县"></u--input>
|
<u--input :value="formDataText.area" disabled disabledColor="#fff" placeholder="请选择区县"></u--input>
|
||||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="乡镇" required prop="street" @click="changeCity('street')" borderBottom>
|
<u-form-item label="乡镇" :required="!readonly" prop="street" @click="changeCity('street')" borderBottom>
|
||||||
<u--input :value="formDataText.street" disabled disabledColor="#fff" placeholder="请选择镇"></u--input>
|
<u--input :value="formDataText.street" disabled disabledColor="#fff" placeholder="请选择镇"></u--input>
|
||||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="村社" required prop="village" @click="changeCity('village')" borderBottom>
|
<u-form-item label="村社" :required="!readonly" prop="village" @click="changeCity('village')" borderBottom>
|
||||||
<u--input :value="formDataText.village" type="text" disabled disabledColor="#fff" placeholder="请选择村"></u--input>
|
<u--input :value="formDataText.village" type="text" disabled disabledColor="#fff" placeholder="请选择村"></u--input>
|
||||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="小队" required prop="brigade" @click="changeCity('brigade')" borderBottom>
|
<u-form-item label="小队" :required="!readonly" prop="brigade" @click="changeCity('brigade')" borderBottom>
|
||||||
<u--input :value="formDataText.brigade" disabled disabledColor="#fff" placeholder="请选择小队"></u--input>
|
<u--input :value="formDataText.brigade" disabled disabledColor="#fff" placeholder="请选择小队"></u--input>
|
||||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
@ -110,13 +110,25 @@
|
|||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
datas(newValue, oldValue){
|
datas(newValue, oldValue){
|
||||||
if(newValue){
|
if(this.$props.readonly&&newValue){
|
||||||
console.log('获取地址');
|
this.formDataText.area = this.$props.datas.area_name;
|
||||||
|
this.formDataText.street = this.$props.datas.street_name;
|
||||||
|
this.formDataText.village = this.$props.datas.village_name;
|
||||||
|
this.formDataText.brigade = this.$props.datas.brigade_name;
|
||||||
|
|
||||||
|
this.formData.area = this.$props.datas.area_id;
|
||||||
|
this.formData.street = this.$props.datas.street_id;
|
||||||
|
this.formData.village = this.$props.datas.village_id;
|
||||||
|
this.formData.brigade = this.$props.datas.brigade_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
if(!this.$props.readonly) this.initProvinceAndCity();
|
if(!this.$props.readonly) {
|
||||||
|
this.initProvinceAndCity();
|
||||||
|
}else{
|
||||||
|
this.rules = {};
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
async validate(){
|
async validate(){
|
||||||
|
@ -212,8 +212,10 @@
|
|||||||
let flag1 = this.$refs.districtSelectorRef.validate();
|
let flag1 = this.$refs.districtSelectorRef.validate();
|
||||||
let flag2 = this.$refs.residentsRef.validate();
|
let flag2 = this.$refs.residentsRef.validate();
|
||||||
let flag3 = this.$refs.breedingRef.validate();
|
let flag3 = this.$refs.breedingRef.validate();
|
||||||
|
// return console.log(flag1);
|
||||||
this.$refs.archives.validate().then(async (e) => {
|
this.$refs.archives.validate().then(async (e) => {
|
||||||
if (e && flag1 && flag2 && flag3) {
|
console.log('提交');
|
||||||
|
if (e && flag1==true && flag2==true && flag3==true) {
|
||||||
uni.showLoading()
|
uni.showLoading()
|
||||||
let districtForm = {
|
let districtForm = {
|
||||||
area_id: this.$refs.districtSelectorRef.formData.area,
|
area_id: this.$refs.districtSelectorRef.formData.area,
|
||||||
@ -226,7 +228,7 @@
|
|||||||
...districtForm,
|
...districtForm,
|
||||||
...this.$refs.residentsRef.residents,
|
...this.$refs.residentsRef.residents,
|
||||||
datas: [{
|
datas: [{
|
||||||
id: 7,
|
card_id: 7,
|
||||||
datas: {
|
datas: {
|
||||||
...this.$refs.breedingRef.formData
|
...this.$refs.breedingRef.formData
|
||||||
}
|
}
|
||||||
@ -255,7 +257,7 @@
|
|||||||
// console.log(this.$refs['demandRef'+item.category_id+''+item.category_child][0]);
|
// console.log(this.$refs['demandRef'+item.category_id+''+item.category_child][0]);
|
||||||
this.$refs['demandRef' + item.id][0].validate();
|
this.$refs['demandRef' + item.id][0].validate();
|
||||||
datas.push({
|
datas.push({
|
||||||
id: item.id,
|
card_id: item.id,
|
||||||
datas: { ...this.$refs['demandRef' + item.id][0]['formData'] }
|
datas: { ...this.$refs['demandRef' + item.id][0]['formData'] }
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -83,12 +83,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right"
|
|
||||||
@click="naviTo('/subpkg/pdfView/pdfView?url=' + userInfo.contract&&userInfo.contract.file)">
|
|
||||||
<!-- <image class="icon"></image> -->
|
|
||||||
<uni-icons type="paperclip" color="#3274F9"></uni-icons>
|
|
||||||
<view>查看</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user