Commit 73d24001 authored by 王's avatar

修改商品数量

parent 6c4a0db1
......@@ -107,6 +107,10 @@
{{scope.row.is_real | isOrNot}}
</template>
</el-table-column>
<el-table-column
prop="buy_nums"
label="商品购买数量">
</el-table-column>
<el-table-column
label="状态">
<template slot-scope="scope">
......@@ -125,7 +129,7 @@
<template slot-scope="scope">
<el-popover
placement="top"
width="680">
width="800">
<div style="text-align: center">
<el-button size="mini" plain type="primary" @click="detail(scope.row)">
查看详情
......@@ -155,6 +159,9 @@
<el-button size="mini" plain type="success" @click="addComment(scope.row)">
编辑备注
</el-button>
<el-button size="mini" plain type="primary" @click="updateGoodsNumber(scope.row)">
修改购买数量
</el-button>
<el-button size="mini" plain type="danger" @click="onDel(scope.row)" v-if="$store.state.deletePermission">
删除
</el-button>
......@@ -201,7 +208,7 @@
</template>
<script>
import {getGoodsListApi,deleteGoodsApi,downGoodsApi,upGoodsApi,bindOtherApi,conflictApi,copyShopApi,getLessonApi,editGoodsDescApi} from "../../service/api";
import {getGoodsListApi,deleteGoodsApi,downGoodsApi,upGoodsApi,bindOtherApi,conflictApi,copyShopApi,getLessonApi,editGoodsDescApi,updateGoodsNumbeApi} from "../../service/api";
import {ISORNOT,GOODSTYPE,LESSONTYPE,GOODSSTATUS} from "../../util/wordbook";
import page from '../framework/page'
import dialogCom from './dialog'
......@@ -478,6 +485,22 @@
this.getUser()
});
})
},
updateGoodsNumber(row){
this.$prompt('', '修改商品购买数量', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType:'number',
inputValue: row.buy_nums || 0
}).then(({ value }) => {
updateGoodsNumbeApi(row.id,{buy_nums: parseInt(value)}).then(res=>{
this.$message({
type: 'success',
message: '修改商品购买数量成功'
});
this.getUser()
});
})
}
}
}
......
......@@ -371,8 +371,6 @@
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log('json form id', dia.form.id)
console.log('json', json)
updateSourceApi(dia.form.id,json).then(()=>{
this.$message({
type: 'success',
......
......@@ -704,3 +704,8 @@ const delSourceUrl = `api/admin/code/rule/`;
export const delSourceApi = function (id) {
return Vue.prototype.$del(`${delSourceUrl}${id}`)
};
// 修改商品购买数量
const updateGoodsNumberUrl = 'api/admin/goods/buy/nums';
export const updateGoodsNumbeApi = function (id,json) {
return Vue.prototype.$put(`${updateGoodsNumberUrl}/${id}`,json)
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment