Commit 35bd332e by zhouzy

1

1 parent 826224c3
...@@ -159,4 +159,162 @@ ...@@ -159,4 +159,162 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
}
\ No newline at end of file \ No newline at end of file
}
.equity-wrap .contain {
background: #FFFFFF;
margin: 0 20px 20px 40px;
padding: 20px;
box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.10);
}
.equity-wrap .contain .el-table__empty-text{
display: inline-block;
width: 64px;
height: 41px;
}
.fr-mr0 {
float: right;
margin-right: 0px!important;
}
// 单行省略
.ellipsis-1 {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
/* for Opera */
}
.mb10{
margin-bottom: 10px;
}
// 我这里以两行为例,该方法基本兼容市场上面所有主流浏览器。
.ellipsis-2 {
overflow: hidden;
height: 40px;
line-height: 20px;
position: relative;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
/*显示的行数*/
}
.ellipsis-2-text:after {
content: "...";
position: absolute;
bottom: 0;
right: 15px;
padding-left: 20px;
background: -webkit-linear-gradient(left, transparent, #fff 55%);
/*我在Safari上测试时发现透明到白色中间会有一个黑色的过渡后来我就写成-webkit-linear-gradient(left,rgba(255,255,255,0),rgba(255,255,255,1) 55%)*/
background: -o-linear-gradient(left, transparent, #fff 55%);
background: -moz-linear-gradient(left, transparent, #fff 55%);
background: linear-gradient(to right, transparent, #fff 55%);
}
.el-scrollbar__bar.is-horizontal{
height: 10px !important;
left: 10px;
}
.base-container-right .el-main-scroll .el-scrollbar__thumb {
background-color: rgba(144, 147, 153, 0.5) !important;
}
.equity-wrap .el-table .cell {
line-height: 16px;
}
.equity-wrap .table-btns .el-button {
padding: 0 0 0 5px;
margin-left: 5px;
border-left: 1px solid #DCDFE6;
border-radius: 0;
}
.equity-wrap .table-btns .el-button:first-child {
padding: 0;
border: 0;
}
.equity-wrap .img-60 {
width: 60px;
height: 60px;
}
.equity-wrap .edit-container {
margin: 20px 40px 84px;
}
.equity-wrap .footer {
position: absolute;
bottom: 0;
width: 100%;
height: 64px;
text-align: center;
line-height: 64px;
background: #FFFFFF;
z-index: 999;
}
.equity-wrap .flex {
display: flex;
justify-content: space-between;
}
.equity-wrap .edit-title {
font-size: 16px;
font-weight: bold;
height: 48px;
line-height: 48px;
// color: #0947C6;
border-bottom: 1px solid #E7EAEC;
// padding-left: 20px;
margin: 0 0;
}
.equity-wrap .edit-sub-title::before {
position: absolute;
display: inline-block;
content: '';
height: 18px;
width: 4px;
top: 2px;
left: 0;
background-color: #0947C6;
}
.equity-wrap .edit-sub-title {
position: relative;
font-size: 16px;
font-weight: 700;
color: #333333;
margin: 0 0 30px 0;
padding-left: 8px;
}
// .equity-wrap table {
// width: 98%;
// color: #666666;
// border: 1px solid #e5e6e7;
// border-width: 1px 0 0 1px;
// }
// .equity-wrap table tr {
// height: 30px;
// // line-height: 30px;
// }
// .equity-wrap table th,
// .equity-wrap table td {
// font-size: 12px;
// font-weight: normal;
// padding: 0px 10px;
// border: 1px solid #e5e6e7;
// border-width: 0px 1px 1px 0px;
// border-spacing: 0;
// text-align: center;
// vertical-align: middle;
// }
// .equity-wrap table td {
// min-width: 50px;
// }
\ No newline at end of file \ No newline at end of file
...@@ -10,5 +10,35 @@ const staticRoutes = Object.freeze([{ ...@@ -10,5 +10,35 @@ const staticRoutes = Object.freeze([{
component: resolve => require([`@/views/beforeSale/editEquity.vue`], resolve), component: resolve => require([`@/views/beforeSale/editEquity.vue`], resolve),
meta: {} meta: {}
}, },
{
name: 'worryFree',
path: '/worryFree/index',
component: resolve => require([`@/views/worryFree/index.vue`], resolve),
meta: {}
},
{
name: 'addCards',
path: '/addCards/index',
component: resolve => require([`@/views/addCards/index.vue`], resolve),
meta: {}
},
{
name: 'appointment',
path: '/appointment/index',
component: resolve => require([`@/views/appointment/index.vue`], resolve),
meta: {}
},
{
name: 'config',
path: '/config/index',
component: resolve => require([`@/views/config/index.vue`], resolve),
meta: {}
},
{
name: 'addConfig',
path: '/config/addConfig',
component: resolve => require([`@/views/config/addConfig.vue`], resolve),
meta: {}
},
]) ])
export default staticRoutes export default staticRoutes
\ No newline at end of file \ No newline at end of file
<template>
<div class="equity-wrap">
<div class="equity-wrap contain">
<GLTable ref="detailTable" :searchForm="addForm" :tableParams="addParams" :pageConf="addPageConf" style="margin-top: 10px" :hasNum="false">
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="download(scope.scope)">批量下载</el-button>
</span>
</GLTable>
<el-button type="primary" @click="add" size="small" class="addButtom">生成</el-button>
<!-- 生成弹窗 -->
<el-dialog title="修改无忧卡" v-if="addDialog" :visible.sync="addDialog" width="712px" :before-close="handleClose" class="detailDialog">
<el-form :inline="true" :model="addDialogForm" :rules="addDialogRules" ref="detailForm" label-width="120px" class="detailForm">
<div class="form">
<el-row>
<el-form-item label="版本:" prop="edit">
<el-select v-model="addDialogForm.edit" placeholder="请选择" size="small">
<el-option v-for="(item, index) in dialogEditOptions" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="适应类型:" prop="type">
<el-select v-model="addDialogForm.type" placeholder="请选择" size="small">
<el-option v-for="(item, index) in dialogTypeOptions" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="数量:" prop="num">
<el-input v-model="addDialogForm.num" placeholder="请输入1-5000的数字" size="small"></el-input>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="具体价格(万)" prop="price">
<el-input v-model="addDialogForm.price" placeholder="请输入" size="small"></el-input>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="使用年限:" prop="year">
<el-select v-model="addDialogForm.year" placeholder="请选择" size="small">
<el-option v-for="(item, index) in dialogYearOptions" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="备注" prop="remark">
<el-input type="textarea" v-model="addDialogForm.remark" maxlength="200" style="width: 320px" placeholder="请输入活动详情或规则"></el-input>
</el-form-item>
</el-row>
</div>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="cancelDetailDialog">取 消</el-button>
<el-button size="small" type="primary" @click="submitForm('detailForm')">确 定</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data() {
return {
addDialogForm: {},
addDialog: false,
addPageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
detailOptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
}
],
typeOptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
}
],
statusOptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
}
],
lifeOptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
}
],
dialogEditOptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
}
],
dialogTypeOptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
}
],
dialogYearOptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
}
],
addDialogRules: {
edit: [{ required: true, message: '请选择版本', trigger: 'change' }],
type: [{ required: true, message: '请选择适应类型', trigger: 'change' }],
price: [{ required: true, message: '请输入具体价格', trigger: 'blur' }],
year: [{ required: true, message: '请选择使用年限', trigger: 'change' }],
num: [{ required: true, message: '请输入数量', trigger: 'blur' }],
remark: [{ required: true, message: '请输入备注', trigger: 'blur' }]
},
addParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '批次号',
prop: 'batchNo'
},
{
label: '生成时间',
prop: 'time'
},
{
label: '数量',
prop: 'Num'
},
{
label: '备注',
prop: 'remark'
// minWidth: '200'
}
]
}
}
},
mounted() {},
methods: {
add() {
this.addDialog = true
},
// 关闭弹窗界面
cancelDetailDialog() {
console.log('1')
this.addDialog = false
this.addDialogForm = {}
},
submitForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
console.log(this.addDialogForm.edit)
this.addDialog = false
this.addDialogForm = {}
this.$refs.detailForm.clearValidate()
} else {
console.log('error submit!!')
return false
}
})
}
}
}
</script>
<style lang="scss" scoped>
.addGood {
margin-bottom: 20px;
margin-left: 40px;
padding: 8px 16px;
// margin-bottom: 20px;
}
/deep/ .contain .el-input--small .el-input__inner {
width: 215px;
}
.row-btns {
margin-top: 5px;
margin-bottom: 10px;
}
.addButtom {
float: right;
margin-top: -30px;
}
/deep/ .el-dialog__footer {
padding: 16px 20px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border-top: 1px solid #e6e6e6;
text-align: center;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="equity-wrap">
<el-button type="primary" size="small" @click="showDialog('add')" style="margin-left:40px">新增特别约定</el-button>
<div class="equity-wrap contain" style="margin-top:10px">
<el-form :inline="true" label-width="auto" label-position="right" style="margin-top: 20px" class="appointmentForm">
<el-row style="align-items: center" class="select">
<el-form-item label="特约名称">
<el-input v-model="appointmentForm.name" placeholder="请输入" size="small"></el-input>
</el-form-item>
<el-form-item label="特约内容">
<el-input v-model="appointmentForm.content" placeholder="请输入" size="small"></el-input>
</el-form-item>
<el-form-item size="small" style="float: right; margin-right: 0px !important">
<el-button plain size="small" @click="seletTable('reset')" class="selectBtn">重置</el-button>
<el-button type="primary" size="small" @click="seletTable('select')" class="selectBtn">搜索</el-button>
<el-button plain size="small" @click="exportTable" class="selectBtn">导出</el-button>
</el-form-item>
</el-row>
</el-form>
<GLTable ref="appointmentTable" :searchForm="appointmentForm" :tableParams="tableParams" :pageConf="tablePageConf">
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<!-- 批次管理详情弹窗按钮 -->
<el-button type="text" @click="showDialog(scope.scope)">修改</el-button>
<el-button type="text" @click="del(scope.scope)">删除</el-button>
</span>
</GLTable>
<!-- 修改界面弹窗 -->
<el-dialog :title="dialogTitle" v-if="modifyDialog" :visible.sync="modifyDialog" width="712px" :before-close="handleClose" class="detailDialog">
<el-form :inline="true" :model="modifyDialogForm" :rules="modifyDialogRules" ref="modifyForm" label-width="120px" class="detailForm">
<div class="form">
<el-row>
<el-form-item label="名称:" prop="name">
<el-input v-model="modifyDialogForm.name" placeholder="请输入" size="small"></el-input>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="特约内容" prop="content">
<el-input type="textarea" v-model="modifyDialogForm.content" maxlength="200" style="width: 320px" placeholder="请输入"></el-input>
</el-form-item>
</el-row>
</div>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="cancelDialog">取 消</el-button>
<el-button size="small" type="primary" @click="submitForm('modifyForm')">确 定</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data() {
return {
dialogTitle: '',
tablePageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
modifyDialog: false,
appointmentForm: {
name: '',
content: ''
},
modifyDialogForm: {
name: '',
content: ''
},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '特约名称',
prop: 'name'
},
{
label: '特约内容',
prop: 'content'
},
{
label: '操作人',
prop: 'operator'
}
]
},
modifyDialogRules: {
name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
content: [{ required: true, message: '请输入特约内容', trigger: 'blur' }]
}
}
},
mounted() {},
methods: {
handleClose() {
this.modifyDialog = false
this.modifyDialogForm = {}
},
cancelDialog() {
this.modifyDialog = false
this.modifyDialogForm = {}
},
submitForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
this.modifyDialog = false
this.modifyDialogForm = {}
this.$refs.modifyForm.clearValidate()
} else {
console.log('error submit!!')
return false
}
})
},
showDialog(e) {
if (e == 'add') {
this.dialogTitle = '新增特别约定'
} else {
this.dialogTitle = '修改特别约定'
}
this.modifyDialog = true
},
del() {},
seletTable(e) {
if (e == 'reset') {
this.appointmentForm.name = ''
this.appointmentForm.content = ''
// this.$apis.equityApi.getEquityCardBatchList(this.appointmentForm).then(res => {
// this.$refs.appointmentTable.refreshTable()
// })
} else if (e == 'select') {
// this.$apis.equityApi.getEquityCardBatchList(this.appointmentForm).then(res => {
// this.$refs.appointmentTable.refreshTable()
// })
}
},
//导出
exportTable() {
console.log('export')
// this.$apis.equityApi.cardExport(this.appointmentForm).then(res => {
// if (res) {
// var a = document.createElement('a')
// a.setAttribute('href', res.data)
// a.setAttribute('target', '_blank')
// a.setAttribute('id', 'd2admin-link-temp')
// a.setAttribute('download', '无忧卡导出' + '.xlsx') // 设置下载文件名称
// window.open(a)
// document.body.appendChild(a)
// a.click()
// document.body.removeChild(document.getElementById('d2admin-link-temp'))
// } else {
// console.log('导出失败')
// }
// })
}
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="equity-wrap">
<el-button class="addGood" type="primary" icon="el-icon-plus" @click="jump('add')">开通配置</el-button>
<div class="equity-wrap contain">
<el-form :inline="true" style="width: 100%" :model="searchForm" label-width="85px" label-position="right">
<el-row>
<el-form-item size="small" label="商户名称">
<el-select size="small" v-model="searchForm.brandName" filterable placeholder="请选择">
<el-option v-for="item in goodsBrandList" :key="item.id" :label="item.brandName" :value="item.brandName"></el-option>
</el-select>
</el-form-item>
<el-form-item size="small" label="开通状态" style="margin-left: -10px">
<el-select size="small" v-model="searchForm.supplier">
<el-option v-for="item in supplierList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item size="small" class="fr-mr0">
<el-button size="small" @click="handleReset">重置</el-button>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
<el-button size="small" @click="exportTable">导出</el-button>
</el-form-item>
</el-row>
</el-form>
</div>
<div class="equity-wrap contain">
<div class="row-btns">
<el-button size="small" @click="toggleAll">全选</el-button>
<div style="float:right">
<el-button size="small" @click="batchOperation(1)">批量开通</el-button>
<el-button size="small" @click="batchOperation(2)">批量关闭</el-button>
</div>
</div>
<GLTable v-if="flag" ref="table" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="jump(scope.scope)">编辑</el-button>
<el-button type="text" @click="copy(scope.scope)">复制</el-button>
</span>
<span slot="switch" slot-scope="scope">
<el-switch v-model="scope.scope.value" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
</span>
</GLTable>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
// import { searchMixin } from '@/mixins'
export default {
name: '',
// mixins: [searchMixin],
data() {
return {
size: 'small',
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
flag: true,
searchForm: {},
supplierList: [
{
label: '开通',
value: 'open'
},
{
label: '关闭',
value: 'close'
}
],
statusList: [
{
label: '上架',
value: '1'
},
{
label: '下架',
value: '2'
},
{
label: '待上架',
value: '0'
}
],
tableParams: {
listName: 'list',
mutiSelectName: 'configIndex',
mutiSelectUniqueKey: 'id',
tableOption: true,
tableColumns: [
{
label: '商户名称',
prop: 'name'
},
{
label: '商品号',
prop: 'num'
},
{
label: '状态',
prop: 'status',
formatter: cell => {
return cell.status == -1 ? '未开通' : '已开通'
}
},
{
prop: 'time',
label: '开通时间'
},
{
label: '操作人',
prop: 'operator'
},
{
label: '开通开关',
minWidth: '200',
addHtml: 'switch'
}
]
},
goodsBrandList: [],
selectStatus: false
}
},
mounted() {},
methods: {
jump(e) {
if (e == 'add') {
this.$router.push({ path: '/config/addConfig' })
} else {
let query = {}
this.$router.push({ path: '/goods/addGoods', query })
}
},
copy({ id }) {
this.$apis.orderApi.getEquityGoodsById({ id }).then(({ code, data, message }) => {
if (code == 0) {
this.$apis.orderApi.createGoods(data).then(res => {
if (res.code == 0) {
this.$message({
message: '复制成功!',
type: 'success'
})
this.search(() => {
let [target] = this.$refs.table.data
this.jump(target)
})
} else {
this.$message.error(res.message)
}
})
} else {
this.$message.error(message)
}
})
},
toggleAll() {
let { configIndexMutiTable } = this.$refs.table.$refs
let { data } = configIndexMutiTable
this.selectStatus = !this.selectStatus
data.map(row => {
configIndexMutiTable.toggleRowSelection(row, this.selectStatus)
})
},
handleReset() {
this.flag = false
this.searchForm = {}
this.$nextTick(() => {
this.flag = true
})
},
handleSearch() {
this.$refs.table.refreshTable()
},
// ['开通', '关闭'] //
batchOperation(status) {
let { configIndexMutiTable } = this.$refs.table.$refs
let { selection } = configIndexMutiTable
if (!selection.length) return
let ids = []
try {
selection.map(e => {
if (status == 1) {
if (e.status == 1) throw '仅能开通未开通的配置'
} else if (status == 2) {
if (e.status != 1) throw '仅能关闭开通的配置'
}
ids.push(e.id)
})
} catch (error) {
this.$message.error(error)
return
}
let content = {
1: '是否批量开通',
2: '是否批量关闭'
}
this.$confirm(content[status], '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning',
center: true
})
.then(() => {
let params = { ids }
this.$apis.orderApi.target(params).then(({ code, message }) => {
if (code == 0) {
this.$message({
message: '操作成功!',
type: 'success'
})
this.$refs.table.refreshTable()
} else {
this.$message.error(message)
}
})
})
.catch(() => {})
},
exportTable() {
console.log('export')
// this.$apis.equityApi.cardExport(this.searchForm).then(res => {
// if (res) {
// var a = document.createElement('a')
// a.setAttribute('href', res.data)
// a.setAttribute('target', '_blank')
// a.setAttribute('id', 'd2admin-link-temp')
// a.setAttribute('download', '配置表格导出' + '.xlsx') // 设置下载文件名称
// window.open(a)
// document.body.appendChild(a)
// a.click()
// document.body.removeChild(document.getElementById('d2admin-link-temp'))
// } else {
// console.log('导出失败')
// }
// })
}
}
}
</script>
<style lang="scss" scoped>
.addGood {
margin-bottom: 20px;
margin-left: 40px;
padding: 8px 16px;
// margin-bottom: 20px;
}
/deep/ .contain .el-input--small .el-input__inner {
width: 215px;
}
.row-btns {
margin-top: 5px;
margin-bottom: 10px;
}
.fr-mr0 {
float: right;
margin-right: 0px !important;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="equity-wrap">
<div class="equity-wrap contain">
<el-form :inline="true" label-width="70px" label-position="right" class="detailForm">
<el-row style="align-items: center">
<el-form-item label="序列号">
<el-input v-model="detailForm.num" placeholder="请输入" size="small" class="formItem"></el-input>
</el-form-item>
<el-form-item label="版本">
<el-select v-model="detailForm.edit" placeholder="请选择" size="small" class="formItem">
<el-option v-for="(item, index) in detailOptions" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="使用类型" style="margin-left: 30px">
<el-select v-model="detailForm.useType" placeholder="请选择" size="small" class="formItem">
<el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="状态">
<el-select v-model="detailForm.status" placeholder="请选择" size="small" class="formItem">
<el-option v-for="(item, index) in statusOptions" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="具体价格">
<el-input v-model="detailForm.price" placeholder="请输入" size="small" class="formItem"></el-input>
</el-form-item>
<el-form-item label="使用年限" style="margin-left: 30px">
<el-select v-model="detailForm.serviceLife" placeholder="请选择" size="small" class="formItem">
<el-option v-for="(item, index) in lifeOptions" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item size="small" style="float: right; margin-right: 0px !important">
<el-button class="selectBtn" size="small" @click="detailSelect('reset')">重置</el-button>
<el-button class="selectBtn" size="small" type="primary" @click="detailSelect('select')" style="">搜索</el-button>
<el-button type="text" @click="detailDialog = true">修改</el-button>
</el-form-item>
</el-row>
</el-form>
</div>
<div class="equity-wrap contain">
<el-alert type="info" show-icon>总计335张,已使用798张</el-alert>
<GLTable ref="detailTable" :searchForm="detailForm" :tableParams="detailParams" :beforeSearchFn="detailFormat" :pageConf="detailPageConf" style="margin-top:10px">
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="modify2(scope.scope)">修改</el-button>
</span>
</GLTable>
</div>
<!-- 详情弹窗 -->
<el-dialog title="修改无忧卡" v-if="detailDialog" :visible.sync="detailDialog" width="712px" :before-close="handleClose" class="detailDialog">
<el-form :inline="true" :model="detailDialogForm" :rules="detailDialogRules" ref="detailForm" label-width="120px" class="detailForm">
<div class="form">
<el-row>
<el-form-item label="版本:" prop="edit">
<el-select v-model="detailDialogForm.edit" placeholder="请选择" size="small">
<el-option v-for="(item, index) in dialogEditOptions" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="适应类型:" prop="type">
<el-select v-model="detailDialogForm.type" placeholder="请选择" size="small">
<el-option v-for="(item, index) in dialogTypeOptions" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="具体价格(万)" prop="price">
<el-input v-model="detailDialogForm.price" placeholder="请输入" size="small"></el-input>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="使用年限:" prop="year">
<el-select v-model="detailDialogForm.year" placeholder="请选择" size="small">
<el-option v-for="(item, index) in dialogYearOptions" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-row>
</div>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="cancelDetailDialog">取 消</el-button>
<el-button size="small" type="primary" @click="submitForm('detailForm')">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data() {
return {
detailDialog: false,
detailPageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
detailForm: {},
detailDialogForm: {
edit: '',
type: '',
price: '',
year: ''
},
detailOptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
}
],
typeOptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
}
],
statusOptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
}
],
lifeOptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
}
],
dialogEditOptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
}
],
dialogTypeOptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
}
],
dialogYearOptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
}
],
detailDialogRules: {
edit: [{ required: true, message: '请选择版本', trigger: 'change' }],
type: [{ required: true, message: '请选择适应类型', trigger: 'change' }],
price: [{ required: true, message: '请输入具体价格', trigger: 'blur' }],
year: [{ required: true, message: '请选择使用年限', trigger: 'change' }]
},
detailParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '序列号',
prop: 'num'
},
{
label: '版本',
prop: 'edit'
},
{
label: '状态',
prop: 'status'
},
{
label: '使用类型',
prop: 'useType'
// minWidth: '200'
},
{
label: '使用时间',
prop: 'time'
},
{
label: '使用者',
prop: 'user'
// minWidth: '200'
},
{
label: '使用年限',
prop: 'serviceLife'
// minWidth: '200'
},
{
label: '具体价格',
prop: 'price'
// minWidth: '200'
}
]
}
}
},
mounted() {},
methods: {
// 详情table搜索
detailSelect() {
console.log('详情table搜索')
},
modify() {
this.detailDialog = true
},
// 详情table搜索回调方法
detailFormat() {},
// 关闭弹窗界面
cancelDetailDialog() {
console.log('1')
this.detailDialog = false
this.detailDialogForm = {}
},
submitForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
console.log(this.detailDialogForm.edit)
this.detailDialog = false
this.detailDialogForm = {}
this.$refs.detailForm.clearValidate()
} else {
console.log('error submit!!')
return false
}
})
}
}
}
</script>
<style lang="scss" scoped>
.addGood {
margin-bottom: 20px;
margin-left: 40px;
padding: 8px 16px;
// margin-bottom: 20px;
}
/deep/ .contain .el-input--small .el-input__inner {
width: 215px;
}
.row-btns {
margin-top: 5px;
margin-bottom: 10px;
}
/deep/ .el-dialog__footer {
padding: 16px 20px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border-top: 1px solid #e6e6e6;
text-align: center;
}
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!