|
@@ -3,13 +3,19 @@
|
|
|
<div class="filter-container" style="margin: 10px 0 10px 0">
|
|
|
<span class="textSpan">客户名称:</span>
|
|
|
<el-input v-model="body.customerName" style="width:200px;" placeholder="客户名称" size="small" clearable />
|
|
|
- <el-button class="filter-item" icon="el-icon-search" type="primary" plain @click="reLoad">搜索</el-button>
|
|
|
+ <el-button class="filter-item" icon="el-icon-search" type="primary" plain @click="Search">搜索</el-button>
|
|
|
<el-button class="classitem" style="marginRight:50px" type="primary" plain icon="el-icon-plus" @click="NewUser">新增</el-button>
|
|
|
</div>
|
|
|
|
|
|
<!-- 表格 -->
|
|
|
<el-table v-loading="loading" :data="tableData" border style="width: 100%">
|
|
|
|
|
|
+ <el-table-column label="序号" width="60" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.$index + 1 }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
<el-table-column label="客户名称" align="center" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ scope.row.customerName }}</span>
|
|
@@ -24,9 +30,8 @@
|
|
|
|
|
|
<el-table-column label="状态" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-tag v-if="scope.row.status === 1" size="small">有效</el-tag>
|
|
|
- <el-tag v-if="scope.row.status === 2" size="small">无效</el-tag>
|
|
|
- <el-tag v-if="scope.row.status === 3" size="small">暂停</el-tag>
|
|
|
+ <el-tag v-if="scope.row.status === 1" >正常</el-tag>
|
|
|
+ <el-tag v-if="scope.row.status === 2" type="warning">暂停</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
@@ -62,8 +67,10 @@
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
- <el-table-column label="操作" fixed="right" min-width="200" align="center">
|
|
|
+ <el-table-column label="操作" fixed="right" min-width="250" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
+ <el-button v-if="scope.row.status === 1" size="small" icon="el-icon-close" type="warning" @click="ModifyStatus(scope.row,2)">暂停</el-button>
|
|
|
+ <el-button v-if="scope.row.status === 2" size="small" icon="el-icon-check" @click="ModifyStatus(scope.row,1)">有效</el-button>
|
|
|
<el-button size="small" icon="el-icon-edit" type="warning" @click="ModifyEdit(scope.row)">编辑</el-button>
|
|
|
<el-button size="small" icon="el-icon-delete" type="danger" @click="ModifyDelete(scope.row)">删除</el-button>
|
|
|
</template>
|
|
@@ -87,9 +94,9 @@
|
|
|
<el-input v-model="dataForm.customerName" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="6" :xs="24" :sm="12" :md="12" :lg="8">
|
|
|
+ <el-col v-if="!operation" :span="6" :xs="24" :sm="12" :md="12" :lg="8">
|
|
|
<el-form-item label="客户ID" :label-width="formLabelWidth" >
|
|
|
- <el-input v-model="dataForm.customerId" />
|
|
|
+ <el-input disabled v-model="dataForm.customerId" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6" :xs="24" :sm="12" :md="12" :lg="8">
|
|
@@ -153,7 +160,15 @@
|
|
|
</el-col>
|
|
|
<el-col :span="6" :xs="24" :sm="12" :md="12" :lg="8">
|
|
|
<el-form-item label="价格校验" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="dataForm.priceCheck" />
|
|
|
+ <!-- <el-input v-model="dataForm.priceCheck" /> -->
|
|
|
+ <el-select size="small" v-model="dataForm.priceCheck">
|
|
|
+ <el-option
|
|
|
+ v-for="item in priceCheck"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -209,16 +224,14 @@ export default {
|
|
|
size: 10,
|
|
|
current: 1
|
|
|
},
|
|
|
- status:[{
|
|
|
- id:1,
|
|
|
- name:"有效"
|
|
|
- },{
|
|
|
- id:2,
|
|
|
- name:"无效"
|
|
|
- },{
|
|
|
- id:3,
|
|
|
- name:"暂停"
|
|
|
- }],
|
|
|
+ status:[
|
|
|
+ {id:1,name:"正常"},
|
|
|
+ {id:2,name:"暂停"}
|
|
|
+ ],
|
|
|
+ priceCheck:[
|
|
|
+ {id:0,name:"关闭"},
|
|
|
+ {id:1,name:"开启"}
|
|
|
+ ],
|
|
|
operation: false, // true:新增, false:编辑
|
|
|
dialogFormVisible: false, // 控制弹出框
|
|
|
formLabelWidth: '120px', //新增宽度
|
|
@@ -254,13 +267,38 @@ export default {
|
|
|
this.dialogFormVisible = true
|
|
|
this.dataForm = row
|
|
|
},
|
|
|
- ModifyDelete() {
|
|
|
- console.log('ModifyDelete')
|
|
|
+ ModifyDelete(row) {
|
|
|
+ this.$confirm('此操作将删除客户:' + row.customerName, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ row.isDeleted = 1
|
|
|
+ api.index.update(row).then((resp)=>{
|
|
|
+ if (resp.status === 200) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '操作成功'
|
|
|
+ })
|
|
|
+ this.getTenantList()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: resp.data.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
//数据
|
|
|
getTenantList(){
|
|
|
this.loading = true
|
|
|
- api.Search(this.body).then((res) => {
|
|
|
+ api.index.Search(this.body).then((res) => {
|
|
|
this.loading =false
|
|
|
this.tableData = res.data.data.records
|
|
|
this.total = res.data.data.total
|
|
@@ -273,32 +311,32 @@ export default {
|
|
|
if (!this.operation) {
|
|
|
console.log(this.dataForm)
|
|
|
// 编辑
|
|
|
- // api.channelEdit(this.dataForm).then(response => {
|
|
|
- // if (response.status === 200) {
|
|
|
- // this.$message({
|
|
|
- // type: 'success',
|
|
|
- // message: '操作成功'
|
|
|
- // })
|
|
|
- // this.dialogFormVisible = false
|
|
|
- // this.getTenantList()
|
|
|
- // } else {
|
|
|
- // this.$message({
|
|
|
- // type: 'error',
|
|
|
- // message: response.data.msg
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
+ api.index.update(this.dataForm).then(response => {
|
|
|
+ if (response.status === 200) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '操作成功'
|
|
|
+ })
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.getTenantList()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: response.data.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
console.log(this.dataForm)
|
|
|
// // 添加
|
|
|
- api.userAdd(this.dataForm).then(response => {
|
|
|
+ api.index.userAdd(this.dataForm).then(response => {
|
|
|
if (response.status === 200) {
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
message: '操作成功'
|
|
|
})
|
|
|
this.dialogFormVisible = false
|
|
|
- this.reLoad()
|
|
|
+ this.getTenantList()
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: 'error',
|
|
@@ -310,8 +348,38 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ ModifyStatus(row,i){
|
|
|
+ this.$confirm('是否修改 '+row.customerName+' 的状态', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(()=>{
|
|
|
+ row.status = i
|
|
|
+ api.index.update(row).then(response => {
|
|
|
+ if (response.status === 200) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '操作成功'
|
|
|
+ })
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.getTenantList()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: response.data.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
//搜索
|
|
|
- reLoad() {
|
|
|
+ Search() {
|
|
|
this.body.current = 1
|
|
|
this.getTenantList()
|
|
|
},
|