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

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