feat: add order accept
This commit is contained in:
@@ -32,9 +32,15 @@
|
||||
icon="el-icon-setting"
|
||||
@click.stop="handleDataSub(row)">Detail
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
icon="el-icon-circle-check"
|
||||
v-if="row.status === 1"
|
||||
@click.stop="handleAccept(row)">Accept
|
||||
</el-button>
|
||||
</template>
|
||||
</avue-crud>
|
||||
<el-drawer :title="`[${orderName}:${serialNumber}] Detail`" v-model="subVisible" :direction="direction" append-to-body
|
||||
<el-drawer :title="`[${orderName}:${serialNumber}] Detail`" v-model="subVisible" :direction="direction"
|
||||
append-to-body
|
||||
:before-close="handleSubClose" size="80%">
|
||||
<basic-container>
|
||||
<avue-crud :option="optionSub"
|
||||
@@ -60,7 +66,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getList, getDetail, add, update, remove } from '@/api/kiosk/order';
|
||||
import { getList, getDetail, add, update, remove, accept } from '@/api/kiosk/order';
|
||||
import {
|
||||
getList as getListSub,
|
||||
getDetail as getDetailSub,
|
||||
@@ -231,10 +237,10 @@ export default {
|
||||
},
|
||||
onLoad(page, params = {}) {
|
||||
this.loading = true;
|
||||
const {} = this.query;
|
||||
|
||||
let values = {};
|
||||
getList(page.currentPage, page.pageSize, values).then(res => {
|
||||
// const {} = this.query;
|
||||
//
|
||||
// let values = {};
|
||||
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
||||
const data = res.data.data;
|
||||
this.page.total = data.total;
|
||||
this.data = data.records;
|
||||
@@ -252,6 +258,23 @@ export default {
|
||||
handleSubClose(hide) {
|
||||
hide();
|
||||
},
|
||||
handleAccept(row) {
|
||||
this.$confirm('Confirmation for Payment?', {
|
||||
confirmButtonText: 'Confirm',
|
||||
cancelButtonText: 'Cancel',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
return accept(row);
|
||||
})
|
||||
.then(() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: 'Success!'
|
||||
});
|
||||
});
|
||||
},
|
||||
rowSaveSub(row, loading, done) {
|
||||
row = {
|
||||
...row,
|
||||
|
||||
Reference in New Issue
Block a user