移动端
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

503 lignes
16 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.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. @load="getList"
  17. >
  18. <!----1-->
  19. <van-swipe-cell v-for="(item,index) in applicationList" :key="index" :disabled="item.firstIsSign =='是'&&item.attachement == null&&item.isArchive == '否'">
  20. <div class="item" @click="goDetail(item.id)">
  21. <div class="info">
  22. <div class="title">
  23. <i class="icon_box" v-if="item.firstSigning==null"></i>
  24. <i class="icon_box1" v-if="item.firstSigning!=null"></i>
  25. <p class="news_title" :style="{'color': item.firstSigning!=null?'#2bc30c':'#eb1616'}">{{item.contractCode}}</p>
  26. <p class="tips_mark" :style="{'color': item.firstSigning!=null?'#79bc29':'#f8a83d','background': item.firstSigning!=null?'#e8ffcd':'#ffedcd'}">{{item.signingMode}}</p>
  27. <p class="tips_mark2" :style="{'background': item.firstSigning!=null?'#2bc30c':'#eb1616'}">{{item.signingStatus}}</p>
  28. </div>
  29. <div class="time">
  30. <p>{{item.contractName}}</p>
  31. <p style="color:#eb1616;font-weight: bold;"><span style="font-size: 12px;">¥</span>{{item.contractMoney.toFixed(2)}}</p>
  32. </div>
  33. </div>
  34. </div>
  35. <template #right>
  36. <div class="operation">
  37. <!-- delete 删除 edit编辑 view查看 list榜单 -->
  38. <div class="opera_btn" v-if="item.signingMode == '线上' && item.attachement != null && item.firstIsSign =='否'" @click="openPopup(item.id)">
  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.isArchive == '是' ">
  47. <a :href="'/api/profile/download/'+item.contractPdf" download style="color: #333333">
  48. <img src="../../assets/images/sunVillage_info/signature_icon_04.png" alt="" width="35">
  49. <p>电子合同</p>
  50. </a>
  51. </div>
  52. <div class="opera_btn" v-if="item.signingMode == '线下' " @click="openPopupFile(item.id)">
  53. <img src="../../assets/images/sunVillage_info/signature_icon_04.png" alt="" width="35">
  54. <p>线下合同</p>
  55. </div>
  56. </div>
  57. </template>
  58. </van-swipe-cell>
  59. </van-list>
  60. </div>
  61. <!-- 签字弹出层 -->
  62. <van-popup v-model="show" closeable position="right" :style="{ height: '100%' }" >
  63. <van-cell-group style="width: 100%;height:100%;overflow: hidden;padding-top: 10px;padding-bottom: 10px;">
  64. <div class="signature-box" @mousedown="canvasTTdown" @touchstart="canvasTTdown">
  65. <vue-esign
  66. ref="esign"
  67. class="mySign"
  68. :width="500"
  69. :height="height"
  70. :isCrop="signature.isCrop"
  71. :lineWidth="signature.lineWidth"
  72. :lineColor="signature.lineColor"
  73. :bgColor.sync="signature.bgColor"
  74. />
  75. </div>
  76. <img src="../../assets/images/sunVillage_info/signature_icon_10.png" id="canvasTT" style="position:absolute;top: 50%;left: 50%;transform: translate(-50%,-50%)" alt="">
  77. <div class="signature-footer">
  78. <van-button @click="handleGenerate" type="info" size="small">保存签字</van-button>
  79. <van-button @click="handleReset" class="clearBtn" type="info" plain size="small">清空画板</van-button>
  80. </div>
  81. </van-cell-group>
  82. </van-popup>
  83. <!-- 附件弹出层 -->
  84. <van-popup v-model="showFile" round closeable position="bottom" :style="{ height: '40%' , padding: '5vh 2vh' }" >
  85. <van-uploader v-if="fileList.length>0" v-model="fileList" multiple :deletable="false" :show-upload="false" />
  86. <van-empty v-else description="暂无附件" />
  87. </van-popup>
  88. </div>
  89. </template>
  90. <script>
  91. import { contractFirstList , signFirst , contractFileList , previewContractFile } from "@/api/sunVillage_info/fixedAssets";
  92. import vueEsign from "vue-esign";
  93. import signatureUploadSignature from "@/views/yinnong/signatureUploadSignature";
  94. import $ from "jquery";
  95. export default {
  96. name: "sunVillageInfoListSignature",
  97. components:{vueEsign,signatureUploadSignature},
  98. data() {
  99. return {
  100. applicationList:[],
  101. loading: false,
  102. finished: false,
  103. show: false,
  104. showFile: false,
  105. fileList:[],
  106. listLength:'0',
  107. queryParams:{
  108. pageNum:1,
  109. pageSize:10,
  110. translate_dict:1,
  111. },
  112. showBtn:true,
  113. signatureImg:'',
  114. //电子签名
  115. signature:{
  116. lineWidth: 6, // 画笔的线条粗细
  117. lineColor: "#000000", // 画笔的颜色
  118. bgColor: "", // 画布的背景颜色
  119. resultImg: "", // 最终画布生成的base64图片
  120. isCrop: false, // 是否裁剪,在画布设定尺寸基础上裁掉四周空白部分
  121. },
  122. signaId:'',
  123. height:null,
  124. };
  125. },
  126. created() {
  127. if (this.$route.query.type == 'code'){
  128. this.showBtn = false;
  129. }
  130. this.height = window.screen.height*1.28-20;
  131. },
  132. methods: {
  133. canvasTTdown(){
  134. $('#canvasTT').css('display','none')
  135. },
  136. getList(){
  137. var _this = this;
  138. contractFirstList(_this.queryParams).then(response => {
  139. response.rows.forEach(item => {
  140. _this.applicationList.push(item);
  141. });
  142. if(_this.applicationList.length >= response.total){
  143. _this.finished = true;
  144. return;
  145. }else{
  146. _this.loading = false;
  147. _this.queryParams.pageNum += 1 ;
  148. }
  149. });
  150. },
  151. goDetail(id){
  152. this.$router.push({path:'/sunVillage_info/list_signature_add',query: {id:id,type:this.$route.query.typeX,showBtn:this.showBtn}})
  153. },
  154. openPopup(id,url){
  155. this.show = true;
  156. this.signaId = id;
  157. },
  158. openPopupFile(id){
  159. this.fileList = [];
  160. this.showFile = true;
  161. contractFileList(id).then(response => {
  162. response.data.map(res=>{
  163. this.fileList.push({
  164. url: '/api'+res.fileUrl,
  165. isImage: true
  166. })
  167. })
  168. });
  169. },
  170. signaImgFun(url){
  171. this.signatureImg = url;
  172. // console.log(url)
  173. },
  174. // 清空画板
  175. handleReset() {
  176. this.$refs.esign.reset();
  177. $('#canvasTT').css('display','block')
  178. },
  179. // 生成签字图
  180. handleGenerate() {
  181. this.$refs.esign
  182. .generate() // 使用生成器调用把签字的图片转换成为base64图片格式
  183. .then((res) => {
  184. console.log(res)
  185. this.signature.resultImg = res;
  186. let wj = this.dataURLtoBlob(res);
  187. let param = new FormData() // 创建form对象
  188. param.append('file', wj) // 通过append向form对象添加数据
  189. param.append('date', this.format(new Date(),'yyyy-MM-dd')) // 通过append向form对象添加数据
  190. signFirst(param,this.signaId).then(response => {
  191. this.$notify({ type: 'success', message: '签字成功' });
  192. this.show = false;
  193. location.reload()
  194. });
  195. })
  196. .catch((err) => {
  197. // 画布没有签字时会执行这里提示一下
  198. this.$toast.fail('请签名后再保存签字');
  199. });
  200. },
  201. dataURLtoBlob (dataurl, filename = 'file') {
  202. let arr = dataurl.split(',')
  203. let mime = arr[0].match(/:(.*?);/)[1]
  204. let suffix = mime.split('/')[1]
  205. let bstr = atob(arr[1])
  206. let n = bstr.length
  207. let u8arr = new Uint8Array(n)
  208. while (n--) {
  209. u8arr[n] = bstr.charCodeAt(n)
  210. }
  211. return new File([u8arr], `${filename}.${suffix}`, {
  212. type: mime
  213. })
  214. },
  215. },
  216. }
  217. </script>
  218. <style scoped lang="scss">
  219. .home_wrapper{
  220. background: #e9e9e9;
  221. min-height: 100vh;
  222. width: 100vw;
  223. .header_main{
  224. height: 116px;
  225. background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
  226. background-size: 100% 100%;
  227. position: fixed;
  228. top: 0;
  229. left: 0;
  230. width: 100%;
  231. font-size: 36px;
  232. line-height: 116px;
  233. text-align: center;
  234. color: #fff;
  235. position: relative;
  236. .return_btn{
  237. width: 24px;
  238. height: 43.2px;
  239. background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  240. background-size: 20px 36px;
  241. position: absolute;
  242. left: 38px;
  243. top: 36px;
  244. }
  245. .add_btn{
  246. width: 56.4px;
  247. height: 40.8px;
  248. background: url('../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  249. background-size: 47px 34px;
  250. position: absolute;
  251. right: 38px;
  252. top: 36px;
  253. }
  254. }
  255. .record_main{
  256. padding:30px 22px;
  257. .record_det{
  258. height: 38px;
  259. line-height: 38px;
  260. display: flex;
  261. justify-content:space-between;
  262. .year_l{
  263. font-size: 30px;
  264. display: flex;
  265. align-items: center;
  266. color: #858585;
  267. .unit{
  268. padding-left: 5px;
  269. }
  270. .icon{
  271. width: 23px;
  272. height: 12px;
  273. display: block;
  274. background: url('../../assets/images/sunVillage_info/list_icon_1.png') no-repeat;
  275. background-size: 100% 100%;
  276. margin-bottom: 4px;
  277. margin-right: 8px;
  278. &.zk {
  279. transform: rotate(0deg)
  280. }
  281. &.ss{
  282. transform: rotate(180deg)
  283. }
  284. }
  285. }
  286. .total_r{
  287. font-size: 26px;
  288. letter-spacing: 2px;
  289. }
  290. }
  291. .record_list{
  292. display: flex;
  293. flex-flow: wrap;
  294. margin-top: 12PX;
  295. .flex_block{
  296. font-size: 30px;
  297. color: #878787;
  298. padding-right: 30px;
  299. &.current{
  300. color: #4199fe;
  301. font-weight: bold;
  302. }
  303. }
  304. }
  305. }
  306. .list_main{
  307. padding:0 22px;
  308. margin-top: 15PX;
  309. .item{
  310. border-radius: 30px;
  311. background: #fff;
  312. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  313. padding:25px 32px;
  314. margin-bottom: 20px;
  315. .info{
  316. .title{
  317. display: flex;
  318. font-size: 32px;
  319. align-items: center;
  320. height: 58px;
  321. .icon_box{
  322. width: 34px;
  323. display: block;
  324. height: 30px;
  325. background: url('../../assets/images/sunVillage_info/signature_icon_01.png') no-repeat;
  326. background-size: 100% 100%;
  327. margin-right: 10px;
  328. flex-shrink: 0;
  329. }
  330. .icon_box1{
  331. width: 34px;
  332. display: block;
  333. height: 30px;
  334. background: url('../../assets/images/sunVillage_info/signature_icon_01g.png') no-repeat;
  335. background-size: 100% 100%;
  336. margin-right: 10px;
  337. flex-shrink: 0;
  338. }
  339. .news_title{
  340. display: -webkit-box;
  341. -webkit-box-orient: vertical;
  342. -webkit-line-clamp: 1;
  343. word-break: break-all;
  344. overflow: hidden;
  345. }
  346. .tips_mark{
  347. background: #ffedcd;
  348. border-radius: 8px;
  349. font-size: 24px;
  350. color: #f8a83d;
  351. text-align: center;
  352. line-height: 34px;
  353. flex-shrink: 0;
  354. padding: 0 5Px;
  355. margin-left: auto;
  356. }
  357. .tips_mark2{
  358. background: #eb1616;
  359. border-radius: 8px;
  360. font-size: 24px;
  361. color: #ffffff;
  362. text-align: center;
  363. line-height: 34px;
  364. flex-shrink: 0;
  365. padding: 0 5Px;
  366. margin-left: 10PX;
  367. }
  368. }
  369. .time{
  370. font-size: 16PX;
  371. color: #333333;
  372. display: flex;
  373. align-items: center;
  374. margin-top: 5PX;
  375. justify-content: space-between;
  376. .icon_time{
  377. width: 25px;
  378. height: 25px;
  379. background: url('../../assets/images/sunVillage_info/list_icon_4.png') no-repeat;
  380. background-size: 100% 100%;
  381. margin-right: 10px;
  382. }
  383. }
  384. }
  385. }
  386. .operation{
  387. display: flex;
  388. align-items: center;
  389. justify-content: right;
  390. text-align: center;
  391. border-radius: 30px;
  392. background: #fff;
  393. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  394. height: 100%;
  395. padding: 0 15Px;
  396. margin-left: 10PX;
  397. .opera_btn{
  398. border-radius: 50%;
  399. margin-left: 10PX;
  400. &:first-child{margin: 0;}
  401. &.delete{
  402. background:#df0707;
  403. margin-left: 10PX;
  404. .icon{
  405. width: 22PX;
  406. height: 29PX;
  407. background: url('../../assets/images/sunVillage_info/signature_icon_03.png') no-repeat;
  408. background-size: 100% 100%;
  409. display: block;
  410. }
  411. }
  412. &.edit{
  413. background: #79cf13;
  414. margin-left: 10PX;
  415. .icon {
  416. width: 26PX;
  417. height: 25PX;
  418. background: url('../../assets/images/sunVillage_info/signature_icon_02.png') no-repeat;
  419. background-size: 100% 100%;
  420. display: block;
  421. }
  422. }
  423. &.view{
  424. background: #3494ff;
  425. margin-left: 10PX;
  426. .icon {
  427. width: 29PX;
  428. height: 21PX;
  429. background: url('../../assets/images/sunVillage_info/signature_icon_04.png') no-repeat;
  430. background-size: 100% 100%;
  431. display: block;
  432. }
  433. }
  434. &.list{
  435. background: #79cf13;
  436. margin-left: 10PX;
  437. .icon {
  438. width: 29px;
  439. height: 21px;
  440. background: url('../../assets/images/sunVillage_info/list_icon_10.png') no-repeat;
  441. background-size: 100% 100%;
  442. display: block;
  443. }
  444. }
  445. }
  446. }
  447. }
  448. .bottom_tips{
  449. font-size: 24px;
  450. color: #a7a6a6;
  451. text-align: center;
  452. margin-top: 32px;
  453. background: url('../../assets/images/sunVillage_info/list_icon_8.png') center center no-repeat;
  454. background-size: 260px 2px;
  455. .xs{
  456. padding:0 8px;
  457. background: #e9e9e9;
  458. }
  459. }
  460. .signature-box{
  461. border:1px dashed #666;
  462. margin:2px 20px;
  463. height: 100%;
  464. /*canvas{*/
  465. /* height: 100%!important;*/
  466. /*}*/
  467. }
  468. .signature-footer{
  469. transform: rotate(90deg);
  470. width: auto;
  471. position: absolute;
  472. top: 50%;
  473. left: 0PX;
  474. .clearBtn{
  475. margin-left: 15px;
  476. }
  477. }
  478. .esigh-result{
  479. margin:15px 20px;
  480. // height: 110px;
  481. border:1px solid #666;
  482. font-size: 0;
  483. .imgs{
  484. width: 100%;
  485. }
  486. }
  487. }
  488. </style>