|
@@ -12,7 +12,7 @@ rookieCode<template>
|
|
|
<el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleQuery">查找</el-button>
|
|
<el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleQuery">查找</el-button>
|
|
|
<el-button class="filter-item" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
<el-button class="filter-item" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
|
<el-button class="filter-item" type="primary" icon="el-icon-plus" @click="handleCreate">添加</el-button>
|
|
<el-button class="filter-item" type="primary" icon="el-icon-plus" @click="handleCreate">添加</el-button>
|
|
|
- <el-button class="filter-item" v-waves icon="el-icon-download" @click="handleDownload">导出</el-button>
|
|
|
|
|
|
|
+ <!-- <el-button class="filter-item" v-waves icon="el-icon-download" @click="handleDownload">导出</el-button> -->
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 查询结果 -->
|
|
<!-- 查询结果 -->
|
|
@@ -43,10 +43,10 @@ rookieCode<template>
|
|
|
<el-table-column align="center" label="操作" width="250" class-name="small-padding fixed-width">
|
|
<el-table-column align="center" label="操作" width="250" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-button type="primary" size="small" @click="handleUpdate(scope.row)">编辑</el-button>
|
|
<el-button type="primary" size="small" @click="handleUpdate(scope.row)">编辑</el-button>
|
|
|
- <el-button v-if="scope.row.status == 0" type="success" size="small"
|
|
|
|
|
- @click="changeState(scope.row.id, 1)">启用</el-button>
|
|
|
|
|
- <el-button v-if="scope.row.status == 1" type="warning" size="small"
|
|
|
|
|
- @click="changeState(scope.row.id, 0)">停用</el-button>
|
|
|
|
|
|
|
+ <el-button v-if="scope.row.status == 1" type="success" size="small"
|
|
|
|
|
+ @click="changeState(scope.row.id, scope.row.status)">启用</el-button>
|
|
|
|
|
+ <el-button v-if="scope.row.status == 0" type="warning" size="small"
|
|
|
|
|
+ @click="changeState(scope.row.id, scope.row.status)">停用</el-button>
|
|
|
<el-button type="danger" size="small" @click="handleDelete(scope.row)">删除</el-button>
|
|
<el-button type="danger" size="small" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -88,7 +88,7 @@ rookieCode<template>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
-import { listBrand, createBrand, updateBrand, deleteBrand, setState } from '@/api/express'
|
|
|
|
|
|
|
+import { listExpress, createExpress, updateExpress, deleteExpress, setState } from '@/api/express'
|
|
|
import waves from '@/directive/waves' // 水波纹指令
|
|
import waves from '@/directive/waves' // 水波纹指令
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -149,7 +149,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
getList() {
|
|
getList() {
|
|
|
this.listLoading = true
|
|
this.listLoading = true
|
|
|
- listBrand(this.listQuery).then(response => {
|
|
|
|
|
|
|
+ listExpress(this.listQuery).then(response => {
|
|
|
this.list = response.data.data.items
|
|
this.list = response.data.data.items
|
|
|
this.total = response.data.data.total
|
|
this.total = response.data.data.total
|
|
|
this.listLoading = false
|
|
this.listLoading = false
|
|
@@ -190,7 +190,7 @@ export default {
|
|
|
createData() {
|
|
createData() {
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
- createBrand(this.dataForm).then(response => {
|
|
|
|
|
|
|
+ createExpress(this.dataForm).then(response => {
|
|
|
this.list.unshift(response.data.data)
|
|
this.list.unshift(response.data.data)
|
|
|
this.dialogFormVisible = false
|
|
this.dialogFormVisible = false
|
|
|
this.$notify({
|
|
this.$notify({
|
|
@@ -199,6 +199,7 @@ export default {
|
|
|
type: 'success',
|
|
type: 'success',
|
|
|
duration: 2000
|
|
duration: 2000
|
|
|
})
|
|
})
|
|
|
|
|
+ this.getList()
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -214,7 +215,7 @@ export default {
|
|
|
updateData() {
|
|
updateData() {
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
- updateBrand(this.dataForm).then(() => {
|
|
|
|
|
|
|
+ updateExpress(this.dataForm).then(() => {
|
|
|
for (const v of this.list) {
|
|
for (const v of this.list) {
|
|
|
if (v.id === this.dataForm.id) {
|
|
if (v.id === this.dataForm.id) {
|
|
|
const index = this.list.indexOf(v)
|
|
const index = this.list.indexOf(v)
|
|
@@ -229,27 +230,35 @@ export default {
|
|
|
type: 'success',
|
|
type: 'success',
|
|
|
duration: 2000
|
|
duration: 2000
|
|
|
})
|
|
})
|
|
|
|
|
+ this.getList()
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
|
- deleteBrand(row).then(response => {
|
|
|
|
|
- this.$notify({
|
|
|
|
|
- title: '成功',
|
|
|
|
|
- message: '删除成功',
|
|
|
|
|
- type: 'success',
|
|
|
|
|
- duration: 2000
|
|
|
|
|
|
|
+ this.$confirm('确认删除吗?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ deleteExpress({id:row.id}).then(response => {
|
|
|
|
|
+ this.$notify({
|
|
|
|
|
+ title: '成功',
|
|
|
|
|
+ message: '删除成功',
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ })
|
|
|
|
|
+ this.getList()
|
|
|
|
|
+ })
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+
|
|
|
})
|
|
})
|
|
|
- const index = this.list.indexOf(row)
|
|
|
|
|
- this.list.splice(index, 1)
|
|
|
|
|
- })
|
|
|
|
|
},
|
|
},
|
|
|
handleDownload() {
|
|
handleDownload() {
|
|
|
window.location.href = process.env.BASE_API + '/product/export';
|
|
window.location.href = process.env.BASE_API + '/product/export';
|
|
|
},
|
|
},
|
|
|
- changeState(id, index) {
|
|
|
|
|
- setState({ id: id, status: index }).then(response => {
|
|
|
|
|
|
|
+ changeState(id, status) {
|
|
|
|
|
+ setState({ id: id, status: status }).then(response => {
|
|
|
this.$notify({
|
|
this.$notify({
|
|
|
title: '成功',
|
|
title: '成功',
|
|
|
message: '状态修改成功',
|
|
message: '状态修改成功',
|