移动端
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

683 satır
21 KiB

  1. <template>
  2. <div class="home_wrapper">
  3. <div
  4. class="header_main"
  5. :style="`background-image:url(${require(showBtn?'@/assets/images/sunVillage_info/list_head_green.png':'@/assets/images/sunVillage_info/list_head_red.png')})`"
  6. >
  7. 承包合同
  8. <div class="return_btn" @click="onClickLeft"></div>
  9. <!-- <div class="add_btn" @click="goAdd" v-show="showBtn"></div>-->
  10. </div>
  11. <div class="list_main">
  12. <van-list
  13. v-model="loading"
  14. :finished="finished"
  15. finished-text="没有更多了"
  16. :immediate-check="false"
  17. @load="getList"
  18. >
  19. <!----1-->
  20. <van-swipe-cell v-for="item in applicationList" :key="item.id" >
  21. <div class="item" @click="goDetail(item.id)">
  22. <div class="info">
  23. <div class="title">
  24. <i class="icon_box" v-if="item.signingStatus =='合同筹备' || item.signingStatus =='合同待签' ||item.signingStatus =='单方已签'"></i>
  25. <i class="icon_box1" v-if="item.signingStatus =='签字完成' || item.signingStatus =='合同归档'"></i>
  26. <p class="news_title" >{{item.cbhtbm}}</p>
  27. <p class="tips_mark2" v-if="item.signingMode === '线上'" :style="{'background': formatDict(item)}">{{item.signingStatus}}</p>
  28. <p class="tips_mark" :style="{'background': item.signingMode === '线上'?'#F9BE0C':'#08BE4E'}">{{item.signingMode}}</p>
  29. </div>
  30. <div class="time">
  31. <p>{{item.cbfmc}}</p>
  32. <p>{{item.htzmjm.toFixed(2)}} 亩</p>
  33. </div>
  34. </div>
  35. </div>
  36. <template #right>
  37. <div class="operation">
  38. <!-- <div class="opera_btn" @click="openPopup(item.id)" v-if="item.signingMode == '线上' && item.secondIsSign === '否'">
  39. <img src="../../assets/images/sunVillage_info/signature_icon_02.png" alt="" width="35">
  40. <p>签名</p>
  41. </div> -->
  42. <!-- <div class="opera_btn" v-if="item.signingMode == '线上' && item.attachement != null " @click="$router.push({path:'/sunVillage_info/list_signature_pdf',query: {id:item.id,type:$route.query.type}})">
  43. <img src="../../assets/images/sunVillage_info/signature_icon_03.png" alt="" width="35">
  44. <p>预览</p>
  45. </div> -->
  46. <div class="opera_btn" v-if="item.signingMode == '线上' && item.cbfqszt !='2' && item.signingStatus !=='合同筹备'" @click="contractSign(item)">
  47. <img src="../../assets/images/sunVillage_info/signature_icon_02.png" alt="" width="35">
  48. <p>合同网签</p>
  49. </div>
  50. <!-- <div class="opera_btn" @click="openPopupGsjg(item.cbfbm)">
  51. <img src="../../assets/images/sunVillage_info/signature_icon_02.png" alt="" width="35">
  52. <p>公示结果签名</p>
  53. </div> -->
  54. <div class="opera_btn" v-if="item.signingMode == '线上' && item.signingStatus !=='合同筹备' && item.signingStatus !=='双方待签'" @click="contractView(item.id)">
  55. <img src="../../assets/images/sunVillage_info/signature_icon_03.png" alt="" width="35">
  56. <p>合同预览</p>
  57. </div>
  58. <div class="opera_btn" v-if="item.signingMode === '线上' && item.signingStatus === '合同归档'"
  59. @click="handleDownload(item.id)">
  60. <img src="../../assets/images/sunVillage_info/download.png" alt="" width="35">
  61. <p>下载合同</p>
  62. </div>
  63. <!-- <div class="opera_btn">
  64. <img src="../../assets/images/sunVillage_info/signature_icon_03.png" alt="" width="35">
  65. <p>预览</p>
  66. </div> -->
  67. <div class="opera_btn" @click="openPopupFile(item.id)">
  68. <img src="../../assets/images/sunVillage_info/signature_icon_04.png" alt="" width="35">
  69. <p>附件</p>
  70. </div>
  71. </div>
  72. </template>
  73. </van-swipe-cell>
  74. </van-list>
  75. </div>
  76. <van-dialog v-model="htqsShow" title="合同签署" confirmButtonText="关闭" @confirm="confirmn">
  77. <iframe width="100%" height="600px;" :src="noticeUrl"></iframe>
  78. </van-dialog>
  79. <van-popup v-model="show" closeable position="right" :style="{ height: '100%' }" >
  80. <van-cell-group style="width: 100%;height:100%;overflow: hidden;padding-top: 10px;padding-bottom: 10px;">
  81. <div class="signature-box" @mousedown="canvasTTdown" @touchstart="canvasTTdown">
  82. <vue-esign
  83. ref="esign"
  84. class="mySign"
  85. :width="500"
  86. :height="height"
  87. :isCrop="signature.isCrop"
  88. :lineWidth="signature.lineWidth"
  89. :lineColor="signature.lineColor"
  90. :bgColor.sync="signature.bgColor"
  91. />
  92. </div>
  93. <img src="../../assets/images/sunVillage_info/signature_icon_10.png" id="canvasTT" style="position:absolute;top: 50%;left: 50%;transform: translate(-50%,-50%)" alt="">
  94. <div class="signature-footer">
  95. <van-button @click="handleGenerate" v-if="!showGsjgqz" type="info" size="small">保存签字</van-button>
  96. <van-button @click="handleGenerateGsjg" v-if="showGsjgqz" type="info" size="small">保存签字</van-button>
  97. <van-button @click="handleReset" class="clearBtn" type="info" plain size="small">清空画板</van-button>
  98. </div>
  99. </van-cell-group>
  100. </van-popup>
  101. <!-- 附件弹出层 -->
  102. <van-popup v-model="showFile" round closeable position="bottom" :style="{ height: '30%' }" >
  103. <div style="padding: 0 3%;">
  104. <van-divider>附件</van-divider>
  105. <van-uploader v-model="fileList" accept="" :after-read="afterRead" @delete="deleteFile" /> <!-- accept=".jpg, .gif, .png, .jpeg, .txt, .pdf, .doc, .docx, .xls, .xlsx" -->
  106. </div>
  107. </van-popup>
  108. </div>
  109. </template>
  110. <script>
  111. import { getCbf, eqbCbfhtwq,getCbhtList,signedContractDownload,viewSignedContract, cbhtSecondSign,updateGsjgSign, attachmentQuery, attachmentUpload, attachmentRemove } from "@/api/sunVillage_info/fixedAssets";
  112. import vueEsign from "vue-esign";
  113. import $ from "jquery";
  114. import Cookies from "js-cookie";
  115. export default {
  116. name: "sunVillageInfoListCbf",
  117. components: { vueEsign },
  118. data() {
  119. return {
  120. applicationList: [],
  121. loading: false,
  122. finished: false,
  123. show: false,
  124. showFile: false,
  125. htqsShow:false,
  126. noticeUrl:"",
  127. showGsjgqz:false,
  128. fileList: [],
  129. listLength: '0',
  130. cbfbm:"",
  131. queryParams: {
  132. pageNum: 1,
  133. pageSize: 10,
  134. cbfbm: null,
  135. translate_dict: 1,
  136. },
  137. showBtn: true,
  138. signatureImg: '',
  139. //电子签名
  140. signature: {
  141. lineWidth: 6, // 画笔的线条粗细
  142. lineColor: "#000000", // 画笔的颜色
  143. bgColor: "", // 画布的背景颜色
  144. resultImg: "", // 最终画布生成的base64图片
  145. isCrop: false, // 是否裁剪,在画布设定尺寸基础上裁掉四周空白部分
  146. },
  147. signaId: '',
  148. height: null
  149. };
  150. },
  151. created() {
  152. this.height = window.screen.height * 1.28 - 20;
  153. this.getCbfInfo();
  154. this.houseGetDicts("signing_status").then((res) => {
  155. this.signingStatusData = res.data;
  156. });
  157. // this.queryParams.cbfbm = JSON.parse(Cookies.get('user')).idcard;
  158. },
  159. methods: {
  160. canvasTTdown() {
  161. $('#canvasTT').css('display', 'none');
  162. },
  163. getCbfInfo() {
  164. if (Cookies.get('user')) {
  165. getCbf(JSON.parse(Cookies.get('user')).idcard).then(response => {
  166. this.queryParams.cbfbm = response.data.cbfbm;
  167. this.getList();
  168. });
  169. }
  170. },
  171. getList() {
  172. if (this.queryParams.cbfbm != null) {
  173. getCbhtList(this.queryParams).then(response => {
  174. response.rows.forEach(item => {
  175. this.applicationList.push(item);
  176. });
  177. if (this.applicationList.length >= response.total) {
  178. this.finished = true;
  179. return;
  180. } else {
  181. this.loading = false;
  182. this.queryParams.pageNum += 1;
  183. }
  184. });
  185. } else {
  186. this.finished = true;
  187. }
  188. },
  189. goDetail(id) {
  190. this.$router.push({
  191. path: '/sunVillage_info/list_cbht_detail',
  192. query: { id: id }
  193. })
  194. },
  195. openPopup(id, url) {
  196. this.show = true;
  197. this.showGsjgqz = false;
  198. this.signaId = id;
  199. this.$nextTick(() => {
  200. this.handleReset();
  201. });
  202. },
  203. openPopupGsjg(cbfbm, url) {
  204. this.show = true;
  205. this.showGsjgqz = true;
  206. this.cbfbm = cbfbm;
  207. this.$nextTick(() => {
  208. this.handleReset();
  209. });
  210. },
  211. contractSign(val){
  212. eqbCbfhtwq(val).then(response => {
  213. this.noticeUrl = response.data;
  214. this.htqsShow = true;
  215. });
  216. },
  217. confirmn(){
  218. this.applicationList = [];
  219. this.getList();
  220. },
  221. openPopupFile(id){
  222. this.fileList = [];
  223. this.signaId = id;
  224. this.showFile = true;
  225. let queryParams = {
  226. tableId: id,
  227. tableName: 't_sys_cbht',
  228. };
  229. attachmentQuery(queryParams).then(response => {
  230. response.rows.map(res => {
  231. // let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  232. this.fileList.push({
  233. url: '/api'+res.fileUrl,
  234. file: new File([], res.fileName,{}),
  235. id: res.id
  236. });
  237. })
  238. });
  239. },
  240. afterRead(file) {
  241. // 此时可以自行将文件上传至服务器
  242. let params = new FormData();
  243. params.append("tableId", this.signaId);
  244. params.append("tableName", "t_sys_cbht");
  245. params.append("bizPath", "service");
  246. params.append("fileType", '0');
  247. params.append("file", file.file);
  248. params.append("userName", JSON.parse(Cookies.get('user')).memberName);
  249. attachmentUpload(params).then(response => {
  250. this.$notify({ type: 'success', message: '上传成功' });
  251. let newFile = this.fileList[this.fileList.length - 1];
  252. this.$set(newFile, 'id', response.id);
  253. });
  254. },
  255. deleteFile(file){
  256. attachmentRemove(file.id).then(res => {
  257. this.$notify({ type: 'success', message: '删除成功' });
  258. });
  259. },
  260. formatDict(item){
  261. let colorval = "";
  262. this.signingStatusData.map(function (e){
  263. if(item.signingStatus === e.dictLabel){
  264. colorval = e.remark;
  265. }
  266. })
  267. return colorval;
  268. },
  269. signaImgFun(url) {
  270. this.signatureImg = url;
  271. },
  272. // 清空画板
  273. handleReset() {
  274. this.$refs.esign.reset();
  275. $('#canvasTT').css('display', 'block')
  276. },
  277. // 生成签字图
  278. handleGenerate() {
  279. this.$refs.esign
  280. .generate() // 使用生成器调用把签字的图片转换成为base64图片格式
  281. .then((res) => {
  282. this.signature.resultImg = res;
  283. let wj = this.dataURLtoBlob(res);
  284. let param = new FormData() // 创建form对象
  285. param.append('file', wj) // 通过append向form对象添加数据
  286. param.append('date', this.format(new Date(), 'yyyy-MM-dd')) // 通过append向form对象添加数据
  287. cbhtSecondSign(param, this.signaId).then(response => {
  288. this.$notify({type: 'success', message: '签字成功'});
  289. this.show = false;
  290. // location.reload();
  291. this.applicationList = [];
  292. this.getList();
  293. });
  294. })
  295. .catch((err) => {
  296. // 画布没有签字时会执行这里提示一下
  297. this.$toast.fail('请签名后再保存签字');
  298. });
  299. },
  300. handleGenerateGsjg(){
  301. this.$refs.esign
  302. .generate() // 使用生成器调用把签字的图片转换成为base64图片格式
  303. .then((res) => {
  304. this.signature.resultImg = res;
  305. let wj = this.dataURLtoBlob(res);
  306. let param = new FormData() // 创建form对象
  307. param.append('file', wj) // 通过append向form对象添加数据
  308. param.append('cbfbm', this.cbfbm)
  309. updateGsjgSign(param).then(response => {
  310. this.$notify({type: 'success', message: '签字成功'});
  311. this.show = false;
  312. // location.reload();
  313. this.applicationList = [];
  314. this.getList();
  315. });
  316. })
  317. .catch((err) => {
  318. // 画布没有签字时会执行这里提示一下
  319. this.$toast.fail('请签名后再保存签字');
  320. });
  321. },
  322. contractView(id) {
  323. viewSignedContract(id).then(response => {
  324. if (response.code === 200) {
  325. this.noticeUrl = response.data;
  326. this.htqsShow = true;
  327. }
  328. });
  329. },
  330. // 签署合同下载
  331. handleDownload(id) {
  332. this.$dialog.confirm({
  333. message: '是否下载承包合同?',
  334. }).then(() => {
  335. // on confirm
  336. signedContractDownload(id).then(res => {
  337. if (res.code === 200) {
  338. window.location.href = res.data;
  339. }
  340. });
  341. }).catch(() => {
  342. // on cancel
  343. });
  344. },
  345. dataURLtoBlob(dataurl, filename = 'file') {
  346. let arr = dataurl.split(',')
  347. let mime = arr[0].match(/:(.*?);/)[1]
  348. let suffix = mime.split('/')[1]
  349. let bstr = atob(arr[1])
  350. let n = bstr.length
  351. let u8arr = new Uint8Array(n)
  352. while (n--) {
  353. u8arr[n] = bstr.charCodeAt(n)
  354. }
  355. return new File([u8arr], `${filename}.${suffix}`, {
  356. type: mime
  357. })
  358. },
  359. },
  360. }
  361. </script>
  362. <style scoped lang="scss">
  363. .home_wrapper {
  364. background: #e9e9e9;
  365. min-height: 100vh;
  366. width: 100vw;
  367. .header_main {
  368. height: 116px;
  369. background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
  370. background-size: 100% 100%;
  371. position: fixed;
  372. top: 0;
  373. left: 0;
  374. width: 100%;
  375. font-size: 36px;
  376. line-height: 116px;
  377. text-align: center;
  378. color: #fff;
  379. position: relative;
  380. .return_btn {
  381. width: 24px;
  382. height: 43.2px;
  383. background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  384. background-size: 20px 36px;
  385. position: absolute;
  386. left: 38px;
  387. top: 36px;
  388. }
  389. .add_btn {
  390. width: 56.4px;
  391. height: 40.8px;
  392. background: url('../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  393. background-size: 47px 34px;
  394. position: absolute;
  395. right: 38px;
  396. top: 36px;
  397. }
  398. }
  399. .record_main {
  400. padding: 30px 22px;
  401. .record_det {
  402. height: 38px;
  403. line-height: 38px;
  404. display: flex;
  405. justify-content: space-between;
  406. .year_l {
  407. font-size: 30px;
  408. display: flex;
  409. align-items: center;
  410. color: #858585;
  411. .unit {
  412. padding-left: 5px;
  413. }
  414. .icon {
  415. width: 23px;
  416. height: 12px;
  417. display: block;
  418. background: url('../../assets/images/sunVillage_info/list_icon_1.png') no-repeat;
  419. background-size: 100% 100%;
  420. margin-bottom: 4px;
  421. margin-right: 8px;
  422. &.zk {
  423. transform: rotate(0deg)
  424. }
  425. &.ss {
  426. transform: rotate(180deg)
  427. }
  428. }
  429. }
  430. .total_r {
  431. font-size: 26px;
  432. letter-spacing: 2px;
  433. }
  434. }
  435. .record_list {
  436. display: flex;
  437. flex-flow: wrap;
  438. margin-top: 12PX;
  439. .flex_block {
  440. font-size: 30px;
  441. color: #878787;
  442. padding-right: 30px;
  443. &.current {
  444. color: #4199fe;
  445. font-weight: bold;
  446. }
  447. }
  448. }
  449. }
  450. .list_main {
  451. padding: 0 22px;
  452. margin-top: 15PX;
  453. .item {
  454. border-radius: 30px;
  455. background: #fff;
  456. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  457. padding: 25px 32px;
  458. margin-bottom: 20px;
  459. .info {
  460. .title {
  461. display: flex;
  462. font-size: 32px;
  463. align-items: center;
  464. height: 58px;
  465. .icon_box {
  466. width: 34px;
  467. display: block;
  468. height: 30px;
  469. background: url('../../assets/images/sunVillage_info/signature_icon_01.png') no-repeat;
  470. background-size: 100% 100%;
  471. margin-right: 10px;
  472. flex-shrink: 0;
  473. }
  474. .icon_box1 {
  475. width: 34px;
  476. display: block;
  477. height: 30px;
  478. background: url('../../assets/images/sunVillage_info/signature_icon_01g.png') no-repeat;
  479. background-size: 100% 100%;
  480. margin-right: 10px;
  481. flex-shrink: 0;
  482. }
  483. .news_title {
  484. display: -webkit-box;
  485. -webkit-box-orient: vertical;
  486. -webkit-line-clamp: 1;
  487. word-break: break-all;
  488. overflow: hidden;
  489. }
  490. .tips_mark {
  491. background: #ffedcd;
  492. border-radius: 8px;
  493. font-size: 24px;
  494. color: #ffffff;
  495. text-align: center;
  496. line-height: 34px;
  497. flex-shrink: 0;
  498. padding: 0 5Px;
  499. margin-left: auto;
  500. }
  501. .tips_mark2 {
  502. background: #eb1616;
  503. border-radius: 8px;
  504. font-size: 24px;
  505. color: #ffffff;
  506. text-align: center;
  507. line-height: 34px;
  508. flex-shrink: 0;
  509. padding: 0 5Px;
  510. margin-left: 10PX;
  511. }
  512. }
  513. .time {
  514. font-size: 16PX;
  515. color: #333333;
  516. display: flex;
  517. align-items: center;
  518. margin-top: 5PX;
  519. justify-content: space-between;
  520. .icon_time {
  521. width: 25px;
  522. height: 25px;
  523. background: url('../../assets/images/sunVillage_info/list_icon_4.png') no-repeat;
  524. background-size: 100% 100%;
  525. margin-right: 10px;
  526. }
  527. }
  528. }
  529. }
  530. .operation {
  531. display: flex;
  532. align-items: center;
  533. justify-content: right;
  534. text-align: center;
  535. border-radius: 30px;
  536. background: #fff;
  537. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  538. height: 100%;
  539. padding: 0 15Px;
  540. margin-left: 10PX;
  541. .opera_btn {
  542. border-radius: 50%;
  543. padding: 0 10px;
  544. &.delete {
  545. background: #df0707;
  546. margin-left: 10PX;
  547. .icon {
  548. width: 22PX;
  549. height: 29PX;
  550. background: url('../../assets/images/sunVillage_info/signature_icon_03.png') no-repeat;
  551. background-size: 100% 100%;
  552. display: block;
  553. }
  554. }
  555. &.edit {
  556. background: #79cf13;
  557. margin-left: 10PX;
  558. .icon {
  559. width: 26PX;
  560. height: 25PX;
  561. background: url('../../assets/images/sunVillage_info/signature_icon_02.png') no-repeat;
  562. background-size: 100% 100%;
  563. display: block;
  564. }
  565. }
  566. &.view {
  567. background: #3494ff;
  568. margin-left: 10PX;
  569. .icon {
  570. width: 29PX;
  571. height: 21PX;
  572. background: url('../../assets/images/sunVillage_info/signature_icon_04.png') no-repeat;
  573. background-size: 100% 100%;
  574. display: block;
  575. }
  576. }
  577. &.list {
  578. background: #79cf13;
  579. margin-left: 10PX;
  580. .icon {
  581. width: 29px;
  582. height: 21px;
  583. background: url('../../assets/images/sunVillage_info/list_icon_10.png') no-repeat;
  584. background-size: 100% 100%;
  585. display: block;
  586. }
  587. }
  588. }
  589. }
  590. }
  591. .bottom_tips {
  592. font-size: 24px;
  593. color: #a7a6a6;
  594. text-align: center;
  595. margin-top: 32px;
  596. background: url('../../assets/images/sunVillage_info/list_icon_8.png') center center no-repeat;
  597. background-size: 260px 2px;
  598. .xs {
  599. padding: 0 8px;
  600. background: #e9e9e9;
  601. }
  602. }
  603. .signature-box {
  604. border: 1px dashed #666;
  605. margin: 2px 20px;
  606. height: 100%;
  607. /*canvas{*/
  608. /* height: 100%!important;*/
  609. /*}*/
  610. }
  611. .signature-footer {
  612. transform: rotate(90deg);
  613. width: auto;
  614. position: absolute;
  615. top: 50%;
  616. left: 0PX;
  617. .clearBtn {
  618. margin-left: 15px;
  619. }
  620. }
  621. .esigh-result {
  622. margin: 15px 20px;
  623. // height: 110px;
  624. border: 1px solid #666;
  625. font-size: 0;
  626. .imgs {
  627. width: 100%;
  628. }
  629. }
  630. }
  631. </style>