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

пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  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. :immediate-check="false"
  17. @load="getList"
  18. >
  19. <!----1-->
  20. <van-swipe-cell v-for="item in applicationList" :key="item.id" >
  21. <div class="item" @click="goDetail(item.id)">
  22. <div class="info">
  23. <div class="title">
  24. <i class="icon_box" v-if="item.secondSigning==null"></i>
  25. <i class="icon_box1" v-if="item.secondSigning!=null"></i>
  26. <p class="news_title" :style="{'color': item.secondSigning!=null?'#2bc30c':'#eb1616'}">{{item.cbhtbm}}</p>
  27. <p class="tips_mark" :style="{'color': item.secondSigning!=null?'#79bc29':'#f8a83d','background': item.secondSigning!=null?'#e8ffcd':'#ffedcd'}">{{item.signingMode}}</p>
  28. <p class="tips_mark2" v-if="item.signingMode === '线上'" :style="{'background': item.secondSigning!=null?'#2bc30c':'#eb1616'}">{{item.signingStatus}}</p>
  29. </div>
  30. <div class="time">
  31. <p style="color:#eb1616;">{{item.cbfmc}}</p>
  32. <p style="color:#eb1616;font-weight: bold;">{{item.htzmjm.toFixed(2)}} 亩</p>
  33. </div>
  34. </div>
  35. </div>
  36. <template #right>
  37. <div class="operation">
  38. <div class="opera_btn" @click="openPopup(item.id)" v-if="item.signingMode == '线上' && 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" 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">
  47. <img src="../../assets/images/sunVillage_info/signature_icon_03.png" alt="" width="35">
  48. <p>预览</p>
  49. </div>
  50. <div class="opera_btn" @click="openPopupFile(item.id)">
  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. <!-- 附件弹出层 -->
  81. <van-popup v-model="showFile" round closeable position="bottom" :style="{ height: '30%' }" >
  82. <div style="padding: 0 3%;">
  83. <van-divider>附件</van-divider>
  84. <van-uploader v-model="fileList" accept="" :after-read="afterRead" @delete="deleteFile" /> <!-- accept=".jpg, .gif, .png, .jpeg, .txt, .pdf, .doc, .docx, .xls, .xlsx" -->
  85. </div>
  86. </van-popup>
  87. </div>
  88. </template>
  89. <script>
  90. import { getCbf, getCbhtList, cbhtSecondSign, attachmentQuery, attachmentUpload, attachmentRemove } from "@/api/sunVillage_info/fixedAssets";
  91. import vueEsign from "vue-esign";
  92. import $ from "jquery";
  93. import Cookies from "js-cookie";
  94. export default {
  95. name: "sunVillageInfoListCbf",
  96. components: { vueEsign },
  97. data() {
  98. return {
  99. applicationList: [],
  100. loading: false,
  101. finished: false,
  102. show: false,
  103. showFile: false,
  104. fileList: [],
  105. listLength: '0',
  106. queryParams: {
  107. pageNum: 1,
  108. pageSize: 10,
  109. cbfbm: null,
  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. this.height = window.screen.height * 1.28 - 20;
  128. this.getCbfInfo();
  129. // this.queryParams.cbfbm = JSON.parse(Cookies.get('user')).idcard;
  130. },
  131. methods: {
  132. canvasTTdown() {
  133. $('#canvasTT').css('display', 'none');
  134. },
  135. getCbfInfo() {
  136. if (Cookies.get('user')) {
  137. getCbf(JSON.parse(Cookies.get('user')).idcard).then(response => {
  138. this.queryParams.cbfbm = response.data.cbfbm;
  139. this.getList();
  140. });
  141. }
  142. },
  143. getList() {
  144. if (this.queryParams.cbfbm != null) {
  145. getCbhtList(this.queryParams).then(response => {
  146. response.rows.forEach(item => {
  147. this.applicationList.push(item);
  148. });
  149. if (this.applicationList.length >= response.total) {
  150. this.finished = true;
  151. return;
  152. } else {
  153. this.loading = false;
  154. this.queryParams.pageNum += 1;
  155. }
  156. });
  157. } else {
  158. this.finished = true;
  159. }
  160. },
  161. goDetail(id) {
  162. this.$router.push({
  163. path: '/sunVillage_info/list_cbht_detail',
  164. query: { id: id }
  165. })
  166. },
  167. openPopup(id, url) {
  168. this.show = true;
  169. this.signaId = id;
  170. this.$nextTick(() => {
  171. this.handleReset();
  172. });
  173. },
  174. openPopupFile(id){
  175. this.fileList = [];
  176. this.signaId = id;
  177. this.showFile = true;
  178. let queryParams = {
  179. tableId: id,
  180. tableName: 't_sys_cbht',
  181. };
  182. attachmentQuery(queryParams).then(response => {
  183. response.rows.map(res => {
  184. // let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  185. this.fileList.push({
  186. url: '/api'+res.fileUrl,
  187. file: new File([], res.fileName,{}),
  188. id: res.id
  189. });
  190. })
  191. });
  192. },
  193. afterRead(file) {
  194. // 此时可以自行将文件上传至服务器
  195. let params = new FormData();
  196. params.append("tableId", this.signaId);
  197. params.append("tableName", "t_sys_cbht");
  198. params.append("bizPath", "service");
  199. params.append("fileType", '0');
  200. params.append("file", file.file);
  201. params.append("userName", JSON.parse(Cookies.get('user')).memberName);
  202. attachmentUpload(params).then(response => {
  203. this.$notify({ type: 'success', message: '上传成功' });
  204. let newFile = this.fileList[this.fileList.length - 1];
  205. this.$set(newFile, 'id', response.id);
  206. });
  207. },
  208. deleteFile(file){
  209. attachmentRemove(file.id).then(res => {
  210. this.$notify({ type: 'success', message: '删除成功' });
  211. });
  212. },
  213. signaImgFun(url) {
  214. this.signatureImg = url;
  215. },
  216. // 清空画板
  217. handleReset() {
  218. this.$refs.esign.reset();
  219. $('#canvasTT').css('display', 'block')
  220. },
  221. // 生成签字图
  222. handleGenerate() {
  223. this.$refs.esign
  224. .generate() // 使用生成器调用把签字的图片转换成为base64图片格式
  225. .then((res) => {
  226. this.signature.resultImg = res;
  227. let wj = this.dataURLtoBlob(res);
  228. let param = new FormData() // 创建form对象
  229. param.append('file', wj) // 通过append向form对象添加数据
  230. param.append('date', this.format(new Date(), 'yyyy-MM-dd')) // 通过append向form对象添加数据
  231. cbhtSecondSign(param, this.signaId).then(response => {
  232. this.$notify({type: 'success', message: '签字成功'});
  233. this.show = false;
  234. // location.reload();
  235. this.applicationList = [];
  236. this.getList();
  237. });
  238. })
  239. .catch((err) => {
  240. // 画布没有签字时会执行这里提示一下
  241. this.$toast.fail('请签名后再保存签字');
  242. });
  243. },
  244. dataURLtoBlob(dataurl, filename = 'file') {
  245. let arr = dataurl.split(',')
  246. let mime = arr[0].match(/:(.*?);/)[1]
  247. let suffix = mime.split('/')[1]
  248. let bstr = atob(arr[1])
  249. let n = bstr.length
  250. let u8arr = new Uint8Array(n)
  251. while (n--) {
  252. u8arr[n] = bstr.charCodeAt(n)
  253. }
  254. return new File([u8arr], `${filename}.${suffix}`, {
  255. type: mime
  256. })
  257. },
  258. },
  259. }
  260. </script>
  261. <style scoped lang="scss">
  262. .home_wrapper {
  263. background: #e9e9e9;
  264. min-height: 100vh;
  265. width: 100vw;
  266. .header_main {
  267. height: 116px;
  268. background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
  269. background-size: 100% 100%;
  270. position: fixed;
  271. top: 0;
  272. left: 0;
  273. width: 100%;
  274. font-size: 36px;
  275. line-height: 116px;
  276. text-align: center;
  277. color: #fff;
  278. position: relative;
  279. .return_btn {
  280. width: 24px;
  281. height: 43.2px;
  282. background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  283. background-size: 20px 36px;
  284. position: absolute;
  285. left: 38px;
  286. top: 36px;
  287. }
  288. .add_btn {
  289. width: 56.4px;
  290. height: 40.8px;
  291. background: url('../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  292. background-size: 47px 34px;
  293. position: absolute;
  294. right: 38px;
  295. top: 36px;
  296. }
  297. }
  298. .record_main {
  299. padding: 30px 22px;
  300. .record_det {
  301. height: 38px;
  302. line-height: 38px;
  303. display: flex;
  304. justify-content: space-between;
  305. .year_l {
  306. font-size: 30px;
  307. display: flex;
  308. align-items: center;
  309. color: #858585;
  310. .unit {
  311. padding-left: 5px;
  312. }
  313. .icon {
  314. width: 23px;
  315. height: 12px;
  316. display: block;
  317. background: url('../../assets/images/sunVillage_info/list_icon_1.png') no-repeat;
  318. background-size: 100% 100%;
  319. margin-bottom: 4px;
  320. margin-right: 8px;
  321. &.zk {
  322. transform: rotate(0deg)
  323. }
  324. &.ss {
  325. transform: rotate(180deg)
  326. }
  327. }
  328. }
  329. .total_r {
  330. font-size: 26px;
  331. letter-spacing: 2px;
  332. }
  333. }
  334. .record_list {
  335. display: flex;
  336. flex-flow: wrap;
  337. margin-top: 12PX;
  338. .flex_block {
  339. font-size: 30px;
  340. color: #878787;
  341. padding-right: 30px;
  342. &.current {
  343. color: #4199fe;
  344. font-weight: bold;
  345. }
  346. }
  347. }
  348. }
  349. .list_main {
  350. padding: 0 22px;
  351. margin-top: 15PX;
  352. .item {
  353. border-radius: 30px;
  354. background: #fff;
  355. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  356. padding: 25px 32px;
  357. margin-bottom: 20px;
  358. .info {
  359. .title {
  360. display: flex;
  361. font-size: 32px;
  362. align-items: center;
  363. height: 58px;
  364. .icon_box {
  365. width: 34px;
  366. display: block;
  367. height: 30px;
  368. background: url('../../assets/images/sunVillage_info/signature_icon_01.png') no-repeat;
  369. background-size: 100% 100%;
  370. margin-right: 10px;
  371. flex-shrink: 0;
  372. }
  373. .icon_box1 {
  374. width: 34px;
  375. display: block;
  376. height: 30px;
  377. background: url('../../assets/images/sunVillage_info/signature_icon_01g.png') no-repeat;
  378. background-size: 100% 100%;
  379. margin-right: 10px;
  380. flex-shrink: 0;
  381. }
  382. .news_title {
  383. display: -webkit-box;
  384. -webkit-box-orient: vertical;
  385. -webkit-line-clamp: 1;
  386. word-break: break-all;
  387. overflow: hidden;
  388. }
  389. .tips_mark {
  390. background: #ffedcd;
  391. border-radius: 8px;
  392. font-size: 24px;
  393. color: #f8a83d;
  394. text-align: center;
  395. line-height: 34px;
  396. flex-shrink: 0;
  397. padding: 0 5Px;
  398. margin-left: auto;
  399. }
  400. .tips_mark2 {
  401. background: #eb1616;
  402. border-radius: 8px;
  403. font-size: 24px;
  404. color: #ffffff;
  405. text-align: center;
  406. line-height: 34px;
  407. flex-shrink: 0;
  408. padding: 0 5Px;
  409. margin-left: 10PX;
  410. }
  411. }
  412. .time {
  413. font-size: 16PX;
  414. color: #333333;
  415. display: flex;
  416. align-items: center;
  417. margin-top: 5PX;
  418. justify-content: space-between;
  419. .icon_time {
  420. width: 25px;
  421. height: 25px;
  422. background: url('../../assets/images/sunVillage_info/list_icon_4.png') no-repeat;
  423. background-size: 100% 100%;
  424. margin-right: 10px;
  425. }
  426. }
  427. }
  428. }
  429. .operation {
  430. display: flex;
  431. align-items: center;
  432. justify-content: right;
  433. text-align: center;
  434. border-radius: 30px;
  435. background: #fff;
  436. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  437. height: 100%;
  438. padding: 0 15Px;
  439. margin-left: 10PX;
  440. .opera_btn {
  441. border-radius: 50%;
  442. padding: 0 10px;
  443. &.delete {
  444. background: #df0707;
  445. margin-left: 10PX;
  446. .icon {
  447. width: 22PX;
  448. height: 29PX;
  449. background: url('../../assets/images/sunVillage_info/signature_icon_03.png') no-repeat;
  450. background-size: 100% 100%;
  451. display: block;
  452. }
  453. }
  454. &.edit {
  455. background: #79cf13;
  456. margin-left: 10PX;
  457. .icon {
  458. width: 26PX;
  459. height: 25PX;
  460. background: url('../../assets/images/sunVillage_info/signature_icon_02.png') no-repeat;
  461. background-size: 100% 100%;
  462. display: block;
  463. }
  464. }
  465. &.view {
  466. background: #3494ff;
  467. margin-left: 10PX;
  468. .icon {
  469. width: 29PX;
  470. height: 21PX;
  471. background: url('../../assets/images/sunVillage_info/signature_icon_04.png') no-repeat;
  472. background-size: 100% 100%;
  473. display: block;
  474. }
  475. }
  476. &.list {
  477. background: #79cf13;
  478. margin-left: 10PX;
  479. .icon {
  480. width: 29px;
  481. height: 21px;
  482. background: url('../../assets/images/sunVillage_info/list_icon_10.png') no-repeat;
  483. background-size: 100% 100%;
  484. display: block;
  485. }
  486. }
  487. }
  488. }
  489. }
  490. .bottom_tips {
  491. font-size: 24px;
  492. color: #a7a6a6;
  493. text-align: center;
  494. margin-top: 32px;
  495. background: url('../../assets/images/sunVillage_info/list_icon_8.png') center center no-repeat;
  496. background-size: 260px 2px;
  497. .xs {
  498. padding: 0 8px;
  499. background: #e9e9e9;
  500. }
  501. }
  502. .signature-box {
  503. border: 1px dashed #666;
  504. margin: 2px 20px;
  505. height: 100%;
  506. /*canvas{*/
  507. /* height: 100%!important;*/
  508. /*}*/
  509. }
  510. .signature-footer {
  511. transform: rotate(90deg);
  512. width: auto;
  513. position: absolute;
  514. top: 50%;
  515. left: 0PX;
  516. .clearBtn {
  517. margin-left: 15px;
  518. }
  519. }
  520. .esigh-result {
  521. margin: 15px 20px;
  522. // height: 110px;
  523. border: 1px solid #666;
  524. font-size: 0;
  525. .imgs {
  526. width: 100%;
  527. }
  528. }
  529. }
  530. </style>