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

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