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

add4.vue 28 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768
  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 !== "5"){
  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. if(this.inspectDataList.length > 0){
  482. this.zcxdShow = true;
  483. }else{
  484. this.zcxdShow = false;
  485. this.$toast.success('校对数据正常');
  486. }
  487. });
  488. },
  489. // van-dialog 点击confirm事件不自动关闭
  490. onBeforeClose(action, done) {
  491. if (action === 'confirm') {
  492. this.$refs.ycbzForm.validate().then(() => {
  493. this.$set(this.zjdzdxx, 'surveyStatus', "2");
  494. updateZjdzd(this.zjdzdxx).then(response => {
  495. localStorage.setItem("zjdzdxxItem",JSON.stringify(this.zjdzdxx));
  496. let _this =this
  497. this.$toast({
  498. icon: 'success', // 找到自己需要的图标
  499. message: '保存成功',
  500. duration:"1000",
  501. onClose:function(){
  502. _this.getList();
  503. }
  504. })
  505. return done(true);
  506. });
  507. }).catch(() => {
  508. return done(false);
  509. });
  510. } else {
  511. return done();
  512. }
  513. },
  514. dcsh(){
  515. this.$set(this.zjdzdxx, 'surveyStatus', "5");
  516. this.dcshShow = true;
  517. },
  518. showUploadList(id){
  519. this.getAttachments(id);
  520. this.showImageList = true;
  521. this.zjdId = id;
  522. },
  523. getAttachments(id) {
  524. this.uploadImgList = [];
  525. let cond = {
  526. tableId: id,
  527. tableName: 't_homestead_fsss',
  528. fileType: 0,
  529. };
  530. attachmentFind(cond).then(resp => {
  531. this.uploadImgList = resp.data.map(function(item){
  532. return {id:item.id,url:'/api'+item.fileUrl,isImage: true}
  533. });
  534. });
  535. },
  536. deleteFileImageList(file){
  537. if(file.id !== undefined ){
  538. systemAttachment(file.id);
  539. }
  540. },
  541. // 图片上传前
  542. beforeReadImageList(file){
  543. let _this = this;
  544. if(file.length!=undefined){
  545. file.map(res => {
  546. let zjddm = res.file.name
  547. //zjddm=zjddm.substring(0,zjddm.lastIndexOf("\("));
  548. // 创建Canvas对象(画布)
  549. let canvas = document.createElement('canvas')
  550. // 获取对应的CanvasRenderingContext2D对象(画笔)
  551. let context = canvas.getContext('2d')
  552. // 创建新的图片对象
  553. let img = new Image()
  554. // 指定图片的DataURL(图片的base64编码数据)
  555. img.src = res.content
  556. // 监听浏览器加载图片完成,然后进行进行绘制
  557. img.onload = () => {
  558. /*const h = img.height
  559. const w = img.width*/
  560. let ch = img.height/5
  561. let cw = img.width/5
  562. let canvas = document.createElement('canvas')
  563. let ctx = canvas.getContext('2d')
  564. canvas.height = ch
  565. canvas.width = cw
  566. ctx.clearRect(0,0,cw,ch)
  567. ctx.drawImage(img,0,0,cw,ch)
  568. let base_img = canvas.toDataURL('image/jpeg')
  569. let blobBin = atob(base_img.split(',')[1])
  570. let d = []
  571. for (let i=0;i<blobBin.length;i++){
  572. d.push(blobBin.charCodeAt(i))
  573. }
  574. let data2 = new FormData();
  575. data2.append("file", new Blob([new Uint8Array(d)],{type:'image/jpeg'}));
  576. uploadFile(data2);
  577. }
  578. })
  579. }else{
  580. let zjddm = file.file.name
  581. //zjddm=zjddm.substring(0,zjddm.lastIndexOf("\("));
  582. // 创建Canvas对象(画布)
  583. let canvas = document.createElement('canvas')
  584. // 获取对应的CanvasRenderingContext2D对象(画笔)
  585. let context = canvas.getContext('2d')
  586. // 创建新的图片对象
  587. let img = new Image()
  588. // 指定图片的DataURL(图片的base64编码数据)
  589. img.src = file.content
  590. // 监听浏览器加载图片完成,然后进行进行绘制
  591. img.onload = () => {
  592. /*const h = img.height
  593. const w = img.width*/
  594. let ch = img.height/5
  595. let cw = img.width/5
  596. let canvas = document.createElement('canvas')
  597. let ctx = canvas.getContext('2d')
  598. canvas.height = ch
  599. canvas.width = cw
  600. ctx.clearRect(0,0,cw,ch)
  601. ctx.drawImage(img,0,0,cw,ch)
  602. let base_img = canvas.toDataURL('image/jpeg')
  603. let blobBin = atob(base_img.split(',')[1])
  604. let d = []
  605. for (let i=0;i<blobBin.length;i++){
  606. d.push(blobBin.charCodeAt(i))
  607. }
  608. let data2 = new FormData();
  609. data2.append("file", new Blob([new Uint8Array(d)],{type:'image/jpeg'}));
  610. uploadFile(data2);
  611. }
  612. }
  613. },
  614. qkClick(){
  615. this.uploadImgList1 = this.uploadImgList;
  616. for(let i = 0; i < this.uploadImgList1.length; i++){
  617. if(this.uploadImgList[i].id !== undefined ){
  618. systemAttachment(this.uploadImgList[i].id);
  619. }
  620. }
  621. this.uploadImgList = [];
  622. },
  623. submitUploadList(val){
  624. let f = []
  625. for (let i of this.uploadImgList){
  626. if(i.content !== undefined){
  627. f.push(i.content)
  628. }
  629. }
  630. if(f.length === 0){
  631. return this.$toast.fail("请上传照片");
  632. }
  633. this.$toast.loading({
  634. message: "数据处理中",
  635. forbidClick: true,
  636. duration: 10000000000,
  637. });
  638. let _this = this;
  639. let file = {
  640. tableId:val,
  641. tableName:"t_homestead_fsss",
  642. bizPath:"upload",
  643. fileType:"0",
  644. files: f
  645. };
  646. base64Attach(file).then((resp) => {
  647. this.$toast({
  648. icon: 'success', // 找到自己需要的图标
  649. message: '上传成功',
  650. duration:"1000",
  651. onClose:function(){
  652. _this.showImageList = false
  653. }
  654. })
  655. });
  656. },
  657. }
  658. }
  659. </script>
  660. <style scoped >
  661. >>> .bannerBg{
  662. width: 100%;
  663. color:#fff;
  664. padding:10px;
  665. background: linear-gradient(134deg,#7ac943 1%, #22b7f2);
  666. }
  667. >>> .van-hairline--bottom::after {
  668. border-bottom-width: 0;
  669. }
  670. >>> .title:before
  671. {
  672. content:"";
  673. width: 6px;
  674. height: 20PX;
  675. background: #7ac943;
  676. border-radius: 3px;
  677. position:absolute;
  678. left:0;
  679. bottom:0;
  680. }
  681. >>> .delete-button {
  682. height: 100%;
  683. }
  684. >>> .van-swipe-cell__wrapper{
  685. margin-right:-3px;
  686. }
  687. >>> .label-class .van-collapse-item__title--expanded{
  688. font-weight: bold;
  689. }
  690. /deep/ .van-nav-bar__text {
  691. color: #fff;
  692. }
  693. .signature-footer {
  694. transform: rotate(90deg);
  695. width: auto;
  696. position: absolute;
  697. top: 50%;
  698. left: 0px;
  699. }
  700. .clearBtn {
  701. margin-left: 15px;
  702. }
  703. .flex4 {
  704. flex: 1;
  705. margin-left: 10px;
  706. overflow: hidden; /*超出部分隐藏*/
  707. white-space: nowrap; /*不换行*/
  708. text-overflow: ellipsis; /*超出部分文字以...显示*/
  709. }
  710. .gl_main{
  711. margin-top: .8vh;
  712. height: 48.15vh;
  713. background-color: #fff;
  714. }
  715. .gl_main .headers {
  716. position: relative;
  717. height: 3.24vh;
  718. color: #515a6e;
  719. font-weight: bold;
  720. text-align: left;
  721. display: flex;
  722. justify-content: center;
  723. align-items: center;
  724. background: #D3D3D3;
  725. padding-right: 0.53vw;
  726. margin-bottom: 1vh;
  727. }
  728. .gl_main .desc_main{
  729. height: 45.5vh;
  730. overflow-y: scroll;
  731. padding-right: 0.3vw;
  732. box-sizing:border-box;
  733. }
  734. .gl_main .desc_main {
  735. margin: 0;
  736. padding: 0;
  737. flex: 1;
  738. display: flex;
  739. flex-direction: column;
  740. }
  741. .gl_main .desc_main .analysisTable_list .flex_item {
  742. height: 3.77vh;
  743. list-style: none;
  744. margin: 0;
  745. display: flex;
  746. justify-content: center;
  747. align-items: center;
  748. text-align: left;
  749. color: #000000;
  750. position: relative;
  751. }
  752. </style>