feat: add order accept
This commit is contained in:
@@ -2,15 +2,15 @@ import request from '@/axios';
|
||||
|
||||
export const getList = (current, size, params) => {
|
||||
return request({
|
||||
url: '/kiosk/order/page',
|
||||
url: '/kiosk/order/list',
|
||||
method: 'get',
|
||||
params: {
|
||||
...params,
|
||||
current,
|
||||
size,
|
||||
size
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const getDetail = (id) => {
|
||||
return request({
|
||||
@@ -19,32 +19,39 @@ export const getDetail = (id) => {
|
||||
params: {
|
||||
id
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const remove = (ids) => {
|
||||
return request({
|
||||
url: '/kiosk/order/remove',
|
||||
method: 'post',
|
||||
params: {
|
||||
ids,
|
||||
ids
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const add = (row) => {
|
||||
return request({
|
||||
url: '/kiosk/order/submit',
|
||||
method: 'post',
|
||||
data: row
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const update = (row) => {
|
||||
return request({
|
||||
url: '/kiosk/order/submit',
|
||||
method: 'post',
|
||||
data: row
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const accept = (row) => {
|
||||
return request({
|
||||
url: '/kiosk/order/accept',
|
||||
method: 'post',
|
||||
data: row
|
||||
});
|
||||
};
|
||||
|
||||
@@ -32,9 +32,10 @@ export default {
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "SerialNumber",
|
||||
label: "Serial",
|
||||
prop: "serialNumber",
|
||||
type: "input",
|
||||
search: true,
|
||||
},
|
||||
{
|
||||
label: "Phone",
|
||||
|
||||
@@ -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