移动端
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

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