<template>
|
<div class="comm-page">
|
<div class="form-content">
|
<FormList
|
:info="formInfo"
|
:isShowDetail="isShowDetail"
|
@handleClick="isShowDetail = !isShowDetail"
|
@updateValue="updateValue"
|
:buttonsList="[]"
|
@setValueInfo="setValueInfo"
|
></FormList>
|
</div>
|
<p>
|
<el-button type="primary" size="small" @click="onSubmit">登录</el-button>
|
</p>
|
</div>
|
</template>
|
<script>
|
/**
|
* 公共页面
|
*/
|
import CryptoJS from 'crypto-js'
|
import FormList from './components/FormList'
|
import { loginForm } from '@comprehensive/utils/formItems'
|
|
import { login } from '@comprehensive/serve/public'
|
|
export default {
|
components: {
|
FormList
|
},
|
data() {
|
return {
|
// 表单结果数据
|
valueInfo: {},
|
records: [],
|
formInfo: [...loginForm],
|
pageInfo: {
|
currentPage: 1,
|
pageSize: 10,
|
total: 0
|
},
|
// 是否显示所有表单项
|
isShowDetail: false,
|
loading: false,
|
dialogTableVisible: false,
|
dialogAppointment: false,
|
serialNo: ''
|
}
|
},
|
created() {
|
this.init()
|
},
|
methods: {
|
// 页面初始化处理
|
init() {},
|
|
// 更新表单数据或查找某项数据
|
setOrGetFormInfo(nameKey, newInfo) {
|
let { formInfo } = this
|
let index = formInfo.findIndex(({ name }) => name === nameKey)
|
let result = {}
|
if (!isNaN(index)) {
|
this.$set(this.formInfo, index, { ...formInfo[index], ...newInfo })
|
result = this.formInfo[index]
|
}
|
if (typeof newInfo === 'undefined') {
|
return result
|
}
|
},
|
|
// 设置表单结果数据
|
setValueInfo(info = {}) {
|
this.valueInfo = info
|
},
|
|
// 跳转到详情页
|
toDetail(result) {
|
const {
|
serialNo,
|
flowno,
|
customerid: customerID,
|
objecttype: objectType,
|
occurtype
|
} = result
|
|
this.$router.push(
|
`/comprehensiveTransaction/loanDetail/${serialNo}?occurType=${occurtype}&flowno=${flowno}&objectType=${objectType}&customerID=${customerID}`
|
)
|
},
|
|
// 更新数据
|
updateValue(value, item) {
|
let { name } = item
|
this.setOrGetFormInfo(name, { value })
|
},
|
|
encrypt(word) {
|
var key = CryptoJS.enc.Utf8.parse('1qaz2WSX3edc4RFV')
|
var srcs = CryptoJS.enc.Utf8.parse(word)
|
var encrypted = CryptoJS.AES.encrypt(srcs, key, {
|
mode: CryptoJS.mode.ECB,
|
padding: CryptoJS.pad.Pkcs7
|
})
|
return encrypted.toString()
|
},
|
|
// 查询操作
|
async onSubmit() {
|
let { valueInfo } = this
|
const res = await login({
|
params: {
|
...valueInfo,
|
loginPwd: this.encrypt(valueInfo.loginPwd)
|
}
|
})
|
}
|
}
|
}
|
</script>
|
<style lang="postcss" scoped>
|
.comm-page {
|
& .list-content {
|
font-size: 14px;
|
}
|
& .export-excle {
|
margin: 20px 0;
|
}
|
& .empty-section {
|
height: 50px;
|
}
|
& >>> .comm-dialog {
|
width: 1200px;
|
}
|
}
|
</style>
|