移动端
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

479 rader
15 KiB

  1. <template>
  2. <div class="app-container" style="background: #fff;height: 100%">
  3. <van-nav-bar
  4. title="报名"
  5. left-arrow
  6. fixed
  7. placeholder
  8. @click-left="$router.back(-1)"
  9. />
  10. <van-row>
  11. <p class="" style="padding:20px 20px 0px;font-size: 0.4rem">
  12. <span>项目名称:</span>
  13. <span style="color:#007E72;font-size: 0.45rem;font-weight: bold;">{{ projectName }}</span>
  14. </p>
  15. <p style="padding:10px 20px 0;font-size: 0.4rem;">
  16. <span>缴纳保证金:</span>
  17. <span style="color:#C21F3A;font-size: 0.45rem;font-weight: bold;">¥{{ deposit }}</span>
  18. </p>
  19. <p class="" style="padding:10px 20px 0px;font-size: 0.4rem">
  20. <span>保证金缴纳账号:</span>
  21. <span style="color:#007E72;font-size: 0.45rem;font-weight: bold;">{{ payAccount }}</span>
  22. </p>
  23. <p class="" style="padding:10px 20px 0px;font-size: 0.4rem">
  24. <span>账户名称:</span>
  25. <span style="color:#007E72;font-size: 0.45rem;font-weight: bold;">{{ accountName }}</span>
  26. </p>
  27. <p class="" style="padding:10px 20px 0px;font-size: 0.4rem;margin-bottom: 20px">
  28. <span>开户银行:</span>
  29. <span style="color:#007E72;font-size: 0.45rem;font-weight: bold;">{{ bankName }}</span>
  30. </p>
  31. </van-row>
  32. <van-row style="padding:0 20px;">
  33. <h2 style="margin-bottom:10px;">1.竞买人条件确认</h2>
  34. <p style="margin-bottom:10px;">· 已阅读并知晓:
  35. <span style="color:#C21F3A" @click="show1=true">《乳山市农村产权交易项目报名服务协议》</span>
  36. </p>
  37. <van-dialog v-model="show1" title="乳山市农村产权交易项目报名服务协议" confirmButtonText="关闭">
  38. <div class="dialog_content_center" v-html="fwxyConfig"></div>
  39. </van-dialog>
  40. <p style="margin-bottom:10px;">· 已阅读并知晓:
  41. <span style="color:#C21F3A" @click="show2=true">《竞买人承诺书》</span>
  42. </p>
  43. <van-dialog v-model="show2" title="竞买人承诺书" confirmButtonText="关闭">
  44. <div class="dialog_content_center" v-html="cnsConfig"></div>
  45. </van-dialog>
  46. <van-checkbox v-model="checked" shape="square" checked-color="#007E72" >
  47. <p :style="{color:color}">确认已知晓并同意以上所有内容
  48. </p>
  49. </van-checkbox>
  50. </van-row>
  51. <van-row style="padding:0 20px;margin-top:10px;">
  52. <h2 style="margin-bottom:10px;">竞买人身份确认说明:</h2>
  53. <p>竞买人身份信息无法在此修改,请前往<span style="color: #c12e2a;">个人中心 > 账户设置 > 银行账户信息</span>进行修改维护</p>
  54. </van-row>
  55. <van-row style="padding:0 10px;margin-top: 20px;">
  56. <h2 style="margin-bottom:10px;padding:0 10px">2.竞买人身份确认</h2>
  57. <van-form @submit="onSubmit">
  58. <van-field
  59. readonly
  60. v-model="realname"
  61. name="realname"
  62. label="姓名"
  63. placeholder="姓名"
  64. required
  65. :rules="[{ required: true, message: '请填写姓名' }]"
  66. />
  67. <van-field
  68. readonly
  69. v-model="phone"
  70. name="phone"
  71. label="会员账号"
  72. placeholder="会员账号"
  73. required
  74. :rules="[{ required: true, message: '请填写会员账号' }]"
  75. />
  76. <van-field
  77. readonly
  78. v-model="accountType"
  79. name="accountType"
  80. label="账户类型"
  81. placeholder="账户类型"
  82. required
  83. :rules="[{ required: true, message: '请填写账户类型' }]"
  84. />
  85. <van-field
  86. readonly
  87. v-model="bankType"
  88. name="bankType"
  89. label="所属银行"
  90. placeholder="所属银行"
  91. required
  92. :rules="[{ required: true, message: '请填写所属银行' }]"
  93. />
  94. <van-field
  95. readonly
  96. v-model="bankCardName"
  97. name="bankCardName"
  98. label="开户姓名"
  99. placeholder="开户姓名"
  100. required
  101. :rules="[{ required: true, message: '请填写开户姓名' }]"
  102. />
  103. <van-field
  104. readonly
  105. v-model="bankAddress"
  106. name="bankAddress"
  107. label="开户银行"
  108. placeholder="开户银行"
  109. required
  110. :rules="[{ required: true, message: '请填写开户银行' }]"
  111. />
  112. <van-field
  113. readonly
  114. v-model="bankCardNum"
  115. name="bankCardNum"
  116. label="银行卡号"
  117. placeholder="银行卡号"
  118. required
  119. :rules="[{ required: true, message: '请填写银行卡号' }]"
  120. />
  121. <van-field
  122. readonly
  123. v-model="payeePaymentLines"
  124. name="payeePaymentLines"
  125. label="联行号"
  126. placeholder="联行号"
  127. required
  128. :rules="[{ required: true, message: '请填写联行号' }]"
  129. />
  130. <van-field
  131. readonly
  132. v-model="idCardNum"
  133. name="idCardNum"
  134. label="身份证号"
  135. placeholder="身份证号"
  136. required
  137. :rules="[{ required: true, message: '请填写身份证号' }]"
  138. />
  139. <van-field
  140. v-model="projectId"
  141. name="projectId"
  142. style="display: none"
  143. />
  144. <van-field
  145. v-model="memberId"
  146. name="memberId"
  147. style="display: none"
  148. />
  149. <van-field
  150. v-model="status"
  151. name="status"
  152. style="display: none"
  153. />
  154. <van-field label="缴款凭证">
  155. <template #input>
  156. <van-uploader v-model="fileList" multiple>
  157. <van-button icon="plus" size="small" round color="#007E72">点击上传</van-button>
  158. </van-uploader>
  159. </template>
  160. </van-field>
  161. <van-field label="电子签名" required name="signPic" v-model="signFileUrlUp">
  162. <template #input>
  163. <van-button @click="show=true" native-type="button" icon="plus" size="small" round color="#007E72">点击签名</van-button>
  164. </template>
  165. </van-field>
  166. <img :src="signFileUrl" style="width: 100%;" alt="">
  167. <div style="margin: 16px;">
  168. <van-button round block type="info" native-type="submit" color="#007E72">保存</van-button>
  169. </div>
  170. </van-form>
  171. </van-row>
  172. <van-popup v-model="show" closeable position="right" :style="{ height: '100%' }" >
  173. <van-cell-group style="width: 100%;height:100%;overflow: hidden;padding-top: 10px;padding-bottom: 10px;">
  174. <div class="signature-box" @mousedown="canvasTTdown" @touchstart="canvasTTdown">
  175. <vue-esign
  176. ref="esign"
  177. class="mySign"
  178. :width="500"
  179. :height="height"
  180. :isCrop="signature.isCrop"
  181. :lineWidth="signature.lineWidth"
  182. :lineColor="signature.lineColor"
  183. :bgColor.sync="signature.bgColor"
  184. />
  185. </div>
  186. <img src="../../assets/images/sunVillage_info/signature_icon_10.png" id="canvasTT" style="position:absolute;top: 50%;left: 50%;transform: translate(-50%,-50%)" alt="">
  187. <div class="signature-footer">
  188. <van-button @click="handleGenerate" type="info" size="small">保存签字</van-button>
  189. <van-button @click="handleReset" class="clearBtn" type="info" plain size="small">清空画板</van-button>
  190. </div>
  191. </van-cell-group>
  192. </van-popup>
  193. </div>
  194. </template>
  195. <script>
  196. import {getMember, submmitSignup, uploadPic, getOutProjectDetail, getWebConfig,signUp} from "../../api/project";
  197. import {getInfo} from "../../api/login";
  198. import $ from "jquery";
  199. import {signSecond} from "@/api/sunVillage_info/fixedAssets";
  200. import {Toast} from "vant";
  201. export default {
  202. name: "signUp",
  203. data() {
  204. return {
  205. projectId:this.$route.query.projectId,
  206. deposit:this.$route.query.deposit,
  207. projectName:this.$route.query.projectName,
  208. bankAddress:"",
  209. bankCardNum:"",
  210. bankCardName:"",
  211. idCardNum:"",
  212. phone:"",
  213. memberId:"",
  214. status:"N",
  215. checked: false,
  216. show1: false,
  217. show2: false,
  218. color:"#007E72",
  219. nickName:"",
  220. userName:"",
  221. password:"",
  222. fileList:[],
  223. tableId:"",
  224. realname:"",
  225. accountType:"",
  226. bankType:"",
  227. payeePaymentLines:"",
  228. payAccount :"",
  229. accountName :"",
  230. bankName:"",
  231. show: false,
  232. signatureImg:'',
  233. //电子签名
  234. signature:{
  235. lineWidth: 6, // 画笔的线条粗细
  236. lineColor: "#000000", // 画笔的颜色
  237. bgColor: "", // 画布的背景颜色
  238. resultImg: "", // 最终画布生成的base64图片
  239. isCrop: false, // 是否裁剪,在画布设定尺寸基础上裁掉四周空白部分
  240. },
  241. signaId:'',
  242. height:null,
  243. cnsConfig:'',
  244. fwxyConfig:'',
  245. signFileUrl:'',
  246. signFileUrlUp:'',
  247. };
  248. },
  249. created() {
  250. this.height = window.screen.height*1.28-20;
  251. this.projectId = this.$route.query.projectId;
  252. this.deposit = this.$route.query.deposit;
  253. this.projectName = this.$route.query.projectName;
  254. console.log(this.$route.query.projectId)
  255. console.log(this.$route.query.deposit)
  256. console.log(this.$route.query.projectName)
  257. getInfo().then(response => {
  258. getMember(response.user.userId).then(res => {
  259. this.realname = res.data.realname
  260. this.bankCardName = res.data.bankCardName
  261. this.idCardNum = res.data.idCardNum
  262. this.bankAddress = res.data.bankAddress
  263. this.bankCardNum = res.data.bankCardNum
  264. this.phone = res.data.phone
  265. this.memberId = res.data.id
  266. this.payeePaymentLines = res.data.payeePaymentLines
  267. this.getDicts("bank_account_type").then(rr => {
  268. this.accountType = this.selectDictLabel(rr.data,res.data.accountType);
  269. });
  270. this.getDicts("bank_type_all").then(rr => {
  271. this.bankType = this.selectDictLabel(rr.data,res.data.bankType);
  272. });
  273. })
  274. });
  275. getOutProjectDetail(this.$route.query.projectId).then(res => {
  276. // this.projectId = res.data.projectId
  277. // this.deposit = res.data.deposit
  278. // this.projectName = res.data.projectName
  279. this.payAccount = res.data.payAccount
  280. this.accountName = res.data.accountName
  281. this.bankName = res.data.bankName
  282. });
  283. getWebConfig().then(response =>{
  284. this.fwxyConfig = response.data[15].configValue;
  285. this.cnsConfig = response.data[16].configValue;
  286. });
  287. },
  288. methods: {
  289. canvasTTdown(){
  290. $('#canvasTT').css('display','none')
  291. },
  292. // 清空画板
  293. handleReset() {
  294. this.$refs.esign.reset();
  295. $('#canvasTT').css('display','block')
  296. },
  297. handleGenerate() {
  298. this.$toast.loading({
  299. message: "正在生成签字",
  300. forbidClick: true,
  301. duration: 0,
  302. });
  303. console.log(this.$refs.esign)
  304. this.$refs.esign
  305. .generate() // 使用生成器调用把签字的图片转换成为base64图片格式
  306. .then((res) => {
  307. console.log(res)
  308. this.signature.resultImg = res;
  309. let wj = this.dataURLtoBlob(res);
  310. let param = new FormData() // 创建form对象
  311. param.append('file', wj) // 通过append向form对象添加数据
  312. param.append('isAngle', 'true') // 通过append向form对象添加数据
  313. console.log(param)
  314. signUp(param).then(response => {
  315. this.$notify({ type: 'success', message: '签字成功' });
  316. this.show = false;
  317. this.signFileUrl = '/api'+response.fileUrl;
  318. this.signFileUrlUp = response.fileUrl;
  319. console.log(response)
  320. });
  321. })
  322. .catch((err) => {
  323. console.log(err)
  324. this.$toast.clear();
  325. // 画布没有签字时会执行这里提示一下
  326. this.$toast.fail('请签名后再保存签字');
  327. });
  328. },
  329. dataURLtoBlob (dataurl, filename = 'file') {
  330. let arr = dataurl.split(',')
  331. let mime = arr[0].match(/:(.*?);/)[1]
  332. let suffix = mime.split('/')[1]
  333. let bstr = atob(arr[1])
  334. let n = bstr.length
  335. let u8arr = new Uint8Array(n)
  336. while (n--) {
  337. u8arr[n] = bstr.charCodeAt(n)
  338. }
  339. return new File([u8arr], `${filename}.${suffix}`, {
  340. type: mime
  341. })
  342. },
  343. onRead (file) {
  344. this.$toast.loading({
  345. message: "正在提交签名",
  346. forbidClick: true,
  347. duration: 0,
  348. });
  349. let data = {};
  350. let f = []
  351. for (let i of file){
  352. f.push(i.content)
  353. }
  354. data['files']= f
  355. data['fileType']= ""
  356. data['bizPath']= "transaction"
  357. data['tableName']= "t_transaction_signup"
  358. data['tableId']= this.tableId
  359. uploadPic(data).then(response => {
  360. if(response.code=="200"){
  361. let _this = this
  362. this.$toast({
  363. icon: 'success', // 找到自己需要的图标
  364. message: '提交申请,等待审核',
  365. duration:"2000",
  366. onClose:function(){
  367. _this.$router.back(-1);
  368. }
  369. })
  370. }
  371. })
  372. },
  373. onSubmit(values){
  374. if(!this.checked){
  375. this.$toast({
  376. icon: 'warning', // 找到自己需要的图标
  377. message: '保存之前,请先勾选<<竞拍服务协议>>!'
  378. })
  379. return;
  380. }
  381. if(this.signFileUrlUp==''){
  382. this.$toast({
  383. icon: 'warning', // 找到自己需要的图标
  384. message: '请签名后提交'
  385. })
  386. return;
  387. }
  388. // if(this.fileList.length<1){
  389. // this.$toast({
  390. // icon: 'warning', // 找到自己需要的图标
  391. // message: '请上传相关凭证'
  392. // })
  393. // return;
  394. // }
  395. this.$toast.loading({
  396. message: "正在提交报名",
  397. forbidClick: true,
  398. duration: 0,
  399. });
  400. values.signPic = this.signFileUrlUp;
  401. submmitSignup(values).then(response =>{
  402. if(response.code==200){
  403. this.tableId = response.data
  404. console.log(response)
  405. if (response.msg!='操作成功'){
  406. this.$toast({
  407. icon: 'fail', // 找到自己需要的图标
  408. message: response.msg,
  409. duration:"2000"
  410. })
  411. }else{
  412. this.onRead(this.fileList)
  413. }
  414. }
  415. })
  416. }
  417. },
  418. watch:{
  419. checked(val){
  420. val==true?this.color="#007E72":this.color="#000"
  421. }
  422. }
  423. }
  424. </script>
  425. <style scoped lang="scss">
  426. .dialog_content_center{
  427. height: 40vh;
  428. overflow-y: scroll;
  429. margin-top: 2vh;
  430. padding: 0 2vh;
  431. }
  432. .signature-box{
  433. border:1px dashed #666;
  434. margin:2px 20px;
  435. height: 100%;
  436. /*canvas{*/
  437. /* height: 100%!important;*/
  438. /*}*/
  439. }
  440. .signature-footer{
  441. transform: rotate(90deg);
  442. width: auto;
  443. position: absolute;
  444. top: 50%;
  445. left: 0PX;
  446. .clearBtn{
  447. margin-left: 15px;
  448. }
  449. }
  450. .esigh-result{
  451. margin:15px 20px;
  452. // height: 110px;
  453. border:1px solid #666;
  454. font-size: 0;
  455. .imgs{
  456. width: 100%;
  457. }
  458. }
  459. </style>