|
@@ -4,8 +4,8 @@
|
|
|
<template slot="menuLeft">
|
|
|
<el-button type="primary" icon="el-icon-plus" size="small" v-if="isAuth('shop:pickAddr:save')"
|
|
|
@click.stop="addOrUpdateHandle()">新增</el-button>
|
|
|
- <el-button type="danger" @click="deleteHandle()" size="small" v-if="isAuth('shop:pickAddr:delete')"
|
|
|
- :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
|
|
+ <!--el-button type="danger" @click="deleteHandle()" size="small" v-if="isAuth('shop:pickAddr:delete')"
|
|
|
+ :disabled="dataListSelections.length <= 0">批量删除</el-button-->
|
|
|
</template>
|
|
|
|
|
|
<template slot-scope="scope" slot="menu">
|
|
@@ -20,6 +20,8 @@
|
|
|
<script>
|
|
|
import { tableOption } from '@/avue/crud/prodList.js'
|
|
|
import Axios from 'axios'
|
|
|
+import httpx from '@/utils/httpx'
|
|
|
+
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -45,15 +47,14 @@ export default {
|
|
|
// 获取数据列表
|
|
|
getDataList(page, params, done) {
|
|
|
this.dataListLoading = true
|
|
|
- Axios.post(this.$http.adornUrl('/goods/queryGoodList'), {
|
|
|
+ httpx.post(httpx.makeurl('/goods/queryGoodList'), {
|
|
|
name: params?.name || "",
|
|
|
limit: page == null ? this.page.pageSize : page.pageSize,
|
|
|
page: page == null ? this.page.currentPage : page.currentPage,
|
|
|
}).then(({ data }) => {
|
|
|
- console.log(data)
|
|
|
- const items = data.data.goodList
|
|
|
+ const items = data.goodList
|
|
|
this.dataList = items
|
|
|
- // this.page.total = data.total
|
|
|
+ this.page.total = data.total
|
|
|
this.dataListLoading = false
|
|
|
if (done) {
|
|
|
done()
|
|
@@ -67,9 +68,8 @@ export default {
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
console.log(id)
|
|
|
- Axios.post("/goods/deleteGood", { id }
|
|
|
+ httpx.post("/goods/deleteGood", { id }
|
|
|
).then(({ data }) => {
|
|
|
- console.log(data)
|
|
|
this.$message({
|
|
|
message: '操作成功',
|
|
|
type: 'success',
|
|
@@ -89,30 +89,30 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 删除和批量删除
|
|
|
- deleteHandle(id) {
|
|
|
- let prodIds = this.getSeleProdIds()
|
|
|
- if (id) {
|
|
|
- prodIds.push(id)
|
|
|
- }
|
|
|
- this.$confirm(`确定进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.$http({
|
|
|
- url: this.$http.adornUrl(`/prod/prod`),
|
|
|
- method: 'delete',
|
|
|
- data: this.$http.adornData(prodIds, false)
|
|
|
- }).then(({ data }) => {
|
|
|
- this.getDataList(this.page)
|
|
|
- this.$message({
|
|
|
- message: '操作成功',
|
|
|
- type: 'success',
|
|
|
- duration: 1500
|
|
|
- })
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
+ // deleteHandle(id) {
|
|
|
+ // let prodIds = this.getSeleProdIds()
|
|
|
+ // if (id) {
|
|
|
+ // prodIds.push(id)
|
|
|
+ // }
|
|
|
+ // this.$confirm(`确定进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
|
|
+ // confirmButtonText: '确定',
|
|
|
+ // cancelButtonText: '取消',
|
|
|
+ // type: 'warning'
|
|
|
+ // }).then(() => {
|
|
|
+ // this.$http({
|
|
|
+ // url: this.$http.adornUrl(`/prod/prod`),
|
|
|
+ // method: 'delete',
|
|
|
+ // data: this.$http.adornData(prodIds, false)
|
|
|
+ // }).then(({ data }) => {
|
|
|
+ // this.getDataList(this.page)
|
|
|
+ // this.$message({
|
|
|
+ // message: '操作成功',
|
|
|
+ // type: 'success',
|
|
|
+ // duration: 1500
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // },
|
|
|
// 条件查询
|
|
|
searchChange(params, done) {
|
|
|
this.getDataList(this.page, params, done)
|