增加订单审核操作:增加到审核、审核失败状态

This commit is contained in:
邱贞招 2023-12-26 17:19:30 +08:00
parent 1a571e3519
commit 6bc3939a1b
2 changed files with 99 additions and 26 deletions

View File

@ -122,6 +122,18 @@ export function orderRefuseApi(params) {
});
}
/**
* 订单 审核失败
* @param prams
*/
export function orderAuditApi(audit,params) {
return request({
url: `/admin/store/order/audit/${audit}`,
method: 'get',
params,
});
}
/**
* 订单 立即退款
* @param prams

View File

@ -19,6 +19,9 @@
<el-radio-button label="unPaid"
>未支付 {{ '(' + orderChartType.unPaid ? orderChartType.unPaid : 0 + ')' }}</el-radio-button
>
<el-radio-button label="audit"
>待审核 {{ '(' + orderChartType.audit ? orderChartType.audit : 0 + ')' }}</el-radio-button
>
<el-radio-button label="notShipped"
>未发货 {{ '(' + orderChartType.notShipped ? orderChartType.notShipped : 0 + ')' }}</el-radio-button
>
@ -41,6 +44,9 @@
<el-radio-button label="refunded"
>已退款 {{ '(' + orderChartType.refunded ? orderChartType.refunded : 0 + ')' }}</el-radio-button
>
<el-radio-button label="auditReject"
>已驳回 {{ '(' + orderChartType.auditReject ? orderChartType.auditReject : 0 + ')' }}</el-radio-button
>
<el-radio-button label="deleted"
>已删除 {{ '(' + orderChartType.deleted ? orderChartType.deleted : 0 + ')' }}</el-radio-button
>
@ -203,6 +209,14 @@
class="mr10"
>编辑</el-button
>
<el-button
v-if="scope.row.orderType == '[分期订单]' && scope.row.statusStr.key === 'audit' && checkPermi(['admin:order:audit'])"
type="text"
size="small"
@click="onAudit(scope.row)"
class="mr10"
>审核</el-button
>
<el-button
v-if="
scope.row.statusStr.key === 'notShipped' &&
@ -253,15 +267,9 @@
<el-dropdown-item
@click.native="onInstallmentBills(scope.row.id)"
v-if="checkPermi(['admin:order:info'])"
v-show="scope.row.orderType == '[分期订单]'"
v-show="scope.row.orderType == '[分期订单]' && scope.row.statusStr.key != 'audit' && scope.row.statusStr.key != 'auditReject'"
>查看账单</el-dropdown-item
>
<el-dropdown-item
@click.native="onAudit(scope.row.id)"
v-if="checkPermi(['admin:order:info'])"
v-show="scope.row.orderType == '[分期订单]'"
>审核</el-dropdown-item
>
<el-dropdown-item
@click.native="onOrderLog(scope.row.orderId)"
v-if="checkPermi(['admin:order:status:list'])"
@ -379,6 +387,25 @@
<!--详情-->
<details-from ref="orderDetail" :orderId="orderId" />
<!--审核-->
<el-dialog
title="审核"
v-if="AuditVisible"
:visible.sync="AuditVisible"
width="500px"
:before-close="AudithandleClose"
>
<zb-parser
:form-id="145"
:is-create="1"
:edit-data="AuditData"
@submit="AudithandlerSubmit"
@resetForm="resetFormAudithand"
/>
</el-dialog>
<!-- 发送货 -->
<order-send
ref="send"
@ -424,20 +451,20 @@
</template>
<script>
import {
orderListDataApi,
orderStatusNumApi,
writeUpdateApi,
orderListApi,
updatePriceApi,
orderLogApi,
orderMarkApi,
orderDeleteApi,
orderRefuseApi,
orderRefundApi,
orderPrint,
orderDetailApi,
} from '@/api/order';
import {
orderListDataApi,
orderStatusNumApi,
writeUpdateApi,
orderListApi,
updatePriceApi,
orderLogApi,
orderMarkApi,
orderDeleteApi,
orderRefuseApi,
orderRefundApi,
orderPrint,
orderDetailApi, orderAuditApi
} from '@/api/order'
import zbParser from '@/components/FormGenerator/components/parser/ZBParser';
import detailsFrom from './orderDetail';
import orderSend from './orderSend';
@ -479,6 +506,8 @@ export default {
],
RefuseVisible: false,
RefuseData: {},
AuditVisible: false,//
AuditData: {},
orderId: '',
refundVisible: false,
refundData: {},
@ -576,6 +605,9 @@ export default {
resetFormRefusehand() {
this.RefuseVisible = false;
},
resetFormAudithand() {
this.AuditVisible = false;
},
resetForm(formValue) {
this.dialogVisible = false;
},
@ -598,6 +630,10 @@ export default {
RefusehandleClose() {
this.RefuseVisible = false;
},
//
AudithandleClose() {
this.AuditVisible = false;
},
onOrderRefuse(row) {
this.orderids = row.orderId;
this.RefuseData = {
@ -613,6 +649,25 @@ export default {
this.getList();
});
},
//
AudithandlerSubmit(formValue) {
let data;
if(formValue.audit == "reject" && (formValue.reason == undefined || formValue.reason == "")){
this.$message.error("驳回原因不能为空");
return
}
if(formValue.audit == "pass"){
data = { orderNo: this.orderids, reason: "" ,audit:formValue.audit};
}else{
data = { orderNo: this.orderids, reason: formValue.reason ,audit:formValue.audit};
}
console.log("formValue-------"+JSON.stringify(data));
orderAuditApi(formValue.audit,data).then((res) => {
this.$message.success('操作成功');
this.AuditVisible = false;
this.getList();
});
},
// 退
refundhandleClose() {
this.refundVisible = false;
@ -707,11 +762,14 @@ export default {
this.getInstallmentList(id);
},
//
onAudit(id) {
this.tableFromLog.limit = 10;
this.orderId = id;
this.dialogVisibleInstallment = true;
// this.getInstallmentList(id);
onAudit(row) {
this.orderids = row.orderId;
this.AuditData = {
orderId: row.orderId,
audit: "pass",
reason: ""
};
this.AuditVisible = true;
},
//
onOrderLog(id) {
@ -1015,4 +1073,7 @@ export default {
::v-deep .el-checkbox__input.is-checked + .el-checkbox__label {
color: #606266;
}
.el-form-item__content{
float: right;
}
</style>