城阳运营端pc前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

430 lines
12 KiB

5 years ago
<template>
<div>
<el-card shadow="never"
class="aui-card--fill">
<div class="mod-demo__demo}">
5 years ago
5 years ago
<el-form :inline="true"
5 years ago
:model="tableParams"
@keyup.enter.native="loadData()">
5 years ago
<el-form-item>
5 years ago
<el-select v-model="tableParams.customerId"
5 years ago
placeholder="客户">
5 years ago
<el-option v-for="item in form.data['client']"
:key="item.customerId"
:label="item.customerName"
:value="item.customerId">
5 years ago
</el-option>
</el-select>
</el-form-item>
<el-form-item>
5 years ago
<el-select v-model="tableParams.clientType"
5 years ago
placeholder="类型">
5 years ago
<el-option v-for="item in form.data['clientType']"
5 years ago
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
5 years ago
<el-select v-model="tableParams.state"
5 years ago
placeholder="状态">
5 years ago
<el-option v-for="item in form.data['state']"
5 years ago
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item>
5 years ago
<el-date-picker v-model="tableParams.commitDate"
5 years ago
type="daterange"
range-separator="至"
start-placeholder="发布开始日期"
end-placeholder="发布结束日期"
:default-value="new Date()"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item> -->
5 years ago
<!-- <el-form-item>
<el-date-picker v-model="tableParams.submitDate"
5 years ago
type="daterange"
range-separator="至"
start-placeholder="审核开始日期"
end-placeholder="审核结束日期"
:default-value="new Date()"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
5 years ago
</el-form-item> -->
5 years ago
<el-form-item>
5 years ago
<el-button @click="loadData()">查询</el-button>
5 years ago
</el-form-item>
<el-form-item>
<el-button type="primary"
@click="commitCode()">上传代码</el-button>
</el-form-item>
</el-form>
5 years ago
<c-table column-type="index"
ref="table"
:url="tableUrl"
:params="tableParams"
keyword="CommitCodeList"
:operations="operations"
:tableHeight="tableHeight"
@submitCode="submitCode"
@showQRCode="showQRCode"
@submitRecall="submitRecall"
@issueCode="issueCode"
@submitFailReason="submitFailReason"
@operHistory="operHistory">
</c-table>
-
5 years ago
</div>
</el-card>
<c-dialog :title="commitDia.title"
:visible="commitDia.visible"
:showConfirm="false"
@cancel="commitDiaCancel">
5 years ago
<commit-form ref="ref_commit_form"
:optionData="optionData"
@commitConfirm="commitConfirm"></commit-form>
5 years ago
</c-dialog>
<c-dialog :title="submitDia.title"
:visible="submitDia.visible"
:dialogHeight="1.1"
@cancel="submitDiaCancel">
5 years ago
<submit-form ref="ref_submit_form"
:feedbackShow="feedbackShow"></submit-form>
5 years ago
</c-dialog>
<c-dialog :showFooter="false"
:title="operDia.title"
:visible="operDia.visible"
@cancel="operDiaCancel">
<oper-history ref="ref_oper_history"></oper-history>
</c-dialog>
5 years ago
<c-dialog :showFooter="false"
:title="'二维码'"
:visible="operDia.visible"
@cancel="operDiaCancel">
<oper-history ref="ref_oper_history"></oper-history>
</c-dialog>
5 years ago
</div>
</template>
<script>
5 years ago
import CDialog from '@c/CDialog'
import CTable from '@c/CTable'
5 years ago
import SubmitForm from './SubmitForm'
import CommitForm from './CommitForm'
import OperHistory from './OperHistory'
import { mapGetters } from 'vuex'
5 years ago
export default {
data () {
return {
loading: false,
5 years ago
// 查询相关
tableParams: {
customerId: '', // 客户
clientType: '', // 类型
5 years ago
state: '', // 代码状态
commitDate: '', // 发布日期
submitDate: '' // 审核日期
},
5 years ago
// 列表相关
// tableUrl: '/third/code/uploadlist',
tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/third/code/uploadlist',
// 列表操作栏的操作项数组
operations: [
{
lable: '提交审核', // 按钮显示名称
size: 'mini',
style: 'margin: 0 6px;',
type: 'text',
slot: '',
plain: false,
methodName: 'submitCode', // 回调方法名称
isShow: function (row) {
5 years ago
return true
// if (row.status === 'unaudited' || row.status === 'audit_failed' || row.status === 'withdrawn') {
// return true
// } else {
// return false
// }
5 years ago
}
},
{
lable: '二维码', // 按钮显示名称
size: 'mini',
style: 'margin: 0 6px;',
type: 'text',
slot: '',
plain: false,
methodName: 'showQRCode', // 回调方法名称
isShow: function (row) {
5 years ago
return true
// if (row.status === 'unaudited') {
// return true
// } else {
// return false
// }
5 years ago
}
},
{
lable: '审核撤回', // 按钮显示名称
size: 'mini',
style: 'margin: 0 6px;',
type: 'text',
slot: '',
plain: false,
methodName: 'submitRecall', // 回调方法名称
isShow: function (row) {
5 years ago
return true
// if (row.status === 'auditing') {
// return true
// } else {
// return false
// }
5 years ago
}
},
{
lable: '发布', // 按钮显示名称
size: 'mini',
style: 'margin: 0 6px;',
type: 'text',
slot: '',
plain: false,
methodName: 'issueCode', // 回调方法名称
isShow: function (row) {
5 years ago
return true
// if (row.status === 'audit_success' || row.status === 'release_failed') {
// return true
// } else {
// return false
// }
5 years ago
}
},
{
lable: '审核失败原因', // 按钮显示名称
size: 'mini',
style: 'margin: 0 6px;',
type: 'text',
slot: '',
plain: false,
methodName: 'submitFailReason', // 回调方法名称
isShow: function (row) {
5 years ago
return true
// if (row.status === 'audit_failed') {
// return true
// } else {
// return false
// }
5 years ago
}
},
{
lable: '操作历史', // 按钮显示名称
size: 'mini',
style: 'margin: 0 6px;',
type: 'text',
slot: '',
plain: false,
methodName: 'operHistory',
isShow: 'show'
}
],
5 years ago
// 上传弹出框相关
commitDia: {
title: '',
visible: false
},
5 years ago
optionData: Object,
5 years ago
// 审核弹出框相关
5 years ago
feedbackShow: false,
5 years ago
submitDia: {
title: '',
visible: false
},
// 操作历史弹出框相关
operDia: {
title: '',
visible: false
},
// 查询栏下拉框数据
5 years ago
form: {
dataUrl: [], // 下拉框/单选框/复选框等获取数据的url
data: { // 全部下拉框数据
clientType: [
{
value: 'resi',
label: '居民端'
},
{
value: 'work',
label: '工作端'
}
],
state: [
{
value: 'unaudited',
label: '未审核'
},
{
value: 'auditing',
label: '审核中'
},
{
value: 'audit_success',
label: '审核成功'
},
{
value: 'audit_failed',
label: '审核被拒绝'
},
{
value: 'withdrawn',
label: '已撤回'
},
{
value: 'delay',
label: '审核延后'
},
{
value: 'release_success',
label: '发布成功'
},
{
value: 'release_failed',
label: '发布失败'
}
]
5 years ago
}
5 years ago
}
5 years ago
}
},
components: {
5 years ago
CDialog, SubmitForm, CommitForm, OperHistory, CTable
5 years ago
},
activated () {
this.$nextTick(() => {
this.$refs.table.doLayout() // 解决表格错位
})
},
5 years ago
mounted () {
let params = this.$route.params
// 由客户注册信息跳转来
if (params.showCommit) {
this.commitDia.title = '上传代码'
this.commitDia.visible = true
let dataForm = {
5 years ago
clientType: '工作端',
client: params.name
}
this.$nextTick(() => {
this.$refs['ref_commit_form'].initData(dataForm)
})
}
5 years ago
this.renderSelData()
this.loadData()
},
computed: {
tableHeight () {
5 years ago
return this.clientHeight - 60 - 80 - 80 - 85
},
...mapGetters(['clientHeight'])
5 years ago
},
methods: {
5 years ago
// 加载列表数据
loadData () {
this.$nextTick(() => {
this.$refs.table.loadData() // 获取表格数据
})
},
5 years ago
// 上传代码
commitCode (id) {
5 years ago
this.form.data['customerId'] = this.form.data['client']
this.optionData = this.form.data
5 years ago
this.commitDia.title = '上传代码'
this.commitDia.visible = true
},
// 提交审核
5 years ago
submitCode (row) {
// if (row.status === 'audit_failed') {
this.feedbackShow = true
// }
5 years ago
this.submitDia.title = '提交审核'
this.submitDia.visible = true
},
submitDiaCancel () {
this.submitDia.title = ''
this.submitDia.visible = false
},
// 审核撤回
submitRecall (id) {
},
// 体验版二维码
showQRCode (id) {
},
// 发布
issueCode (id) {
},
// 审核失败原因
submitFailReason (id) {
},
// 操作历史
operHistory (id) {
this.operDia.title = '操作历史'
this.operDia.visible = true
},
5 years ago
// 提交审核确定
commitConfirm () {
this.commitDia.visible = false
this.loadData()
},
5 years ago
commitDiaCancel () {
this.commitDia.title = ''
this.commitDia.visible = false
},
operDiaCancel () {
this.operDia.title = ''
this.operDia.visible = false
5 years ago
},
renderSelData () { // 渲染下拉框/单选框/复选框等数据
this.form.dataUrl = []
this.form.dataUrl.push({ // 有效客户
key: 'client', // 对应bean.js中对应属性的key
url: '/oper/crm/customer/getvalidcustomerlist',
params: {}
})
window.app.ajax.all( // 并发请求全部的渲染数据
this.form.dataUrl,
data => {
data.forEach((oneData, index) => { // 组织数据
var key = this.form.dataUrl[index].key
this.form.data[key] = oneData
})
this.form.data['client'].forEach((oneData, index) => { // 组织数据
oneData.value = oneData.customerId
oneData.label = oneData.customerName
})
this.$forceUpdate()
}
)
5 years ago
}
}
}
</script>