移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1271 lines
44 KiB

  1. <template>
  2. <div>
  3. <van-nav-bar
  4. title="确权颁证调查统计表"
  5. left-text="退出"
  6. right-text="新增"
  7. left-arrow
  8. @click-left="$router.back(-1)"
  9. @click-right="onClickRight"
  10. />
  11. <van-dropdown-menu>
  12. <van-dropdown-item v-model="value1" :options="option1" @change="changeDept(1)"/>
  13. <van-dropdown-item v-model="value11" :options="option11" :disabled="value1==0" @change="changeDept(2)"/>
  14. </van-dropdown-menu>
  15. <van-dropdown-menu>
  16. <van-dropdown-item v-model="value2" :options="option2" :disabled="value11==0" @change="changeDept(3)"/>
  17. <van-dropdown-item v-model="value22" :options="option22" :disabled="value2==0" @change="changeDept(4)"/>
  18. </van-dropdown-menu>
  19. <van-pull-refresh v-model="refreshing" @refresh="">
  20. <van-list
  21. v-model="loading"
  22. :finished="finished"
  23. finished-text="没有更多了"
  24. @load="onL"
  25. >
  26. <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;">
  27. <van-col span="8" style="border: 1px solid #FFF">
  28. <span >农户名</span>
  29. </van-col>
  30. <van-col span="8" style="border: 1px solid #FFF">
  31. <span >调查状态</span>
  32. </van-col>
  33. <van-col span="8" style="border: 1px solid #FFF">
  34. <span >操作</span>
  35. </van-col>
  36. </van-row>
  37. <van-swipe-cell v-for="(item,index) in samplingList" stop-propagation>
  38. <template #left>
  39. <van-button square type="danger" style="height: 30px" text="删除" @click="removeRow(item.id,index)"/>
  40. </template>
  41. <van-row style="text-align: center;line-height: 30px;border: 1px solid #FFF">
  42. <van-col span="8" >
  43. <span>{{item.farmerName}}</span>
  44. </van-col>
  45. <van-col span="8" >
  46. <span >{{item.status}}</span>
  47. </van-col>
  48. <van-col span="8" >
  49. <van-button type="primary" size="mini" v-show="item.status=='未调查'" style="vertical-align: middle" @click="selectType(1,item,index)">替补</van-button>
  50. <van-button type="info" size="mini" v-show="item.status=='电话调查'||item.status=='未调查'" style="vertical-align: middle" @click="selectType(2,item,index)">电话</van-button>
  51. <van-button type="warning" size="mini" v-show="item.status=='现场调查'||item.status=='未调查'" style="vertical-align: middle" @click="selectType(3,item,index)">现场</van-button>
  52. </van-col>
  53. </van-row>
  54. </van-swipe-cell>
  55. </van-list>
  56. </van-pull-refresh>
  57. <van-action-sheet v-model="showXCDC" title="现场调查">
  58. <van-form @submit="onSubmitXCDC">
  59. <van-field
  60. v-model="xcdcform.countName"
  61. name="countName"
  62. label="县(区)"
  63. label-width="120px"
  64. placeholder="县(区)"
  65. :rules="[{ required: true, message: '请填写县(区)' }]"
  66. />
  67. <van-field
  68. v-model="xcdcform.townName"
  69. name="townName"
  70. label="乡(镇、街)"
  71. label-width="120px"
  72. placeholder="乡(镇、街)"
  73. :rules="[{ required: true, message: '请填写乡(镇、街)' }]"
  74. />
  75. <van-field
  76. v-model="xcdcform.villageName"
  77. name="villageName"
  78. label="经联社"
  79. label-width="120px"
  80. placeholder="经联社"
  81. :rules="[{ required: true, message: '请填写经联社' }]"
  82. />
  83. <van-field
  84. v-model="xcdcform.cooperativeName"
  85. name="cooperativeName"
  86. label="经济社(小组)"
  87. label-width="120px"
  88. placeholder="经济社(小组))"
  89. :rules="[{ required: true, message: '请填写经济社(小组))' }]"
  90. />
  91. <van-field
  92. v-model="xcdcform.farmerName"
  93. name="farmerName"
  94. label="抽查户主名称"
  95. label-width="120px"
  96. placeholder="抽查户主名称"
  97. :rules="[{ required: true, message: '请填写抽查户主名称' }]"
  98. />
  99. <van-field
  100. v-model="xcdcform.originalNameCheckedBy"
  101. name="originalNameCheckedBy"
  102. label="原抽查户主姓名"
  103. label-width="120px"
  104. placeholder="原抽查户主姓名"
  105. />
  106. <van-field
  107. v-model="xcdcform.nameCheckedBy"
  108. name="nameCheckedBy"
  109. label="被核查人姓名"
  110. label-width="120px"
  111. placeholder="被核查人姓名"
  112. :rules="[{ required: true, message: '请填写被核查人姓名' }]"
  113. >
  114. <template #button>
  115. <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">
  116. <van-button icon="photograph" type="primary" size="mini">扫描身份证</van-button>
  117. </van-uploader>
  118. </template>
  119. </van-field>
  120. <van-field
  121. v-model="xcdcform.idcardCheckedBy"
  122. name="idcardCheckedBy"
  123. label="被核查人身份证号"
  124. label-width="120px"
  125. placeholder="被核查人身份证号"
  126. :rules="[{ required: true, message: '请填写被核查人身份证号' }]"
  127. />
  128. <van-row type="flex" justify="space-around">
  129. <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>
  130. <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>
  131. </van-row>
  132. <h2 class="van-doc-demo-block__title">农村土地承包经营权证</h2>
  133. <van-field name="item1" label="是否有证书" label-width="200px">
  134. <template #input>
  135. <van-radio-group v-model="xcdcform.item1" direction="horizontal" @change="haveCertificate(1)">
  136. <van-radio name="Y">是</van-radio>
  137. <van-radio name="N">否</van-radio>
  138. </van-radio-group>
  139. </template>
  140. </van-field>
  141. <van-field name="item2" label="印鉴是否合规" label-width="200px">
  142. <template #input>
  143. <van-radio-group v-model="xcdcform.item2" direction="horizontal">
  144. <van-radio name="Y">是</van-radio>
  145. <van-radio name="N">否</van-radio>
  146. </van-radio-group>
  147. </template>
  148. </van-field>
  149. <van-field name="item3" label="发包方是否准确" label-width="200px">
  150. <template #input>
  151. <van-radio-group v-model="xcdcform.item3" direction="horizontal">
  152. <van-radio name="Y">是</van-radio>
  153. <van-radio name="N">否</van-radio>
  154. </van-radio-group>
  155. </template>
  156. </van-field>
  157. <van-field name="item4" label="户主姓名是否正确" label-width="200px">
  158. <template #input>
  159. <van-radio-group v-model="xcdcform.item4" direction="horizontal">
  160. <van-radio name="Y">是</van-radio>
  161. <van-radio name="N">否</van-radio>
  162. </van-radio-group>
  163. </template>
  164. </van-field>
  165. <van-field name="item5" label="户主身份证号是否正确" label-width="200px">
  166. <template #input>
  167. <van-radio-group v-model="xcdcform.item5" direction="horizontal">
  168. <van-radio name="Y">是</van-radio>
  169. <van-radio name="N">否</van-radio>
  170. </van-radio-group>
  171. </template>
  172. </van-field>
  173. <van-field
  174. v-model="xcdcform.item6"
  175. name="item6"
  176. label="地块数(块)"
  177. placeholder="地块数"
  178. label-width="120px"
  179. :rules="[{ required: true, message: '请填写地块数' }]"
  180. />
  181. <van-field
  182. v-model="xcdcform.item7"
  183. name="item7"
  184. label="面积(亩)"
  185. placeholder="面积"
  186. label-width="120px"
  187. :rules="[{ required: true, message: '请填写面积' }]"
  188. />
  189. <van-field name="item8" label="期限是否合法" label-width="200px">
  190. <template #input>
  191. <van-radio-group v-model="xcdcform.item8" direction="horizontal">
  192. <van-radio name="Y">是</van-radio>
  193. <van-radio name="N">否</van-radio>
  194. </van-radio-group>
  195. </template>
  196. </van-field>
  197. <van-field name="item9" label="承包合同编号是否正确" label-width="200px">
  198. <template #input>
  199. <van-radio-group v-model="xcdcform.item9" direction="horizontal">
  200. <van-radio name="Y">是</van-radio>
  201. <van-radio name="N">否</van-radio>
  202. </van-radio-group>
  203. </template>
  204. </van-field>
  205. <h2 class="van-doc-demo-block__title">农村土地承包经营权证</h2>
  206. <van-field name="item10" label="是否保存合同" label-width="200px" >
  207. <template #input>
  208. <van-radio-group v-model="xcdcform.item10" direction="horizontal" @change="haveCertificate(2)">
  209. <van-radio name="Y">是</van-radio>
  210. <van-radio name="N">否</van-radio>
  211. </van-radio-group>
  212. </template>
  213. </van-field><van-field name="item11" label="印鉴是否合规" label-width="200px">
  214. <template #input>
  215. <van-radio-group v-model="xcdcform.item11" direction="horizontal">
  216. <van-radio name="Y">是</van-radio>
  217. <van-radio name="N">否</van-radio>
  218. </van-radio-group>
  219. </template>
  220. </van-field><van-field name="item12" label="发包方是否与证书一致" label-width="200px">
  221. <template #input>
  222. <van-radio-group v-model="xcdcform.item12" direction="horizontal">
  223. <van-radio name="Y">是</van-radio>
  224. <van-radio name="N">否</van-radio>
  225. </van-radio-group>
  226. </template>
  227. </van-field>
  228. <van-field name="item13" label="户主姓名是否与证书一致" label-width="200px">
  229. <template #input>
  230. <van-radio-group v-model="xcdcform.item13" direction="horizontal">
  231. <van-radio name="Y">是</van-radio>
  232. <van-radio name="N">否</van-radio>
  233. </van-radio-group>
  234. </template>
  235. </van-field>
  236. <van-field name="item14" label="户主身份证号码是否正确" label-width="200px">
  237. <template #input>
  238. <van-radio-group v-model="xcdcform.item14" direction="horizontal">
  239. <van-radio name="Y">是</van-radio>
  240. <van-radio name="N">否</van-radio>
  241. </van-radio-group>
  242. </template>
  243. </van-field>
  244. <van-field name="item15" label="地块数是否与证书一致" label-width="200px">
  245. <template #input>
  246. <van-radio-group v-model="xcdcform.item15" direction="horizontal">
  247. <van-radio name="Y">是</van-radio>
  248. <van-radio name="N">否</van-radio>
  249. </van-radio-group>
  250. </template>
  251. </van-field>
  252. <van-field name="item16" label="面积是否与证书一致" label-width="200px">
  253. <template #input>
  254. <van-radio-group v-model="xcdcform.item16" direction="horizontal">
  255. <van-radio name="Y">是</van-radio>
  256. <van-radio name="N">否</van-radio>
  257. </van-radio-group>
  258. </template>
  259. </van-field>
  260. <van-field name="item17" label="期限是否与证书一致" label-width="200px">
  261. <template #input>
  262. <van-radio-group v-model="xcdcform.item17" direction="horizontal">
  263. <van-radio name="Y">是</van-radio>
  264. <van-radio name="N">否</van-radio>
  265. </van-radio-group>
  266. </template>
  267. </van-field>
  268. <van-field name="item18" label="承包合同编号是否正确" label-width="200px">
  269. <template #input>
  270. <van-radio-group v-model="xcdcform.item18" direction="horizontal">
  271. <van-radio name="Y">是</van-radio>
  272. <van-radio name="N">否</van-radio>
  273. </van-radio-group>
  274. </template>
  275. </van-field>
  276. <van-field
  277. v-model="xcdcform.checkedBy"
  278. name="checkedBy"
  279. label="检查人"
  280. label-width="120px"
  281. placeholder="检查人"
  282. :rules="[{ required: true, message: '请填写检查人' }]"
  283. />
  284. <van-field
  285. v-model="xcdcform.fileName"
  286. name="fileName"
  287. label="影像文件名称"
  288. label-width="120px"
  289. placeholder="影像文件名称"
  290. :rules="[{ required: true, message: '请填写影像文件名称' }]"
  291. />
  292. <van-field
  293. v-model="xcdcform.fileTime"
  294. name="fileTime"
  295. label="影像起始时间"
  296. label-width="120px"
  297. placeholder="影像起始时间"
  298. @click="showPop"
  299. :rules="[{ required: true, message: '请填写影像起始时间' }]"
  300. >
  301. </van-field>
  302. <van-popup v-model="showDate" position="bottom" :style="{ height: '40%' }">
  303. <van-datetime-picker v-model="currentValue" type="datetime" @change="changeFn()" @confirm="confirmFn()" @cancel="cancelFn()"/>
  304. </van-popup>
  305. <div style="margin: 16px;">
  306. <van-button round block type="info" native-type="submit">提交</van-button>
  307. </div>
  308. </van-form>
  309. </van-action-sheet>
  310. <van-action-sheet v-model="showDHDC" title="电话调查">
  311. <van-form @submit="onSubmitDHDC">
  312. <van-field
  313. v-model="dhdcform.countName"
  314. name="countName"
  315. label="县(区)"
  316. label-width="120px"
  317. placeholder="县(区)"
  318. :rules="[{ required: true, message: '请填写县(区)' }]"
  319. />
  320. <van-field
  321. v-model="dhdcform.townName"
  322. name="townName"
  323. label="乡(镇、街)"
  324. label-width="120px"
  325. placeholder="乡(镇、街)"
  326. :rules="[{ required: true, message: '请填写乡(镇、街)' }]"
  327. />
  328. <van-field
  329. v-model="dhdcform.villageName"
  330. name="villageName"
  331. label="经联社"
  332. label-width="120px"
  333. placeholder="经联社"
  334. :rules="[{ required: true, message: '请填写经联社' }]"
  335. />
  336. <van-field
  337. v-model="dhdcform.cooperativeName"
  338. name="cooperativeName"
  339. label="经济社(小组)"
  340. label-width="120px"
  341. placeholder="经济社(小组))"
  342. :rules="[{ required: true, message: '请填写经济社(小组))' }]"
  343. />
  344. <van-field
  345. v-model="dhdcform.farmerName"
  346. name="farmerName"
  347. label="抽查户主名称"
  348. label-width="120px"
  349. placeholder="抽查户主名称"
  350. :rules="[{ required: true, message: '请填写抽查户主名称' }]"
  351. />
  352. <van-field
  353. v-model="dhdcform.idcardCheckedBy"
  354. name="idcardCheckedBy"
  355. label="抽查户主身份证号"
  356. label-width="120px"
  357. placeholder="抽查户主身份证号"
  358. :rules="[{ required: true, message: '请填写抽查户主身份证号' }]"
  359. />
  360. <van-field
  361. v-model="dhdcform.originalNameCheckedBy"
  362. name="originalNameCheckedBy"
  363. label="原抽查户主姓名"
  364. label-width="120px"
  365. placeholder="原抽查户主姓名"
  366. />
  367. <van-field
  368. v-model="dhdcform.callPhone"
  369. name="callPhone"
  370. label="主叫号码"
  371. label-width="120px"
  372. placeholder="主叫号码"
  373. :rules="[{ required: true, message: '请填写主叫号码' }]"
  374. />
  375. <van-field
  376. v-model="dhdcform.calledPhone"
  377. name="calledPhone"
  378. label="被叫号码"
  379. label-width="120px"
  380. placeholder="被叫号码"
  381. :rules="[{ required: true, message: '请填写被叫号码' }]"
  382. />
  383. <h2 class="van-doc-demo-block__title">农村土地承包经营权证</h2>
  384. <van-field name="item1" label="是否有证书">
  385. <template #input>
  386. <van-radio-group v-model="dhdcform.item1" direction="horizontal">
  387. <van-radio name="Y">是</van-radio>
  388. <van-radio name="N">否</van-radio>
  389. </van-radio-group>
  390. </template>
  391. </van-field>
  392. <h2 class="van-doc-demo-block__title">农村土地承合同</h2>
  393. <van-field name="item10" label="是否保存合同">
  394. <template #input>
  395. <van-radio-group v-model="dhdcform.item10" direction="horizontal">
  396. <van-radio name="Y">是</van-radio>
  397. <van-radio name="N">否</van-radio>
  398. </van-radio-group>
  399. </template>
  400. </van-field>
  401. <van-field
  402. v-model="dhdcform.checkedBy"
  403. name="checkedBy"
  404. label="检查人"
  405. label-width="120px"
  406. placeholder="检查人"
  407. :rules="[{ required: true, message: '请填写检查人' }]"
  408. />
  409. <van-field
  410. v-model="dhdcform.fileName"
  411. name="fileName"
  412. label="影像文件名称"
  413. label-width="120px"
  414. placeholder="影像文件名称"
  415. :rules="[{ required: true, message: '请填写影像文件名称' }]"
  416. />
  417. <van-field
  418. v-model="dhdcform.fileTime"
  419. name="fileTime"
  420. label="影像起始时间"
  421. label-width="120px"
  422. @click="showPop1"
  423. placeholder="影像起始时间"
  424. :rules="[{ required: true, message: '请填写影像起始时间' }]"
  425. >
  426. </van-field>
  427. <van-popup v-model="showDate1" position="bottom" :style="{ height: '40%' }">
  428. <van-datetime-picker v-model="currentValue" type="datetime" @change="changeFn()" @confirm="confirmFn()" @cancel="cancelFn()"/>
  429. </van-popup>
  430. <div style="margin: 16px;">
  431. <van-button round block type="info" native-type="submit">提交</van-button>
  432. </div>
  433. </van-form>
  434. </van-action-sheet>
  435. <van-action-sheet v-model="show" title="基础数据">
  436. <van-form @submit="onSubmit">
  437. <van-field
  438. v-model="queryform.countName"
  439. name="countName"
  440. label="县(区)"
  441. label-width="120px"
  442. placeholder="县(区)"
  443. :rules="[{ required: true, message: '请填写县(区)' }]"
  444. />
  445. <van-field
  446. v-model="queryform.townName"
  447. name="townName"
  448. label="乡(镇、街)"
  449. label-width="120px"
  450. placeholder="乡(镇、街)"
  451. :rules="[{ required: true, message: '请填写乡(镇、街)' }]"
  452. />
  453. <van-field
  454. v-model="queryform.villageName"
  455. name="villageName"
  456. label="经联社"
  457. label-width="120px"
  458. placeholder="经联社"
  459. :rules="[{ required: true, message: '请填写经联社' }]"
  460. />
  461. <van-field
  462. v-model="queryform.cooperativeName"
  463. name="cooperativeName"
  464. label="经济社(小组)"
  465. label-width="120px"
  466. placeholder="经济社(小组))"
  467. :rules="[{ required: true, message: '请填写经济社(小组))' }]"
  468. />
  469. <van-field
  470. v-model="queryform.farmerName"
  471. name="farmerName"
  472. label="抽查户主名称"
  473. label-width="120px"
  474. placeholder="抽查户主名称"
  475. :rules="[{ required: true, message: '请填写抽查户主名称' }]"
  476. />
  477. <div style="margin: 16px;">
  478. <van-button round block type="info" native-type="submit">提交</van-button>
  479. </div>
  480. </van-form>
  481. </van-action-sheet>
  482. </div>
  483. </template>
  484. <script>
  485. import {
  486. addInvestigate,
  487. addSampling,
  488. delSampling,
  489. getInvestigate,
  490. listSampling, listSamplingDept,
  491. updateInvestigate,
  492. updateSampling, uploadFile, uploadFileBase
  493. } from "../../api/authenticRight";
  494. import {getDeptList} from "../../api/biddingHall";
  495. import {Dialog} from "vant";
  496. import {getInfo} from "@/api/login/index";
  497. import {getNowFormatDate} from "../../utils/utils";
  498. import request from '@/utils/request'
  499. export default {
  500. name: "authenticRightApply",
  501. data() {
  502. return {
  503. showDate:false,
  504. showDate1 : false,
  505. value1:0,
  506. option1:[{ text: '请选择区县', value: 0 }],
  507. value11:0,
  508. option11:[{ text: '请选择乡镇', value: 0 }],
  509. value2:0,
  510. option2:[{ text: '请选择村级', value: 0 }],
  511. value22:0,
  512. option22:[{ text: '请选择合作社', value: 0 }],
  513. loading: false,
  514. finished: false,
  515. refreshing: false,
  516. value:"",
  517. show:false,
  518. showXCDC:false,
  519. showDHDC:false,
  520. radio: '1',
  521. username: '',
  522. password: '',
  523. queryParams:{
  524. // 分页
  525. pageNum: 1,
  526. pageSize: 10,
  527. // 查询排序
  528. //orderByColumn: "id",
  529. //isAsc: "desc",
  530. countName: null,
  531. townName: null,
  532. villageName: null,
  533. cooperativeName: null,
  534. farmerName: null,
  535. status: null,
  536. id: null,
  537. },
  538. samplingList:[
  539. ],
  540. queryform:{
  541. // 分页
  542. pageNum: 1,
  543. pageSize: 10,
  544. // 查询排序
  545. //orderByColumn: "id",
  546. //isAsc: "desc",
  547. countName: null,
  548. townName: null,
  549. villageName: null,
  550. cooperativeName: null,
  551. farmerName: null,
  552. status: null,
  553. id: null,
  554. },
  555. xcdcform:{
  556. countName: null,
  557. townName: null,
  558. villageName: null,
  559. cooperativeName: null,
  560. farmerName: null,
  561. status: null,
  562. callPhone: null,
  563. calledPhone: null,
  564. checkedBy: null,
  565. createBy: null,
  566. createTime: null,
  567. fileName: null,
  568. fileTime: null,
  569. id: null,
  570. idcardCheckedBy: null,
  571. item1: '',
  572. item2: '',
  573. item3: '',
  574. item4: '',
  575. item5: '',
  576. item6: '',
  577. item7: '',
  578. item8: '',
  579. item9: '',
  580. item10: '',
  581. item11: '',
  582. item12: '',
  583. item13: '',
  584. item14: '',
  585. item15: '',
  586. item16: '',
  587. item17: '',
  588. item18: '',
  589. lackCount: null,
  590. originalNameCheckedBy: null,
  591. nameCheckedBy: null,
  592. params: null,
  593. samplingId: null,
  594. searchValue: null,
  595. fileUrl1:[],
  596. fileUrl2:[],
  597. },
  598. dhdcform:{
  599. callPhone: null,
  600. calledPhone: null,
  601. checkedBy: null,
  602. createBy: null,
  603. createTime: null,
  604. fileName: null,
  605. fileTime: null,
  606. id: null,
  607. idcardCheckedBy: null,
  608. item1: null,
  609. item10: null,
  610. lackCount: null,
  611. originalNameCheckedBy: null,
  612. nameCheckedBy: null,
  613. params: null,
  614. samplingId: null,
  615. searchValue: null,
  616. countName: null,
  617. townName: null,
  618. villageName: null,
  619. cooperativeName: null,
  620. farmerName: null,
  621. status: null,
  622. },
  623. show1: false,
  624. fieldValue: '',
  625. cascaderValue: '',
  626. options: [
  627. ],
  628. userId :null,
  629. nickName:null,
  630. currentValue:null,
  631. fileList:[],
  632. fileList1:[],
  633. fileList2:[],
  634. }
  635. },
  636. created(){
  637. listSamplingDept(this.queryParams).then(res => {
  638. if(res.data){
  639. this.option1=[{ text: '请选择区县', value: 0 }]
  640. res.data.map(item => {
  641. this.option1.push({ "text":item.countName,"value": item.countName})
  642. })
  643. }
  644. })
  645. getInfo().then(response => {
  646. this.userId = response.user.userId
  647. this.nickName = response.user.nickName
  648. });
  649. },
  650. methods:{
  651. onOversize(file) {
  652. this.$toast({
  653. icon: 'error', // 找到自己需要的图标
  654. message: '上传失败!文件大小不能超过 16m',
  655. duration:"1000",
  656. })
  657. },
  658. afterRead(file){
  659. // 创建Canvas对象(画布)
  660. let canvas = document.createElement('canvas')
  661. // 获取对应的CanvasRenderingContext2D对象(画笔)
  662. let context = canvas.getContext('2d')
  663. // 创建新的图片对象
  664. let img = new Image()
  665. // 指定图片的DataURL(图片的base64编码数据)
  666. img.src = file.content
  667. // 监听浏览器加载图片完成,然后进行进行绘制
  668. const height = 166
  669. const width = 316
  670. img.onload = () => {
  671. const h = img.height
  672. const w = img.width
  673. let ch = img.height/4
  674. let cw = img.width/4
  675. let canvas = document.createElement('canvas')
  676. let ctx = canvas.getContext('2d')
  677. canvas.height = ch
  678. canvas.width = cw
  679. ctx.clearRect(0,0,cw,ch)
  680. ctx.drawImage(img,0,0,cw,ch)
  681. let base_img = canvas.toDataURL('image/jpeg')
  682. const blobBin = atob(base_img.split(',')[1])
  683. let d = []
  684. for (let i=0;i<blobBin.length;i++){
  685. d.push(blobBin.charCodeAt(i))
  686. }
  687. const data2 = new FormData();
  688. data2.append("file", new Blob([new Uint8Array(d)],{type:'image/jpeg'}));
  689. uploadFile(data2).then(res => {
  690. if(res.code == 200){
  691. this.xcdcform.idcardCheckedBy = res.idcardCheckedBy
  692. this.xcdcform.nameCheckedBy = res.nameCheckedBy
  693. this.xcdcform["fileUrl"] = res.url
  694. }
  695. })
  696. this.fileList = []
  697. }
  698. this.fileList = []
  699. },
  700. afterRead1(file){
  701. // 创建Canvas对象(画布)
  702. let canvas = document.createElement('canvas')
  703. // 获取对应的CanvasRenderingContext2D对象(画笔)
  704. let context = canvas.getContext('2d')
  705. // 创建新的图片对象
  706. let img = new Image()
  707. // 指定图片的DataURL(图片的base64编码数据)
  708. img.src = file.content
  709. img.onload = () => {
  710. const h = img.height
  711. const w = img.width
  712. let ch = img.height/4
  713. let cw = img.width/4
  714. let canvas = document.createElement('canvas')
  715. let ctx = canvas.getContext('2d')
  716. canvas.height = ch
  717. canvas.width = cw
  718. ctx.clearRect(0,0,cw,ch)
  719. ctx.drawImage(img,0,0,cw,ch)
  720. let base_img = canvas.toDataURL('image/jpeg')
  721. const blobBin = atob(base_img.split(',')[1])
  722. let d = []
  723. for (let i=0;i<blobBin.length;i++){
  724. d.push(blobBin.charCodeAt(i))
  725. }
  726. const data2 = new FormData();
  727. data2.append("file", new Blob([new Uint8Array(d)],{type:'image/jpeg'}));
  728. uploadFileBase(data2).then(res => {
  729. this.xcdcform.fileUrl1=res.fileName
  730. console.log(res)
  731. })
  732. }
  733. },
  734. afterRead2(file){
  735. // 创建Canvas对象(画布)
  736. let canvas = document.createElement('canvas')
  737. // 获取对应的CanvasRenderingContext2D对象(画笔)
  738. let context = canvas.getContext('2d')
  739. // 创建新的图片对象
  740. let img = new Image()
  741. // 指定图片的DataURL(图片的base64编码数据)
  742. img.src = file.content
  743. img.onload = () => {
  744. const h = img.height
  745. const w = img.width
  746. let ch = img.height/4
  747. let cw = img.width/4
  748. let canvas = document.createElement('canvas')
  749. let ctx = canvas.getContext('2d')
  750. canvas.height = ch
  751. canvas.width = cw
  752. ctx.clearRect(0,0,cw,ch)
  753. ctx.drawImage(img,0,0,cw,ch)
  754. let base_img = canvas.toDataURL('image/jpeg')
  755. const blobBin = atob(base_img.split(',')[1])
  756. let d = []
  757. for (let i=0;i<blobBin.length;i++){
  758. d.push(blobBin.charCodeAt(i))
  759. }
  760. const data2 = new FormData();
  761. data2.append("file", new Blob([new Uint8Array(d)],{type:'image/jpeg'}));
  762. uploadFileBase(data2).then(res => {
  763. this.xcdcform.fileUrl2=res.fileName
  764. })
  765. }
  766. },
  767. remove(val){
  768. if(val==1){
  769. this.xcdcform.fileUrl1=""
  770. }else {
  771. this.xcdcform.fileUrl2=""
  772. }
  773. },
  774. changeFn(val) {
  775. },
  776. confirmFn(){
  777. this.xcdcform.fileTime = getNowFormatDate(this.currentValue)
  778. this.dhdcform.fileTime = getNowFormatDate(this.currentValue)
  779. this.showDate = false;
  780. this.showDate1 = false;
  781. },
  782. cancelFn(){
  783. this.showDate = false;
  784. this.showDate1 = false;
  785. }
  786. ,
  787. showPop(){
  788. this.showDate = true;
  789. },
  790. showPop1(){
  791. this.showDate1 = true;
  792. },
  793. changeDept(val){
  794. if(val==1){
  795. this.queryParams.countName = this.value1
  796. this.queryParams.townName = null
  797. this.queryParams.villageName = null
  798. this.queryParams.cooperativeName = null
  799. listSamplingDept(this.queryParams).then(res => {
  800. if(res.data){
  801. this.option11=[{ text: '请选择乡镇', value: 0 }]
  802. res.data.map(item => {
  803. this.option11.push({ "text":item.townName,"value": item.townName})
  804. })
  805. this.value11=0
  806. this.value2=0
  807. this.value22=0
  808. }
  809. })
  810. }else if(val==2){
  811. this.queryParams.countName = this.value1
  812. this.queryParams.townName = this.value11
  813. this.queryParams.villageName = null
  814. this.queryParams.cooperativeName = null
  815. listSamplingDept(this.queryParams).then(res => {
  816. if(res.data){
  817. this.option2=[{ text: '请选择村级', value: 0 }]
  818. res.data.map(item => {
  819. this.option2.push({ "text":item.villageName,"value": item.villageName})
  820. })
  821. this.value2=0
  822. this.value22=0
  823. }
  824. })
  825. }else if(val==3){
  826. this.queryParams.countName = this.value1
  827. this.queryParams.townName = this.value11
  828. this.queryParams.villageName = this.value2
  829. this.queryParams.cooperativeName = null
  830. listSamplingDept(this.queryParams).then(res => {
  831. if(res.data){
  832. this.option22=[{ text: '请选择合作社', value: 0 }]
  833. res.data.map(item => {
  834. this.option22.push({ "text":item.cooperativeName,"value": item.cooperativeName})
  835. })
  836. this.value22=0
  837. }
  838. })
  839. }else if(val==4){
  840. this.queryParams.countName = this.value1
  841. this.queryParams.townName = this.value11
  842. this.queryParams.villageName = this.value2
  843. this.queryParams.cooperativeName = this.value22
  844. this.getList()
  845. }
  846. },
  847. reset(){
  848. this.queryform={
  849. pageNum: 1,
  850. pageSize: 10,
  851. // 查询排序
  852. //orderByColumn: "id",
  853. //isAsc: "desc",
  854. countName: null,
  855. townName: null,
  856. villageName: null,
  857. cooperativeName: null,
  858. status: null,
  859. id: null,
  860. }
  861. this.xcdcform={
  862. countName: null,
  863. townName: null,
  864. villageName: null,
  865. cooperativeName: null,
  866. farmerName: null,
  867. status: null,
  868. callPhone: null,
  869. calledPhone: null,
  870. checkedBy: null,
  871. createBy: null,
  872. createTime: null,
  873. fileName: null,
  874. fileTime: null,
  875. id: null,
  876. idcardCheckedBy: null,
  877. item1: '',
  878. item2: '',
  879. item3: '',
  880. item4: '',
  881. item5: '',
  882. item6: '',
  883. item7: '',
  884. item8: '',
  885. item9: '',
  886. item10: '',
  887. item11: '',
  888. item12: '',
  889. item13: '',
  890. item14: '',
  891. item15: '',
  892. item16: '',
  893. item17: '',
  894. item18: '',
  895. lackCount: null,
  896. originalNameCheckedBy: null,
  897. nameCheckedBy: null,
  898. params: null,
  899. samplingId: null,
  900. searchValue: null,
  901. updateBy: null,
  902. fileUrl1: [],
  903. fileUrl2: [],
  904. };
  905. this.dhdcform={
  906. countName: null,
  907. townName: null,
  908. villageName: null,
  909. cooperativeName: null,
  910. farmerName: null,
  911. status: null,
  912. callPhone: null,
  913. calledPhone: null,
  914. checkedBy: null,
  915. createBy: null,
  916. createTime: null,
  917. fileName: null,
  918. fileTime: null,
  919. id: null,
  920. idcardCheckedBy: null,
  921. item1: null,
  922. item10: null,
  923. lackCount: null,
  924. originalNameCheckedBy: null,
  925. nameCheckedBy: null,
  926. params: null,
  927. samplingId: null,
  928. searchValue: null,
  929. updateBy: null,
  930. }
  931. this.fileList = []
  932. this.fileList1 = []
  933. this.fileList2 = []
  934. },
  935. onClickRight() {
  936. this.show = true
  937. this.queryform = this.queryParams
  938. },
  939. onSearch() {
  940. },
  941. onChange({ value }) {
  942. this.options.map(i => {
  943. if (value === i.value) {
  944. getDeptList(value).then(response => {
  945. if(response.data.length>0){
  946. i.children=[]
  947. response.data.map(item => {
  948. i.children.push({ text: item.deptName,value:item.deptId});
  949. });
  950. }
  951. });
  952. }
  953. })
  954. },
  955. removeRow(id,index){
  956. let _this = this
  957. Dialog.confirm({
  958. title: '删除',
  959. message: '删除后数据无法恢复,确认要删除么?'
  960. }).then(() => {
  961. delSampling(id).then(res => {
  962. this.$toast({
  963. icon: 'success', // 找到自己需要的图标
  964. message: '删除成功',
  965. duration:"1000",
  966. onClose:function(){
  967. _this.getList();
  968. }
  969. })
  970. })
  971. }).catch(() => {
  972. // on cancel
  973. });
  974. },
  975. onFinish({ selectedOptions }) {
  976. this.show1 = false;
  977. this.fieldValue = selectedOptions.map((option) => option.text).join('/');
  978. },
  979. /** 判断是否有证书 */
  980. haveCertificate(id){
  981. if(id == "1"){
  982. if(this.xcdcform.item1=='N'){
  983. this.xcdcform.item2 = 'N'
  984. this.xcdcform.item3 = 'N'
  985. this.xcdcform.item4 = 'N'
  986. this.xcdcform.item5 = 'N'
  987. this.xcdcform.item8 = 'N'
  988. this.xcdcform.item9 = 'N'
  989. }
  990. }if(id == "2") {
  991. if(this.xcdcform.item10=='N'){
  992. this.xcdcform.item11 = 'N'
  993. this.xcdcform.item12 = 'N'
  994. this.xcdcform.item13 = 'N'
  995. this.xcdcform.item14 = 'N'
  996. this.xcdcform.item15 = 'N'
  997. this.xcdcform.item16 = 'N'
  998. this.xcdcform.item17 = 'N'
  999. this.xcdcform.item18 = 'N'
  1000. }
  1001. }
  1002. },
  1003. selectType(val,data,index){
  1004. if(val==1){
  1005. let _this = this
  1006. let a ={
  1007. "countName": data.countName,
  1008. "townName": data.townName,
  1009. "villageName": data.villageName,
  1010. "cooperativeName": data.cooperativeName,
  1011. "status": "1",
  1012. "id": data.id
  1013. }
  1014. a.status = "1"
  1015. updateSampling(a).then(res => {
  1016. this.$toast({
  1017. icon: 'success', // 找到自己需要的图标
  1018. message: '修改成功',
  1019. duration:"1000",
  1020. onClose:function(){
  1021. _this.getList();
  1022. }
  1023. })
  1024. })
  1025. }else if(val==3){
  1026. this.reset();
  1027. this.showXCDC=true
  1028. getInvestigate(data.id).then(res => {
  1029. if(res.data){
  1030. this.xcdcform = res.data
  1031. console.log(res.data)
  1032. if(this.xcdcform.fileUrl1){
  1033. this.fileList1.push({
  1034. "url":this.xcdcform.fileUrl1
  1035. })
  1036. }
  1037. if(this.xcdcform.fileUrl2){
  1038. this.fileList2.push({
  1039. "url":this.xcdcform.fileUrl2
  1040. })
  1041. }
  1042. this.xcdcform["countName"] = data.countName
  1043. this.xcdcform["townName"] = data.townName
  1044. this.xcdcform["villageName"] = data.villageName
  1045. this.xcdcform["cooperativeName"] = data.cooperativeName
  1046. this.xcdcform["farmerName"] = data.farmerName
  1047. }else{
  1048. this.xcdcform["countName"] = data.countName
  1049. this.xcdcform["townName"] = data.townName
  1050. this.xcdcform["villageName"] = data.villageName
  1051. this.xcdcform["cooperativeName"] = data.cooperativeName
  1052. this.xcdcform["farmerName"] = data.farmerName
  1053. this.xcdcform["samplingId"] = data.id
  1054. this.xcdcform["fileName"] = data.townName+data.villageName
  1055. this.xcdcform["checkedBy"] = this.nickName
  1056. this.xcdcform["fileTime"] = getNowFormatDate()
  1057. }
  1058. })
  1059. }else if(val==2){
  1060. this.reset();
  1061. this.showDHDC=true
  1062. getInvestigate(data.id).then(res => {
  1063. if(res.data){
  1064. this.dhdcform = res.data
  1065. this.dhdcform["countName"] = data.countName
  1066. this.dhdcform["townName"] = data.townName
  1067. this.dhdcform["villageName"] = data.villageName
  1068. this.dhdcform["cooperativeName"] = data.cooperativeName
  1069. this.dhdcform["farmerName"] = data.farmerName
  1070. }else{
  1071. this.dhdcform["countName"] = data.countName
  1072. this.dhdcform["townName"] = data.townName
  1073. this.dhdcform["villageName"] = data.villageName
  1074. this.dhdcform["cooperativeName"] = data.cooperativeName
  1075. this.dhdcform["farmerName"] = data.farmerName
  1076. this.dhdcform["samplingId"] = data.id
  1077. this.dhdcform["fileName"] = data.townName+data.villageName
  1078. this.dhdcform["checkedBy"] = this.nickName
  1079. this.dhdcform["fileTime"] = getNowFormatDate()
  1080. }
  1081. })
  1082. }
  1083. },
  1084. onSubmit(values) {
  1085. this.queryform["createBy"] = this.userId
  1086. this.queryform["createTime"] = getNowFormatDate()
  1087. addSampling(this.queryform).then(res => {
  1088. this.show = false
  1089. this.getList();
  1090. })
  1091. },
  1092. onSubmitXCDC(values) {
  1093. let i = 0
  1094. if(this.xcdcform.item1=='N'){
  1095. i++
  1096. }if(this.xcdcform.item2=='N'){
  1097. i++
  1098. }if(this.xcdcform.item3=='N'){
  1099. i++
  1100. }if(this.xcdcform.item4=='N'){
  1101. i++
  1102. }if(this.xcdcform.item5=='N'){
  1103. i++
  1104. }if(this.xcdcform.item8=='N'){
  1105. i++
  1106. }if(this.xcdcform.item9=='N'){
  1107. i++
  1108. }if(this.xcdcform.item10=='N'){
  1109. i++
  1110. }if(this.xcdcform.item11=='N'){
  1111. i++
  1112. }if(this.xcdcform.item12=='N'){
  1113. i++
  1114. }if(this.xcdcform.item13=='N'){
  1115. i++
  1116. }if(this.xcdcform.item14=='N'){
  1117. i++
  1118. }if(this.xcdcform.item15=='N'){
  1119. i++
  1120. }if(this.xcdcform.item16=='N'){
  1121. i++
  1122. }if(this.xcdcform.item17=='N'){
  1123. i++
  1124. }if(this.xcdcform.item18=='N'){
  1125. i++
  1126. }
  1127. this.xcdcform["lackCount"] = i
  1128. if(this.xcdcform.fileUrl1.length>0){
  1129. this.xcdcform.fileUrl1 = location.protocol+"//"+location.host+request.defaults.baseURL+ this.xcdcform.fileUrl1.replace(location.protocol+"//"+location.host+request.defaults.baseURL,"")
  1130. }else {
  1131. this.xcdcform.fileUrl1=""
  1132. }if(this.xcdcform.fileUrl2.length>0){
  1133. this.xcdcform.fileUrl2 = location.protocol+"//"+location.host+request.defaults.baseURL+ this.xcdcform.fileUrl2.replace(location.protocol+"//"+location.host+request.defaults.baseURL,"")
  1134. }else {
  1135. this.xcdcform.fileUrl2=""
  1136. }
  1137. if(this.xcdcform.id){
  1138. updateInvestigate(this.xcdcform).then(res => {
  1139. this.showXCDC = false
  1140. let _this = this
  1141. this.xcdcform.status = "2"
  1142. this.xcdcform.id = this.xcdcform.samplingId
  1143. updateSampling(this.xcdcform).then(res => {
  1144. _this.reset()
  1145. this.$toast({
  1146. icon: 'success', // 找到自己需要的图标
  1147. message: '修改成功',
  1148. duration:"1000",
  1149. onClose:function(){
  1150. _this.getList();
  1151. }
  1152. })
  1153. })
  1154. })
  1155. }else {
  1156. addInvestigate(this.xcdcform).then(res => {
  1157. this.showXCDC = false
  1158. let _this = this
  1159. this.xcdcform.status = "2"
  1160. this.xcdcform.id = this.xcdcform.samplingId
  1161. updateSampling(this.xcdcform).then(res => {
  1162. _this.reset()
  1163. this.$toast({
  1164. icon: 'success', // 找到自己需要的图标
  1165. message: '保存成功',
  1166. duration:"1000",
  1167. onClose:function(){
  1168. _this.getList();
  1169. }
  1170. })
  1171. })
  1172. })
  1173. }},
  1174. onSubmitDHDC(values) {
  1175. if(this.dhdcform.id){
  1176. updateInvestigate(this.dhdcform).then(res => {
  1177. this.showDHDC = false
  1178. let _this = this
  1179. this.dhdcform.status = "3"
  1180. this.dhdcform.id = this.dhdcform.samplingId
  1181. updateSampling(this.dhdcform).then(res => {
  1182. _this.reset()
  1183. this.$toast({
  1184. icon: 'success', // 找到自己需要的图标
  1185. message: '修改成功',
  1186. duration:"1000",
  1187. onClose:function(){
  1188. _this.getList();
  1189. }
  1190. })
  1191. })
  1192. })
  1193. }else {
  1194. addInvestigate(this.dhdcform).then(res => {
  1195. this.showDHDC = false
  1196. let _this = this
  1197. this.dhdcform.status = "3"
  1198. this.dhdcform.id = this.dhdcform.samplingId
  1199. updateSampling(this.dhdcform).then(res => {
  1200. _this.reset()
  1201. this.$toast({
  1202. icon: 'success', // 找到自己需要的图标
  1203. message: '保存成功',
  1204. duration:"1000",
  1205. onClose:function(){
  1206. _this.getList();
  1207. }
  1208. })
  1209. })
  1210. })
  1211. }
  1212. },
  1213. getList(){
  1214. this.queryParams["farmerName"] = null
  1215. listSampling(this.queryParams).then(response => {
  1216. if(response.rows.length>0){
  1217. response.rows.map(item => {
  1218. if(item.status==0){
  1219. item.status="未调查"
  1220. }else if(item.status==1){
  1221. item.status="被替补"
  1222. }else if(item.status==2){
  1223. item.status="现场调查"
  1224. }else if(item.status==3){
  1225. item.status="电话调查"
  1226. }
  1227. })
  1228. this.samplingList = response.rows;
  1229. this.loading = false;
  1230. }
  1231. });
  1232. },
  1233. onL() {
  1234. this.refreshing = true;
  1235. this.loading = false;
  1236. this.refreshing = false;
  1237. },
  1238. onRefresh() {
  1239. // 清空列表数据
  1240. this.finished = false;
  1241. // 重新加载数据
  1242. // 将 loading 设置为 true,表示处于加载状态
  1243. this.loading = true;
  1244. this.onL();
  1245. },
  1246. },
  1247. }
  1248. </script>
  1249. <style scoped>
  1250. .van-doc-demo-block__title {
  1251. margin: 0;
  1252. padding: 32px 16px 16px;
  1253. color: rgba(69, 90, 100, 0.6);
  1254. font-weight: normal;
  1255. font-size: 14px;
  1256. line-height: 16px;
  1257. }
  1258. </style>