Commit 08bb1a34 authored by 王's avatar

商品添加备注

parent 9b880b31
......@@ -113,13 +113,19 @@
{{scope.row.status | goodsStatus}}
</template>
</el-table-column>
<el-table-column
label="备注">
<template slot-scope="scope">
{{scope.row.desc | goodsDesc}}
</template>
</el-table-column>
<el-table-column
width="60"
label="操作">
<template slot-scope="scope">
<el-popover
placement="top"
width="600">
width="680">
<div style="text-align: center">
<el-button size="mini" plain type="primary" @click="detail(scope.row)">
查看详情
......@@ -146,6 +152,9 @@
<el-button size="mini" plain @click="conflict(scope.row)">
冲突商品
</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>
......@@ -192,7 +201,7 @@
</template>
<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 page from '../framework/page'
import dialogCom from './dialog'
......@@ -246,6 +255,11 @@
goodsStatus(value){
return GOODSSTATUS[value]
},
goodsDesc(value){
let _desc = JSON.parse(value)
console.log('goodsDesc value', _desc.desc)
return _desc.desc
}
},
mounted(){
this.getUser();
......@@ -449,6 +463,23 @@
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>
......
......@@ -630,3 +630,9 @@ const getSyncUserUrl = '/api/admin/student/mobile';
export const getSyncUserApi = function (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