feat: add order accept
This commit is contained in:
@@ -2,15 +2,15 @@ import request from '@/axios';
|
|||||||
|
|
||||||
export const getList = (current, size, params) => {
|
export const getList = (current, size, params) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/kiosk/order/page',
|
url: '/kiosk/order/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: {
|
||||||
...params,
|
...params,
|
||||||
current,
|
current,
|
||||||
size,
|
size
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export const getDetail = (id) => {
|
export const getDetail = (id) => {
|
||||||
return request({
|
return request({
|
||||||
@@ -19,32 +19,39 @@ export const getDetail = (id) => {
|
|||||||
params: {
|
params: {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
export const remove = (ids) => {
|
export const remove = (ids) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/kiosk/order/remove',
|
url: '/kiosk/order/remove',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
params: {
|
params: {
|
||||||
ids,
|
ids
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export const add = (row) => {
|
export const add = (row) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/kiosk/order/submit',
|
url: '/kiosk/order/submit',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: row
|
data: row
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
export const update = (row) => {
|
export const update = (row) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/kiosk/order/submit',
|
url: '/kiosk/order/submit',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: row
|
data: row
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
|
export const accept = (row) => {
|
||||||
|
return request({
|
||||||
|
url: '/kiosk/order/accept',
|
||||||
|
method: 'post',
|
||||||
|
data: row
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|||||||
@@ -32,9 +32,10 @@ export default {
|
|||||||
hide: true,
|
hide: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "SerialNumber",
|
label: "Serial",
|
||||||
prop: "serialNumber",
|
prop: "serialNumber",
|
||||||
type: "input",
|
type: "input",
|
||||||
|
search: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Phone",
|
label: "Phone",
|
||||||
|
|||||||
@@ -32,9 +32,15 @@
|
|||||||
icon="el-icon-setting"
|
icon="el-icon-setting"
|
||||||
@click.stop="handleDataSub(row)">Detail
|
@click.stop="handleDataSub(row)">Detail
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button type="text"
|
||||||
|
icon="el-icon-circle-check"
|
||||||
|
v-if="row.status === 1"
|
||||||
|
@click.stop="handleAccept(row)">Accept
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</avue-crud>
|
</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%">
|
:before-close="handleSubClose" size="80%">
|
||||||
<basic-container>
|
<basic-container>
|
||||||
<avue-crud :option="optionSub"
|
<avue-crud :option="optionSub"
|
||||||
@@ -60,7 +66,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getList, getDetail, add, update, remove } from '@/api/kiosk/order';
|
import { getList, getDetail, add, update, remove, accept } from '@/api/kiosk/order';
|
||||||
import {
|
import {
|
||||||
getList as getListSub,
|
getList as getListSub,
|
||||||
getDetail as getDetailSub,
|
getDetail as getDetailSub,
|
||||||
@@ -231,10 +237,10 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad(page, params = {}) {
|
onLoad(page, params = {}) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const {} = this.query;
|
// const {} = this.query;
|
||||||
|
//
|
||||||
let values = {};
|
// let values = {};
|
||||||
getList(page.currentPage, page.pageSize, values).then(res => {
|
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
||||||
const data = res.data.data;
|
const data = res.data.data;
|
||||||
this.page.total = data.total;
|
this.page.total = data.total;
|
||||||
this.data = data.records;
|
this.data = data.records;
|
||||||
@@ -252,6 +258,23 @@ export default {
|
|||||||
handleSubClose(hide) {
|
handleSubClose(hide) {
|
||||||
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) {
|
rowSaveSub(row, loading, done) {
|
||||||
row = {
|
row = {
|
||||||
...row,
|
...row,
|
||||||
|
|||||||
Reference in New Issue
Block a user