Commit 62d1b189 by cwq0219

商品-已入库

1 parent 7eb16e57
......@@ -65,4 +65,15 @@ const insertGoodGroupApi = params => {
})
}
export { getWarehousListApi, auditGoodApi, getGoodInfoApi, getGoodGroupInfoApi, insertGoodApi, insertGoodGroupApi }
const deleteGoodApi = params => {
params.method = `${defaultPath}delete.goods`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export { getWarehousListApi, auditGoodApi, getGoodInfoApi, getGoodGroupInfoApi, insertGoodApi, insertGoodGroupApi, deleteGoodApi }
......@@ -209,10 +209,10 @@ export default {
params.price = this.editForm.price * 100
params.shopMallGoodsInfo = {
goodsId: this.selectedProInfo.id,
name: this.selectedProInfo.goodsName,
// name: this.selectedProInfo.goodsName,
merchantId: this.selectedProInfo.merchantId,
merchantName: this.selectedProInfo.merchantName,
selfGoodsImageUrl: this.selectedProInfo.goodsImage
// selfGoodsImageUrl: this.selectedProInfo.goodsImage
}
insertGoodApi(params).then(res => {
this.$message({
......
......@@ -18,7 +18,6 @@
</el-form-item>
</el-form>
</div>
<div></div>
<GLTable ref="warehousListRef" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="coverImgUrl" slot-scope="scope">
<img class="img-60" :src="scope.scope.coverImgUrl" />
......@@ -36,7 +35,7 @@
</template>
<script>
import { getWarehousListApi, auditGoodApi } from '@/api/modules/cmmodityLibrary'
import { getWarehousListApi, auditGoodApi, deleteGoodApi } from '@/api/modules/cmmodityLibrary'
import { auditStatusList } from '@/common/constant'
export default {
name: 'warehousList',
......@@ -146,9 +145,14 @@ export default {
confirmButtonText: '确定',
type: 'error',
callback: action => {
this.$message({
type: 'success',
message: '操作成功'
deleteGoodApi({ id: row.id }).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
}
})
......
<template>
<div>
<el-card shadow="never" slot="header">
<el-form :inline="true" :model="searchForm" class="demo-form-inline" size="small">
<el-form-item label="商品搜索:">
<el-input v-model="searchForm.proName" placeholder="请输入商品名称" clearable />
<div class="flex">
<el-form :inline="true" :model="searchForm">
<el-form-item label="商品搜索:">
<el-input :size="size" v-model="searchForm.name" placeholder="请输入商品名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" :loading="tableLoading" @click="getList()">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button :loading="tableLoading" @click="reset()">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="wareRef" :searchForm="searchForm" :tableParams="tableParams" :tableData="tableData" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="showImg" slot-scope="scope">
<img class="img-60" :src="scope.scope.pic" />
{{ scope.scope.title }}
<GLTable ref="wareRef" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf">
<span slot="coverImgUrl" slot-scope="scope">
<img class="img-60" :src="scope.scope.coverImgUrl" />
</span>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="updatePrice(scope.scope)">修改价格</el-button>
<el-button type="text" @click="handleEdit(scope.scope)">修改价格</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</span>
</GLTable>
<!-- 表格区域 end -->
......@@ -43,10 +41,7 @@
</template>
<script>
// import {
// GETLISTUSERINFO,
// UPDATEPASSWORD
// } from '@/http/interface'
import { getWarehousListApi, deleteGoodApi } from '@/api/modules/cmmodityLibrary'
import glsxDialog from '@/components/glsx-dialog'
export default {
components: {
......@@ -54,26 +49,36 @@ export default {
},
data() {
return {
size: 'small',
searchForm: {
proName: ''
name: '',
status: '2'
},
// 表格组件
getListApi: getWarehousListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '基本信息',
prop: 'pic',
line: 1,
addHtml: 'showImg'
label: '商品标题',
prop: 'name'
},
{
label: '直播间图片',
prop: 'coverImgUrl',
addHtml: 'coverImgUrl'
},
{
label: '价格(元)',
prop: 'price'
prop: 'price',
formatter: cellValue => {
return cellValue.price2 && cellValue.price1 != cellValue.price2 ? (cellValue.price1 / 100).toFixed(2) + '-' + (cellValue.price2 / 100).toFixed(2) : (cellValue.price1 / 100).toFixed(2)
}
},
{
label: '来源门店',
prop: 'merchant'
prop: 'merchantName'
}
]
},
......@@ -87,7 +92,6 @@ export default {
merchant: 'xxx'
}
],
tableLoading: false,
pageTotal: 0,
userInfo: {},
currentPage: 1,
......@@ -106,67 +110,38 @@ export default {
},
created() {},
mounted: function() {
// this.getList()
},
mounted: function() {},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
/**
* 查询列表
*/
getList: function(current) {
const _this = this
const oParams = _this.getParams()
// oParams.pageNum = current || _this.currentPage
_this.tableLoading = true
let list = [
{
id: 1,
pic: 'https://t7.baidu.com/it/u=4162611394,4275913936&fm=193&f=GIF',
title: '商品标题',
price: 999,
merchant: 'xxx'
}
]
// GETLISTUSERINFO(oParams).then(res => {
// console.log(res)
_this.tableLoading = false
// if (res.returnCode == 0) {
// const { data } = res
// const { total, list } = data
_this.tableData = list || []
// _this.pageTotal = total
// }
// })
},
/**
* 获取查询参数
*/
getParams: function() {
const oParams = this.searchForm
oParams.pageSize = this.pageSize
return oParams
handleReset() {
this.searchForm = {
name: '',
status: '2'
}
this.handleSearch()
},
/**
* 每页展示
*/
changePageSize: function(e) {
this.pageSize = e
this.getList()
handleSearch() {
this.$refs.wareRef.refreshTable()
},
reset() {
this.$refs.wareRef.refreshTable()
handleDelete(row) {
this.$messageBox.alert('是否删除该商品?', '删除', {
confirmButtonText: '确定',
type: 'error',
callback: action => {
// deleteGoodApi({ id: row.id }).then(res => {
// this.$message({
// message: res.code == '0' ? '操作成功' : '操作失败',
// type: res.code == '0' ? 'success' : 'error'
// })
// if (res.code == '0') {
// this.handleSearch()
// }
// })
}
})
},
updatePrice: function() {
handleEdit: function() {
this.showPriceDialog = true
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!