移动端
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.
 
 

761 regels
28 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-sticky style="position:relative;">
  4. <div class="bannerBg">
  5. <van-nav-bar
  6. style="background:transparent;border-bottom-width:0;margin-bottom:.5rem;"
  7. @click-left="goBack()"
  8. right-text ="首页"
  9. @click-right="goRightBack()"
  10. >
  11. <template #left>
  12. <van-icon name="arrow-left" size="18" color="#fff" />
  13. </template>
  14. <!-- <template #right>
  15. <van-icon name="map-marked" size="18" color="#fff" />
  16. </template>-->
  17. <template #title>
  18. <p style="color:#fff">入户调查</p>
  19. </template>
  20. </van-nav-bar>
  21. </div>
  22. <div style="width:95%;left:2.5%;position:absolute;background:#fff;border-radius:15px;box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16);padding: .3rem;top:1.2rem">
  23. <van-row>
  24. <van-col span="4" :offset="1" style="text-align:center;" @click="$router.push({path:'/homesteadSurvey/add'})">
  25. <van-icon :name="require('../../assets/images/housesteadSurvey/zjd'+(active==1?'A':'D')+'.png')" size="1rem" style="margin-top:0px;"/>
  26. <p :style="{color:(active==1?'rgb(34, 183, 242)':'#000')}">宅基地</p>
  27. </van-col>
  28. <van-col span="2">
  29. <div style="border-top: 2px dashed #b5b4b4;margin-top: 20px;"></div>
  30. </van-col>
  31. <van-col span="4" style="text-align:center;" @click="$router.push({path:'/homesteadSurvey/add2'})" >
  32. <van-icon :name="require('../../assets/images/housesteadSurvey/nhxx'+(active==2?'A':'D')+'.png')" size="1rem" style="margin-top:0px;"/>
  33. <p :style="{color:(active==2?'rgb(34, 183, 242)':'#000')}">权利人</p>
  34. </van-col>
  35. <van-col span="2">
  36. <div style="border-top: 2px dashed #b5b4b4;margin-top: 20px;"></div>
  37. </van-col>
  38. <van-col span="4" style="text-align:center;" @click="$router.push({path:'/homesteadSurvey/add3'})" >
  39. <van-icon :name="require('../../assets/images/housesteadSurvey/fwxx'+(active==3?'A':'D')+'.png')" size="1rem" style="margin-top:0px;"/>
  40. <p :style="{color:(active==3?'rgb(34, 183, 242)':'#000')}">房屋</p>
  41. </van-col>
  42. <van-col span="2">
  43. <div style="border-top: 2px dashed #b5b4b4;margin-top: 20px;"></div>
  44. </van-col>
  45. <van-col span="4" style="text-align:center;" @click="$router.push({path:'/homesteadSurvey/add4'})">
  46. <van-icon :name="require('../../assets/images/housesteadSurvey/fsss'+(active==4?'A':'D')+'.png')" size="1rem" style="margin-top:0px;"/>
  47. <p :style="{color:(active==4?'rgb(34, 183, 242)':'#000')}">附属物</p>
  48. </van-col>
  49. </van-row>
  50. </div>
  51. </van-sticky>
  52. <div style="margin:1.6rem auto 0;width: 95%;">
  53. <p class="title" style="position:relative;padding-left:10px;line-height:20px;font-size: 16px;margin-bottom: 5px;">附属设施</p>
  54. </div>
  55. <van-list
  56. v-model:loading="loading"
  57. :finished="finished"
  58. finished-text="没有更多了"
  59. :immediate-check="false"
  60. @load="onRefreshFsss"
  61. >
  62. <van-swipe-cell v-for="(item,index) in fssslist" :key="'fsss'+index" style="border-radius: 16px;box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16); width:95%;margin:15px auto 0;background:#fff;">
  63. <div style="padding:15px;">
  64. <p style="display: flex;align-items: center;">
  65. <img src="../../assets/images/housesteadSurvey/add03.png" alt="" style="margin-right: 5px;">
  66. <span style="line-height: 1;font-size: 16px;">{{ formatDict(fssslxList, item.fssslx) }}</span>
  67. </p>
  68. <div style="display:flex;line-height:20px;margin-top: 15px;font-size: 14px;color: #999999;">
  69. <p style="flex:1;text-align:left;">建筑面积(㎡):</p>
  70. <p style="flex:1;text-align:right;">{{item.jzmj}}</p>
  71. </div>
  72. <div style="display:flex;line-height:20px;margin-top: 5px;font-size: 14px;color: #999999;">
  73. <p style="flex:1;text-align:left;">建筑物情况:</p>
  74. <p style="flex:1;text-align:right;">{{ formatDict(jzwqkList, item.jzwqk) }} </p>
  75. </div>
  76. <div style="text-align:center;overflow:auto;display: flex;justify-content: center;margin-top: 10px;">
  77. <p style="width:49%;display: flex;align-items: center;justify-content:center;border: 1px solid #22B7F2;padding: 3px 0;border-radius: 50px;" @click="showPopupzrz(item)">
  78. <img src="../../assets/images/housesteadSurvey/add02.png" alt="">
  79. <span style="font-size: 14px;color: #22B7F2;margin-left: 5px;" >查看附属设施信息</span>
  80. </p>
  81. </div>
  82. </div>
  83. <template #right>
  84. <van-row style="height: 100%">
  85. <van-col style="height: 100%">
  86. <van-button square type="info" class="delete-button" style="position: relative;" @click="showUploadList(item.id)"><van-icon style="bottom: -3px;" name="photo-o" size=".4rem" color="#FFFFFF"/>附件</van-button>
  87. </van-col>
  88. <van-col style="height: 100%">
  89. <van-button v-show="permission == 'true'" square type="danger" class="delete-button" @click="deletefsss(item)"><img width="10px" src="../../assets/images/sunVillage_info/list_icon_7.png" alt="">删除</van-button>
  90. </van-col>
  91. </van-row>
  92. </template>
  93. </van-swipe-cell>
  94. </van-list>
  95. <div v-if="permission == 'true' " style=" width:95%;margin:20px auto;display: flex;justify-content: center;">
  96. <div style="width:100%;text-align:center;overflow:auto;border-radius: 16px;box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16);padding: 15px 0px;background: #ffffff;color: #22B7F2;">
  97. <p style="font-size: 16px;" @click="showPopupAddzrz()">+ 添加附属设施信息</p>
  98. </div>
  99. </div>
  100. <div style="width:95%;margin:20px auto;text-align:center;overflow:auto;display: flex;justify-content: space-around;">
  101. <p v-if="showYcbj" style="width:32%;border: 1px solid transparent;background: #FA5353;padding: 5px 0;border-radius: 50px;">
  102. <span style="font-size: 14px;color: #fff;margin-left: 5px;" @click="ycbj()">异常标记</span>
  103. </p>
  104. <p v-if="zjdzdxx.surveyStatus == '4'" style="width:32%;border: 1px solid transparent;background: #FFA500;padding: 5px 0;border-radius: 50px;">
  105. <span style="font-size: 14px;color: #fff;margin-left: 5px;" @click="bhyyLook()">驳回原因</span>
  106. </p>
  107. <p v-if="showSh" style="width:32%;border: 1px solid transparent;background: #22B7F2;padding: 5px 0;border-radius: 50px;">
  108. <span style="font-size: 14px;color: #fff;margin-left: 5px;" @click="qmqr()">{{qzqr}}</span>
  109. </p>
  110. <p v-if = "showDcsh" style="width:32%;border: 1px solid #22B7F2;background: #ffffff;padding: 5px 0;border-radius: 50px;">
  111. <span style="font-size: 14px;color: #22B7F2;margin-left: 5px;" @click="dcsh()">调查审核</span>
  112. </p>
  113. </div>
  114. <div v-if = "showHd" style="width:95%;margin:20px auto;text-align:center;overflow:auto;display: flex;justify-content: space-around;">
  115. <p style="width:82%;border: 1px solid #22B7F2;background: #ffffff;padding: 5px 0;border-radius: 50px;">
  116. <span style="font-size: 14px;color: #22B7F2;margin-left: 5px;" @click="zcxd()">自查校对</span>
  117. </p>
  118. </div>
  119. <van-popup v-model="showesign" closeable position="right" :style="{ height: '100%' }"
  120. close-icon="close">
  121. <van-row style="margin:0 10%">
  122. <p class="title" style="margin:20px 0;position:relative;padding-left:20px;font-size:0.5rem">电子签名</p>
  123. </van-row>
  124. <div class="signature-box" @mousedown="canvasTTdown" @touchstart="canvasTTdown">
  125. <vue-esign
  126. ref="esign"
  127. class="mySign"
  128. :width="500"
  129. :height="height"
  130. :isCrop="signature.isCrop"
  131. :lineWidth="signature.lineWidth"
  132. :lineColor="signature.lineColor"
  133. :bgColor.sync="signature.bgColor"
  134. v-if="zjdzdxx.surveyStatus != '3' && zjdzdxx.surveyStatus != '5' || !signature.resultImg && permission == 'true'"
  135. />
  136. </div>
  137. <img src="../../assets/images/sunVillage_info/signature_icon_10.png" id="canvasTT" v-if="zjdzdxx.surveyStatus != '3' && zjdzdxx.surveyStatus != '5' || !signature.resultImg && permission == 'true'"
  138. style="position:absolute;top: 50%;left: 50%;transform: translate(-50%,-50%)" alt="">
  139. <img :src="signature.resultImg" alt="" width="100%" v-if="signature.resultImg && zjdzdxx.surveyStatus == '3' || zjdzdxx.surveyStatus == '5'"/>
  140. <div class="signature-footer" v-if="zjdzdxx.surveyStatus != '3' && zjdzdxx.surveyStatus != '5' || !signature.resultImg && permission == 'true'">
  141. <van-button type="primary" round size="small" @click="handleReset">清空画板</van-button>
  142. <van-button type="primary" round size="small" @click="handleGenerate">保存提交</van-button>
  143. </div>
  144. </van-popup>
  145. <van-dialog v-model="ycbzShow" title="异常标记" show-cancel-button confirmButtonText="保存" cancelButtonText="关闭" confirmButtonColor="#323233" :before-close="onBeforeClose" >
  146. <van-form ref="ycbzForm">
  147. <van-row>
  148. <van-col span="24">
  149. <van-field v-model="zjdzdxx.surveyBz" label="异常备注" placeholder="异常备注" input-align="right" :rules="[{ required: true }]" required />
  150. </van-col>
  151. <van-col span="12">
  152. <p style="margin-left: 10%;color: #646566; font-size: 0.373333rem;">备注图片</p>
  153. </van-col>
  154. <van-col span="12">
  155. <MultiImageUploadComp :value="zjdzdxx.surveyBztp" :uploadDisabled="false" @fileUpdate="fileUpdate"/>
  156. </van-col>
  157. </van-row>
  158. </van-form>
  159. </van-dialog>
  160. <van-dialog v-model="dcshShow" title="调查审核" show-cancel-button confirmButtonText="保存" cancelButtonText="关闭" confirmButtonColor="#323233" :before-close="onBeforeCloseSh" >
  161. <van-form ref="dcshForm">
  162. <van-row>
  163. <van-col span="24">
  164. <van-field v-model="zjddcsh.auditRemark" label="备注" placeholder="审核备注" input-align="right" />
  165. </van-col>
  166. <van-col span="8">
  167. <p style="margin-left: 10%;color: #646566; font-size: 0.373333rem;">审核</p>
  168. </van-col>
  169. <van-col span="16">
  170. <van-radio-group v-model="zjddcsh.surveyStatus" direction="horizontal">
  171. <van-radio name="5">通过</van-radio>
  172. <van-radio name="4">驳回</van-radio>
  173. </van-radio-group>
  174. </van-col>
  175. </van-row>
  176. </van-form>
  177. </van-dialog>
  178. <div class="gl_main" v-if="zcxdShow">
  179. <div class="headers">
  180. <div class="flex4">检查事项</div>
  181. <img width="20px" style="left: 15px;" @click="onCloseMessage" src="../../assets/images/homestead/searchBar_close_gray.png" alt="">
  182. </div>
  183. <div class="desc_main">
  184. <ul class="analysisTable_list">
  185. <!--1-->
  186. <li v-for="(item,index) in inspectDataList" class="flex_item">
  187. <div class="flex4" >{{(index+1)+'、'+item}}</div>
  188. </li>
  189. </ul>
  190. </div>
  191. </div>
  192. <van-popup v-model:show="showImageList" position="bottom" style="height:40vh;padding:50px 10px 0" closeable
  193. close-icon="close">
  194. <p style="color:#000;position:absolute;top:0.426667rem;left:0.426667rem">图片上传</p>
  195. <div style="width:100%;height:calc( 40vh - 100px);overflow-y: scroll;">
  196. <van-uploader accept="image/*" v-model="uploadImgList" :after-read="beforeReadImageList" @delete="deleteFileImageList" multiple :max-count="50" />
  197. </div>
  198. <van-row justify="space-around" style=" position:fixed;bottom:0;left:0;width:100%;height:50px;text-align: center;">
  199. <van-col span="12"><van-button type="primary" style="width:100px;" round @click="qkClick">清空</van-button></van-col>
  200. <van-col span="12"><van-button type="primary" style="width:100px;" round @click="submitUploadList(zjdId)">上传</van-button></van-col>
  201. </van-row>
  202. </van-popup>
  203. </div>
  204. </template>
  205. <script>
  206. import {attach} from "@/api/onlineHome/homestead/application";
  207. import {getZjdzd,updateZjdzd,zjddcSign,surveyInspectByZjddm} from "@/api/homesteadSurvey/zjdzd";
  208. import MapGisDrawing from "@/components/Map/MapGisDrawing";
  209. import {listFsss,addFsss,updateFsss,delFsss,getFsssZjdDmList,updateFsssStatus} from "@/api/homesteadSurvey/fsss";
  210. import MultiImageUploadComp from "@/components/house/MultiImageUploadComp"
  211. import {uploadFile} from "@/api/homesteadSurvey/zjdzd";
  212. import {attachmentFind} from "@/api/sunVillage_info/homestead/application";
  213. import {systemAttachment} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  214. import {base64Attach} from "@/api/user";
  215. import {Dialog} from "vant";
  216. import $ from "jquery";
  217. export default {
  218. name: "homesteadAdd",
  219. components: { MapGisDrawing,MultiImageUploadComp},
  220. data() {
  221. return {
  222. active:4,
  223. dcshShow:false,
  224. showesign:false,
  225. showDcsh:false,
  226. qzqr:"签名确认",
  227. showSh:false,
  228. loading:false,
  229. finished:false,
  230. zcxdShow:false,
  231. showYcbj:false,
  232. showHd:false,
  233. countyhc:1,
  234. ycbzShow:false,
  235. permission:false,
  236. showImageList:false,
  237. zjdId:null,
  238. uploadImgList:[],
  239. uploadImgList1:[],
  240. inspectDataList:[],
  241. bztp:"",
  242. ycbz:"",
  243. jzwqkList:[],
  244. fssslxList:[],
  245. zjdzdxx:{surveyStatus:"5"},
  246. zjddcsh:{surveyStatus:"5",auditRemark:""},
  247. fssslist:[],
  248. //电子签名
  249. signature: {
  250. lineWidth: 6, // 画笔的线条粗细
  251. lineColor: "#000000", // 画笔的颜色
  252. bgColor: "", // 画布的背景颜色
  253. resultImg: "", // 最终画布生成的base64图片
  254. isCrop: false, // 是否裁剪,在画布设定尺寸基础上裁掉四周空白部分
  255. },
  256. };
  257. },
  258. created(){
  259. this.houseGetDicts("jzwqk").then((response) => {
  260. this.jzwqkList = response.data;
  261. });
  262. this.houseGetDicts("fsss_type").then((response) => {
  263. this.fssslxList = response.data;
  264. });
  265. this.zjdzdxx = JSON.parse(localStorage.getItem("zjdzdxxItem"));
  266. this.permission = localStorage.getItem("executePermission");
  267. let businessLevel = this.$store.state.user.businessLevel;
  268. if(this.zjdzdxx.surveySign != null){
  269. this.signature.resultImg = this.$store.getters.baseRoutingUrl+this.zjdzdxx.surveySign;
  270. }
  271. if(this.zjdzdxx.id !== undefined){
  272. getZjdzd(this.zjdzdxx.id).then((response) => {
  273. if(response.data.surveyStatus === "3" && businessLevel === "2"){
  274. this.showDcsh = true;
  275. }
  276. if(response.data.surveyStatus === "3"){
  277. this.showHd = true;
  278. }
  279. if(this.permission ==='true' && response.data.surveyStatus !== "3" && response.data.surveyStatus !== '5'){
  280. this.showYcbj = true;
  281. }
  282. if(response.data.surveyStatus === '5' || response.data.surveyStatus === '3'){
  283. this.qzqr = "签名图片";
  284. }else{
  285. this.qzqr = "签名确认";
  286. }
  287. this.showSh = true;
  288. });
  289. this.getList();
  290. }
  291. this.height = window.screen.height * 1.28 - 20;
  292. },
  293. mounted(){
  294. },
  295. methods: {
  296. getList(){
  297. let params = {
  298. zjddm:this.zjdzdxx.zjddm,
  299. pageNum: this.countyhc+1,
  300. pageSize:10,
  301. }
  302. listFsss(params).then(response => {
  303. this.fssslist = response.rows;
  304. if(response.rows.length>0&&response.rows.length<response.total){
  305. this.countyhc++
  306. this.loading = false
  307. }else{
  308. this.loading = false
  309. this.finished = true
  310. }
  311. });
  312. },
  313. fileUpdate(val){
  314. this.$set(this.zjdzdxx, 'surveyBztp',val.path);
  315. },
  316. canvasTTdown() {
  317. $('#canvasTT').css('display', 'none');
  318. },
  319. bhyyLook(){
  320. if(this.zjdzdxx.auditRemark !== null && this.zjdzdxx.auditRemark !== ''){
  321. Dialog({ type: 'success', message: this.zjdzdxx.auditRemark });
  322. }else{
  323. Dialog({ type: 'success', message: "无"});
  324. }
  325. },
  326. onBeforeCloseSh(action, done){
  327. if (action === 'confirm') {
  328. if(this.zjddcsh.surveyStatus === '4' || this.zjddcsh.surveyStatus === '5') {
  329. let surveyItem = JSON.parse(localStorage.getItem("surveyItem"));
  330. this.$set(this.zjddcsh, 'surveyId', surveyItem.id);
  331. }
  332. this.$set(this.zjddcsh, 'id', this.zjdzdxx.id);
  333. updateZjdzd(this.zjddcsh).then(response => {
  334. if(response.code === 200){
  335. let _this =this
  336. _this.$toast({
  337. icon: 'success', // 找到自己需要的图标
  338. message: '保存成功',
  339. duration:"1000",
  340. onClose:function(){
  341. _this.dcshShow = false;
  342. _this.goRightBack();
  343. }
  344. })
  345. }
  346. });
  347. } else {
  348. return done();
  349. }
  350. },
  351. onRefreshFsss(){
  352. if(this.loading){
  353. let params = {
  354. zjddm:this.zjdzdxx.zjddm,
  355. pageNum: this.countyhc+1,
  356. pageSize:10,
  357. }
  358. listFsss(params).then(response => {
  359. if(response.rows.length>0&&response.rows.length<response.total){
  360. response.rows.map(res => {
  361. this.fssslist.push(res)
  362. })
  363. this.countyhc++
  364. this.loading = false
  365. }else{
  366. this.loading = false
  367. this.finished = true
  368. }
  369. });
  370. }
  371. },
  372. goRightBack(){
  373. this.$router.push({path:'/homesteadSurvey/list'});
  374. },
  375. onCloseMessage(){
  376. this.zcxdShow = false;
  377. },
  378. // 清空画板
  379. handleReset() {
  380. this.resultImg = null
  381. if(this.$refs.esign){
  382. this.$refs.esign.reset();
  383. }
  384. $('#canvasTT').css('display', 'block')
  385. },
  386. // 生成签字图
  387. handleGenerate() {
  388. console.info( this.$refs.esign
  389. .generate() );
  390. this.$refs.esign
  391. .generate() // 使用生成器调用把签字的图片转换成为base64图片格式
  392. .then((res) => {
  393. this.signature.resultImg = res;
  394. let wj = this.dataURLtoBlob(res);
  395. let surveyItem = JSON.parse(localStorage.getItem("surveyItem"));
  396. let param = new FormData() // 创建form对象
  397. param.append('file', wj) // 通过append向form对象添加数据
  398. param.append('id', surveyItem.id)
  399. zjddcSign(param, this.zjdzdxx.zjddm,surveyItem.id).then(response => {
  400. this.$notify({type: 'success', message: '签字成功'});
  401. getZjdzd(this.zjdzdxx.id).then((response) => {
  402. localStorage.setItem("zjdzdxxItem",JSON.stringify(response.data))
  403. location.reload();
  404. });
  405. });
  406. })
  407. .catch((err) => {
  408. // 画布没有签字时会执行这里提示一下
  409. this.$toast.fail('请签名后再保存签字');
  410. });
  411. },
  412. formatDict(dict, value) {
  413. return this.selectDictLabel(dict, value);
  414. },
  415. dataURLtoBlob (dataurl, filename = 'file') {
  416. let arr = dataurl.split(',')
  417. let mime = arr[0].match(/:(.*?);/)[1]
  418. let suffix = mime.split('/')[1]
  419. let bstr = atob(arr[1])
  420. let n = bstr.length
  421. let u8arr = new Uint8Array(n)
  422. while (n--) {
  423. u8arr[n] = bstr.charCodeAt(n)
  424. }
  425. return new File([u8arr], `${filename}.${suffix}`, {
  426. type: mime
  427. })
  428. },
  429. goBack(){
  430. if(this.ztMap && this.enterMap ==1){
  431. if(this.form.id == null){
  432. this.backMap.backMapZjdAData.theGeom= "";
  433. }else{
  434. this.backMap.backMapZjdAData = this.form;
  435. }
  436. this.$cookies.set("search",this.backMap);
  437. } else {
  438. this.$cookies.set("search","");
  439. }
  440. this.$router.push({name: this.$router.back(-1)});
  441. // }
  442. },
  443. showPopupzrz(item){ this.$router.push({name:'fsssAdd',query:item});},
  444. showPopupAddzrz(){
  445. this.$router.push({name:'fsssAdd',query:{zjddm:this.zjdzdxx.zjddm}});
  446. },
  447. deletefsss(val){
  448. const ids = val.id || this.ids;
  449. Dialog.confirm({
  450. title: '系统提示',
  451. message: '是否确认删除附属物的数据项?',
  452. confirmButtonText: '确定',
  453. cancelButtonText: '取消'
  454. })
  455. .then(function() {
  456. return delFsss(ids);
  457. }).then(() => {
  458. this.$notify({ type: 'success' , message: "删除成功" });
  459. location.reload(true);
  460. }).catch(() => {});
  461. },
  462. qmqr(){
  463. if(this.zjdzdxx.surveySign != null){
  464. this.signature.resultImg = this.$store.getters.baseRoutingUrl+this.zjdzdxx.surveySign;
  465. }
  466. this.showesign = true;
  467. },
  468. ycbj(){
  469. this.ycbzShow = true;
  470. },
  471. //自查校对
  472. zcxd(){
  473. this.$toast.loading({
  474. message: "数据校对中",
  475. forbidClick: true,
  476. duration: 100000,
  477. });
  478. surveyInspectByZjddm(this.zjdzdxx.zjddm).then(response => {
  479. this.inspectDataList = response.data;
  480. this.$toast.clear();
  481. this.zcxdShow = true;
  482. });
  483. },
  484. // van-dialog 点击confirm事件不自动关闭
  485. onBeforeClose(action, done) {
  486. if (action === 'confirm') {
  487. this.$refs.ycbzForm.validate().then(() => {
  488. this.$set(this.zjdzdxx, 'surveyStatus', "2");
  489. updateZjdzd(this.zjdzdxx).then(response => {
  490. localStorage.setItem("zjdzdxxItem",JSON.stringify(this.zjdzdxx));
  491. let _this =this
  492. this.$toast({
  493. icon: 'success', // 找到自己需要的图标
  494. message: '保存成功',
  495. duration:"1000",
  496. onClose:function(){
  497. _this.getList();
  498. }
  499. })
  500. return done(true);
  501. });
  502. }).catch(() => {
  503. return done(false);
  504. });
  505. } else {
  506. return done();
  507. }
  508. },
  509. dcsh(){
  510. this.$set(this.zjdzdxx, 'surveyStatus', "5");
  511. this.dcshShow = true;
  512. },
  513. showUploadList(id){
  514. this.getAttachments(id);
  515. this.showImageList = true;
  516. this.zjdId = id;
  517. },
  518. getAttachments(id) {
  519. this.uploadImgList = [];
  520. let cond = {
  521. tableId: id,
  522. tableName: 't_homestead_fsss',
  523. fileType: 0,
  524. };
  525. attachmentFind(cond).then(resp => {
  526. this.uploadImgList = resp.data.map(function(item){
  527. return {id:item.id,url:'/api'+item.fileUrl,isImage: true}
  528. });
  529. });
  530. },
  531. deleteFileImageList(file){
  532. if(file.id !== undefined ){
  533. systemAttachment(file.id);
  534. }
  535. },
  536. // 图片上传前
  537. beforeReadImageList(file){
  538. let _this = this;
  539. if(file.length!=undefined){
  540. file.map(res => {
  541. let zjddm = res.file.name
  542. //zjddm=zjddm.substring(0,zjddm.lastIndexOf("\("));
  543. // 创建Canvas对象(画布)
  544. let canvas = document.createElement('canvas')
  545. // 获取对应的CanvasRenderingContext2D对象(画笔)
  546. let context = canvas.getContext('2d')
  547. // 创建新的图片对象
  548. let img = new Image()
  549. // 指定图片的DataURL(图片的base64编码数据)
  550. img.src = res.content
  551. // 监听浏览器加载图片完成,然后进行进行绘制
  552. img.onload = () => {
  553. /*const h = img.height
  554. const w = img.width*/
  555. let ch = img.height/5
  556. let cw = img.width/5
  557. let canvas = document.createElement('canvas')
  558. let ctx = canvas.getContext('2d')
  559. canvas.height = ch
  560. canvas.width = cw
  561. ctx.clearRect(0,0,cw,ch)
  562. ctx.drawImage(img,0,0,cw,ch)
  563. let base_img = canvas.toDataURL('image/jpeg')
  564. let blobBin = atob(base_img.split(',')[1])
  565. let d = []
  566. for (let i=0;i<blobBin.length;i++){
  567. d.push(blobBin.charCodeAt(i))
  568. }
  569. let data2 = new FormData();
  570. data2.append("file", new Blob([new Uint8Array(d)],{type:'image/jpeg'}));
  571. uploadFile(data2);
  572. }
  573. })
  574. }else{
  575. let zjddm = file.file.name
  576. //zjddm=zjddm.substring(0,zjddm.lastIndexOf("\("));
  577. // 创建Canvas对象(画布)
  578. let canvas = document.createElement('canvas')
  579. // 获取对应的CanvasRenderingContext2D对象(画笔)
  580. let context = canvas.getContext('2d')
  581. // 创建新的图片对象
  582. let img = new Image()
  583. // 指定图片的DataURL(图片的base64编码数据)
  584. img.src = file.content
  585. // 监听浏览器加载图片完成,然后进行进行绘制
  586. img.onload = () => {
  587. /*const h = img.height
  588. const w = img.width*/
  589. let ch = img.height/5
  590. let cw = img.width/5
  591. let canvas = document.createElement('canvas')
  592. let ctx = canvas.getContext('2d')
  593. canvas.height = ch
  594. canvas.width = cw
  595. ctx.clearRect(0,0,cw,ch)
  596. ctx.drawImage(img,0,0,cw,ch)
  597. let base_img = canvas.toDataURL('image/jpeg')
  598. let blobBin = atob(base_img.split(',')[1])
  599. let d = []
  600. for (let i=0;i<blobBin.length;i++){
  601. d.push(blobBin.charCodeAt(i))
  602. }
  603. let data2 = new FormData();
  604. data2.append("file", new Blob([new Uint8Array(d)],{type:'image/jpeg'}));
  605. uploadFile(data2);
  606. }
  607. }
  608. },
  609. qkClick(){
  610. this.uploadImgList1 = this.uploadImgList;
  611. for(let i = 0; i < this.uploadImgList1.length; i++){
  612. if(this.uploadImgList[i].id !== undefined ){
  613. systemAttachment(this.uploadImgList[i].id);
  614. }
  615. }
  616. this.uploadImgList = [];
  617. },
  618. submitUploadList(val){
  619. let f = []
  620. for (let i of this.uploadImgList){
  621. if(i.content !== undefined){
  622. f.push(i.content)
  623. }
  624. }
  625. if(f.length === 0){
  626. return this.$toast.fail("请上传照片");
  627. }
  628. this.$toast.loading({
  629. message: "数据处理中",
  630. forbidClick: true,
  631. duration: 10000000000,
  632. });
  633. let _this = this;
  634. let file = {
  635. tableId:val,
  636. tableName:"t_homestead_fsss",
  637. bizPath:"upload",
  638. fileType:"0",
  639. files: f
  640. };
  641. base64Attach(file).then((resp) => {
  642. this.$toast({
  643. icon: 'success', // 找到自己需要的图标
  644. message: '上传成功',
  645. duration:"1000",
  646. onClose:function(){
  647. _this.showImageList = false
  648. }
  649. })
  650. });
  651. },
  652. }
  653. }
  654. </script>
  655. <style scoped >
  656. >>> .bannerBg{
  657. width: 100%;
  658. color:#fff;
  659. padding:10px;
  660. background: linear-gradient(134deg,#7ac943 1%, #22b7f2);
  661. }
  662. >>> .van-hairline--bottom::after {
  663. border-bottom-width: 0;
  664. }
  665. >>> .title:before
  666. {
  667. content:"";
  668. width: 6px;
  669. height: 20PX;
  670. background: #7ac943;
  671. border-radius: 3px;
  672. position:absolute;
  673. left:0;
  674. bottom:0;
  675. }
  676. >>> .delete-button {
  677. height: 100%;
  678. }
  679. >>> .van-swipe-cell__wrapper{
  680. margin-right:-3px;
  681. }
  682. >>> .label-class .van-collapse-item__title--expanded{
  683. font-weight: bold;
  684. }
  685. /deep/ .van-nav-bar__text {
  686. color: #fff;
  687. }
  688. .signature-footer {
  689. transform: rotate(90deg);
  690. width: auto;
  691. position: absolute;
  692. top: 50%;
  693. left: 0px;
  694. }
  695. .clearBtn {
  696. margin-left: 15px;
  697. }
  698. .flex4 {
  699. flex: 1;
  700. margin-left: 10px;
  701. overflow: hidden; /*超出部分隐藏*/
  702. white-space: nowrap; /*不换行*/
  703. text-overflow: ellipsis; /*超出部分文字以...显示*/
  704. }
  705. .gl_main{
  706. margin-top: .8vh;
  707. height: 48.15vh;
  708. background-color: #fff;
  709. }
  710. .gl_main .headers {
  711. position: relative;
  712. height: 3.24vh;
  713. color: #515a6e;
  714. font-weight: bold;
  715. text-align: left;
  716. display: flex;
  717. justify-content: center;
  718. align-items: center;
  719. background: #D3D3D3;
  720. padding-right: 0.53vw;
  721. margin-bottom: 1vh;
  722. }
  723. .gl_main .desc_main{
  724. height: 45.5vh;
  725. overflow-y: scroll;
  726. padding-right: 0.3vw;
  727. box-sizing:border-box;
  728. }
  729. .gl_main .desc_main {
  730. margin: 0;
  731. padding: 0;
  732. flex: 1;
  733. display: flex;
  734. flex-direction: column;
  735. }
  736. .gl_main .desc_main .analysisTable_list .flex_item {
  737. height: 3.77vh;
  738. list-style: none;
  739. margin: 0;
  740. display: flex;
  741. justify-content: center;
  742. align-items: center;
  743. text-align: left;
  744. color: #000000;
  745. position: relative;
  746. }
  747. </style>