|
@@ -2,10 +2,10 @@
|
|
|
<div class="mod-svipItems app-container">
|
|
|
<el-form :inline="true" :model="dataForm" @keyup.enter.native="querySvipItems()">
|
|
|
<el-form-item label="卡名称">
|
|
|
- <el-input v-model="dataForm.cname" placeholder="卡名称" clearable></el-input>
|
|
|
+ <el-input v-model="dataForm.cName" placeholder="卡名称" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="卡名称">
|
|
|
- <el-input v-model="dataForm.cname" placeholder="卡名称" clearable></el-input>
|
|
|
+ <el-input v-model="dataForm.cName" placeholder="卡名称" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="卡类型">
|
|
|
<el-select v-model="dataForm.itemType" placeholder="卡类型" style="width: 100px">
|
|
@@ -30,7 +30,7 @@
|
|
|
width="50">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="cname"
|
|
|
+ prop="cName"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
label="卡名称">
|
|
@@ -91,13 +91,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import { query ,deletenow} from "@/api/cardtype/cardtype";
|
|
|
import AddOrUpdate from './svipItems-add-or-update'
|
|
|
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
|
dataForm: {
|
|
|
- cname: null,
|
|
|
+ cName: null,
|
|
|
amount: null,
|
|
|
itemType: null,
|
|
|
expirationDate: null,
|
|
@@ -125,43 +126,38 @@
|
|
|
activated () {
|
|
|
this.querySvipItems()
|
|
|
},
|
|
|
+ created(){
|
|
|
+ this.querySvipItems()
|
|
|
+ },
|
|
|
methods: {
|
|
|
// 查询
|
|
|
querySvipItems: function () {
|
|
|
this.dataListLoading = true
|
|
|
- this.$http({
|
|
|
- url: this.$http.adornUrl('/svip/svipItems/querySvipItems'),
|
|
|
- method: 'get',
|
|
|
- params: this.$http.adornParams(this.dataForm)
|
|
|
- }).then(({data}) => {
|
|
|
- if (data && data.code === 0) {
|
|
|
- this.dataList = data.page.records
|
|
|
- this.totalPage = data.page.total
|
|
|
- } else {
|
|
|
- this.dataList = []
|
|
|
- this.totalPage = 0
|
|
|
- }
|
|
|
- this.dataListLoading = false
|
|
|
- })
|
|
|
- },
|
|
|
- // 获取数据列表
|
|
|
- getDataList () {
|
|
|
- this.dataListLoading = true
|
|
|
- this.dataList = []
|
|
|
- this.$http({
|
|
|
- url: this.$http.adornUrl('/svip/svipItems/page'),
|
|
|
- method: 'get',
|
|
|
- params: this.$http.adornParams(this.dataForm)
|
|
|
- }).then(({data}) => {
|
|
|
- if (data && data.code === 0) {
|
|
|
- this.dataList = data.page.records
|
|
|
- this.totalPage = data.page.total
|
|
|
- } else {
|
|
|
- this.dataList = []
|
|
|
- this.totalPage = 0
|
|
|
- }
|
|
|
- this.dataListLoading = false
|
|
|
+ query(this.dataForm).then(data =>{
|
|
|
+ console.log(data)
|
|
|
+ if (data && data.code === 200) {
|
|
|
+ this.dataList = data.rows
|
|
|
+ this.totalPage = data.total
|
|
|
+ } else {
|
|
|
+ this.dataList = []
|
|
|
+ this.totalPage = 0
|
|
|
+ }
|
|
|
+ this.dataListLoading = false
|
|
|
})
|
|
|
+ // this.$http({
|
|
|
+ // url: this.$http.adornUrl('/svip/svipItems/querySvipItems'),
|
|
|
+ // method: 'get',
|
|
|
+ // params: this.$http.adornParams(this.dataForm)
|
|
|
+ // }).then(({data}) => {
|
|
|
+ // if (data && data.code === 0) {
|
|
|
+ // this.dataList = data.page.records
|
|
|
+ // this.totalPage = data.page.total
|
|
|
+ // } else {
|
|
|
+ // this.dataList = []
|
|
|
+ // this.totalPage = 0
|
|
|
+ // }
|
|
|
+ // this.dataListLoading = false
|
|
|
+ // })
|
|
|
},
|
|
|
// 每页数
|
|
|
sizeChangeHandle (val) {
|
|
@@ -186,7 +182,7 @@
|
|
|
} else {
|
|
|
this.editModel = {
|
|
|
itemId: null,
|
|
|
- cname: null,
|
|
|
+ cName: null,
|
|
|
itemType: 'T',
|
|
|
expirationDate: 1
|
|
|
}
|
|
@@ -205,12 +201,9 @@
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- this.$http({
|
|
|
- url: this.$http.adornUrl('/svip/svipItems/delete'),
|
|
|
- method: 'post',
|
|
|
- data: this.$http.adornData(svipItemsIds, false)
|
|
|
- }).then(({data}) => {
|
|
|
- if (data && data.code === 0) {
|
|
|
+ deletenow(svipItemsIds).then(data=>{
|
|
|
+ console.log(data)
|
|
|
+ if (data && data.code === 200) {
|
|
|
this.$message({
|
|
|
message: '操作成功',
|
|
|
type: 'success',
|
|
@@ -223,6 +216,24 @@
|
|
|
this.$message.error(data.msg)
|
|
|
}
|
|
|
})
|
|
|
+ // this.$http({
|
|
|
+ // url: this.$http.adornUrl('/svip/svipItems/delete'),
|
|
|
+ // method: 'post',
|
|
|
+ // data: this.$http.adornData(svipItemsIds, false)
|
|
|
+ // }).then(({data}) => {
|
|
|
+ // if (data && data.code === 0) {
|
|
|
+ // this.$message({
|
|
|
+ // message: '操作成功',
|
|
|
+ // type: 'success',
|
|
|
+ // duration: 1500,
|
|
|
+ // onClose: () => {
|
|
|
+ // this.querySvipItems()
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // this.$message.error(data.msg)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
}).catch(() => {
|
|
|
})
|
|
|
}
|