Browse Source

修复部分bug

dev-xx
qb 6 months ago
parent
commit
b9fe3f4808
  1. 12
      src/api/finance/ReconciliationDepositSlip.js
  2. 749
      src/option/finance/ReconciliationDepositSlip.js
  3. 1
      src/utils/util.js
  4. 28
      src/views/distribution/reservation/reservation.vue
  5. 216
      src/views/finance/ReconciliationDepositSlip.vue

12
src/api/finance/ReconciliationDepositSlip.js

@ -13,6 +13,18 @@ export const postPageList = data => {
});
};
/**
* 导出
*/
export const postOrderInfoListExport = data => {
return request({
url: '/api/logpm-statisticsdata/merchantStatistics/orderInfoListExport',
method: 'post',
data,
responseType: 'blob'
});
}
/**
* 确认结算
* @param {*} data

749
src/option/finance/ReconciliationDepositSlip.js

File diff suppressed because it is too large Load Diff

1
src/utils/util.js

@ -495,6 +495,7 @@ export const getWinHeight = () => {
*/
export const setNodeHeight = async (_node, _height = '', isDelayed = false) => {
const _fn = async (_node, _height) => {
console.log('123123 :>> ', 123123);
await nextTick();
const _defaultHeight = getWinHeight();
// 判断是否传入的是数组

28
src/views/distribution/reservation/reservation.vue

@ -1496,20 +1496,20 @@ export default {
item.periodOfTime = d.dictValue;
}
});
let pa = [];
if (item.serveType.length > 1) {
pa = item.serveType.split(',');
} else {
pa.push(item.serveType);
}
this.addvalueServeTypeData.forEach(f => {
pa.forEach((p, index) => {
if (p === f.dictKey) {
pa[index] = f.dictValue;
}
});
});
item.serveType = pa.join(',');
// let pa = [];
// if (item.serveType.length > 1) {
// pa = item.serveType.split(',');
// } else {
// pa.push(item.serveType);
// }
// this.addvalueServeTypeData.forEach(f => {
// pa.forEach((p, index) => {
// if (p === f.dictKey) {
// pa[index] = f.dictValue;
// }
// });
// });
// item.serveType = pa.join(',');
});
}
this.page.total = data.total;

216
src/views/finance/ReconciliationDepositSlip.vue

@ -26,16 +26,13 @@
<!-- 审核 -->
<el-button type="primary" icon="Stamp" @click="handleConfirm">生成对账单</el-button>
<!-- 计算费用 -->
<el-button type="primary" icon="Stamp" @click="handleConfirm">计算费用</el-button>
<!-- 导出 -->
<el-button type="primary" icon="Download" @click="handleExport"> </el-button>
</div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="Operation" @click="showdrawer(true, item)" circle></el-button>
<el-button icon="Operation" @click="showdrawer(item, true)" circle></el-button>
<el-button icon="Search" @click="searchHide" circle></el-button>
</div>
</div>
@ -46,14 +43,14 @@
:columnList="item.columnList"
:tableData="details.data"
:loading="details.loadingObj.list"
@inputTxt="inputsc"
@inputTxt="(val, col)=> inputsc(val, col, item)"
@timeCheck="timesc"
@selectCheck="selectsc"
@selectCheck="(val, col)=> selectsc(val, col, item)"
@selection="selectionChange"
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '操作'">
<el-text @click="() => handleComputedPrice(slotProps.scope)">计算费用</el-text>
</template>
</template>
</tablecmt>
@ -77,12 +74,72 @@
</div>
<!-- 列表配置显示 -->
<edittablehead
@closce="(flag)=> showdrawer(flag, item)"
@closce="(flag)=> showdrawer(item, flag)"
:drawerShow="item.drawerShow"
v-model="item.columnList"
></edittablehead>
</el-tab-pane>
</el-tabs>
<el-dialog
destroy-on-close
:modal-append-to-body="false"
:append-to-body="false"
class="confirmVisited"
width="80%"
v-model="details.popUpShow.confirmVisited"
:fullscreen="details.fullscreenObj.confirmVisited"
:show-close="false"
draggable
>
<!-- 标题 -- 头部控件区 -->
<template #header="{ close, titleId, titleClass }">
<div class="my-header flex-c-sb" draggable>
<div class="fwb" :id="titleId" :class="titleClass">开标签</div>
<div class="flex-c-c">
<!-- 全屏显示按钮 -->
<el-button
type="text"
@click="handleFullScrean('open', 'confirmVisited')"
v-if="!details.fullscreenObj.confirmVisited"
>
<el-icon class=""><FullScreen /></el-icon>
</el-button>
<el-button type="text" @click="handleFullScrean('close', 'confirmVisited')" v-else>
<el-icon class=""><CopyDocument /></el-icon>
</el-button>
<!-- 弹窗关闭按钮 -->
<el-button type="text">
<el-icon class="" @click="close"><Close /></el-icon>
</el-button>
</div>
</div>
</template>
<tablecmt
:columnList="details.confirmColumnList"
:tableData="details.selectionList"
>
</tablecmt>
<div class="flex-c-c dialog-footer">
<el-button icon="Close" @click="details.popUpShow.confirmVisited = false">
</el-button>
<!-- 提交 -->
<el-button
icon="Position"
type="primary"
:loading="details.loadingObj.addTagLoading"
@click="handleSubmitConfrim"
>
</el-button>
</div>
</el-dialog>
</div>
</basic-container>
@ -95,7 +152,7 @@ import dayjs from 'dayjs';
import { mapGetters } from 'vuex';
/** 获取字典 */
import { getDictionaryBiz } from '@/api/system/dict';
import { postPageList, postCheckBalance, postReal } from '@/api/finance/ReconciliationDepositSlip';
import { postPageList, postCheckBalance, postReal,postOrderInfoListExport } from '@/api/finance/ReconciliationDepositSlip';
import {
downloadXls,
setNodeHeight,
@ -104,8 +161,9 @@ import {
handleInputQuery,
handleSelectQuery,
handleTranslationDataSeclect,
getObjType
} from '@/utils/util';
import { columnList } from '@/option/finance/ReconciliationDepositSlip';
import { columnListByToB, columnListByToC,confirmColumnList } from '@/option/finance/ReconciliationDepositSlip';
import { useRouter } from 'vue-router';
import { deepClone } from '@/utils/util';
import { ElMessage, ElMessageBox } from 'element-plus';
@ -118,14 +176,14 @@ const details = reactive<any>({
search: true,
pageInfo: [
{
title: 'toB运单对账',
columnList: deepClone(columnList),
title: 'toB',
columnList: deepClone(columnListByToB),
query: {},
name: 1
},
{
title: 'toC订单对账',
columnList: deepClone(columnList),
title: 'toC',
columnList: deepClone(columnListByToC),
query: {},
name: 2
}
@ -161,7 +219,6 @@ const details = reactive<any>({
},
},
],
/** 列表 */
/** 列表数据 */
data: [],
/** 页面loading */
@ -170,10 +227,20 @@ const details = reactive<any>({
list: false,
pageLoading: false,
},
/** 全屏 */
fullscreenObj: {
/** 开标签 */
confirmVisited: false,
},
/** 弹出层显示 */
popUpShow: {
/** 新增标签 */
confirmVisited: false,
},
/** 列表复选框选中的数据 */
selectionList: [],
/** 是否显示设置表格 */
drawerShow: false,
/** 生成对账单表头 */
confirmColumnList: deepClone(confirmColumnList),
/** 分页参数 */
page: {
pageNum: 1,
@ -202,12 +269,14 @@ onMounted(async () => {
});
/** 请求页面数据 */
const onLoad = async (params = {}) => {
const onLoad = async () => {
try {
// loading
details.loadingObj.list = true;
const submitData = { ...details.query, ...params, ...details.page };
const {query, columnList} = ( details.pageStatus === 1 ?details.pageInfo[0]: details.pageInfo[1])
const submitData = { query, ...details.page };
// listType 1 -- toB ; 2 -- toC
submitData.listType = details.pageStatus;
@ -220,7 +289,7 @@ const onLoad = async (params = {}) => {
details.page.total = data.total;
handleTranslationDataSeclect(
details.data,
details.pageStatus === 1 ? details.columnList1 : details.columnList2
columnList
);
return res.data;
@ -231,10 +300,10 @@ const onLoad = async (params = {}) => {
}
};
const initOnLoad = (params = {}) => {
const initOnLoad = () => {
details.page.pageNum = 1;
details.page.total = 0;
onLoad(params);
onLoad();
};
initOnLoad();
@ -254,7 +323,7 @@ const searchReset = () => {
};
/** 展开列表控件 */
const showdrawer = (_flag?: boolean, item) => {
const showdrawer = ( item:any, _flag?: boolean) => {
item.drawerShow = _flag;
};
@ -268,8 +337,8 @@ const searchHide = () => {
};
/** 表格表头输入框搜索 */
const inputsc = (index, col) => {
handleInputQuery(index, col, details.pageStatus === 1 ? details.query1 : details.query2);
const inputsc = (index, col, item) => {
handleInputQuery(index, col, item.query);
initOnLoad();
};
@ -287,8 +356,8 @@ const timesc = (index, row) => {
};
/** 表格表头下拉框选择 */
const selectsc = (index, colors) => {
handleSelectQuery(index, colors, details.pageStatus === 1 ? details.query1 : details.query2);
const selectsc = (index, colors, item) => {
handleSelectQuery(index, colors, item.query);
initOnLoad();
};
@ -321,8 +390,34 @@ const handleClickTab = async e => {
initOnLoad();
};
/** 批量对账单确认 */
const handleConfirm = () => {
/**
* 是否开启全屏
* @params(_type) 开启或关闭
*/
const handleFullScrean = (_type: 'open' | 'close', _name: string) => {
let _node: any = '';
if (_name) _node = document.querySelector(`.${_name} .maboxhi`);
switch (_name) {
case 'confirmVisited':
details.fullscreenObj.confirmVisited =
!details.fullscreenObj.confirmVisited;
if (_type === 'close') {
if (_node) setNodeHeight(_node, '500px', true);
} else {
if (_node) setNodeHeight(_node,'', true);
}
break;
default:
details.fullscreenObj[_name] = !details.fullscreenObj[_name];
break;
}
};
/** 生成对账单 */
const handleConfirm = async () => {
if (details.selectionList.length === 0) return ElMessage.warning('请选择需要确认的数据');
const _errorArr = [];
@ -337,6 +432,14 @@ const handleConfirm = () => {
if (_errorArr.length > 0)
return ElMessage.warning(`订单【 ${_errorArr.join('、')} 】-- 已确认,请勿重复确认`);
details.popUpShow.confirmVisited = true
await nextTick()
const _node = document.querySelector(`.confirmVisited .maboxhi`);
setNodeHeight(_node, details.popUpShow.confirmVisited ? '' : '500px', true);
};
const handleSubmitConfrim= ()=>{
ElMessageBox.confirm('是否确认对账单?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@ -346,7 +449,7 @@ const handleConfirm = () => {
details.loadingObj.pageLoading = true;
const submitData = {
orderInfoIds: _arr,
orderInfoIds: details.selectionList.map(val => val.orderInfoId),
};
const res = await postCheckBalance(submitData);
@ -361,7 +464,7 @@ const handleConfirm = () => {
details.loadingObj.pageLoading = false;
}
});
};
}
/** 计算仓储&配送费用 */
const handleComputedPrice = ({ row }) => {
@ -393,11 +496,43 @@ const handleExport = () => {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
ElMessage({
type: 'success',
message: '导出成功!',
});
}).then(async() => {
try {
details.loadingObj.pageLoading = true
const submitData=details.pageStatus === 1 ?
{ ...details.pageInfo[0].query } :
{ ...details.pageInfo[1].query }
submitData.listType = details.pageStatus;
if (getObjType(submitData.createTimeArr) === 'array' && submitData.createTimeArr.length > 0){
submitData.createTimeStartStr = submitData.createTimeArr[0]
submitData.createTimeEndStr = submitData.createTimeArr[1]
}
if (getObjType(submitData.checkTimeArr) === 'array' && submitData.checkTimeArr.length > 0){
submitData.checkTimeStartStr = submitData.checkTimeArr[0]
submitData.checkTimeEndStr = submitData.checkTimeArr[1]
}
delete submitData.createTimeArr
delete submitData.checkTimeArr
const res = await postOrderInfoListExport(submitData)
const {status, data} = res
if (status !== 200) return
downloadXls(data, details.pageStatus === 1 ? '对账预存单toB.xlsx': '对账预存单toC.xlsx')
ElMessage.success('导出成功!');
} catch (error) {
console.log('error :>> ', error);
}finally{
details.loadingObj.pageLoading = false
}
});
};
</script>
@ -412,4 +547,13 @@ const handleExport = () => {
:deep(.el-range-editor.el-input__wrapper) {
height: 100% !important;
}
//
:deep(.el-overlay) {
position: absolute;
}
:deep(.el-overlay-dialog) {
position: absolute;
}
</style>

Loading…
Cancel
Save