<template>
|
<div>
|
<div class="zixuancontainer">
|
<Newheader ref="newheader"></Newheader>
|
<div class="newguheader">
|
<div :class="idx == 0 ? 'newguheaderactive' : ''" @click="firstselect">
|
{{$t('hj45')}}
|
</div>
|
<div :class="idx == 1 ? 'newguheaderactive' : ''" @click="twoselect">
|
{{$t('sgjl')}}
|
</div>
|
</div>
|
<div style="background: #25262a;" v-if="idx == 0">
|
<el-table :data="zixuanlist" :highlight-current-row="false" border style="width: 100%"
|
v-loading="loading" element-loading-spinner="el-icon-loading"
|
element-loading-background="rgba(37,38,42, 0.8)" :height="tableHeight" @row-click="handleTableRow"
|
:header-cell-style="{ 'padding': '2px 0', 'background': 'rgb(37,38,42)', 'color': '#9d9d9d', 'font-size': '12px' }">
|
<el-table-column prop="name" :label="$t('MingCheng')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.name ? scope.row.name : '--' }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="code" :label="$t('dm')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.code ? scope.row.code : '--' }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="price":label="$t('xj')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.price ? scope.row.price : '--' }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="orderNumber" :label="$t('zdgml')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.orderNumber ? scope.row.orderNumber : '--' }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="subscribeTime" :label="$t('hj59')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.subscribeTime | formatTime(that) }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="subscriptionTime" :label="$t('hj60')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.subscriptionTime | formatTime(that) }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="type" :label="$t('hj42')">
|
<template slot-scope="scope">
|
<span style="cursor: pointer;" class="contents"
|
:class="scope.row.type == 2 ? 'greens' : 'reds'">
|
{{ scope.row.type == 2 ? $t('hj46') : $t('hj45') }}
|
</span>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
<div style="background: #25262a;" v-if="idx == 1">
|
<el-table :data="recordList" :highlight-current-row="false" border style="width: 100%"
|
v-loading="loading" element-loading-spinner="el-icon-loading"
|
element-loading-background="rgba(37,38,42, 0.8)" :height="tableHeight"
|
:header-cell-style="{ 'padding': '2px 0', 'background': 'rgb(37,38,42)', 'color': '#9d9d9d', 'font-size': '12px' }">
|
<el-table-column prop="newName" :label="$t('MingCheng')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.newName ? scope.row.newName : '--' }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="newCode" :label="$t('dm')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.newCode ? scope.row.newCode : '--' }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="buyPrice" :label="$t('hj98')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.buyPrice ? scope.row.buyPrice : '--' }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="applyNums" :label="$t('hj57')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.applyNums ? scope.row.applyNums : '--' }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="bond" :label="$t('bzj')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.bond ? scope.row.bond : '--' }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="addTime" :label="$t('hj59')">
|
<template slot-scope="scope">
|
<span class="contents">
|
{{ scope.row.addTime }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="type" :label="$t('hj42')">
|
<template slot-scope="scope">
|
<span style="cursor: pointer;" class="contents"
|
:class="scope.row.type == 2 ? 'greens' : 'reds'">
|
{{ scope.row.type == 2 ? $t('hj46') : $t('hj45') }}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="status" :label="$t('hj42')">
|
<template slot-scope="scope">
|
<span style="cursor: pointer;" class="contents"
|
v-if="!(scope.row.type == 1 && scope.row.status == 3)">
|
{{ scope.row.status == 1 ? $t('hj131') : scope.row.status == 2 ? $t('hj132') : (scope.row.status ==
|
3 && scope.row.type != 1) ? '已中签' : scope.row.status == 4 ?
|
$t('hj134') : scope.row.status == 5 ? $t('hj135') : ''
|
}}
|
</span>
|
<span v-if="scope.row.type == 1 && scope.row.status == 3" class="renjiao"
|
@click="getrenjiao(scope.row.id)">
|
认缴
|
</span>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
<Newfooter></Newfooter>
|
<el-dialog :title="(currentitem.type == 2 ? $t('hj46') : $t('hj45')) + '(' + currentitem.code + ')'" center
|
:visible.sync="dialogVisible" width="400px">
|
<div>
|
<el-input :placeholder="$t('qsrsgsl')" v-model="sgvalue"></el-input>
|
<div class="shengoutime">
|
<p>{{$t('maxsg')}}:{{ currentitem.orderNumber }}</p>
|
</div>
|
</div>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="dialogVisible = false">{{$t('qxx')}}</el-button>
|
<el-button type="primary" @click="getshengou">{{$t('qr')}}</el-button>
|
</span>
|
</el-dialog>
|
</div>
|
</div>
|
</template>
|
<script>
|
import * as api from "../../axios/api";
|
import Newheader from '@/components/newheader';
|
import Newfooter from '@/components/newfooters';
|
export default {
|
components: {
|
Newheader,
|
Newfooter
|
},
|
data() {
|
return {
|
windowWidth: document.documentElement.clientWidth, //实时屏幕宽度
|
windowHeight: document.documentElement.clientHeight, //实时屏幕高
|
tableHeight: (document.documentElement.clientHeight - 104) + 'px',
|
keyWords: '',
|
pageNum: 1,
|
pageSize: 15,
|
zixuanlist: [],
|
loading: true,
|
isshow: true,
|
dialogVisible: false,
|
that: this,
|
sgvalue: '',
|
currentitem: {},
|
userData: '',
|
idx: 0,
|
recordList: []
|
}
|
},
|
computed: {
|
},
|
watch: {
|
windowHeight(val) {
|
let that = this;
|
console.log("实时屏幕高度:", val, that.windowHeight);
|
},
|
windowWidth(val) {
|
let that = this;
|
console.log("实时屏幕宽度:", val, that.windowHeight);
|
}
|
},
|
mounted() {
|
var that = this;
|
window.onresize = () => {
|
return (() => {
|
window.fullHeight = document.documentElement.clientHeight;
|
window.fullWidth = document.documentElement.clientWidth;
|
that.windowHeight = window.fullHeight; // 高
|
that.windowWidth = window.fullWidth; // 宽
|
that.$nextTick(() => {
|
that.tableHeight = (that.windowHeight - 104) + 'px'
|
})
|
})()
|
};
|
this.getzixuan()
|
this.getUserInfo()
|
},
|
beforeDestroy() {
|
window.onresize = null;
|
this.isshow = false
|
},
|
filters: {
|
formatTime(value, that) {
|
if (value) {
|
return that.dayjs(value).format('YYYY-MM-DD HH:mm:ss')
|
} else {
|
return '--'
|
}
|
}
|
},
|
methods: {
|
getrenjiao(val) {
|
this.$confirm(this.$t('hj251'), this.$t('hj165'), {
|
confirmButtonText: this.$t('hj161'),
|
cancelButtonText: this.$t('hj106'),
|
type: 'warning'
|
}).then(async () => {
|
let opt = {
|
id: val
|
}
|
let data = await api.submitSubscribe(opt)
|
if (data.status == 0) {
|
this.$message({
|
message: data.msg,
|
type: 'success'
|
});
|
this.getnewguRecord();
|
this.$refs.newheader.getUserInfo()
|
} else {
|
this.$message({
|
message: data.msg,
|
type: 'error'
|
});
|
}
|
}).catch(() => {
|
|
});
|
},
|
firstselect() {
|
this.idx = 0;
|
this.pageNum = 1
|
this.zixuanlist = []
|
this.loading = true;
|
this.tableHeight = (document.documentElement.clientHeight - 104) + 'px',
|
this.getzixuan()
|
},
|
twoselect() {
|
this.idx = 1;
|
this.pageNum = 1
|
this.recordList = []
|
this.getnewguRecord()
|
},
|
async getnewguRecord() {
|
this.loading = true;
|
let params = {
|
pageNum: this.pageNum,
|
pageSize: this.pageSize,
|
}
|
let res = await api.getOneSubscribeByUserId(params);
|
if (res.status == 0) {
|
this.recordList = res.data;
|
this.loading = false;
|
}
|
},
|
async getzixuan() {
|
var that = this;
|
var opt = {
|
keyWords: this.keyWords,
|
pageNum: this.pageNum,
|
pageSize: this.pageSize,
|
};
|
var data = await api.getNewguList(opt);
|
if (data.data.list.length > 0) {
|
this.zixuanlist = data.data.list
|
// for (const i in data.data.list) {
|
// this.zixuanlist.push(data.data.list[i])
|
// }
|
// if (that.isshow) {
|
// setTimeout(() => {
|
// that.pageNum++
|
// that.getzixuan()
|
// }, 100);
|
// }
|
if (this.loading == true && this.pageNum >= 1) {
|
this.loading = false;
|
}
|
} else {
|
this.loading = false;
|
}
|
},
|
handleTableRow(row, event, column) {
|
console.log(row, event, column)
|
this.dialogVisible = true
|
this.currentitem = row
|
},
|
async getUserInfo() {
|
let data = await api.getUserInfo();
|
if (data.status == 0) {
|
this.userData = data.data;
|
}
|
},
|
async getshengou() {
|
if (!this.sgvalue) {
|
this.$message({
|
message: this.$t('qsrsgsl'),
|
type: 'warning'
|
});
|
return
|
}
|
if (this.sgvalue < 1) {
|
this.$message({
|
message: this.$t('sgtips'),
|
type: 'warning'
|
});
|
return
|
}
|
if (this.sgvalue > this.currentitem.orderNumber) {
|
this.$message({
|
message: this.$t('sgtips2'),
|
type: 'warning'
|
});
|
return
|
}
|
var opt = {
|
newCode: this.currentitem.code,
|
applyNums: this.sgvalue,
|
phone: this.userData.phone,
|
};
|
var data = await api.getNewguAdd(opt);
|
if (data.status == 0) {
|
this.dialogVisible = false
|
this.$message({
|
message: this.$t('hj70'),
|
type: 'success'
|
});
|
this.currentitem = ''
|
} else {
|
this.$message({
|
message: data.msg,
|
type: 'warning'
|
});
|
}
|
},
|
}
|
}
|
</script>
|
<style lang="less" scoped>
|
.bgblue {
|
color: #1890ff;
|
background: #e6f7ff;
|
border-color: #91d5ff;
|
padding: 2px 7px;
|
font-size: 12px;
|
border-radius: 2px;
|
|
}
|
|
.bgpurple {
|
color: #722ed1;
|
background: #f9f0ff;
|
border-color: #d3adf7;
|
padding: 2px 7px;
|
font-size: 12px;
|
border-radius: 2px;
|
}
|
|
.el-table {
|
background: #25262a;
|
}
|
|
/deep/ .el-table__body td {
|
color: #fff !important;
|
font-size: 14px;
|
}
|
|
/deep/ .el-table tbody tr:hover>td,
|
.el-table tbody tr:hover>tr,
|
.el-table tbody tr:hover .el-table tbody tr td {
|
background-color: rgb(33, 59, 76) !important;
|
background: rgb(33, 59, 76) !important;
|
}
|
|
// /deep/.el-table--enable-row-hover .el-table__body tr:hover > td {
|
// background-color: rgb(19, 75, 132) !important; //颜色必须是rgb
|
// }
|
/deep/ .el-table__body-wrapper {
|
background-color: rgb(37, 38, 42) !important;
|
}
|
|
/deep/ .el-table__body-wrapper::-webkit-scrollbar-corner {
|
width: 8px;
|
height: 8px;
|
display: none;
|
}
|
|
/deep/ .el-table--border::after,
|
.el-table--group::after,
|
.el-table::before {
|
background-color: rgb(37, 38, 42);
|
}
|
|
/deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb {
|
background: rgb(37, 38, 42);
|
/*滚动条里面小方块*/
|
}
|
|
/deep/ .el-table__body-wrapper::-webkit-scrollbar-track {
|
// -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
border-radius: unset;
|
/*滚动条的背景区域的圆角*/
|
background-color: rgb(37, 38, 42);
|
/*滚动条的背景颜色*/
|
}
|
|
/deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb {
|
border-radius: unset;
|
/*滚动条的圆角*/
|
// -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
background-color: rgb(50, 51, 55);
|
/*滚动条的背景颜色*/
|
}
|
|
.greens {
|
color: rgb(22, 135, 64) !important;
|
}
|
|
.blues {
|
color: rgb(3, 182, 191) !important;
|
}
|
|
.reds {
|
color: rgb(237, 58, 59) !important;
|
}
|
|
.zixuancontainer {
|
background: #25262a;
|
height: calc(100vh - 34px);
|
overflow: unset;
|
|
.newguheader {
|
display: flex;
|
align-items: center;
|
color: #c9c9c9;
|
height: 30px;
|
font-size: 12px;
|
background: #323337;
|
|
div {
|
padding: 0 20px;
|
line-height: 30px;
|
cursor: pointer;
|
border: 1px solid #4a4b51;
|
}
|
|
.newguheaderactive {
|
background: rgb(74, 75, 81);
|
color: #fff;
|
}
|
}
|
|
.renjiao {
|
text-align: center;
|
color: #c9c9c9;
|
cursor: pointer;
|
border: 1px solid #757575;
|
padding: 0 6px;
|
border-radius: 4px;
|
background: rgb(50, 51, 55);
|
}
|
|
.shengoutime {
|
line-height: 2;
|
margin-bottom: 10px;
|
color: #999;
|
}
|
}
|
</style>
|