Przeglądaj źródła

尚志:承包方家庭成员添加字段

rongxin_dev
张泽亮 1 tydzień temu
rodzic
commit
1728168d92
1 zmienionych plików z 47 dodań i 0 usunięć
  1. +47
    -0
      src/views/contracted/village/contractor/contractorFamilyDetail.vue

+ 47
- 0
src/views/contracted/village/contractor/contractorFamilyDetail.vue Wyświetl plik

@@ -170,6 +170,14 @@
<van-field v-model="form.cybzsm" label="备注说明:" placeholder="请输入备注说明" type="textarea" rows="3" :border="false" input-align="right" maxlength="250" />
<!-- <van-field v-model="form.cycgfs" label="持股份数:" type="number" placeholder="请输入持股份数" :border="false" input-align="right" />
<van-field v-model="form.gqzbh" label="股权编号:" placeholder="请输入股权编号" :border="false" input-align="right" /> -->

<van-field label="佐证资料:" required :border="false" input-align="right" :rules="[{ required: true }]">
<template #input>
<van-uploader v-model="cyImg" multiple :after-read="afterRead" @delete="deleteFile" style="margin-top: 10PX" />
</template>
</van-field>


</van-form>
<p class="btn" @click="submitForm" v-if="taskStatus === '2' && $route.params.surveyStatus !== '3'">保存</p>
</div>
@@ -183,6 +191,7 @@
import FieldSelect from "@/components/form/FieldSelect";
import FieldDatePicker from "@/components/form/FieldDatePicker";
import { getJtcy, addJtcy, updateJtcy } from "@/api/contracted/cbfjtcy";
import {commonUpload} from "@/api/sunVillage_info/fixedAssets";

export default {
name: "contractedVillageContractor",
@@ -208,6 +217,8 @@
showNewAt: false, // 控制新建日期弹出层的显示和隐藏
minDate: new Date(1978, 0, 1),
maxDate: new Date(2100, 11, 31),
cyImg:[],
cyImg2:[],
};
},
created() {
@@ -242,6 +253,14 @@
methods: {
getDetail(){
getJtcy(this.$route.params.id).then(response => {
if (response.data.cyImg!='' && response.data.cyImg != null && response.data.cyImg != undefined){
this.cyImg = response.data.cyImg.split(',')
this.cyImg2 = response.data.cyImg.split(',')
this.cyImg.map((rrr,i)=>{
this.cyImg[i] = {url:'/api'+rrr}
})
}

this.form = response.data;
this.familyStatusText = this.selectDictLabel(this.familyStatusOptions, response.data.yhzgx);
this.cyzjlxText = this.selectDictLabel(this.cyzjlxOptions, response.data.cyzjlx);
@@ -292,6 +311,7 @@
}
}
this.$refs.formData.validate().then(() => {
this.form.cyImg = this.cyImg2.join(',')
if (this.$route.params.id) {
updateJtcy(this.form).then(response => {
if (response.code == 200) {
@@ -331,6 +351,32 @@
this.$notify({ type: 'danger', message: '请填写完整的表单项' });
});
},
deleteFile(file,detail){
this.cyImg2.splice(detail.index,1)
},
afterRead(file) {
this.$toast.loading({
message: "上传中...",
forbidClick: true,
duration: 0,
});
// 此时可以自行将文件上传至服务器
if (file instanceof Array){//判断是否为数组,单张图片为array,多张为数组,数组返回true否则为false
file.map(res=>{
let params1 = new FormData();
params1.append("file", res.file);
commonUpload(params1).then((r1) => {
this.cyImg2.push(r1.fileName);
})
})
}else{
let params1 = new FormData();
params1.append("file", file.file);
commonUpload(params1).then((r1) => {
this.cyImg2.push(r1.fileName);
})
}
},
resetForm() {
this.form = {
deptId: null,
@@ -353,6 +399,7 @@
wdyy: null,
sfhdr: 'N',
// householdStatus: '1',
cyImg: null
};
this.cyzjlxText = '居民身份证';
}


Ładowanie…
Anuluj
Zapisz