移动端
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

list_multipleLotsNh.vue 16 KiB

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