移动端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

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