|
@@ -0,0 +1,551 @@
|
|
|
+<template>
|
|
|
+ <div class="social-wrap">
|
|
|
+ <section class="social-basic input-qian">
|
|
|
+ <form action id="social-basic" class="needs-validation" novalidate>
|
|
|
+ <div class="form-group row">
|
|
|
+ <label for="mobile" class="col-3 col-form-label">手机号码</label>
|
|
|
+ <div class="col-8">
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ class="form-control"
|
|
|
+ id="mobile"
|
|
|
+ name="mobile"
|
|
|
+ :value="data.mobile"
|
|
|
+ required
|
|
|
+ pattern="^1[3-9]\d{9}$"
|
|
|
+ />
|
|
|
+ <div class="invalid-feedback">请输入有效的手机号码</div>
|
|
|
+ </div>
|
|
|
+ <b class="text-danger">*</b>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group row">
|
|
|
+ <label for="realname" class="col-3 col-form-label">身份证姓名</label>
|
|
|
+ <div class="col-8">
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ class="form-control"
|
|
|
+ id="realname"
|
|
|
+ name="realname"
|
|
|
+ :value="data.realname"
|
|
|
+ required
|
|
|
+ pattern="^[\u4e00-\u9fa5]{2,4}$"
|
|
|
+ />
|
|
|
+ <div class="invalid-feedback">请输入有效的姓名</div>
|
|
|
+ </div>
|
|
|
+ <b class="text-danger">*</b>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group row">
|
|
|
+ <label for="idCard" class="col-3 col-form-label">身份证号码</label>
|
|
|
+ <div class="col-8">
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ class="form-control"
|
|
|
+ id="idCard"
|
|
|
+ name="idCard"
|
|
|
+ :value="data.id_card"
|
|
|
+ required
|
|
|
+ pattern="(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)"
|
|
|
+ />
|
|
|
+ <div class="invalid-feedback">请输入有效的身份证号</div>
|
|
|
+ </div>
|
|
|
+ <b class="text-danger">*</b>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group row">
|
|
|
+ <label for="gender" class="col-3 col-form-label">性别</label>
|
|
|
+ <div class="col-8">
|
|
|
+ <select id="gender" name="gender" class="form-control" :value="data.gender">
|
|
|
+ <option value="1">男</option>
|
|
|
+ <option value="2">女</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group row">
|
|
|
+ <label for="city" class="col-3 col-form-label">代缴城市</label>
|
|
|
+ <div class="col-8">
|
|
|
+ <select class="city-sheng" name id="sheng" v-model="data.code" @change="chooseShi()">
|
|
|
+ <option
|
|
|
+ style="color:#8e8e8e"
|
|
|
+ v-for="item in data.sheng"
|
|
|
+ :value="item.code"
|
|
|
+ >{{item.name}}</option>
|
|
|
+ </select>
|
|
|
+ <br />
|
|
|
+ <select
|
|
|
+ class="city-shi"
|
|
|
+ name="social_city"
|
|
|
+ id
|
|
|
+ v-model="data.codes"
|
|
|
+ @change="chooseSocial()"
|
|
|
+ >
|
|
|
+ <option v-for="items in data.shi" :value="items.code">{{items.name}}</option>
|
|
|
+ </select>
|
|
|
+ <div class="invalid-feedback">请选择代缴城市</div>
|
|
|
+ </div>
|
|
|
+ <b class="text-danger">*</b>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group row">
|
|
|
+ <label for="socialType" class="col-3 col-form-label">社保户别</label>
|
|
|
+ <div class="col-8">
|
|
|
+ <select id="socialType" name="socialType" class="form-control">
|
|
|
+ <option v-for="item in data.sociallist" :value="item.id">{{item.name}}</option>
|
|
|
+ </select>
|
|
|
+ <div class="invalid-feedback">请输入有效的社保户别</div>
|
|
|
+ </div>
|
|
|
+ <b class="text-danger">*</b>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group row">
|
|
|
+ <label for="addr" class="col-3 col-form-label">联系地址</label>
|
|
|
+ <div class="col-8">
|
|
|
+ <input type="text" class="form-control" id="addr" name="addr" value />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="text-right" style="color: #6b6b6b">
|
|
|
+ <small class="small">
|
|
|
+ 输入您的个人信息,
|
|
|
+ <b class="text-danger">*</b>号为必填内容
|
|
|
+ </small>
|
|
|
+ </div>
|
|
|
+ <div class="btn-box form-group mt-3 row">
|
|
|
+ <input type="hidden" name="is_edit" value />
|
|
|
+ <a
|
|
|
+ href="https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzUxMzYyMjYzOA==&scene=126&bizpsid=0#wechat_redirect"
|
|
|
+ >联系客服</a>
|
|
|
+ <button
|
|
|
+ type="button"
|
|
|
+ style="background: #0dbc5a;color: #ffffff;"
|
|
|
+ class="btn btn-block p-3"
|
|
|
+ v-on:click="saveInfo"
|
|
|
+ >下一步</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </section>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts">
|
|
|
+import {Component, Vue} from 'vue-property-decorator';
|
|
|
+import Utils from '@/extend/Utils';
|
|
|
+import Http from '@/extend/Http';
|
|
|
+import router from '@/router';
|
|
|
+import {MessageBox} from 'element-ui';
|
|
|
+
|
|
|
+@Component({})
|
|
|
+export default class Detail extends Vue
|
|
|
+{
|
|
|
+ public data: any = {
|
|
|
+ mobile:'',
|
|
|
+ realname:'',
|
|
|
+ citycode:'',
|
|
|
+ city_name:'',
|
|
|
+ gender:1,
|
|
|
+
|
|
|
+ is_discounts: false,
|
|
|
+ social_calc: null,
|
|
|
+ service_calc: 0,
|
|
|
+ fund_calc: 0,
|
|
|
+ shouxu:0,
|
|
|
+ subtotal_calc: 0,
|
|
|
+ total_calc: 0,
|
|
|
+ social_basic: {pension: 3400, fund: 3400},
|
|
|
+ social_type: null,
|
|
|
+ social_name:'',
|
|
|
+ service_charge: null,
|
|
|
+ discountList:'',
|
|
|
+ // value:'',
|
|
|
+ discount:0,
|
|
|
+ freedom:0,
|
|
|
+ hubie:'',
|
|
|
+ month:'',
|
|
|
+
|
|
|
+ sheng:'',
|
|
|
+ shi:'',
|
|
|
+ code:'11',
|
|
|
+ codes:'1101',
|
|
|
+ couponSelected:'',
|
|
|
+ sociallist:[{id: 1, name: "本地城镇"}, {id: 2, name: "本地农村"}, {id: 3, name: "外埠城镇"}, {id: 4, name: "外埠农村"}]
|
|
|
+ };
|
|
|
+ private initData() {
|
|
|
+ this.data.realname = localStorage.getItem('realname');
|
|
|
+ this.data.mobile = localStorage.getItem('mobile');
|
|
|
+ this.data.gender = localStorage.getItem('gender');
|
|
|
+ this.data.id_card = localStorage.getItem('id_card');
|
|
|
+ this.data.citycode = localStorage.getItem('citycode');
|
|
|
+ this.data.city_name = localStorage.getItem('city_name');
|
|
|
+ this.data.social_type = localStorage.getItem('social_type');
|
|
|
+ this.data.hubie = localStorage.getItem('social_name');
|
|
|
+
|
|
|
+
|
|
|
+ console.log('id_card',this.data.id_card);
|
|
|
+ }
|
|
|
+
|
|
|
+ async created()
|
|
|
+ {
|
|
|
+ console.log('created');
|
|
|
+ try {
|
|
|
+ this.initData();
|
|
|
+
|
|
|
+ let res = await Http.getInstance().getProvinceList();
|
|
|
+ this.data.sheng = res.data.prolist
|
|
|
+ this.data.shi = res.data.citylist
|
|
|
+ let params = Utils.getInstance().getParams(location.href);
|
|
|
+ this.data.is_fund = Number(params.is_fund);
|
|
|
+
|
|
|
+ if (this.data.social_type != null) {
|
|
|
+ let res = await Http.getInstance().getSocialLimit({
|
|
|
+ socialType: this.data.social_type,
|
|
|
+ code: this.data.citycode
|
|
|
+ });
|
|
|
+ this.data.social_basic = res.data;
|
|
|
+ }
|
|
|
+ // this.data.service_charge = serviceChargeData[this.data.is_fund];
|
|
|
+ } catch (error) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ async chooseShi(){
|
|
|
+ let res = await Http.getInstance().getCityList({
|
|
|
+ code: this.data.code
|
|
|
+ });
|
|
|
+ this.data.shi = res.data
|
|
|
+ console.log(res.data)
|
|
|
+ }
|
|
|
+ async chooseSocial(){
|
|
|
+ let res = await Http.getInstance().getSociallist({
|
|
|
+ code: this.data.codes
|
|
|
+ });
|
|
|
+ if(res.data){
|
|
|
+ this.data.sociallist = res.data
|
|
|
+ }
|
|
|
+ }
|
|
|
+ open() {
|
|
|
+ // @ts-ignore
|
|
|
+ MessageBox.alert('<a href="tel:' + Http.PHONE + '">' + Http.PHONE + '</a><p>手机号同步微信</p>', '请联系客服', {
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ confirmButtonText: "拨打" ,
|
|
|
+ }).then(action =>{
|
|
|
+ window.location.href = 'tel://' +Http.PHONE;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ async updated() {
|
|
|
+ if (this.data.social_calc == null) {
|
|
|
+ this.calcBill();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ async saveInfo(event: any)
|
|
|
+ {
|
|
|
+ if(this.data.codes == ''){
|
|
|
+ alert('请选择代缴城市')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ let form = event.target.form;
|
|
|
+ if (form.checkValidity() === false) {
|
|
|
+ form.classList.add('was-validated');
|
|
|
+ event.preventDefault();
|
|
|
+ event.stopPropagation();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ let res = await Http.getInstance().saveBase(Utils.getInstance().serialize(form));
|
|
|
+ // @ts-ignore
|
|
|
+ this.data.social_type = res.data.social_type;
|
|
|
+ this.data.social_name = res.data.social_name;
|
|
|
+ this.data.citycode = res.data.city_code;
|
|
|
+ this.data.city_name = res.data.city_name;
|
|
|
+ // this.data.service_charge = serviceChargeData[this.data.is_fund];
|
|
|
+
|
|
|
+ localStorage.setItem('social_type', this.data.social_type);
|
|
|
+ localStorage.setItem('social_name', this.data.social_name);
|
|
|
+ localStorage.setItem('service_charge', this.data.service_charge);
|
|
|
+ localStorage.setItem('citycode', res.data.city_code);
|
|
|
+ localStorage.setItem('city_name', res.data.city_name);
|
|
|
+
|
|
|
+ res = await Http.getInstance().getSocialLimit({
|
|
|
+ socialType: this.data.social_type,
|
|
|
+ code: this.data.codes
|
|
|
+ });
|
|
|
+ this.data.social_basic = res.data;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ async calcBill(event?: any) {
|
|
|
+ let form = event ? event.target.form : document.getElementById('social-detail');
|
|
|
+ if (form.checkValidity() === false) {
|
|
|
+ form.classList.add('was-validated');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ console.log(form)
|
|
|
+ let res = await Http.getInstance().calcBill(Utils.getInstance().serialize(form));
|
|
|
+ this.data.social_calc = res.data.social;
|
|
|
+ this.data.service_calc = res.data.service;
|
|
|
+ this.data.discount = res.data.discount;
|
|
|
+ this.data.freedom = res.data.freedom;
|
|
|
+ this.data.fund_calc = res.data.fund;
|
|
|
+ this.data.subtotal_calc = res.data.subtotal;
|
|
|
+ this.data.total_calc = res.data.total;
|
|
|
+ this.data.is_discounts = res.data.discounts;
|
|
|
+ this.data.month = res.data.month;
|
|
|
+ let ress = await Http.getInstance().getDiscount();
|
|
|
+ if(ress.data.length == 0){
|
|
|
+ this.data.discountList= [{id: 0, money: "暂无优惠券"}]
|
|
|
+ }else{
|
|
|
+ this.data.discountList = ress.data;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ async saveOrder(event: any) {
|
|
|
+ let date = new Date();
|
|
|
+ let seperator1 = "-";
|
|
|
+ let year = date.getFullYear();
|
|
|
+ let month = date.getMonth() + 1;
|
|
|
+ let strDate = date.getDate();
|
|
|
+ if (strDate > 28 ) {
|
|
|
+ if(this.data.is_fund == 0){
|
|
|
+ MessageBox.alert('当月社保缴纳时间为1-29日,目前只能为您代缴下个月的社保,如需缴纳本月社保,请联系客服。', '溫馨提示', {
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ showCancelButton: true,
|
|
|
+ confirmButtonText: "联系客服" ,
|
|
|
+ cancelButtonText: '继续缴费',
|
|
|
+ }).then(action =>{
|
|
|
+ window.location.href = 'tel://' +Http.PHONE;
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ MessageBox.alert('当月社保/公积金缴纳时间为1-29日,目前只能为您代缴下个月的社保/公积金,如需缴纳本月社保/公积金,请联系客服。', '溫馨提示', {
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ showCancelButton: true,
|
|
|
+ confirmButtonText: "联系客服" ,
|
|
|
+ cancelButtonText: '继续缴费',
|
|
|
+ }).then(action =>{
|
|
|
+ window.location.href = 'tel://' +Http.PHONE;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let form = event.target.form;
|
|
|
+ if (form.checkValidity() === false) {
|
|
|
+ form.classList.add('was-validated');
|
|
|
+ event.preventDefault();
|
|
|
+ event.stopPropagation();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ let res = await Http.getInstance().saveOrder(Utils.getInstance().serialize(form));
|
|
|
+ localStorage.setItem('order_paying', JSON.stringify(res.data));
|
|
|
+ router.replace({
|
|
|
+ name: 'opayment',
|
|
|
+ params: {
|
|
|
+ order_sn: res.data.order_sn,
|
|
|
+ type: '1'
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+@import "@/assets/scss/variables.scss";
|
|
|
+
|
|
|
+.social-wrap {
|
|
|
+ width: 100%;
|
|
|
+ padding: 1.5rem;
|
|
|
+ background: #ffffff;
|
|
|
+}
|
|
|
+.input-qian{
|
|
|
+ padding: 1rem 2rem 5rem 2rem;
|
|
|
+}
|
|
|
+.social-wrap .form-group {
|
|
|
+ margin: 1.6rem 0;
|
|
|
+ font-size: 16px;
|
|
|
+}
|
|
|
+
|
|
|
+.form-group.btn-box {
|
|
|
+ background: $gray;
|
|
|
+ margin: 2rem -1.5rem -4.5rem;
|
|
|
+ padding: 3rem;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+
|
|
|
+.btn-box .btn {
|
|
|
+ margin: 1rem 0;
|
|
|
+ color: white;
|
|
|
+ background: $green;
|
|
|
+ border-radius: 0.5rem;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+.btn-box .btn:last-child {
|
|
|
+ margin: 1rem 0;
|
|
|
+ color: #8e8e8e;
|
|
|
+ background: #ffffff;
|
|
|
+ border-radius: 0.5rem;
|
|
|
+}
|
|
|
+
|
|
|
+#app {
|
|
|
+ background: $gray;
|
|
|
+}
|
|
|
+.badge-pill{
|
|
|
+ font-size: 1.3rem;
|
|
|
+ font-weight: 400;
|
|
|
+}
|
|
|
+.badge{
|
|
|
+ font-size: 1.3rem;
|
|
|
+}
|
|
|
+.social-wrap input, .social-wrap select {
|
|
|
+ //background: $gray;
|
|
|
+}
|
|
|
+
|
|
|
+.swich-box .box {
|
|
|
+ width: 60px;
|
|
|
+ height: 25px;
|
|
|
+ background: #ccc;
|
|
|
+ border-radius: 20px;
|
|
|
+ transition: all .5s ease;
|
|
|
+}
|
|
|
+
|
|
|
+.swich-box input {
|
|
|
+ display: none;
|
|
|
+}
|
|
|
+
|
|
|
+.swich-box .box span {
|
|
|
+ display: inline-block;
|
|
|
+ height: 25px;
|
|
|
+ width: 25px;
|
|
|
+ border-radius: 15px;
|
|
|
+ background: #fff;
|
|
|
+ box-shadow: 1px 1px 1px #ddd;
|
|
|
+ transform: translateX(0px);
|
|
|
+ transition: all .5s ease;
|
|
|
+}
|
|
|
+
|
|
|
+.swich-on .box {
|
|
|
+ background: forestgreen;
|
|
|
+ transition: all .5s ease;
|
|
|
+}
|
|
|
+
|
|
|
+.swich-on .box span {
|
|
|
+ transform: translateX(36px);
|
|
|
+ transition: all .5s ease;
|
|
|
+}
|
|
|
+.detail{
|
|
|
+ font-size: 15px;
|
|
|
+}
|
|
|
+.detail .hubie-right{
|
|
|
+ float: right;
|
|
|
+ margin-top: 5px;
|
|
|
+}
|
|
|
+.detail .list-group, .detail .list-group-item{
|
|
|
+ background: $gray;
|
|
|
+}
|
|
|
+
|
|
|
+.col-form-label{
|
|
|
+ padding-right: 0;
|
|
|
+ padding-left: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.social-wrap .needs-validation .form-control {
|
|
|
+ background-image: none;
|
|
|
+}
|
|
|
+.youhui{
|
|
|
+ .pingtai{
|
|
|
+ padding: 10px 0 0;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #999999;
|
|
|
+ }
|
|
|
+ .pingtai-2{
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ .fuwuinput{
|
|
|
+ background: white !important;
|
|
|
+ }
|
|
|
+ .youhui-box{
|
|
|
+ //border: 1px solid #e8e8e8;
|
|
|
+ position:relative;
|
|
|
+ img{
|
|
|
+ width: 178px;
|
|
|
+ height: 33px;
|
|
|
+ margin: 10px 0;
|
|
|
+ }
|
|
|
+ .youhui-text{
|
|
|
+ //padding-left: 10px;
|
|
|
+ font-size: 16px;
|
|
|
+ padding-top: 1rem;
|
|
|
+ position: relative;
|
|
|
+ .youinput{
|
|
|
+ width: 15rem;
|
|
|
+ position: absolute;
|
|
|
+ right: 1rem;
|
|
|
+ top: 1.5rem;
|
|
|
+ background: white;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .youhui-p{
|
|
|
+ padding-left: 10px;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #d30000;
|
|
|
+ margin-top: 2rem;
|
|
|
+ //padding-right: 20px;
|
|
|
+ }
|
|
|
+ .youhui-dec{
|
|
|
+ margin-top: 1rem;
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.social-wrap{
|
|
|
+ padding:0;
|
|
|
+}
|
|
|
+.bottom-twobtn{
|
|
|
+ width: 100%;
|
|
|
+ padding-left: 0 !important;
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0;
|
|
|
+ height: 4rem;
|
|
|
+ .button-1{
|
|
|
+ width: 50%;
|
|
|
+ height: 100%;
|
|
|
+ border: none;
|
|
|
+ background: #2ba408;
|
|
|
+ color: #ffffff;
|
|
|
+ font-size: 1.5rem;
|
|
|
+ }
|
|
|
+ .button-2{
|
|
|
+ width: 50%;
|
|
|
+ height: 100%;
|
|
|
+ border: none;
|
|
|
+ background: #f5f5f5;
|
|
|
+ color: #5ac53a;
|
|
|
+ font-size: 1.5rem;
|
|
|
+ .button-2-img{
|
|
|
+ width: 1.5rem;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.city-boxs{
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+}
|
|
|
+.city-sheng{
|
|
|
+ width: 15.7rem;
|
|
|
+ height: 2.5rem;
|
|
|
+ font-size: 1rem;
|
|
|
+ background: white;
|
|
|
+ border-radius: 3px;
|
|
|
+ border-color: #d2d2d2;
|
|
|
+ color: #666666;
|
|
|
+}
|
|
|
+.city-shi{
|
|
|
+ width: 15.7rem;
|
|
|
+ height: 2.5rem;
|
|
|
+ font-size: 1rem;
|
|
|
+ background: white;
|
|
|
+ border-radius: 3px;
|
|
|
+ border-color: #d2d2d2;
|
|
|
+ color: #666666;
|
|
|
+ margin-top: 1rem;
|
|
|
+}
|
|
|
+</style>
|