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

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