Commit 9f6067a9 authored by 王's avatar

二维码添加备注

parent 451a53c8
......@@ -80,11 +80,22 @@
</a>
</template>
</el-table-column>
<el-table-column
prop="desc"
label="备注">
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="150">
width="200">
<template slot-scope="scope">
<el-button
@click="editComment(scope.$index, list)"
type="text"
size="small"
v-if="!$store.state.readonly">
备注
</el-button>
<el-button
@click.native.prevent="editRow(scope.$index, list)"
type="text"
......@@ -108,7 +119,7 @@
<script>
import dialogDiv from './dialog'
import {getQrCodeListApi,getQrCodeDetailUrlApi} from "../../service/api";
import {getQrCodeListApi,getQrCodeDetailUrlApi,updateQrcodeDescApi} from "../../service/api";
import {QRCODETYPE,QRSTATUS,QRTYPE} from "../../util/wordbook";
import page from '../framework/page'
export default {
......@@ -244,6 +255,22 @@
this.newObj.show = true;
});
},
editComment(index, list) {
this.$prompt('', '编辑备注', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType:'textarea',
inputValue: list[index].desc ? list[index].desc : ''
}).then(({ value }) => {
updateQrcodeDescApi(list[index].id,{desc: value}).then(res=>{
this.$message({
type: 'success',
message: '编辑备注成功'
});
this.initPage()
});
})
},
detail(index, list){
let _obj = list[index]
getQrCodeDetailUrlApi(_obj.id).then(res=> {
......
......@@ -159,7 +159,7 @@
},
methods: {
editComment(id, desc) {
this.$prompt('编辑备注', '提示', {
this.$prompt('', '编辑备注', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType:'textarea',
......
......@@ -610,3 +610,8 @@ const getCouponListUrl = 'api/admin/order/coupon';
export const getCouponListApi = function (json) {
return Vue.prototype.$fetch(getCouponListUrl, json)
};
// 更新二维码备注
const updateQrcodeDescUrl = 'api/admin/wechat/qrcode/desc';
export const updateQrcodeDescApi = function (id, json) {
return Vue.prototype.$put(`${updateQrcodeDescUrl}/${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