|
@@ -29,7 +29,7 @@
|
|
|
</div>
|
|
|
<dateSelectList @update="update($event)"></dateSelectList>
|
|
|
<typeSelectList @upselectdata="upselectdata($event)"></typeSelectList>
|
|
|
- <div v-if="!noData(salesVolume, salesNumber, orderNumber)" class="o-plr-8">
|
|
|
+ <div v-if="!noData(salesVolume, salesNumber, orderNumber)" class="o-plr-8 o-pt-15">
|
|
|
<div class="outer5 flex-col">
|
|
|
<div class="block5 flex-col">
|
|
|
<div class="outerBox flex-row">
|
|
@@ -210,7 +210,7 @@
|
|
|
<span class="word8">{{ $t('orderCenter.refunded') }}</span>
|
|
|
<span class="info4">{{ refundObject.refundAmount }}</span>
|
|
|
</div>
|
|
|
- <van-button size="small" v-if="refundObject.status === 1" @click="noticeClk(refundObject)" round
|
|
|
+ <van-button size="small" v-if="refundObject.status === 1 && isRefund" @click="noticeClk(refundObject)" round
|
|
|
type="primary" style="margin-top: 20px;">
|
|
|
{{ $t('orderCenter.initiateRefund') }}
|
|
|
</van-button>
|
|
@@ -253,13 +253,12 @@
|
|
|
<div class="btnFooter">
|
|
|
<van-checkbox class="checkAllBtn o-mt-5" v-model="checkedAll" @click="checkAll">全选</van-checkbox>
|
|
|
<div class="o-mt-5">
|
|
|
- <span class="">退款总额:</span>
|
|
|
+ <span class="">{{ $t('orderCenter.totalRefund') }}:</span>
|
|
|
<span class="totalRefund o-pr-15">¥ {{ totalRefund.toFixed(2) }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</kDialog>
|
|
|
- <loading v-model:show="isLoading" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -319,14 +318,14 @@ export default {
|
|
|
}
|
|
|
// 点击增加按钮
|
|
|
const plusRefundGood = (index) => {
|
|
|
- console.log(isChecked.value[index])
|
|
|
+ // console.log(isChecked.value[index])
|
|
|
if (isChecked.value[index]) {
|
|
|
totalRefund.value = parseFloat((totalRefund.value + orderDetails.value[index].price).toFixed(2));
|
|
|
}
|
|
|
}
|
|
|
// 点击减少按钮
|
|
|
const minusRefundGood = (index) => {
|
|
|
- console.log(isChecked.value[index])
|
|
|
+ // console.log(isChecked.value[index])
|
|
|
if (isChecked.value[index]) {
|
|
|
totalRefund.value = parseFloat((totalRefund.value - orderDetails.value[index].price).toFixed(2));
|
|
|
}
|
|
@@ -334,32 +333,37 @@ export default {
|
|
|
// 点击弹出退款弹窗
|
|
|
const noticeClk = (row) => {
|
|
|
// console.log('row', row)
|
|
|
- isChecked.value = [];
|
|
|
- orderDetails.value = [];
|
|
|
- refundNum.value = [];
|
|
|
- checkedAll.value = false;
|
|
|
- totalRefund.value = 0;
|
|
|
- console.log("isChecked", isChecked.value);
|
|
|
- // cofficentForm.price = row.price;
|
|
|
- // cofficentForm.maxPrice = row.price;
|
|
|
- cofficentForm.id = row.id;
|
|
|
- // cofficentForm.maxNumber = row.productNumber;
|
|
|
- // cofficentForm.productNumber = row.productNumber;
|
|
|
- row.orderDetails.forEach(item => {
|
|
|
- console.log(item)
|
|
|
- if (item.refundStatus == '1' || item.refundStatus == '2') {
|
|
|
- orderDetails.value.push(item);
|
|
|
- if (item.refundQuantity != null) {
|
|
|
- refundNum.value.push(item.productNumber - item.refundQuantity);
|
|
|
- } else {
|
|
|
- refundNum.value.push(item.productNumber);
|
|
|
+ if (row.orderDetails.length > 0) {
|
|
|
+ isChecked.value = [];
|
|
|
+ orderDetails.value = [];
|
|
|
+ refundNum.value = [];
|
|
|
+ checkedAll.value = false;
|
|
|
+ totalRefund.value = 0;
|
|
|
+ // console.log("isChecked", isChecked.value);
|
|
|
+ // cofficentForm.price = row.price;
|
|
|
+ // cofficentForm.maxPrice = row.price;
|
|
|
+ cofficentForm.id = row.id;
|
|
|
+ // cofficentForm.maxNumber = row.productNumber;
|
|
|
+ // cofficentForm.productNumber = row.productNumber;
|
|
|
+ row.orderDetails.forEach(item => {
|
|
|
+ // console.log(item)
|
|
|
+ if (item.refundStatus == '1' || item.refundStatus == '2') {
|
|
|
+ orderDetails.value.push(item);
|
|
|
+ if (item.refundQuantity != null) {
|
|
|
+ refundNum.value.push(item.productNumber - item.refundQuantity);
|
|
|
+ } else {
|
|
|
+ refundNum.value.push(item.productNumber);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
- // 根据orderDetails的长度,向isChecked添加相应数量的false
|
|
|
- isChecked.value = Array.from({ length: orderDetails.value.length }, () => false);
|
|
|
- console.log(refundNum.value);
|
|
|
- kDialogRef.value.openDialog();
|
|
|
+ });
|
|
|
+ // 根据orderDetails的长度,向isChecked添加相应数量的false
|
|
|
+ isChecked.value = Array.from({ length: orderDetails.value.length }, () => false);
|
|
|
+ // console.log(refundNum.value);
|
|
|
+ kDialogRef.value.openDialog();
|
|
|
+ } else {
|
|
|
+ Toast("请联系管理员");
|
|
|
+ return;
|
|
|
+ }
|
|
|
};
|
|
|
// 点击全选按钮
|
|
|
const checkAll = () => {
|
|
@@ -389,7 +393,7 @@ export default {
|
|
|
Toast(t('orderCenter.refundPlace'));
|
|
|
return;
|
|
|
} else {
|
|
|
- console.log(cofficentForm);
|
|
|
+ // console.log(cofficentForm);
|
|
|
Dialog.confirm({
|
|
|
// title: "提示",
|
|
|
message: t('orderCenter.refundCheck'),
|
|
@@ -397,7 +401,7 @@ export default {
|
|
|
isLoading.value = true; // 开始加载
|
|
|
refundAjax();
|
|
|
isLoading.value = false; // 加载完成
|
|
|
-
|
|
|
+
|
|
|
kDialogRef.value.closeDialog();
|
|
|
}).catch(() => {
|
|
|
return;
|
|
@@ -419,10 +423,10 @@ export default {
|
|
|
});
|
|
|
} else {
|
|
|
Toast.fail(data.message);
|
|
|
- }
|
|
|
+ }
|
|
|
} catch (error) {
|
|
|
Toast.fail(t('orderCenter.requestFailed'));
|
|
|
- }
|
|
|
+ }
|
|
|
};
|
|
|
// 修改的价格
|
|
|
const cofficentForm = reactive({
|
|
@@ -441,7 +445,14 @@ export default {
|
|
|
// console.log("orderDetails:", row.orderDetails[0].productNo);
|
|
|
return require(`../../assets/order/spunSugar/goods/${row.orderDetails[0].productNo}.png`);
|
|
|
} else {
|
|
|
- return require(`../../assets/order/spunSugar/goods/A15.png`);
|
|
|
+ if (row.productNo != null) {
|
|
|
+ return require(`../../assets/order/spunSugar/goods/${row.productNo}.png`);
|
|
|
+ }
|
|
|
+ if (row.machineType == null || row.machineType == '0') {
|
|
|
+ return require(`../../assets/order/spunSugar/goods/A01.png`);
|
|
|
+ } else {
|
|
|
+ return require(`../../assets/order/spunSugar/goods/B01.png`);
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
// 订单明细商品图片路径处理
|
|
@@ -486,6 +497,7 @@ export default {
|
|
|
size: 20, // 页大小
|
|
|
status: "",//支付状态
|
|
|
companyType: "", // 公司平台
|
|
|
+ machineType: "", // 设备类型
|
|
|
});
|
|
|
let chartType = "day";
|
|
|
// 获取订单列表数据
|
|
@@ -585,7 +597,9 @@ export default {
|
|
|
adminId: user.id,
|
|
|
});
|
|
|
if (data.code === '00000') {
|
|
|
- huifuId.value = data.data.huifuId;
|
|
|
+ if(data.data != null) {
|
|
|
+ huifuId.value = data.data.huifuId;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 获取当天
|
|
@@ -602,6 +616,12 @@ export default {
|
|
|
getAccountDetail(user.id);
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ // 查询是否有退款权限
|
|
|
+ const isRefund = user.menuCodeList.some((item) => {
|
|
|
+ return item === "M16";
|
|
|
+ });
|
|
|
+
|
|
|
// 跳转订单导出
|
|
|
const gotoOrderExcel = async () => {
|
|
|
// router.push({ path: "/orderExport" });
|
|
@@ -730,6 +750,7 @@ export default {
|
|
|
payType:
|
|
|
searchParams.payType === "" ? null : searchParams.payType,
|
|
|
companyType: searchParams.companyType,
|
|
|
+ machineType: searchParams.machineType,
|
|
|
};
|
|
|
const { data } = await getStatistics(params);
|
|
|
if (data.code && data.data) {
|
|
@@ -791,7 +812,8 @@ export default {
|
|
|
checkGood,
|
|
|
plusRefundGood,
|
|
|
minusRefundGood,
|
|
|
- isLoading
|
|
|
+ isLoading,
|
|
|
+ isRefund
|
|
|
};
|
|
|
},
|
|
|
};
|