diff --git a/src/views/finance/ReconciliationDepositSlip.vue b/src/views/finance/ReconciliationDepositSlip.vue
index eb27213f..0022fb4a 100644
--- a/src/views/finance/ReconciliationDepositSlip.vue
+++ b/src/views/finance/ReconciliationDepositSlip.vue
@@ -94,7 +94,23 @@
- 生成对账单
+
+ 生成对账单
+
+
+
+ 批量结算
+
导 出
@@ -119,8 +135,12 @@
@selection="selectionChange"
>
-
- handleComputedPrice(slotProps.scope)">计算费用
+
+ handleComputedPrice(slotProps.scope)"
+ >计算费用
@@ -215,7 +235,7 @@
import { ref, reactive, toRefs, computed, onMounted, nextTick } from 'vue';
import functions from '@/utils/functions.js';
import dayjs from 'dayjs';
-import { mapGetters } from 'vuex';
+import { mapGetters, useStore } from 'vuex';
/** 获取字典 */
import { getDictionaryBiz } from '@/api/system/dict';
import {
@@ -226,7 +246,7 @@ import {
postCreateReconciliationOrder,
postCreateFinishWaybillId,
postCreateReconciliationwWaybillId,
- postCalculateRealCostByWaybillId
+ postCalculateRealCostByWaybillId,
} from '@/api/finance/ReconciliationDepositSlip';
import {
downloadXls,
@@ -339,8 +359,32 @@ const tableNodeRef = ref();
const { search, shortcuts, selectionList, drawerShow, page, defaultTime2 } = toRefs(details);
/** vuex */
-const permission = computed(() => mapGetters(['permission', 'tagWel', 'tagList']));
-console.log('permission :>> ', permission);
+const $store = useStore();
+
+const { permission } = $store.getters;
+
+const permissionObj = reactive({
+ // 生成对账单
+ ReconciliationDepositSlip_handleConfirm: computed(() => {
+ return details.pageStatus === 1
+ ? permission.ReconciliationDepositSlip_handleConfirm_toB
+ : permission.ReconciliationDepositSlip_handleConfirm_toC;
+ }),
+ // 批量结算
+ ReconciliationDepositSlip_handleBatchSettle: computed(() => {
+ return details.pageStatus === 1
+ ? permission.ReconciliationDepositSlip_handleBatchSettle_toB
+ : // 暂时没有
+ permission.ReconciliationDepositSlip_handleBatchSettle_toC;
+ }),
+ // 计算费用
+ ReconciliationDepositSlip_handleComputedPrice: computed(() => {
+ return details.pageStatus === 1
+ ? // 暂时没有
+ permission.ReconciliationDepositSlip_handleComputedPrice_toB
+ : permission.ReconciliationDepositSlip_handleComputedPrice_toC;
+ }),
+});
onMounted(async () => {
await nextTick();
@@ -568,6 +612,42 @@ const handleFullScrean = (_type: 'open' | 'close', _name: string) => {
}
};
+/** 批量结算 */
+const handleBatchSettle = () => {
+ try {
+ if (details.selectionList.length === 0) return ElMessage.warning('请选择需要结算的数据');
+
+ ElMessageBox.confirm('是否批量结算?', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning',
+ }).then(async () => {
+ details.popUpShow.confirmVisited = false;
+ try {
+ details.loadingObj.pageLoading = true;
+
+ const submitData = {
+ waybillIds: details.selectionList.map(val => val.waybillId),
+ };
+
+ const res = await postCreateFinishWaybillId(submitData);
+ const { code, msg } = res.data;
+
+ if (code !== 200) return msg && ElMessage.warning(msg);
+ if (msg) ElMessage.success(msg);
+ } catch (error) {
+ console.log('error :>> ', error);
+ } finally {
+ onLoad();
+ details.loadingObj.pageLoading = false;
+ }
+ });
+ } catch (error) {
+ console.log('error :>> ', error);
+ } finally {
+ }
+};
+
/** 生成对账单 */
const handleConfirm = async () => {
await nextTick();
@@ -611,11 +691,25 @@ const handleSubmitConfrim = () => {
try {
details.loadingObj.pageLoading = true;
- const submitData = {
- orderInfoIds: details.selectionList.map(val => val.orderInfoId),
- };
+ let res: any = {};
+
+ // toB
+ if (details.pageStatus === 1) {
+ const submitData = {
+ waybillIds: details.selectionList.map(val => val.waybillId),
+ };
+
+ res = await postCreateReconciliationwWaybillId(submitData);
+ }
+ // toC
+ else {
+ const submitData = {
+ orderInfoIds: details.selectionList.map(val => val.orderInfoId),
+ };
+
+ res = await postCreateReconciliationOrder(submitData);
+ }
- const res = await postCreateReconciliationOrder(submitData);
const { code, msg } = res.data;
if (code !== 200) return msg && ElMessage.warning(msg);
@@ -639,8 +733,8 @@ const handleComputedPrice = ({ row }) => {
try {
details.loadingObj.pageLoading = true;
- // const res = await postReal(row.orderInfoId);
- const res = await postCalculateRealCostByWaybillId(row.waybillId);
+ const res = await postReal(row.orderInfoId);
+ // const res = await postCalculateRealCostByWaybillId(row.waybillId);
const { code, msg } = res.data;
if (code !== 200) return msg && ElMessage.warning(msg);