订单
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',
|
||||
|
||||
Reference in New Issue
Block a user