移动端
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

496 рядки
16 KiB

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