租赁平台登录

This commit is contained in:
zhouzy062 2024-02-27 18:02:33 +08:00
parent 8b1ecec6c1
commit 15c8119f94
6 changed files with 160 additions and 104 deletions

View File

@ -11,11 +11,11 @@ export function getSltAgreementInfo(query) {
// 查询费用结算申请详情 // 查询费用结算申请详情
export function getSltInfo(query) { export function getSltInfo(params){
return request({ return request({
url: '/material/sltAgreementInfo/getSltInfo', url: '/material/sltAgreementInfo/getSltInfo',
method: 'get', method: 'post',
params: query data: params
}) })
} }
@ -37,4 +37,3 @@ export function getSltInfo(query) {

View File

@ -87,7 +87,7 @@ export function checkCode(data) {
//南网机具认证中心登录 //南网机具认证中心登录1
export function SsoLogin(data) { export function SsoLogin(data) {
return request({ return request({
url: '/auth/onlineApprove', url: '/auth/onlineApprove',
@ -100,4 +100,17 @@ export function SsoLogin(data) {
} }
//南网机具认证中心登录2
export function loginByMall(data) {
return request({
url: '/auth/loginByMall',
headers: {
isToken: false
},
method: 'post',
data: data
})
}

View File

@ -1,4 +1,4 @@
import { login, logout, getInfo, refreshToken,checkCode,SsoLogin } from '@/api/login' import { login, logout, getInfo, refreshToken,checkCode,loginByMall } from '@/api/login'
import { getToken, setToken, setExpiresIn, removeToken } from '@/utils/auth' import { getToken, setToken, setExpiresIn, removeToken } from '@/utils/auth'
import { Notification, MessageBox, Message, Loading } from 'element-ui' import { Notification, MessageBox, Message, Loading } from 'element-ui'
const user = { const user = {
@ -55,7 +55,7 @@ const user = {
}) })
}) })
}, },
// 验证码 登录 // 短信验证码 登录
textLogin({ commit }, userInfo) { textLogin({ commit }, userInfo) {
console.log(userInfo) console.log(userInfo)
let params = { let params = {
@ -78,20 +78,20 @@ const user = {
}) })
}) })
}, },
//机具租赁平台跳转登录---南网
ssoLogin({ commit }, param) { ssoLogin({ commit }, param) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
SsoLogin(param).then(res => { loginByMall(param).then(res => {
console.log(res) console.log(res)
let data = res.data let data = res.data
if(res.code==200){ if(res.code==200){
console.log('登录成功1111111') // console.log('登录成功1111111')
setToken(data.access_token) setToken(data.access_token)
commit('SET_TOKEN', data.access_token) commit('SET_TOKEN', data.access_token)
setExpiresIn(data.expires_in) setExpiresIn(data.expires_in)
commit('SET_EXPIRES_IN', data.expires_in) commit('SET_EXPIRES_IN', data.expires_in)
}else{ }else{
console.log('登录失败22222222') // console.log('登录失败22222222')
this.$modal.msgError('登录失败'); this.$modal.msgError('登录失败');
} }
resolve() resolve()

View File

@ -8,7 +8,7 @@
<el-button type="primary" size="mini" >维修明细导出</el-button> <el-button type="primary" size="mini" >维修明细导出</el-button>
<el-button type="primary" size="mini" >报废明细导出</el-button> <el-button type="primary" size="mini" >报废明细导出</el-button>
<el-button type="warning" size="mini" >全部明细导出</el-button> <el-button type="warning" size="mini" >全部明细导出</el-button>
<el-button type="success" size="mini" >提交</el-button> <el-button type="success" size="mini" @click="handleAdd">提交</el-button>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-button type="danger" size="mini" style="float: right;" @click="handleBack">返回</el-button> <el-button type="danger" size="mini" style="float: right;" @click="handleBack">返回</el-button>
@ -20,108 +20,118 @@
<div> <div>
<el-table v-loading="loading" :data="agreementList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="leaseList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" /> --> <!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="租赁费用明细" align="center"> <el-table-column label="租赁费用明细" align="center">
<el-table-column label="序号" align="center" type="index" width="60"/> <el-table-column label="序号" align="center" type="index" width="60"/>
<el-table-column label="结算单位名称" align="center" prop="agreementCode" :show-overflow-tooltip="true" /> <el-table-column label="结算单位名称" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="结算工程名称" align="center" prop="contractCode" :show-overflow-tooltip="true" /> <el-table-column label="结算工程名称" align="center" prop="projectName" :show-overflow-tooltip="true" />
<el-table-column label="设备名称" align="center" prop="fileName" :show-overflow-tooltip="true" /> <el-table-column label="设备名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="signTime" :show-overflow-tooltip="true" /> <el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" /> <el-table-column label="计量单位" align="center" prop="nuitName" :show-overflow-tooltip="true" />
<el-table-column label="租赁单价" align="center" prop="projectName" :show-overflow-tooltip="true" /> <el-table-column label="租赁单价" align="center" prop="leasePrice" :show-overflow-tooltip="true" />
<el-table-column label="租赁数量" align="center" prop="planStartTime" :show-overflow-tooltip="true" /> <el-table-column label="租赁数量" align="center" prop="num" :show-overflow-tooltip="true" />
<el-table-column label="租赁日期" align="center" prop="leaseDay" :show-overflow-tooltip="true" /> <el-table-column label="租赁日期" align="center" prop="startTime" :show-overflow-tooltip="true" />
<el-table-column label="归还数量" align="center" prop="authPerson" :show-overflow-tooltip="true" /> <!-- <el-table-column label="归还数量" align="center" prop="" :show-overflow-tooltip="true" /> -->
<el-table-column label="归还日期 " align="center" prop="phone" :show-overflow-tooltip="true" /> <el-table-column label="归还日期 " align="center" prop="endTime" :show-overflow-tooltip="true" />
<el-table-column label="租赁天数" align="center" prop="remark" :show-overflow-tooltip="true" /> <el-table-column label="租赁天数" align="center" prop="leaseDays" :show-overflow-tooltip="true" />
<el-table-column label="外部租赁费用" align="center" prop="remark" :show-overflow-tooltip="true" /> <el-table-column label="外部租赁费用" align="center" prop="costs" :show-overflow-tooltip="true" />
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- <pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/> -->
<div style="width: 100%;text-align: right;padding: 20px 20px;">租赁费用小计97010.08</div> <div style="width: 100%;text-align: right;padding: 20px 20px;">租赁费用小计97010.08</div>
</div> </div>
<div> <div>
<el-table v-loading="loading" :data="agreementList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="repairList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" /> --> <!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="维修费用明细" align="center"> <el-table-column label="维修费用明细" align="center">
<el-table-column label="序号" align="center" type="index" width="60"/> <el-table-column label="序号" align="center" type="index" width="60"/>
<el-table-column label="结算单位名称" align="center" prop="agreementCode" :show-overflow-tooltip="true" /> <el-table-column label="结算单位名称" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="结算工程名称" align="center" prop="contractCode" :show-overflow-tooltip="true" /> <el-table-column label="结算工程名称" align="center" prop="projectName" :show-overflow-tooltip="true" />
<el-table-column label="设备名称" align="center" prop="fileName" :show-overflow-tooltip="true" /> <el-table-column label="设备名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="signTime" :show-overflow-tooltip="true" /> <el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" /> <el-table-column label="计量单位" align="center" prop="nuitName" :show-overflow-tooltip="true" />
<el-table-column label="维修数量" align="center" prop="projectName" :show-overflow-tooltip="true" /> <el-table-column label="计量单位" align="center" prop="nuitName" :show-overflow-tooltip="true" />
<el-table-column label="维修费用" align="center" prop="planStartTime" :show-overflow-tooltip="true" /> <el-table-column label="维修状态" align="center" prop="repairStatus" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.repairStatus==0">未审核</span>
<span v-if="scope.row.repairStatus==1">已审核</span>
</template>
</el-table-column>
<el-table-column label="维修数量" align="center" prop="num" :show-overflow-tooltip="true" />
<el-table-column label="维修费用" align="center" prop="costs" :show-overflow-tooltip="true" />
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- <pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/> -->
<div style="width: 100%;text-align: right;padding: 20px 20px;">维修费用小计230</div> <div style="width: 100%;text-align: right;padding: 20px 20px;">维修费用小计230</div>
</div> </div>
<div> <div>
<el-table v-loading="loading" :data="agreementList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="scrapList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" /> --> <!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="报废费用明细" align="center"> <el-table-column label="报废费用明细" align="center">
<el-table-column label="序号" align="center" type="index" width="60"/> <el-table-column label="序号" align="center" type="index" width="60"/>
<el-table-column label="结算单位名称" align="center" prop="agreementCode" :show-overflow-tooltip="true" /> <el-table-column label="结算单位名称" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="结算工程名称" align="center" prop="contractCode" :show-overflow-tooltip="true" /> <el-table-column label="结算工程名称" align="center" prop="projectName" :show-overflow-tooltip="true" />
<el-table-column label="设备名称" align="center" prop="fileName" :show-overflow-tooltip="true" /> <el-table-column label="设备名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="signTime" :show-overflow-tooltip="true" /> <el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" /> <el-table-column label="计量单位" align="center" prop="nuitName" :show-overflow-tooltip="true" />
<el-table-column label="报废数量" align="center" prop="projectName" :show-overflow-tooltip="true" /> <el-table-column label="报废数量" align="center" prop="num" :show-overflow-tooltip="true" />
<el-table-column label="报废原因" align="center" prop="planStartTime" :show-overflow-tooltip="true" /> <el-table-column label="报废原因" align="center" prop="scrapType" :show-overflow-tooltip="true">
<el-table-column label="维修费用" align="center" prop="planStartTime" :show-overflow-tooltip="true" /> <template slot-scope="scope">
<span v-if="scope.row.scrapType==0">自然</span>
<span v-if="scope.row.scrapType==1">人为</span>
</template>
</el-table-column>
<el-table-column label="维修费用" align="center" prop="costs" :show-overflow-tooltip="true" />
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- <pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/> -->
<div style="width: 100%;text-align: right;padding: 20px 20px;">报废费用小计230</div> <div style="width: 100%;text-align: right;padding: 20px 20px;">报废费用小计230</div>
</div> </div>
<div> <div>
<el-table v-loading="loading" :data="agreementList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="loseList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" /> --> <!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="丢失费用明细" align="center"> <el-table-column label="丢失费用明细" align="center">
<el-table-column label="序号" align="center" type="index" width="60"/> <el-table-column label="序号" align="center" type="index" width="60"/>
<el-table-column label="结算单位名称" align="center" prop="agreementCode" :show-overflow-tooltip="true" /> <el-table-column label="结算单位名称" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="结算工程名称" align="center" prop="contractCode" :show-overflow-tooltip="true" /> <el-table-column label="结算工程名称" align="center" prop="projectName" :show-overflow-tooltip="true" />
<el-table-column label="设备名称" align="center" prop="fileName" :show-overflow-tooltip="true" /> <el-table-column label="设备名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="signTime" :show-overflow-tooltip="true" /> <el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" /> <el-table-column label="计量单位" align="center" prop="nuitName" :show-overflow-tooltip="true" />
<el-table-column label="丢失数量" align="center" prop="projectName" :show-overflow-tooltip="true" /> <el-table-column label="丢失数量" align="center" prop="num" :show-overflow-tooltip="true" />
<el-table-column label="丢失费用" align="center" prop="planStartTime" :show-overflow-tooltip="true" /> <el-table-column label="丢失费用" align="center" prop="costs" :show-overflow-tooltip="true" />
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- <pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/> -->
<div style="width: 100%;text-align: right;padding: 20px 20px;">丢失费用小计230</div> <div style="width: 100%;text-align: right;padding: 20px 20px;">丢失费用小计230</div>
</div> </div>
<el-dialog title="费用结算提交" :visible.sync="applyVisible" width="1000px">
<div>
<el-table v-loading="loading" :data="applyList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="报废费用明细" align="center">
<el-table-column label="序号" align="center" type="index" width="60"/>
<el-table-column label="结算单位名称" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="结算工程名称" align="center" prop="contractCode" :show-overflow-tooltip="true" />
<el-table-column label="设备名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="报废数量" align="center" prop="num" :show-overflow-tooltip="true" />
<el-table-column label="报废原因" align="center" prop="planStartTime" :show-overflow-tooltip="true" />
<el-table-column label="维修费用" align="center" prop="costs" :show-overflow-tooltip="true" />
</el-table-column>
</el-table>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="applyVisible=false"> </el-button>
<el-button type="primary"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -205,11 +215,19 @@
{ required: true, message: "通知内容不能为空", trigger: "blur" } { required: true, message: "通知内容不能为空", trigger: "blur" }
] ]
}, },
leaseList:[],//
repairList:[],//
scrapList:[],//
loseList:[],//
deptName: undefined, deptName: undefined,
applyVisible:false,
applyList:[]
}; };
}, },
created() { created() {
this.getList(); this.rowData = this.$route.query.rowData;
console.log(this.rowData)
this.getDataAll();
// this.getUnitList(); // this.getUnitList();
// this.getProjectList(); // this.getProjectList();
@ -227,16 +245,28 @@
}) })
}, },
/** 查询字典类型列表 */ /** 查询列表 */
getList() { getDataAll() {
this.loading = true; this.loading = true;
getAgreementList(this.queryParams).then(response => { getSltInfo(this.rowData).then(response => {
this.agreementList = response.rows; // this.agreementList = response.rows;
this.total = response.total; this.leaseList = response.data.leaseList;//
this.repairList = response.data.repairList;//
this.scrapList = response.data.scrapList;//
this.loseList = response.data.loseList;//
this.loading = false; this.loading = false;
} }
); );
}, },
//
handleAdd() {
this.applyVisible = true
},
//
handleBack(){ handleBack(){
this.$tab.closeOpenPage({ this.$tab.closeOpenPage({
path:'/cost/cost/costApplyList', path:'/cost/cost/costApplyList',
@ -251,20 +281,6 @@
this.single = selection.length!=1 this.single = selection.length!=1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 删除按钮操作 */
handleDelete(row) {
// const agreementId = row.agreementId;
// let param = {
// agreementId:row.agreementId+''
// }
// this.$modal.confirm('').then(function() {
// return removeAgreement(param);
// }).then(() => {
// this.getList();
// this.$modal.msgSuccess("");
// }).catch(() => {});
},
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// this.download('material/agreementInfo/export', { // this.download('material/agreementInfo/export', {

View File

@ -126,7 +126,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
keyWord: undefined, keyWord: undefined,
sltStatus:'0'
}, },
// //
form: {}, form: {},
@ -217,7 +217,7 @@ export default {
this.$tab.closeOpenPage({ this.$tab.closeOpenPage({
path:'/cost/cost/costApplyAdd', path:'/cost/cost/costApplyAdd',
query:{ query:{
isEdit:true rowData:[row]
} }
}) })
}, },

View File

@ -120,7 +120,7 @@
</template> </template>
<script> <script>
import {getCodeImg,sendCode} from "@/api/login"; import {getCodeImg,sendCode,loginByMall} from "@/api/login";
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import {encrypt, decrypt} from '@/utils/jsencrypt' import {encrypt, decrypt} from '@/utils/jsencrypt'
@ -162,18 +162,29 @@ export default {
readonlyFlag: true, readonlyFlag: true,
show: 1, show: 1,
count: '', count: '',
timer: null timer: null,
loginParams:{}//
}; };
}, },
watch: { watch: {
$route: { $route: {
handler: function (route) { handler: function (route) {
this.redirect = route.query && route.query.redirect; this.redirect = route.query && route.query.redirect;
if(this.$route.query.redirect.split("?").length>0){
let arr = this.$route.query.redirect.split("?")[1].split("&")||[]
arr.forEach((item,index)=>{
this.$set(this.loginParams, item.split("=")[0]+"", item.split("=")[1]);
})
}
}, },
immediate: true immediate: true
} }
}, },
created() { created() {
// console.log(this.$route.query.redirect.split("?")[1])
if(JSON.stringify(this.loginParams) != '{}'){
this.jumpLogin()
}
this.getCode(); this.getCode();
this.getCookie(); this.getCookie();
}, },
@ -193,8 +204,6 @@ export default {
}, },
// //
getTextCode() { getTextCode() {
const regExp = /^1[3456789]\d{9}$/; const regExp = /^1[3456789]\d{9}$/;
if (regExp.test(this.loginForm.phone)) { if (regExp.test(this.loginForm.phone)) {
console.log('手机号格式正确'); console.log('手机号格式正确');
@ -222,6 +231,7 @@ export default {
} }
}, },
//
textLogin(){ textLogin(){
// checkCode // checkCode
console.log(this.loginForm) console.log(this.loginForm)
@ -248,6 +258,24 @@ export default {
} }
}); });
}, },
//
jumpLogin(){
this.loading = true;
let param = {
token:this.loginParams.token,
username:this.loginParams.userName
}
// console.log(param)
this.$store.dispatch("ssoLogin", param).then(() => {
//
this.$router.push({path: this.redirect || "/"}).catch(() => {
});
}).catch(() => {
this.loading = false;
//
// window.location.replace('https://test-sso.csgmall.com.cn/?client_id=549OWptc&theme=zhgc_storage&response_type=code&redirect_uri=https%3A%2F%2Ftest-cc.zhgkxt.com')
});
},
getCookie() { getCookie() {
const username = Cookies.get("username"); const username = Cookies.get("username");
const password = Cookies.get("password"); const password = Cookies.get("password");