Explorar o código

个人信息修改

pengyh hai 1 ano
pai
achega
aa1726f59d

+ 18 - 0
src/api/payRecords.js

@@ -0,0 +1,18 @@
+import request, { postBlob, getBlob, handleImport } from '@/utils/request'
+
+// 获取师傅列表
+export function listPageV2(data) {
+  return request({
+    url: `/buy/service/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function pageExport(data, name) {
+  return postBlob({
+    url: '/buy/service/list/export',
+    data,
+    name
+  })
+}

BIN=BIN
src/assets/common/weixin.png


+ 1 - 0
src/views/setting/organizationManagement/tenantManagement/index.vue

@@ -79,6 +79,7 @@
           <el-table-column align="center" label="负责人" prop="linkName" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="角色" prop="roleName" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="联系电话" prop="linkPhone" min-width="160" show-overflow-tooltip></el-table-column>
+		  <el-table-column align="center" label="到期时间" prop="expireTime" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="电子邮箱" prop="email" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="地址" prop="address" min-width="200" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="状态" class-name="status-col">

+ 73 - 0
src/views/setting/payRecords/index.vue

@@ -0,0 +1,73 @@
+<template>
+	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
+	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
+	  >
+	  <!-- :exportList="exportList" -->
+	</template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import ImageUpload from '@/components/file-upload'
+import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
+import { listPageV2,pageExport } from "@/api/payRecords";
+export default {
+  components: { TemplatePage, ImageUpload },
+  mixins: [import_mixin],
+  data() {
+    return {
+      // 事件组合
+      optionsEvensGroup: [],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ["新增","编辑", "详情"],
+      formDialog: false,
+	  appraise_status: ''
+    }
+  },
+  computed: {
+    // 更多参数
+    moreParameters() {
+      return []
+    },
+    formItems() {
+		return []
+    }
+  },
+  created() {
+
+  },
+  methods: {
+    // 列表请求函数
+	getList: listPageV2,
+    // 列表导出函数
+    exportList: pageExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+		return defaultData
+    },
+    // 表格操作列
+    operation(h, { row, index, column }) {
+      
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+	.tab{
+		padding: 20px 20px 0 20px;
+	}
+</style>

+ 123 - 46
src/views/setting/personal/index.vue

@@ -1,59 +1,83 @@
 <template>
   <div class="app-container">
-    <div class="setting_title">个人信息</div>
-    <el-divider></el-divider>
-    <div class="userInfo">
-      <el-form label-position="left" label-width="50px">
-        <el-form-item label="账号">
-          <div>{{userInfo.userName}}</div>
-        </el-form-item>
-        <el-form-item label="姓名">
-          <div>{{userInfo.nickName}}</div>
-        </el-form-item>
-        <el-form-item label="角色">
-          <div>{{userInfo.roleName}}</div>
-        </el-form-item>
-        <el-form-item label="密码">
-          <div>{{userInfo.password | passwordFilter}} <el-button type="text" @click="dialogFormVisible = true">修改密码</el-button></div>
-        </el-form-item>
-      </el-form>
-    </div>
-    
-    <!-- 修改密码 -->
-    <el-dialog title="修改密码" :visible.sync="dialogFormVisible" :show-close="false" width="40%" :close-on-click-modal="false">
-      <el-form ref="dialogForm" :model="dialogForm" :rules="dialogFormRules" label-position="left" label-width="80px">
-        <el-form-item label="原密码" prop="oldPassword">
-          <el-input v-model="dialogForm.oldPassword" ref="password1" autocomplete="off" placeholder="请输入原密码" :type="passwordType1"></el-input>
-          <span class="show-pwd" @click="showPwd(1)">
-            <svg-icon :icon-class="passwordType1 === 'password' ? 'eye' : 'eye-open'" />
-          </span>
-        </el-form-item>
-        <el-form-item label="新密码" prop="newPassword">
-          <el-input v-model="dialogForm.newPassword" ref="password2" autocomplete="off" placeholder="请输入新密码" :type="passwordType2"></el-input>
-          <span class="show-pwd" @click="showPwd(2)">
-            <svg-icon :icon-class="passwordType2 === 'password' ? 'eye' : 'eye-open'" />
-          </span>
-        </el-form-item>
-        <el-form-item label="确认密码" prop="confirmPassword">
-          <el-input v-model="dialogForm.confirmPassword" ref="password3" autocomplete="off" placeholder="请再次输入新密码" :type="passwordType3"></el-input>
-          <span class="show-pwd" @click="showPwd(3)">
-            <svg-icon :icon-class="passwordType3 === 'password' ? 'eye' : 'eye-open'" />
-          </span>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="cancelDialogForm">取 消</el-button>
-        <el-button type="primary" @click="submitDialogForm">确定</el-button>
-      </div>
-    </el-dialog>
+    <!-- <div class="setting_title">个人信息</div>
+    <el-divider></el-divider> -->
+    <div v-if="!isRenew">
+		<div class="userInfo">
+			<el-row>
+				<el-col :span="4">
+					<div class="avatar">
+						<fileUpload :multiple="true" :fileList="[{url: userInfo.minLogo3}]" :download="false" :viewOnline="false" :limit="1" @getFiles="getFiles" />
+						<!-- <el-image style="width: 100px;height: 100px;border-radius: 50%;" :src="userInfo.minLogo3"></el-image> -->
+						<!-- <div class="img">
+							<i class="el-icon-camera"></i>
+						</div> -->
+					</div>
+				</el-col>
+				<el-col :span="8">
+					<div style="height: 100px;display: flex;flex-direction: column;justify-content: space-around;">
+						<div>用户名: {{userInfo.nickName}}</div>
+						<div>负责人: {{userInfo.linkName}}</div>
+						<div>开通时间: {{userInfo.companyOpenTime}}</div>
+					</div>
+				</el-col>
+				<el-col :span="12">
+					<div style="height: 100px;display: flex;flex-direction: column;justify-content: space-around;">
+						<div>账号: {{userInfo.userName}}</div>
+						<div>手机号码: {{userInfo.linkPhone}}</div>
+						<div class="flex">
+							<span style="color: #169dff;margin-right: 10px;">到期时间: {{userInfo.companyExpireTime}}</span>
+							<el-tooltip effect="dark" content="账号到期后将自动停用系统功能,续费后功能恢复使用!" placement="top">
+							    <i class="el-icon-question icon-question"></i>
+							</el-tooltip>
+							<el-button style="margin: 0 20px;" size="small" type="primary" @click="renew">续费</el-button>
+							<!-- <el-button size="small" plain type="primary" @click="payRecords">购买记录</el-button> -->
+						</div>
+					</div>
+				</el-col>
+			</el-row>
+		</div>
+		
+		<div style="margin-top: 60px;">
+			<el-form ref="dialogForm" :model="dialogForm" :rules="dialogFormRules" label-position="left" label-width="80px">
+			  <el-form-item label="原密码" prop="oldPassword">
+			    <el-input v-model="dialogForm.oldPassword" ref="password1" autocomplete="off" placeholder="请输入原密码" :type="passwordType1"></el-input>
+			    <span class="show-pwd" @click="showPwd(1)">
+			      <svg-icon :icon-class="passwordType1 === 'password' ? 'eye' : 'eye-open'" />
+			    </span>
+			  </el-form-item>
+			  <el-form-item label="新密码" prop="newPassword">
+			    <el-input v-model="dialogForm.newPassword" ref="password2" autocomplete="off" placeholder="请输入新密码" :type="passwordType2"></el-input>
+			    <span class="show-pwd" @click="showPwd(2)">
+			      <svg-icon :icon-class="passwordType2 === 'password' ? 'eye' : 'eye-open'" />
+			    </span>
+			  </el-form-item>
+			  <el-form-item label="确认密码" prop="confirmPassword">
+			    <el-input v-model="dialogForm.confirmPassword" ref="password3" autocomplete="off" placeholder="请再次输入新密码" :type="passwordType3"></el-input>
+			    <span class="show-pwd" @click="showPwd(3)">
+			      <svg-icon :icon-class="passwordType3 === 'password' ? 'eye' : 'eye-open'" />
+			    </span>
+			  </el-form-item>
+			</el-form>
+			<div slot="footer" class="dialog-footer" style="padding-left: 100px;">
+			  <el-button type="primary" @click="submitDialogForm">保存</el-button>
+			</div>
+		</div>
+	</div>
+	<renew :userInfo="userInfo" @back="getUserInfo" v-if="isRenew"></renew>
   </div>
 </template>
 
 <script>
 import { mapGetters } from 'vuex'
 import { getUserInfo, changePassword } from '@/api/setting'
+import uploadFile from '@/utils/upload-file'
+import fileUpload from '@/components/file-upload'
+import renew from './renew.vue'
+import request from '@/utils/request'
 
 export default {
+	components: { fileUpload, renew },
   data() {
     var validatePass = (rule, value, callback) => {
       if (value === '') {
@@ -99,6 +123,8 @@ export default {
       passwordType1: 'password',
       passwordType2: 'password',
       passwordType3: 'password',
+	  
+	  isRenew: false
     }
   },
   computed: {
@@ -112,6 +138,7 @@ export default {
   methods: {
     // 获取用户信息
     getUserInfo() {
+		this.isRenew = false
       getUserInfo({adminUserId: this.userid}).then(res => {
         this.userInfo = res.data;
       })
@@ -177,6 +204,26 @@ export default {
         })
       }
     },
+	getFiles(e){
+		if(e[0].name){
+			request({
+				url: '/admin/user/user/updateCompanyWechat',
+				method: 'post',
+				data: {
+					minLogo3: e[0].url,
+					companyWechatId: this.userInfo.companyWechatId
+				}
+			}).then(res =>{
+				if(res.code == 200){
+					this.getUserInfo()
+					this.$message.success('上传成功!');
+				}
+			})
+		}
+	},
+	renew(){
+		this.isRenew = true
+	}
   }
 }
 </script>
@@ -188,6 +235,10 @@ export default {
   .userInfo .el-form-item {
     margin-bottom: 10px;
   }
+  .flex{
+	  display: flex;
+	  align-items: center;
+  }
   .show-pwd {
     position: absolute;
     right: 15px;
@@ -196,4 +247,30 @@ export default {
     cursor: pointer;
     user-select: none;
   }
+  .userInfo{
+	  padding-top: 30px;
+	  color: #555555;
+  }
+  .avatar{
+	  position: relative;
+	  cursor: pointer;
+	  .img{
+		  width: 28px;
+		  height: 28px;
+		  border-radius: 14px;
+		  position: absolute;
+		  right: 0;
+		  bottom: 0;
+		  z-index: 9;
+		  text-align: center;
+		  line-height: 28px;
+		  background-color: #eeeeee;
+		  border: 2px solid #ffffff;
+		  color: #168dff;
+		  box-sizing: border-box;
+	  }
+  }
+  ::v-deep .images .item .img{
+	border-radius: 50% !important;
+  }
 </style>

+ 264 - 0
src/views/setting/personal/renew.vue

@@ -0,0 +1,264 @@
+<template>
+	<div class="s-page">
+		<el-page-header @back="goBack" content="续费"></el-page-header>
+		<el-divider></el-divider>
+		<el-card class="goods">
+			<div class="tishi">请选择需要购买的套餐并用微信扫码支付!</div>
+			<div class="flex">
+				<div class="item" v-for="(item,index) in goodsList" :key="index" @click="goodsIndex = index;goodsId = item.id">
+					<div class="tj" v-if="item.isFirst == 1">推荐</div>
+					<div class="year">{{item.normName}}</div>
+					<div class="new"><span style="font-size: 20px;">¥</span>{{(item.normAmount*100 - item.discountAmount*100)/100}}</div>
+					<div class="old">¥{{item.normAmount}}</div>
+					<div :class="goodsIndex == index?'bottom active':'bottom'">立省¥{{item.discountAmount}}</div>
+				</div>
+			</div>
+			<div class="flex" style="justify-content: flex-start;">
+				<el-button style="margin-top: 30px;" type="success" @click="confirmPay()">微信支付</el-button>
+			</div>
+		</el-card>
+		<el-dialog title="确认支付" :visible.sync="is_pay" width="50%" :close-on-click-modal="false" :modal-append-to-body="false" @close="close">
+			<div class="pay" v-if="!isPaySuccess">
+				<div style="font-weight: bold;font-size: 22px;">扫码支付</div>
+				<div class="ewm" ref="payQRCode"/>
+				<div>
+					<div class="flex" style="align-items: center;">
+						<div>实付: <span style="font-size: 20px;color: #ff6804;">¥</span><span style="font-size: 36px;color: #ff6804;font-weight: bold;">{{(goodsList[goodsIndex].normAmount * 100 - goodsList[goodsIndex].discountAmount * 100)/100}}</span></div>
+						<div style="margin: 0 20px;">已优惠: <span style="font-size: 18px;color: #ff6804;">¥</span><span style="font-size: 20px;color: #ff6804;">{{goodsList[goodsIndex].discountAmount}}</span></div>
+						<el-tooltip effect="dark" content="购买年限越大越优惠,优惠价格按年份递减折扣,第1年原价,第2年8折,第3年7折,第4年6折,第5年5折。举例:张三购买了3年限套餐,第1年原价为1000元,所需支付价格为:第一年1000元+第二年800元+第三年700元,需支付金额:2500元。" placement="top">
+						    <i class="el-icon-question icon-question"></i>
+						</el-tooltip>
+					</div>
+					<div style="display: flex;align-items: center;justify-content: center;margin-top: 20px;">
+						<img style="width: 30px;height: 30px;" src="@/assets/common/weixin.png" alt="">
+						<span>请使用微信扫码支付</span>
+					</div>
+				</div>
+			</div>
+			<div class="pay" v-else>
+				<img style="width: 60px;height: 60px;" src="@/assets/common/weixin.png" alt="">
+				<div style="font-weight: bold;font-size: 22px;margin: 20px 0;">支付成功</div>
+				<div class="flex" style="align-items: center;">
+					<div style="font-size: 16px;">支付金额: <span style="font-size: 20px;color: #ff6804;">¥</span><span style="font-size: 36px;color: #ff6804;font-weight: bold;">{{(goodsList[goodsIndex].normAmount * 100 - goodsList[goodsIndex].discountAmount * 100)/100}}</span></div>
+				</div>
+				<div style="margin: 50px 0;font-size: 18px;">您的账号已续费成功,最新到期时间为:<span style="color: #169dff;">{{userInfo.companyExpireTime}}</span></div>
+				<div style="display: flex;justify-content: center;">
+					<el-button size="small" type="primary" @click="goBack">知道了</el-button>
+				</div>
+			</div>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+	import { mapGetters } from 'vuex'
+	import { getUserInfo } from '@/api/setting'
+	import QRCode from "qrcodejs2";
+	import request from '@/utils/request'
+	export default {
+		data() {
+			return {
+				userInfo: {},
+				goodsList: [],
+				goodsId: '',
+				goodsIndex: 0,
+				timer:'',
+				is_pay: false,
+				is_submit: true,
+				isPaySuccess: false,
+			};
+		},
+		computed: {
+		  ...mapGetters([
+		    'userid'
+		  ])
+		},
+		created() {
+			this.getUserInfo()
+			this.getBuyList()
+		},
+		destroyed() {
+			this.clear()
+		},
+		methods: {
+			// 返回
+			goBack() {
+				this.is_pay = false
+				this.clear()
+				this.$emit('back');
+			},
+			close(){
+				this.clear()
+			},
+			getUserInfo() {
+			  getUserInfo({adminUserId: this.userid}).then(res => {
+			    this.userInfo = res.data;
+			  })
+			},
+			getBuyList(){
+				request({
+				  url: `/buy/service/config/list`,
+				  method: 'post',
+				  data: {}
+				}).then(res => {
+					this.goodsList = res.data
+					this.goodsId = res.data[0].id
+				}).catch(erro => {
+					
+				})
+			},
+			confirmPay(){
+				if(!this.is_submit){
+					return false
+				}
+				this.is_submit = false
+				setTimeout(()=>{
+					this.is_submit = true
+				},3000)
+				this.getCode()
+				this.is_pay = true
+			},
+			checkPay(payId){
+				this.timer = setInterval(()=>{
+					request({
+					  url: `/buy/service/query/pay/code`,
+					  method: 'post',
+					  params: {
+						  companyName: this.userInfo.companyName,
+						  payId
+					  }
+					}).then(res => {
+						if(res.data == true){
+							this.getUserInfo()
+							this.$refs.payQRCode.innerHTML = '';
+							this.isPaySuccess = true
+							this.clear()
+						}
+					}).catch(erro => {
+						
+					})
+				},3000)
+			},
+			clear(){
+				clearInterval(this.timer)
+			},
+			getCode(){
+				request({
+				  url: `/buy/service/generate/pay/code`,
+				  method: 'post',
+				  params: {
+					  id: this.userInfo.buyCompanyInfo,
+					  normId: this.goodsId
+				  }
+				}).then(res => {
+					if(res.code == 200){
+						this.$refs.payQRCode.innerHTML = '';
+						this.$nextTick(() => {
+						  new QRCode(this.$refs.payQRCode, {
+						    text: res.data.codeUrl,
+						    width: 200,
+						    height: 200,
+						    colorDark: "#333333", // 二维码颜色
+						    colorLight: "#ffffff", // 二维码背景色
+						    correctLevel: QRCode.CorrectLevel.L // 容错率,L/M/H
+						  });
+						  this.checkPay(res.data.id)
+						});
+					}
+				}).catch(erro => {
+					
+				})
+			}
+		}
+	};
+</script>
+
+<style scoped="scoped" lang="scss">
+	.s-page {
+		padding: 20px;
+		background-color: #ffffff;
+	}
+	.tishi{
+		height: 40px;
+		padding-left: 40px;
+		background-color: #eeeeee;
+		text-align: left;
+		font-weight: bold;
+		line-height: 40px;
+		margin-bottom: 50px;
+	}
+	.flex{
+		display: flex;
+	}
+	.goods{
+		box-sizing: border-box;
+		text-align: center;
+		.item{
+			width: 200px;
+			height: 200px;
+			margin-right: 20px;
+			background-color: #eeeeee;
+			position: relative;
+			padding-top: 40px;
+			box-sizing: border-box;
+			font-weight: bold;
+			border-radius: 10px;
+			border: 1px solid #dddddd;
+			cursor: pointer;
+			.year{
+				font-size: 20px;
+				color: #999999;
+			}
+			.new{
+				font-size: 36px;
+				color: #ff6804;
+			}
+			.old{
+				font-size: 16px;
+				color: #999999;
+				text-decoration: line-through;
+			}
+			.bottom{
+				width: 100%;
+				padding: 10px 0;
+				color: #b4916d;
+				background-color: #e6e6e6;
+				position: absolute;
+				bottom: 0;
+				left: 0;
+			}
+			.tj{
+				padding: 6px 20px;
+				position: absolute;
+				top: 0;
+				left: 0;
+				font-size: 20px;
+				font-weight: 500;
+				color: #ffffff;
+				border-radius: 0 0 26px 0;
+				background-color: #ff554e;
+			}
+			.active{
+				color: #ffffff;
+				background-color: #ff953d;
+			}
+		}
+		.ewm{
+			width: 200px;
+			height: 200px;
+		}
+		.icon-question{
+			font-size: 20px;
+			// color: #189dff;
+		}
+	}
+	.pay{
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		text-align: center;
+		.ewm{
+			margin: 30px 0;
+		}
+	}
+</style>

+ 1 - 1
src/views/userManagement/workerProfileInit/index.vue

@@ -24,7 +24,7 @@ export default {
 		[
 		  [
 		    {
-		      name: '导入模板',
+		      name: '下载导入模板',
 		      click: this.handleDownload
 		    }
 		  ],