|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270 |
- <template>
- <div>
- <van-nav-bar
- title="确权颁证调查统计表"
- left-text="退出"
- right-text="新增"
- left-arrow
- @click-left="$router.back(-1)"
- @click-right="onClickRight"
- />
- <van-dropdown-menu>
- <van-dropdown-item v-model="value1" :options="option1" @change="changeDept(1)"/>
- <van-dropdown-item v-model="value11" :options="option11" :disabled="value1==0" @change="changeDept(2)"/>
- </van-dropdown-menu>
- <van-dropdown-menu>
- <van-dropdown-item v-model="value2" :options="option2" :disabled="value11==0" @change="changeDept(3)"/>
- <van-dropdown-item v-model="value22" :options="option22" :disabled="value2==0" @change="changeDept(4)"/>
- </van-dropdown-menu>
- <van-pull-refresh v-model="refreshing" @refresh="">
- <van-list
- v-model="loading"
- :finished="finished"
- finished-text="没有更多了"
- @load="onL"
- >
- <van-row style="text-align: center;font-weight: bold;border:1px solid #ddd;font-size:.4rem;background: #1989fa;color: #fff;line-height: 1rem;border-radius: 10px;">
- <van-col span="8" style="border: 1px solid #FFF">
- <span >农户名</span>
- </van-col>
- <van-col span="8" style="border: 1px solid #FFF">
- <span >调查状态</span>
- </van-col>
- <van-col span="8" style="border: 1px solid #FFF">
- <span >操作</span>
- </van-col>
- </van-row>
-
- <van-swipe-cell v-for="(item,index) in samplingList" stop-propagation>
- <template #left>
- <van-button square type="danger" style="height: 30px" text="删除" @click="removeRow(item.id,index)"/>
- </template>
- <van-row style="text-align: center;line-height: 30px;border: 1px solid #FFF">
- <van-col span="8" >
- <span>{{item.farmerName}}</span>
- </van-col>
- <van-col span="8" >
- <span >{{item.status}}</span>
- </van-col>
- <van-col span="8" >
- <van-button type="primary" size="mini" v-show="item.status=='未调查'" style="vertical-align: middle" @click="selectType(1,item,index)">替补</van-button>
- <van-button type="info" size="mini" v-show="item.status=='电话调查'||item.status=='未调查'" style="vertical-align: middle" @click="selectType(2,item,index)">电话</van-button>
- <van-button type="warning" size="mini" v-show="item.status=='现场调查'||item.status=='未调查'" style="vertical-align: middle" @click="selectType(3,item,index)">现场</van-button>
- </van-col>
- </van-row>
- </van-swipe-cell>
- </van-list>
- </van-pull-refresh>
- <van-action-sheet v-model="showXCDC" title="现场调查">
- <van-form @submit="onSubmitXCDC">
- <van-field
- v-model="xcdcform.countName"
- name="countName"
- label="县(区)"
- label-width="120px"
- placeholder="县(区)"
- :rules="[{ required: true, message: '请填写县(区)' }]"
- />
- <van-field
- v-model="xcdcform.townName"
- name="townName"
- label="乡(镇、街)"
- label-width="120px"
- placeholder="乡(镇、街)"
- :rules="[{ required: true, message: '请填写乡(镇、街)' }]"
- />
- <van-field
- v-model="xcdcform.villageName"
- name="villageName"
- label="经联社"
- label-width="120px"
- placeholder="经联社"
- :rules="[{ required: true, message: '请填写经联社' }]"
- />
- <van-field
- v-model="xcdcform.cooperativeName"
- name="cooperativeName"
- label="经济社(小组)"
- label-width="120px"
- placeholder="经济社(小组))"
- :rules="[{ required: true, message: '请填写经济社(小组))' }]"
- />
- <van-field
- v-model="xcdcform.farmerName"
- name="farmerName"
- label="抽查户主名称"
- label-width="120px"
- placeholder="抽查户主名称"
- :rules="[{ required: true, message: '请填写抽查户主名称' }]"
- />
- <van-field
- v-model="xcdcform.originalNameCheckedBy"
- name="originalNameCheckedBy"
- label="原抽查户主姓名"
- label-width="120px"
- placeholder="原抽查户主姓名"
- />
- <van-field
- v-model="xcdcform.nameCheckedBy"
- name="nameCheckedBy"
- label="被核查人姓名"
- label-width="120px"
- placeholder="被核查人姓名"
- :rules="[{ required: true, message: '请填写被核查人姓名' }]"
- >
- <template #button>
- <van-uploader :after-read="afterRead" v-model="fileList" :max-size="1024 * 1024 * 16" @oversize="onOversize" :preview-image="false" :max-count="1" :accept="'image/*'" capture="camera">
- <van-button icon="photograph" type="primary" size="mini">扫描身份证</van-button>
- </van-uploader>
- </template>
- </van-field>
- <van-field
- v-model="xcdcform.idcardCheckedBy"
- name="idcardCheckedBy"
- label="被核查人身份证号"
- label-width="120px"
- placeholder="被核查人身份证号"
- :rules="[{ required: true, message: '请填写被核查人身份证号' }]"
- />
- <van-row type="flex" justify="space-around">
- <van-col span="9"><van-uploader v-model="fileList1" :after-read="afterRead1" @delete="remove(1)" :max-count="1" :accept="'image/*'" capture="camera"></van-uploader></van-col>
- <van-col span="9"><van-uploader v-model="fileList2" :after-read="afterRead2" @delete="remove(2)" :max-count="1" :accept="'image/*'" capture="camera"></van-uploader></van-col>
- </van-row>
- <h2 class="van-doc-demo-block__title">农村土地承包经营权证</h2>
- <van-field name="item1" label="是否有证书" label-width="200px">
- <template #input>
- <van-radio-group v-model="xcdcform.item1" direction="horizontal" @change="haveCertificate(1)">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field>
- <van-field name="item2" label="印鉴是否合规" label-width="200px">
- <template #input>
- <van-radio-group v-model="xcdcform.item2" direction="horizontal">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field>
- <van-field name="item3" label="发包方是否准确" label-width="200px">
- <template #input>
- <van-radio-group v-model="xcdcform.item3" direction="horizontal">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field>
- <van-field name="item4" label="户主姓名是否正确" label-width="200px">
- <template #input>
- <van-radio-group v-model="xcdcform.item4" direction="horizontal">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field>
- <van-field name="item5" label="户主身份证号是否正确" label-width="200px">
- <template #input>
- <van-radio-group v-model="xcdcform.item5" direction="horizontal">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field>
- <van-field
- v-model="xcdcform.item6"
- name="item6"
- label="地块数(块)"
- placeholder="地块数"
- label-width="120px"
- :rules="[{ required: true, message: '请填写地块数' }]"
- />
- <van-field
- v-model="xcdcform.item7"
- name="item7"
- label="面积(亩)"
- placeholder="面积"
- label-width="120px"
- :rules="[{ required: true, message: '请填写面积' }]"
- />
- <van-field name="item8" label="期限是否合法" label-width="200px">
- <template #input>
- <van-radio-group v-model="xcdcform.item8" direction="horizontal">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field>
- <van-field name="item9" label="承包合同编号是否正确" label-width="200px">
- <template #input>
- <van-radio-group v-model="xcdcform.item9" direction="horizontal">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field>
- <h2 class="van-doc-demo-block__title">农村土地承包经营权证</h2>
- <van-field name="item10" label="是否保存合同" label-width="200px" >
- <template #input>
- <van-radio-group v-model="xcdcform.item10" direction="horizontal" @change="haveCertificate(2)">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field><van-field name="item11" label="印鉴是否合规" label-width="200px">
- <template #input>
- <van-radio-group v-model="xcdcform.item11" direction="horizontal">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field><van-field name="item12" label="发包方是否与证书一致" label-width="200px">
- <template #input>
- <van-radio-group v-model="xcdcform.item12" direction="horizontal">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field>
- <van-field name="item13" label="户主姓名是否与证书一致" label-width="200px">
- <template #input>
- <van-radio-group v-model="xcdcform.item13" direction="horizontal">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field>
- <van-field name="item14" label="户主身份证号码是否正确" label-width="200px">
- <template #input>
- <van-radio-group v-model="xcdcform.item14" direction="horizontal">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field>
- <van-field name="item15" label="地块数是否与证书一致" label-width="200px">
- <template #input>
- <van-radio-group v-model="xcdcform.item15" direction="horizontal">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field>
- <van-field name="item16" label="面积是否与证书一致" label-width="200px">
- <template #input>
- <van-radio-group v-model="xcdcform.item16" direction="horizontal">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field>
- <van-field name="item17" label="期限是否与证书一致" label-width="200px">
- <template #input>
- <van-radio-group v-model="xcdcform.item17" direction="horizontal">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field>
- <van-field name="item18" label="承包合同编号是否正确" label-width="200px">
- <template #input>
- <van-radio-group v-model="xcdcform.item18" direction="horizontal">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field>
- <van-field
- v-model="xcdcform.checkedBy"
- name="checkedBy"
- label="检查人"
- label-width="120px"
- placeholder="检查人"
- :rules="[{ required: true, message: '请填写检查人' }]"
- />
- <van-field
- v-model="xcdcform.fileName"
- name="fileName"
- label="影像文件名称"
- label-width="120px"
- placeholder="影像文件名称"
- :rules="[{ required: true, message: '请填写影像文件名称' }]"
- />
- <van-field
- v-model="xcdcform.fileTime"
- name="fileTime"
- label="影像起始时间"
- label-width="120px"
- placeholder="影像起始时间"
- @click="showPop"
- :rules="[{ required: true, message: '请填写影像起始时间' }]"
- >
- </van-field>
- <van-popup v-model="showDate" position="bottom" :style="{ height: '40%' }">
- <van-datetime-picker v-model="currentValue" type="datetime" @change="changeFn()" @confirm="confirmFn()" @cancel="cancelFn()"/>
- </van-popup>
- <div style="margin: 16px;">
- <van-button round block type="info" native-type="submit">提交</van-button>
- </div>
- </van-form>
- </van-action-sheet>
- <van-action-sheet v-model="showDHDC" title="电话调查">
- <van-form @submit="onSubmitDHDC">
- <van-field
- v-model="dhdcform.countName"
- name="countName"
- label="县(区)"
- label-width="120px"
- placeholder="县(区)"
- :rules="[{ required: true, message: '请填写县(区)' }]"
- />
- <van-field
- v-model="dhdcform.townName"
- name="townName"
- label="乡(镇、街)"
- label-width="120px"
- placeholder="乡(镇、街)"
- :rules="[{ required: true, message: '请填写乡(镇、街)' }]"
- />
- <van-field
- v-model="dhdcform.villageName"
- name="villageName"
- label="经联社"
- label-width="120px"
- placeholder="经联社"
- :rules="[{ required: true, message: '请填写经联社' }]"
- />
- <van-field
- v-model="dhdcform.cooperativeName"
- name="cooperativeName"
- label="经济社(小组)"
- label-width="120px"
- placeholder="经济社(小组))"
- :rules="[{ required: true, message: '请填写经济社(小组))' }]"
- />
- <van-field
- v-model="dhdcform.farmerName"
- name="farmerName"
- label="抽查户主名称"
- label-width="120px"
- placeholder="抽查户主名称"
- :rules="[{ required: true, message: '请填写抽查户主名称' }]"
- />
- <van-field
- v-model="dhdcform.idcardCheckedBy"
- name="idcardCheckedBy"
- label="抽查户主身份证号"
- label-width="120px"
- placeholder="抽查户主身份证号"
- :rules="[{ required: true, message: '请填写抽查户主身份证号' }]"
- />
- <van-field
- v-model="dhdcform.originalNameCheckedBy"
- name="originalNameCheckedBy"
- label="原抽查户主姓名"
- label-width="120px"
- placeholder="原抽查户主姓名"
- />
- <van-field
- v-model="dhdcform.callPhone"
- name="callPhone"
- label="主叫号码"
- label-width="120px"
- placeholder="主叫号码"
- :rules="[{ required: true, message: '请填写主叫号码' }]"
- />
- <van-field
- v-model="dhdcform.calledPhone"
- name="calledPhone"
- label="被叫号码"
- label-width="120px"
- placeholder="被叫号码"
- :rules="[{ required: true, message: '请填写被叫号码' }]"
- />
- <h2 class="van-doc-demo-block__title">农村土地承包经营权证</h2>
- <van-field name="item1" label="是否有证书">
- <template #input>
- <van-radio-group v-model="dhdcform.item1" direction="horizontal">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field>
- <h2 class="van-doc-demo-block__title">农村土地承合同</h2>
- <van-field name="item10" label="是否保存合同">
- <template #input>
- <van-radio-group v-model="dhdcform.item10" direction="horizontal">
- <van-radio name="Y">是</van-radio>
- <van-radio name="N">否</van-radio>
- </van-radio-group>
- </template>
- </van-field>
- <van-field
- v-model="dhdcform.checkedBy"
- name="checkedBy"
- label="检查人"
- label-width="120px"
- placeholder="检查人"
- :rules="[{ required: true, message: '请填写检查人' }]"
- />
- <van-field
- v-model="dhdcform.fileName"
- name="fileName"
- label="影像文件名称"
- label-width="120px"
- placeholder="影像文件名称"
- :rules="[{ required: true, message: '请填写影像文件名称' }]"
- />
- <van-field
- v-model="dhdcform.fileTime"
- name="fileTime"
- label="影像起始时间"
- label-width="120px"
- @click="showPop1"
- placeholder="影像起始时间"
- :rules="[{ required: true, message: '请填写影像起始时间' }]"
- >
- </van-field>
- <van-popup v-model="showDate1" position="bottom" :style="{ height: '40%' }">
- <van-datetime-picker v-model="currentValue" type="datetime" @change="changeFn()" @confirm="confirmFn()" @cancel="cancelFn()"/>
- </van-popup>
- <div style="margin: 16px;">
- <van-button round block type="info" native-type="submit">提交</van-button>
- </div>
- </van-form>
- </van-action-sheet>
- <van-action-sheet v-model="show" title="基础数据">
- <van-form @submit="onSubmit">
- <van-field
- v-model="queryform.countName"
- name="countName"
- label="县(区)"
- label-width="120px"
- placeholder="县(区)"
- :rules="[{ required: true, message: '请填写县(区)' }]"
- />
- <van-field
- v-model="queryform.townName"
- name="townName"
- label="乡(镇、街)"
- label-width="120px"
- placeholder="乡(镇、街)"
- :rules="[{ required: true, message: '请填写乡(镇、街)' }]"
- />
- <van-field
- v-model="queryform.villageName"
- name="villageName"
- label="经联社"
- label-width="120px"
- placeholder="经联社"
- :rules="[{ required: true, message: '请填写经联社' }]"
- />
- <van-field
- v-model="queryform.cooperativeName"
- name="cooperativeName"
- label="经济社(小组)"
- label-width="120px"
- placeholder="经济社(小组))"
- :rules="[{ required: true, message: '请填写经济社(小组))' }]"
- />
- <van-field
- v-model="queryform.farmerName"
- name="farmerName"
- label="抽查户主名称"
- label-width="120px"
- placeholder="抽查户主名称"
- :rules="[{ required: true, message: '请填写抽查户主名称' }]"
- />
- <div style="margin: 16px;">
- <van-button round block type="info" native-type="submit">提交</van-button>
- </div>
- </van-form>
- </van-action-sheet>
- </div>
- </template>
-
- <script>
-
- import {
- addInvestigate,
- addSampling,
- delSampling,
- getInvestigate,
- listSampling, listSamplingDept,
- updateInvestigate,
- updateSampling, uploadFile, uploadFileBase
- } from "../../api/authenticRight";
- import {getDeptList} from "../../api/biddingHall";
- import {Dialog} from "vant";
- import {getInfo} from "@/api/login/index";
- import {getNowFormatDate} from "../../utils/utils";
- import request from '@/utils/request'
-
- export default {
- name: "authenticRightApply",
- data() {
- return {
- showDate:false,
- showDate1 : false,
- value1:0,
- option1:[{ text: '请选择区县', value: 0 }],
- value11:0,
- option11:[{ text: '请选择乡镇', value: 0 }],
- value2:0,
- option2:[{ text: '请选择村级', value: 0 }],
- value22:0,
- option22:[{ text: '请选择合作社', value: 0 }],
- loading: false,
- finished: false,
- refreshing: false,
- value:"",
- show:false,
- showXCDC:false,
- showDHDC:false,
- radio: '1',
- username: '',
- password: '',
- queryParams:{
- // 分页
- pageNum: 1,
- pageSize: 10,
- // 查询排序
- //orderByColumn: "id",
- //isAsc: "desc",
- countName: null,
- townName: null,
- villageName: null,
- cooperativeName: null,
- farmerName: null,
- status: null,
- id: null,
- },
- samplingList:[
-
- ],
- queryform:{
- // 分页
- pageNum: 1,
- pageSize: 10,
- // 查询排序
- //orderByColumn: "id",
- //isAsc: "desc",
- countName: null,
- townName: null,
- villageName: null,
- cooperativeName: null,
- farmerName: null,
- status: null,
- id: null,
- },
- xcdcform:{
- countName: null,
- townName: null,
- villageName: null,
- cooperativeName: null,
- farmerName: null,
- status: null,
- callPhone: null,
- calledPhone: null,
- checkedBy: null,
- createBy: null,
- createTime: null,
- fileName: null,
- fileTime: null,
- id: null,
- idcardCheckedBy: null,
- item1: '',
- item2: '',
- item3: '',
- item4: '',
- item5: '',
- item6: '',
- item7: '',
- item8: '',
- item9: '',
- item10: '',
- item11: '',
- item12: '',
- item13: '',
- item14: '',
- item15: '',
- item16: '',
- item17: '',
- item18: '',
- lackCount: null,
- originalNameCheckedBy: null,
- nameCheckedBy: null,
- params: null,
- samplingId: null,
- searchValue: null,
- fileUrl1:[],
- fileUrl2:[],
- },
- dhdcform:{
- callPhone: null,
- calledPhone: null,
- checkedBy: null,
- createBy: null,
- createTime: null,
- fileName: null,
- fileTime: null,
- id: null,
- idcardCheckedBy: null,
- item1: null,
- item10: null,
- lackCount: null,
- originalNameCheckedBy: null,
- nameCheckedBy: null,
- params: null,
- samplingId: null,
- searchValue: null,
- countName: null,
- townName: null,
- villageName: null,
- cooperativeName: null,
- farmerName: null,
- status: null,
- },
- show1: false,
- fieldValue: '',
- cascaderValue: '',
- options: [
-
- ],
- userId :null,
- nickName:null,
- currentValue:null,
- fileList:[],
- fileList1:[],
- fileList2:[],
- }
- },
- created(){
- listSamplingDept(this.queryParams).then(res => {
- if(res.data){
- this.option1=[{ text: '请选择区县', value: 0 }]
- res.data.map(item => {
- this.option1.push({ "text":item.countName,"value": item.countName})
- })
- }
- })
- getInfo().then(response => {
- this.userId = response.user.userId
- this.nickName = response.user.nickName
- });
-
- },
- methods:{
- onOversize(file) {
- this.$toast({
- icon: 'error', // 找到自己需要的图标
- message: '上传失败!文件大小不能超过 16m',
- duration:"1000",
- })
- },
- afterRead(file){
- // 创建Canvas对象(画布)
- let canvas = document.createElement('canvas')
- // 获取对应的CanvasRenderingContext2D对象(画笔)
- let context = canvas.getContext('2d')
- // 创建新的图片对象
- let img = new Image()
- // 指定图片的DataURL(图片的base64编码数据)
- img.src = file.content
- // 监听浏览器加载图片完成,然后进行进行绘制
- const height = 166
- const width = 316
- img.onload = () => {
- const h = img.height
- const w = img.width
- let ch = img.height/4
- let cw = img.width/4
- let canvas = document.createElement('canvas')
- let ctx = canvas.getContext('2d')
- canvas.height = ch
- canvas.width = cw
- ctx.clearRect(0,0,cw,ch)
- ctx.drawImage(img,0,0,cw,ch)
- let base_img = canvas.toDataURL('image/jpeg')
- const blobBin = atob(base_img.split(',')[1])
- let d = []
- for (let i=0;i<blobBin.length;i++){
- d.push(blobBin.charCodeAt(i))
- }
- const data2 = new FormData();
- data2.append("file", new Blob([new Uint8Array(d)],{type:'image/jpeg'}));
- uploadFile(data2).then(res => {
- if(res.code == 200){
- this.xcdcform.idcardCheckedBy = res.idcardCheckedBy
- this.xcdcform.nameCheckedBy = res.nameCheckedBy
- this.xcdcform["fileUrl"] = res.url
- }
- })
- this.fileList = []
- }
- this.fileList = []
- },
- afterRead1(file){
- // 创建Canvas对象(画布)
- let canvas = document.createElement('canvas')
- // 获取对应的CanvasRenderingContext2D对象(画笔)
- let context = canvas.getContext('2d')
- // 创建新的图片对象
- let img = new Image()
- // 指定图片的DataURL(图片的base64编码数据)
- img.src = file.content
- img.onload = () => {
- const h = img.height
- const w = img.width
- let ch = img.height/4
- let cw = img.width/4
- let canvas = document.createElement('canvas')
- let ctx = canvas.getContext('2d')
- canvas.height = ch
- canvas.width = cw
- ctx.clearRect(0,0,cw,ch)
- ctx.drawImage(img,0,0,cw,ch)
- let base_img = canvas.toDataURL('image/jpeg')
- const blobBin = atob(base_img.split(',')[1])
- let d = []
- for (let i=0;i<blobBin.length;i++){
- d.push(blobBin.charCodeAt(i))
- }
- const data2 = new FormData();
- data2.append("file", new Blob([new Uint8Array(d)],{type:'image/jpeg'}));
- uploadFileBase(data2).then(res => {
- this.xcdcform.fileUrl1=res.fileName
- console.log(res)
- })
- }
- },
- afterRead2(file){
- // 创建Canvas对象(画布)
- let canvas = document.createElement('canvas')
- // 获取对应的CanvasRenderingContext2D对象(画笔)
- let context = canvas.getContext('2d')
- // 创建新的图片对象
- let img = new Image()
- // 指定图片的DataURL(图片的base64编码数据)
- img.src = file.content
- img.onload = () => {
- const h = img.height
- const w = img.width
- let ch = img.height/4
- let cw = img.width/4
- let canvas = document.createElement('canvas')
- let ctx = canvas.getContext('2d')
- canvas.height = ch
- canvas.width = cw
- ctx.clearRect(0,0,cw,ch)
- ctx.drawImage(img,0,0,cw,ch)
- let base_img = canvas.toDataURL('image/jpeg')
- const blobBin = atob(base_img.split(',')[1])
- let d = []
- for (let i=0;i<blobBin.length;i++){
- d.push(blobBin.charCodeAt(i))
- }
- const data2 = new FormData();
- data2.append("file", new Blob([new Uint8Array(d)],{type:'image/jpeg'}));
- uploadFileBase(data2).then(res => {
- this.xcdcform.fileUrl2=res.fileName
- })
- }
- },
- remove(val){
- if(val==1){
- this.xcdcform.fileUrl1=""
- }else {
- this.xcdcform.fileUrl2=""
- }
- },
- changeFn(val) {
- },
- confirmFn(){
- this.xcdcform.fileTime = getNowFormatDate(this.currentValue)
- this.dhdcform.fileTime = getNowFormatDate(this.currentValue)
- this.showDate = false;
- this.showDate1 = false;
- },
- cancelFn(){
- this.showDate = false;
- this.showDate1 = false;
- }
- ,
- showPop(){
- this.showDate = true;
- },
- showPop1(){
- this.showDate1 = true;
- },
- changeDept(val){
- if(val==1){
- this.queryParams.countName = this.value1
- this.queryParams.townName = null
- this.queryParams.villageName = null
- this.queryParams.cooperativeName = null
- listSamplingDept(this.queryParams).then(res => {
- if(res.data){
- this.option11=[{ text: '请选择乡镇', value: 0 }]
- res.data.map(item => {
- this.option11.push({ "text":item.townName,"value": item.townName})
- })
- this.value11=0
- this.value2=0
- this.value22=0
- }
- })
- }else if(val==2){
- this.queryParams.countName = this.value1
- this.queryParams.townName = this.value11
- this.queryParams.villageName = null
- this.queryParams.cooperativeName = null
- listSamplingDept(this.queryParams).then(res => {
- if(res.data){
- this.option2=[{ text: '请选择村级', value: 0 }]
- res.data.map(item => {
- this.option2.push({ "text":item.villageName,"value": item.villageName})
- })
- this.value2=0
- this.value22=0
- }
- })
- }else if(val==3){
- this.queryParams.countName = this.value1
- this.queryParams.townName = this.value11
- this.queryParams.villageName = this.value2
- this.queryParams.cooperativeName = null
- listSamplingDept(this.queryParams).then(res => {
- if(res.data){
- this.option22=[{ text: '请选择合作社', value: 0 }]
- res.data.map(item => {
- this.option22.push({ "text":item.cooperativeName,"value": item.cooperativeName})
- })
- this.value22=0
- }
- })
-
- }else if(val==4){
- this.queryParams.countName = this.value1
- this.queryParams.townName = this.value11
- this.queryParams.villageName = this.value2
- this.queryParams.cooperativeName = this.value22
- this.getList()
- }
- },
- reset(){
- this.queryform={
- pageNum: 1,
- pageSize: 10,
- // 查询排序
- //orderByColumn: "id",
- //isAsc: "desc",
- countName: null,
- townName: null,
- villageName: null,
- cooperativeName: null,
- status: null,
- id: null,
- }
- this.xcdcform={
- countName: null,
- townName: null,
- villageName: null,
- cooperativeName: null,
- farmerName: null,
- status: null,
- callPhone: null,
- calledPhone: null,
- checkedBy: null,
- createBy: null,
- createTime: null,
- fileName: null,
- fileTime: null,
- id: null,
- idcardCheckedBy: null,
- item1: '',
- item2: '',
- item3: '',
- item4: '',
- item5: '',
- item6: '',
- item7: '',
- item8: '',
- item9: '',
- item10: '',
- item11: '',
- item12: '',
- item13: '',
- item14: '',
- item15: '',
- item16: '',
- item17: '',
- item18: '',
- lackCount: null,
- originalNameCheckedBy: null,
- nameCheckedBy: null,
- params: null,
- samplingId: null,
- searchValue: null,
- updateBy: null,
- fileUrl1: [],
- fileUrl2: [],
- };
- this.dhdcform={
- countName: null,
- townName: null,
- villageName: null,
- cooperativeName: null,
- farmerName: null,
- status: null,
- callPhone: null,
- calledPhone: null,
- checkedBy: null,
- createBy: null,
- createTime: null,
- fileName: null,
- fileTime: null,
- id: null,
- idcardCheckedBy: null,
- item1: null,
- item10: null,
- lackCount: null,
- originalNameCheckedBy: null,
- nameCheckedBy: null,
- params: null,
- samplingId: null,
- searchValue: null,
- updateBy: null,
- }
- this.fileList = []
- this.fileList1 = []
- this.fileList2 = []
- },
- onClickRight() {
- this.show = true
- this.queryform = this.queryParams
- },
- onSearch() {
-
- },
- onChange({ value }) {
- this.options.map(i => {
- if (value === i.value) {
- getDeptList(value).then(response => {
- if(response.data.length>0){
- i.children=[]
- response.data.map(item => {
- i.children.push({ text: item.deptName,value:item.deptId});
- });
- }
- });
- }
- })
- },
- removeRow(id,index){
- let _this = this
- Dialog.confirm({
- title: '删除',
- message: '删除后数据无法恢复,确认要删除么?'
- }).then(() => {
- delSampling(id).then(res => {
- this.$toast({
- icon: 'success', // 找到自己需要的图标
- message: '删除成功',
- duration:"1000",
- onClose:function(){
- _this.getList();
- }
- })
- })
- }).catch(() => {
- // on cancel
- });
-
- },
- onFinish({ selectedOptions }) {
- this.show1 = false;
- this.fieldValue = selectedOptions.map((option) => option.text).join('/');
- },
- /** 判断是否有证书 */
- haveCertificate(id){
- if(id == "1"){
- if(this.xcdcform.item1=='N'){
- this.xcdcform.item2 = 'N'
- this.xcdcform.item3 = 'N'
- this.xcdcform.item4 = 'N'
- this.xcdcform.item5 = 'N'
- this.xcdcform.item8 = 'N'
- this.xcdcform.item9 = 'N'
- }
- }if(id == "2") {
- if(this.xcdcform.item10=='N'){
- this.xcdcform.item11 = 'N'
- this.xcdcform.item12 = 'N'
- this.xcdcform.item13 = 'N'
- this.xcdcform.item14 = 'N'
- this.xcdcform.item15 = 'N'
- this.xcdcform.item16 = 'N'
- this.xcdcform.item17 = 'N'
- this.xcdcform.item18 = 'N'
- }
- }
- },
- selectType(val,data,index){
- if(val==1){
- let _this = this
- let a ={
- "countName": data.countName,
- "townName": data.townName,
- "villageName": data.villageName,
- "cooperativeName": data.cooperativeName,
- "status": "1",
- "id": data.id
- }
- a.status = "1"
- updateSampling(a).then(res => {
- this.$toast({
- icon: 'success', // 找到自己需要的图标
- message: '修改成功',
- duration:"1000",
- onClose:function(){
- _this.getList();
- }
- })
- })
- }else if(val==3){
- this.reset();
- this.showXCDC=true
- getInvestigate(data.id).then(res => {
- if(res.data){
- this.xcdcform = res.data
- console.log(res.data)
- if(this.xcdcform.fileUrl1){
- this.fileList1.push({
- "url":this.xcdcform.fileUrl1
- })
- }
- if(this.xcdcform.fileUrl2){
- this.fileList2.push({
- "url":this.xcdcform.fileUrl2
- })
- }
- this.xcdcform["countName"] = data.countName
- this.xcdcform["townName"] = data.townName
- this.xcdcform["villageName"] = data.villageName
- this.xcdcform["cooperativeName"] = data.cooperativeName
- this.xcdcform["farmerName"] = data.farmerName
- }else{
- this.xcdcform["countName"] = data.countName
- this.xcdcform["townName"] = data.townName
- this.xcdcform["villageName"] = data.villageName
- this.xcdcform["cooperativeName"] = data.cooperativeName
- this.xcdcform["farmerName"] = data.farmerName
- this.xcdcform["samplingId"] = data.id
- this.xcdcform["fileName"] = data.townName+data.villageName
- this.xcdcform["checkedBy"] = this.nickName
- this.xcdcform["fileTime"] = getNowFormatDate()
- }
- })
-
- }else if(val==2){
- this.reset();
- this.showDHDC=true
- getInvestigate(data.id).then(res => {
- if(res.data){
- this.dhdcform = res.data
- this.dhdcform["countName"] = data.countName
- this.dhdcform["townName"] = data.townName
- this.dhdcform["villageName"] = data.villageName
- this.dhdcform["cooperativeName"] = data.cooperativeName
- this.dhdcform["farmerName"] = data.farmerName
- }else{
- this.dhdcform["countName"] = data.countName
- this.dhdcform["townName"] = data.townName
- this.dhdcform["villageName"] = data.villageName
- this.dhdcform["cooperativeName"] = data.cooperativeName
- this.dhdcform["farmerName"] = data.farmerName
- this.dhdcform["samplingId"] = data.id
- this.dhdcform["fileName"] = data.townName+data.villageName
- this.dhdcform["checkedBy"] = this.nickName
- this.dhdcform["fileTime"] = getNowFormatDate()
- }
- })
- }
- },
- onSubmit(values) {
- this.queryform["createBy"] = this.userId
- this.queryform["createTime"] = getNowFormatDate()
- addSampling(this.queryform).then(res => {
- this.show = false
- this.getList();
- })
- },
- onSubmitXCDC(values) {
- let i = 0
- if(this.xcdcform.item1=='N'){
- i++
- }if(this.xcdcform.item2=='N'){
- i++
- }if(this.xcdcform.item3=='N'){
- i++
- }if(this.xcdcform.item4=='N'){
- i++
- }if(this.xcdcform.item5=='N'){
- i++
- }if(this.xcdcform.item8=='N'){
- i++
- }if(this.xcdcform.item9=='N'){
- i++
- }if(this.xcdcform.item10=='N'){
- i++
- }if(this.xcdcform.item11=='N'){
- i++
- }if(this.xcdcform.item12=='N'){
- i++
- }if(this.xcdcform.item13=='N'){
- i++
- }if(this.xcdcform.item14=='N'){
- i++
- }if(this.xcdcform.item15=='N'){
- i++
- }if(this.xcdcform.item16=='N'){
- i++
- }if(this.xcdcform.item17=='N'){
- i++
- }if(this.xcdcform.item18=='N'){
- i++
- }
- this.xcdcform["lackCount"] = i
- if(this.xcdcform.fileUrl1.length>0){
- this.xcdcform.fileUrl1 = location.protocol+"//"+location.host+request.defaults.baseURL+ this.xcdcform.fileUrl1.replace(location.protocol+"//"+location.host+request.defaults.baseURL,"")
- }else {
- this.xcdcform.fileUrl1=""
- }if(this.xcdcform.fileUrl2.length>0){
- this.xcdcform.fileUrl2 = location.protocol+"//"+location.host+request.defaults.baseURL+ this.xcdcform.fileUrl2.replace(location.protocol+"//"+location.host+request.defaults.baseURL,"")
- }else {
- this.xcdcform.fileUrl2=""
- }
- if(this.xcdcform.id){
- updateInvestigate(this.xcdcform).then(res => {
- this.showXCDC = false
- let _this = this
- this.xcdcform.status = "2"
- this.xcdcform.id = this.xcdcform.samplingId
- updateSampling(this.xcdcform).then(res => {
- _this.reset()
- this.$toast({
- icon: 'success', // 找到自己需要的图标
- message: '修改成功',
- duration:"1000",
- onClose:function(){
- _this.getList();
- }
- })
- })
- })
- }else {
- addInvestigate(this.xcdcform).then(res => {
- this.showXCDC = false
- let _this = this
- this.xcdcform.status = "2"
- this.xcdcform.id = this.xcdcform.samplingId
- updateSampling(this.xcdcform).then(res => {
- _this.reset()
- this.$toast({
- icon: 'success', // 找到自己需要的图标
- message: '保存成功',
- duration:"1000",
- onClose:function(){
- _this.getList();
- }
- })
- })
- })
- }},
- onSubmitDHDC(values) {
- if(this.dhdcform.id){
- updateInvestigate(this.dhdcform).then(res => {
- this.showDHDC = false
- let _this = this
- this.dhdcform.status = "3"
- this.dhdcform.id = this.dhdcform.samplingId
- updateSampling(this.dhdcform).then(res => {
- _this.reset()
- this.$toast({
- icon: 'success', // 找到自己需要的图标
- message: '修改成功',
- duration:"1000",
- onClose:function(){
- _this.getList();
- }
- })
- })
- })
- }else {
- addInvestigate(this.dhdcform).then(res => {
- this.showDHDC = false
- let _this = this
- this.dhdcform.status = "3"
- this.dhdcform.id = this.dhdcform.samplingId
- updateSampling(this.dhdcform).then(res => {
- _this.reset()
- this.$toast({
- icon: 'success', // 找到自己需要的图标
- message: '保存成功',
- duration:"1000",
- onClose:function(){
- _this.getList();
- }
- })
- })
- })
- }
- },
- getList(){
- this.queryParams["farmerName"] = null
- listSampling(this.queryParams).then(response => {
- if(response.rows.length>0){
- response.rows.map(item => {
- if(item.status==0){
- item.status="未调查"
- }else if(item.status==1){
- item.status="被替补"
- }else if(item.status==2){
- item.status="现场调查"
- }else if(item.status==3){
- item.status="电话调查"
- }
- })
- this.samplingList = response.rows;
- this.loading = false;
- }
- });
- },
- onL() {
- this.refreshing = true;
- this.loading = false;
- this.refreshing = false;
- },
- onRefresh() {
- // 清空列表数据
- this.finished = false;
- // 重新加载数据
- // 将 loading 设置为 true,表示处于加载状态
- this.loading = true;
- this.onL();
- },
- },
- }
- </script>
-
- <style scoped>
- .van-doc-demo-block__title {
- margin: 0;
- padding: 32px 16px 16px;
- color: rgba(69, 90, 100, 0.6);
- font-weight: normal;
- font-size: 14px;
- line-height: 16px;
- }
- </style>
|