Commit 08bb1a34 authored by 王's avatar

商品添加备注

parent 9b880b31
...@@ -113,13 +113,19 @@ ...@@ -113,13 +113,19 @@
{{scope.row.status | goodsStatus}} {{scope.row.status | goodsStatus}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
label="备注">
<template slot-scope="scope">
{{scope.row.desc | goodsDesc}}
</template>
</el-table-column>
<el-table-column <el-table-column
width="60" width="60"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover <el-popover
placement="top" placement="top"
width="600"> width="680">
<div style="text-align: center"> <div style="text-align: center">
<el-button size="mini" plain type="primary" @click="detail(scope.row)"> <el-button size="mini" plain type="primary" @click="detail(scope.row)">
查看详情 查看详情
...@@ -146,6 +152,9 @@ ...@@ -146,6 +152,9 @@
<el-button size="mini" plain @click="conflict(scope.row)"> <el-button size="mini" plain @click="conflict(scope.row)">
冲突商品 冲突商品
</el-button> </el-button>
<el-button size="mini" plain type="success" @click="addComment(scope.row)">
编辑备注
</el-button>
<el-button size="mini" plain type="danger" @click="onDel(scope.row)" v-if="$store.state.deletePermission"> <el-button size="mini" plain type="danger" @click="onDel(scope.row)" v-if="$store.state.deletePermission">
删除 删除
</el-button> </el-button>
...@@ -192,7 +201,7 @@ ...@@ -192,7 +201,7 @@
</template> </template>
<script> <script>
import {getGoodsListApi,deleteGoodsApi,downGoodsApi,upGoodsApi,bindOtherApi,conflictApi,copyShopApi,getLessonApi} from "../../service/api"; import {getGoodsListApi,deleteGoodsApi,downGoodsApi,upGoodsApi,bindOtherApi,conflictApi,copyShopApi,getLessonApi,editGoodsDescApi} from "../../service/api";
import {ISORNOT,GOODSTYPE,LESSONTYPE,GOODSSTATUS} from "../../util/wordbook"; import {ISORNOT,GOODSTYPE,LESSONTYPE,GOODSSTATUS} from "../../util/wordbook";
import page from '../framework/page' import page from '../framework/page'
import dialogCom from './dialog' import dialogCom from './dialog'
...@@ -246,6 +255,11 @@ ...@@ -246,6 +255,11 @@
goodsStatus(value){ goodsStatus(value){
return GOODSSTATUS[value] return GOODSSTATUS[value]
}, },
goodsDesc(value){
let _desc = JSON.parse(value)
console.log('goodsDesc value', _desc.desc)
return _desc.desc
}
}, },
mounted(){ mounted(){
this.getUser(); this.getUser();
...@@ -449,6 +463,23 @@ ...@@ -449,6 +463,23 @@
this.classList = res.list; this.classList = res.list;
}) })
}, },
addComment(row){
let _descJson = JSON.parse(row.desc) || {}
this.$prompt('', '编辑备注', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType:'textarea',
inputValue: _descJson.desc || ''
}).then(({ value }) => {
editGoodsDescApi(row.id,{desc: value}).then(res=>{
this.$message({
type: 'success',
message: '编辑备注成功'
});
this.getUser()
});
})
}
} }
} }
</script> </script>
......
...@@ -630,3 +630,9 @@ const getSyncUserUrl = '/api/admin/student/mobile'; ...@@ -630,3 +630,9 @@ const getSyncUserUrl = '/api/admin/student/mobile';
export const getSyncUserApi = function (json) { export const getSyncUserApi = function (json) {
return Vue.prototype.$fetch(getSyncUserUrl,json) return Vue.prototype.$fetch(getSyncUserUrl,json)
}; };
// 修改商品备注
const editGoodsDescUrl = `/api/admin/goods/info/desc/`;
export const editGoodsDescApi = function (goodsId, json) {
return Vue.prototype.$put(`${editGoodsDescUrl}${goodsId}`, 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