订单
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
</template>
|
||||
<template slot="content">
|
||||
<ai-card title="基本信息">
|
||||
<template #right>
|
||||
<el-button type="primary" v-if="info.status === '0'" @click="isShow = true">订单核销</el-button>
|
||||
<el-button type="danger" v-if="info.status === '0' || info.status === '1'" @click="cancelOrder">取消订单</el-button>
|
||||
</template>
|
||||
<template #content>
|
||||
<ai-wrapper
|
||||
label-width="120px">
|
||||
@@ -32,7 +36,7 @@
|
||||
:isShowPagination="false"
|
||||
:tableData="[info]"
|
||||
:col-configs="colConfigs"
|
||||
@getList="getList">
|
||||
@getList="() => {}">
|
||||
<el-table-column
|
||||
label="商品"
|
||||
slot="goods"
|
||||
@@ -53,6 +57,19 @@
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-card>
|
||||
<ai-dialog
|
||||
title="订单核销"
|
||||
:visible.sync="isShow"
|
||||
:destroyOnClose="true"
|
||||
width="650px"
|
||||
@onConfirm="onConfirm"
|
||||
@close="form.verificationCode = '', id = ''">
|
||||
<el-form style="height: 200px" class="ai-form" ref="form" :model="form" label-width="120px">
|
||||
<el-form-item label="核销码" style="width: 100%" prop="verificationCode" :rules="[{required: true, message: '请输入核销码', trigger: 'blur'}]">
|
||||
<el-input v-model="form.verificationCode" placeholder="请输入核销码" size="small"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ai-dialog>
|
||||
</template>
|
||||
</ai-detail>
|
||||
</template>
|
||||
@@ -70,7 +87,11 @@
|
||||
data () {
|
||||
return {
|
||||
info: {},
|
||||
isShow: false,
|
||||
id: '',
|
||||
form: {
|
||||
verificationCode: ''
|
||||
},
|
||||
colConfigs: [
|
||||
{ prop: 'goodsSerialNumber', label: '商品ID', align: 'left' },
|
||||
{ slot: 'goods' },
|
||||
@@ -101,6 +122,36 @@
|
||||
})
|
||||
},
|
||||
|
||||
cancelOrder () {
|
||||
this.$confirm('确定取消该订单吗?').then(() => {
|
||||
this.instance.post(`/app/appintegralsupermarketorder/cancel?id=${this.params.id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('取消成功!')
|
||||
this.getInfo(this.params.id)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onConfirm () {
|
||||
this.$refs.form.validate((valid)=> {
|
||||
if(valid) {
|
||||
this.instance.post(`/app/appintegralsupermarketorder/examine`, null, {
|
||||
params: {
|
||||
...this.form,
|
||||
id: this.params.id
|
||||
}
|
||||
}).then(res => {
|
||||
if(res.code == 0) {
|
||||
this.isShow = false
|
||||
this.getInfo(this.params.id)
|
||||
this.$message.success('核销成功')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
cancel (isRefresh) {
|
||||
this.$emit('change', {
|
||||
type: 'GirdList',
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
label="商品"
|
||||
slot="goods"
|
||||
align="left"
|
||||
width="450">
|
||||
width="350">
|
||||
<template v-slot="{ row }">
|
||||
<div class="goods">
|
||||
<ai-uploader
|
||||
@@ -74,12 +74,25 @@
|
||||
<template v-slot="{ row }">
|
||||
<div class="table-options">
|
||||
<el-button type="text" title="取消订单" v-if="row.status === '0' || row.status === '1'" @click="cancel(row.id)">取消订单</el-button>
|
||||
<el-button type="text" title="订单核销" v-if="row.status === '0'" @click="remove(row.id)">订单核销</el-button>
|
||||
<el-button type="text" title="订单核销" v-if="row.status === '0'" @click="id = row.id, isShow = true">订单核销</el-button>
|
||||
<el-button type="text" title="详情" @click="toDetail(row.id)">详情</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
<ai-dialog
|
||||
title="订单核销"
|
||||
:visible.sync="isShow"
|
||||
:destroyOnClose="true"
|
||||
width="650px"
|
||||
@onConfirm="onConfirm"
|
||||
@close="form.verificationCode = '', id = ''">
|
||||
<el-form style="height: 200px" class="ai-form" ref="form" :model="form" label-width="120px">
|
||||
<el-form-item label="核销码" style="width: 100%" prop="verificationCode" :rules="[{required: true, message: '请输入核销码', trigger: 'blur'}]">
|
||||
<el-input v-model="form.verificationCode" placeholder="请输入核销码" size="small"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ai-dialog>
|
||||
</template>
|
||||
</ai-list>
|
||||
</template>
|
||||
@@ -106,17 +119,22 @@
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
},
|
||||
isShow: false,
|
||||
form: {
|
||||
verificationCode: ''
|
||||
},
|
||||
id: '',
|
||||
total: 0,
|
||||
tableData: [],
|
||||
colConfigs: [
|
||||
{ prop: 'goodsSerialNumber', label: '商品ID', align: 'left' },
|
||||
{ slot: 'goods', align: 'center' },
|
||||
{ prop: 'type', label: '商品类型', align: 'center', format: v => this.dict.getLabel('integralSGType', v) },
|
||||
{ prop: 'quantity', label: '数量', align: 'center', format: v => `X${v}` },
|
||||
{ prop: 'quantity', label: '数量', align: 'center', format: v => `x${v}` },
|
||||
{ prop: 'usedIntegral', label: '消耗积分', align: 'center' },
|
||||
{ prop: 'payMoney', label: '兑换后再付', align: 'center' },
|
||||
{ prop: 'integralUserName', label: '兑换人', align: 'center' },
|
||||
{ prop: 'createTime', label: '创建时间', align: 'center' },
|
||||
{ prop: 'createTime', width: 150, label: '创建时间', align: 'center' },
|
||||
{ prop: 'status', label: '状态', align: 'center', format: v => this.dict.getLabel('integralSGOStatus', v) }
|
||||
]
|
||||
}
|
||||
@@ -145,6 +163,25 @@
|
||||
})
|
||||
},
|
||||
|
||||
onConfirm () {
|
||||
this.$refs.form.validate((valid)=> {
|
||||
if(valid) {
|
||||
this.instance.post(`/app/appintegralsupermarketorder/examine`, null, {
|
||||
params: {
|
||||
...this.form,
|
||||
id: this.id
|
||||
}
|
||||
}).then(res => {
|
||||
if(res.code == 0) {
|
||||
this.isShow = false
|
||||
this.getList()
|
||||
this.$message.success('核销成功')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
toDetail (id) {
|
||||
this.$emit('change', {
|
||||
type: 'GirdDetail',
|
||||
|
||||
Reference in New Issue
Block a user