移动端
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

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