|
|
|
@ -9,11 +9,26 @@
|
|
|
|
|
<div> |
|
|
|
|
<el-form-item label="中转仓"> |
|
|
|
|
<el-select |
|
|
|
|
v-model="queryTop.warehouse" |
|
|
|
|
multiple |
|
|
|
|
placeholder="请选择仓库" |
|
|
|
|
style="min-width: 340px" |
|
|
|
|
v-model="queryTop.transitWarehouseName" |
|
|
|
|
filterable |
|
|
|
|
clearable |
|
|
|
|
collapse-tags |
|
|
|
|
popper-class="custom-header" |
|
|
|
|
:max-collapse-tags="1" |
|
|
|
|
placeholder="多选仓库搜索" |
|
|
|
|
style="width: 200px" |
|
|
|
|
> |
|
|
|
|
<template #header> |
|
|
|
|
<el-checkbox |
|
|
|
|
v-model="checkAlla" |
|
|
|
|
:indeterminate="indeterminatea" |
|
|
|
|
@change="handleCheckAlla" |
|
|
|
|
> |
|
|
|
|
全选 |
|
|
|
|
</el-checkbox> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<el-option |
|
|
|
|
v-for="item in warehouseList" |
|
|
|
|
:key="item.value" |
|
|
|
@ -22,29 +37,58 @@
|
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="结算年份"> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="queryTop.costSettlementYear" |
|
|
|
|
type="year" |
|
|
|
|
placeholder="请选择年份" |
|
|
|
|
value-format="YYYY" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<el-form-item label="结算月"> |
|
|
|
|
<el-form-item label="目的仓"> |
|
|
|
|
<el-select |
|
|
|
|
v-model="queryTop.costSettlementMonth" |
|
|
|
|
placeholder="请选择月份" |
|
|
|
|
style="min-width: 80px" |
|
|
|
|
multiple |
|
|
|
|
v-model="queryTop.destinationWarehouseName" |
|
|
|
|
filterable |
|
|
|
|
clearable |
|
|
|
|
collapse-tags |
|
|
|
|
popper-class="custom-header" |
|
|
|
|
:max-collapse-tags="1" |
|
|
|
|
placeholder="多选仓库搜索" |
|
|
|
|
style="width: 200px" |
|
|
|
|
> |
|
|
|
|
<template #header> |
|
|
|
|
<el-checkbox |
|
|
|
|
v-model="checkAllb" |
|
|
|
|
:indeterminate="indeterminateb" |
|
|
|
|
@change="handleCheckAllb" |
|
|
|
|
> |
|
|
|
|
全选 |
|
|
|
|
</el-checkbox> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<el-option |
|
|
|
|
v-for="item in monthList" |
|
|
|
|
v-for="item in warehouseList" |
|
|
|
|
:key="item.value" |
|
|
|
|
:label="item.label" |
|
|
|
|
:value="item.value" |
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="出账时间"> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="queryTop.PaymentTime" |
|
|
|
|
type="month" |
|
|
|
|
value-format="YYYY-MM" |
|
|
|
|
placeholder="请选择日期" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<el-form-item label="结算时间"> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="queryTop.SettlementTime" |
|
|
|
|
type="datetimerange" |
|
|
|
|
unlink-panels |
|
|
|
|
range-separator="至" |
|
|
|
|
start-placeholder="开始时间" |
|
|
|
|
end-placeholder="结束时间" |
|
|
|
|
:shortcuts="shortcuts" |
|
|
|
|
:default-time="defaultTime2" |
|
|
|
|
value-format="YYYY-MM-DD HH:mm:ss" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<!-- 查询按钮 --> |
|
|
|
|
<el-form-item class="el-btn"> |
|
|
|
@ -59,10 +103,7 @@
|
|
|
|
|
<div class="avue-crud__header"> |
|
|
|
|
<!-- 头部左侧按钮模块 --> |
|
|
|
|
<div class="avue-crud__left"> |
|
|
|
|
<el-button type="primary" @click="AddInfo" |
|
|
|
|
><el-icon><Plus /></el-icon>导入</el-button |
|
|
|
|
> |
|
|
|
|
<el-button type="primary" @click="AddInfo" |
|
|
|
|
<el-button type="primary" @click="exportExcel" |
|
|
|
|
><el-icon><Download /></el-icon>导出</el-button |
|
|
|
|
> |
|
|
|
|
</div> |
|
|
|
@ -91,11 +132,20 @@
|
|
|
|
|
> |
|
|
|
|
<template #default="slotProps"> |
|
|
|
|
<template v-if="slotProps.scope.column.label === '操作'"> |
|
|
|
|
<!-- <div class="ElBtnClass"> |
|
|
|
|
<el-text @click="abnormalinformation(slotProps.scope.row)">异常信息</el-text> |
|
|
|
|
<el-text @click="view(slotProps.scope.row)">结算信息</el-text> |
|
|
|
|
<div class="ElBtnClass"> |
|
|
|
|
<el-text @click="abnormalinformation(slotProps.scope.row, '异常')" |
|
|
|
|
>异常信息</el-text |
|
|
|
|
> |
|
|
|
|
<el-text @click="abnormalinformation(slotProps.scope.row, '结算')" |
|
|
|
|
>结算信息</el-text |
|
|
|
|
> |
|
|
|
|
<el-text |
|
|
|
|
v-if="slotProps.scope.row.settlementStatus !== '已结算'" |
|
|
|
|
@click="Confirmsettlement(slotProps.scope.row)" |
|
|
|
|
>确认结算</el-text |
|
|
|
|
> |
|
|
|
|
<el-text @click="view(slotProps.scope.row)">明细</el-text> |
|
|
|
|
</div> --> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</tablecmt> |
|
|
|
@ -123,75 +173,122 @@
|
|
|
|
|
|
|
|
|
|
<el-dialog |
|
|
|
|
v-model="Abnormalsettlement.dialogVisible" |
|
|
|
|
title="结算信息" |
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
:title="Abnormalsettlement.title + '信息'" |
|
|
|
|
width="60%" |
|
|
|
|
class="el_Abnormalsettlement" |
|
|
|
|
> |
|
|
|
|
<el-tabs class="demo-tabs" v-model="Abnormalsettlement.activeName1"> |
|
|
|
|
<el-tab-pane label="费用信息" name="费用信息"> |
|
|
|
|
<h3>结算单号:XXXXXXXXXXXX</h3> |
|
|
|
|
<h3>结算状态:已结算</h3> |
|
|
|
|
<div class="el_money"> |
|
|
|
|
<span>总费用:<b>199999</b></span> |
|
|
|
|
<span>待结算费用:<b>2232</b></span> |
|
|
|
|
<span>已结算费用:<b>23423</b></span> |
|
|
|
|
<span>异常费用:<b>124124</b></span> |
|
|
|
|
</div> |
|
|
|
|
<el-form |
|
|
|
|
:model="Abnormalsettlement.form" |
|
|
|
|
label-width="auto" |
|
|
|
|
:rules="Abnormalsettlement.rules" |
|
|
|
|
ref="ruleFormRef" |
|
|
|
|
> |
|
|
|
|
<el-form-item label="异常费用:" prop="money"> |
|
|
|
|
<el-input-number |
|
|
|
|
v-model="Abnormalsettlement.form.money" |
|
|
|
|
:controls="false" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
:precision="2" |
|
|
|
|
:step="1" |
|
|
|
|
placeholder="此处填写要登记的异常金额,正数表示异常增款,负数表示异常减款" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="异常备注:" prop="textarea2"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="Abnormalsettlement.form.textarea2" |
|
|
|
|
:autosize="{ minRows: 4, maxRows: 4 }" |
|
|
|
|
type="textarea" |
|
|
|
|
placeholder="请输入异常备注" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="异常图片:" prop="fileList"> |
|
|
|
|
<el-upload |
|
|
|
|
list-type="picture-card" |
|
|
|
|
v-model:file-list="Abnormalsettlement.form.fileList" |
|
|
|
|
drag |
|
|
|
|
:action="FileUpload()" |
|
|
|
|
multiple |
|
|
|
|
:limit="10" |
|
|
|
|
:on-preview="handlePictureCardPreview" |
|
|
|
|
:before-upload="beforeAvatarUpload" |
|
|
|
|
:on-remove="handleRemove" |
|
|
|
|
:headers="headers()" |
|
|
|
|
<div v-loading="Abnormalsettlement.loading" element-loading-text="Loading..."> |
|
|
|
|
<el-tabs class="demo-tabs" v-model="Abnormalsettlement.activeName1" v-if="Abnormalsettlement.form.settlementStatus !='已结算'"> |
|
|
|
|
<el-tab-pane label="费用信息" name="费用信息"> |
|
|
|
|
<h3>结算单号:{{ Abnormalsettlement.form.settlementCode }}</h3> |
|
|
|
|
<h3>结算状态:【{{ Abnormalsettlement.form.settlementStatus }}】</h3> |
|
|
|
|
<div class="el_money"> |
|
|
|
|
<span |
|
|
|
|
>总费用:<b>{{ Abnormalsettlement.form.totalCost || 0 }}</b></span |
|
|
|
|
> |
|
|
|
|
<el-icon><Plus /></el-icon> |
|
|
|
|
</el-upload> |
|
|
|
|
<!-- 图片预览 --> |
|
|
|
|
<el-dialog v-model="Abnormalsettlement.dialogurl" class="el_imgdialog"> |
|
|
|
|
<img w-full :src="Abnormalsettlement.url" /> |
|
|
|
|
</el-dialog> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
</el-tabs> |
|
|
|
|
<el-tabs class="demo-tabs" v-model="Abnormalsettlement.activeName2"> |
|
|
|
|
<el-tab-pane label="异常记录" name="异常记录"> </el-tab-pane> |
|
|
|
|
</el-tabs> |
|
|
|
|
<span |
|
|
|
|
>待结算费用:<b>{{ Abnormalsettlement.form.pendingSettlementAmount || 0 }}</b></span |
|
|
|
|
> |
|
|
|
|
<span |
|
|
|
|
>已结算费用:<b>{{ Abnormalsettlement.form.settledAmount || 0 }}</b></span |
|
|
|
|
> |
|
|
|
|
<span |
|
|
|
|
>异常费用:<b>{{ Abnormalsettlement.form.changeAmount || 0 }}</b></span |
|
|
|
|
> |
|
|
|
|
</div> |
|
|
|
|
<el-form |
|
|
|
|
:model="Abnormalsettlement.form" |
|
|
|
|
label-width="auto" |
|
|
|
|
:rules="Abnormalsettlement.rules" |
|
|
|
|
ref="ruleFormRef" |
|
|
|
|
> |
|
|
|
|
<el-form-item :label="`${Abnormalsettlement.title}费用:`" prop="money"> |
|
|
|
|
<el-input-number |
|
|
|
|
v-model="Abnormalsettlement.form.money" |
|
|
|
|
:controls="false" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
:precision="2" |
|
|
|
|
:step="1" |
|
|
|
|
placeholder="此处填写要登记的异常金额,正数表示异常增款,负数表示异常减款" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item :label="`${Abnormalsettlement.title}备注:`" prop="changeNote"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="Abnormalsettlement.form.changeNote" |
|
|
|
|
:autosize="{ minRows: 4, maxRows: 4 }" |
|
|
|
|
type="textarea" |
|
|
|
|
placeholder="请输入备注" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item :label="`${Abnormalsettlement.title}图片:`" prop="changeImageList"> |
|
|
|
|
<el-upload |
|
|
|
|
list-type="picture-card" |
|
|
|
|
v-model:file-list="Abnormalsettlement.form.changeImageList" |
|
|
|
|
drag |
|
|
|
|
:action="FileUpload()" |
|
|
|
|
multiple |
|
|
|
|
:limit="10" |
|
|
|
|
:on-preview="handlePictureCardPreview" |
|
|
|
|
:before-upload="beforeAvatarUpload" |
|
|
|
|
:on-remove="handleRemove" |
|
|
|
|
:headers="headers()" |
|
|
|
|
> |
|
|
|
|
<el-icon><Plus /></el-icon> |
|
|
|
|
</el-upload> |
|
|
|
|
<!-- 图片预览 --> |
|
|
|
|
<el-dialog v-model="Abnormalsettlement.dialogurl" class="el_imgdialog"> |
|
|
|
|
<img w-full :src="Abnormalsettlement.url" /> |
|
|
|
|
</el-dialog> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
</el-tabs> |
|
|
|
|
<el-tabs class="demo-tabs" v-model="Abnormalsettlement.activeName2"> |
|
|
|
|
<el-tab-pane :label="`${Abnormalsettlement.title}记录`" name="异常记录"> |
|
|
|
|
<tablecmt |
|
|
|
|
class="tableNodeRef" |
|
|
|
|
:columnList="details.columnListrecord" |
|
|
|
|
:tableData="details.datarecord" |
|
|
|
|
:loading="details.loadingObj.listrecord" |
|
|
|
|
> |
|
|
|
|
<template #default="slotProps"> |
|
|
|
|
<el-text @click="handleShowImg(slotProps.scope.row)">查看图片</el-text> |
|
|
|
|
</template> |
|
|
|
|
</tablecmt> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
</el-tabs> |
|
|
|
|
</div> |
|
|
|
|
<template #footer> |
|
|
|
|
<el-button @click="Abnormalsettlement.dialogVisible = false">关闭</el-button> |
|
|
|
|
<el-button type="primary" @click="AbnormalsettlementSubmit"> 确定 </el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
@click="AbnormalsettlementSubmit" |
|
|
|
|
:disabled="Abnormalsettlement.loading" |
|
|
|
|
v-if="Abnormalsettlement.form.settlementStatus !='已结算'" |
|
|
|
|
> |
|
|
|
|
确定 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<!-- 记录图片查看 --> |
|
|
|
|
<el-dialog v-model="details.popUpShow.showImgVisited"> |
|
|
|
|
<div class="dialog_img"> |
|
|
|
|
<el-image |
|
|
|
|
v-for="(url, index) in details.imgList" |
|
|
|
|
:key="url" |
|
|
|
|
style="width: 100px; height: 100px" |
|
|
|
|
:src="url" |
|
|
|
|
:zoom-rate="1.2" |
|
|
|
|
:max-scale="7" |
|
|
|
|
:min-scale="0.2" |
|
|
|
|
:preview-src-list="details.imgList" |
|
|
|
|
:initial-index="index" |
|
|
|
|
fit="cover" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
</el-dialog> |
|
|
|
|
</basic-container> |
|
|
|
|
<!-- 列表配置显示 --> |
|
|
|
|
<edittablehead |
|
|
|
@ -204,13 +301,20 @@
|
|
|
|
|
|
|
|
|
|
<script setup> |
|
|
|
|
import { ref, reactive, toRefs, computed, onMounted, nextTick, watch } from 'vue'; |
|
|
|
|
import { columnList } from '@/option/storagecost/Transferwarehousestatistics.js'; |
|
|
|
|
import { $_getMyWarehouseList } from '@/api/storagecost/index.js'; |
|
|
|
|
import { columnList, columnListrecord } from '@/option/storagecost/Transferwarehousestatistics.js'; |
|
|
|
|
import { |
|
|
|
|
$_getMyWarehouseList, |
|
|
|
|
$_Transferwarehousestatistics, |
|
|
|
|
$_Transferwarehousestatisticsdetail, |
|
|
|
|
$_Transferwarehousestatisticssave, |
|
|
|
|
$_TransferwarehousestatisticsconfirmSettlement, |
|
|
|
|
$_exportTransitMonth, |
|
|
|
|
} from '@/api/storagecost/index.js'; |
|
|
|
|
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js'; |
|
|
|
|
import { getDictionaryBiz } from '@/api/system/dict'; //字典 |
|
|
|
|
import { processRowProperty, setNodeHeight } from '@/utils/util'; |
|
|
|
|
import { processRowPropertyName, setNodeHeight, handleClearTableQuery } from '@/utils/util'; |
|
|
|
|
import { ElMessageBox, ElMessage } from 'element-plus'; |
|
|
|
|
import { downloadXls, FileUpload, headers } from '@/utils/util'; |
|
|
|
|
import { downloadXls, FileUpload, headers, getObjType } from '@/utils/util'; |
|
|
|
|
import { getToken } from '@/utils/auth'; |
|
|
|
|
import { useStore } from 'vuex'; |
|
|
|
|
import dayjs from 'dayjs'; |
|
|
|
@ -221,6 +325,10 @@ const $route = useRoute(); //获取地址栏参数
|
|
|
|
|
const queryTop = ref({}); |
|
|
|
|
const warehouseList = ref([]); |
|
|
|
|
const monthList = ref([]); |
|
|
|
|
const indeterminatea = ref(false); |
|
|
|
|
const checkAlla = ref(false); |
|
|
|
|
const indeterminateb = ref(false); |
|
|
|
|
const checkAllb = ref(false); |
|
|
|
|
const validateFileList = (rule, value, callback) => { |
|
|
|
|
if (!value.length) { |
|
|
|
|
callback(new Error('至少上传一张图片')); |
|
|
|
@ -229,14 +337,16 @@ const validateFileList = (rule, value, callback) => {
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
const Abnormalsettlement = ref({ |
|
|
|
|
title: '结算', |
|
|
|
|
loading: false, |
|
|
|
|
dialogVisible: false, |
|
|
|
|
activeName1: '费用信息', |
|
|
|
|
activeName2: '异常记录', |
|
|
|
|
url: '', |
|
|
|
|
dialogurl: false, |
|
|
|
|
form: { |
|
|
|
|
money: null, |
|
|
|
|
fileList: [], //图片列表 |
|
|
|
|
money: 0, |
|
|
|
|
changeImageList: [], //图片列表 |
|
|
|
|
}, |
|
|
|
|
rules: { |
|
|
|
|
money: [ |
|
|
|
@ -246,23 +356,24 @@ const Abnormalsettlement = ref({
|
|
|
|
|
trigger: ['change', 'blur'], |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
textarea2: [ |
|
|
|
|
changeNote: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请填写备注', |
|
|
|
|
trigger: ['change', 'blur'], |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
fileList: [{ validator: validateFileList, trigger: 'change' }], |
|
|
|
|
changeImageList: [{ validator: validateFileList, trigger: 'change' }], |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
const details = reactive({ |
|
|
|
|
fileList: [], |
|
|
|
|
/** 是否开启搜索 */ |
|
|
|
|
search: false, |
|
|
|
|
imgList: [], |
|
|
|
|
/** 表格搜索条件 */ |
|
|
|
|
query: {}, |
|
|
|
|
/** 时间快捷选择设置 */ |
|
|
|
|
defaultTime2: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)], // '12:00:00', '08:00:00' |
|
|
|
|
shortcuts: [ |
|
|
|
|
{ |
|
|
|
|
text: '最近一周', |
|
|
|
@ -294,14 +405,15 @@ const details = reactive({
|
|
|
|
|
], |
|
|
|
|
/** 列表 */ |
|
|
|
|
columnList, |
|
|
|
|
|
|
|
|
|
columnListrecord, |
|
|
|
|
/** 列表数据 */ |
|
|
|
|
data: [{}], |
|
|
|
|
data: [], |
|
|
|
|
datarecord: [], |
|
|
|
|
/** 页面loading */ |
|
|
|
|
loadingObj: { |
|
|
|
|
/** 列表加载loading */ |
|
|
|
|
list: false, |
|
|
|
|
packageListLoading: false, |
|
|
|
|
listrecord: false, |
|
|
|
|
}, |
|
|
|
|
/** 列表复选框选中的数据 */ |
|
|
|
|
selectionList: [], |
|
|
|
@ -322,6 +434,7 @@ const details = reactive({
|
|
|
|
|
QRCodeVisible: false, |
|
|
|
|
/** 修改客户信息 */ |
|
|
|
|
editClientInfoVisible: false, |
|
|
|
|
showImgVisited: false, |
|
|
|
|
}, |
|
|
|
|
/** 列表Dom节点 */ |
|
|
|
|
listNode: '', |
|
|
|
@ -346,6 +459,8 @@ const {
|
|
|
|
|
zeroAdditionalRecordingInfo, |
|
|
|
|
popUpShow, |
|
|
|
|
recorddata, |
|
|
|
|
datarecord, |
|
|
|
|
defaultTime2, |
|
|
|
|
} = toRefs(details); |
|
|
|
|
|
|
|
|
|
/** 展开列表控件 */ |
|
|
|
@ -355,8 +470,8 @@ const showdrawer = _flag => {
|
|
|
|
|
/** 表格表头输入框搜索 */ |
|
|
|
|
const inputsc = (index, row) => { |
|
|
|
|
details.query[row.prop] = index; |
|
|
|
|
processRowProperty(index, row, details); |
|
|
|
|
test(details.query); |
|
|
|
|
processRowPropertyName(index, row, details.query); |
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
// 实例函数 |
|
|
|
|
const test = val => {}; |
|
|
|
@ -378,7 +493,8 @@ const btnsc = val => {
|
|
|
|
|
}; |
|
|
|
|
/** 表格表头下拉框选择 */ |
|
|
|
|
const selectsc = (index, row) => { |
|
|
|
|
processRowProperty(index, row, details); |
|
|
|
|
processRowPropertyName(index, row, details.query); |
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
/** 表格表头复选框选择 */ |
|
|
|
|
const selectionChange = list => { |
|
|
|
@ -387,25 +503,89 @@ const selectionChange = list => {
|
|
|
|
|
}; |
|
|
|
|
// 网页顶部搜索按钮 |
|
|
|
|
const searchChange = () => { |
|
|
|
|
if (queryTop.value.warehouse?.length) { |
|
|
|
|
queryTop.value.warehouseName = queryTop.value.warehouse.join(','); |
|
|
|
|
// 中转仓 |
|
|
|
|
if (queryTop.value.transitWarehouseName?.length) { |
|
|
|
|
details.query.transitWarehouseName = queryTop.value.transitWarehouseName.join(','); |
|
|
|
|
} else { |
|
|
|
|
delete details.query.warehouseName; |
|
|
|
|
delete queryTop.value.warehouseName; |
|
|
|
|
delete details.query.transitWarehouseName; |
|
|
|
|
} |
|
|
|
|
if (queryTop.value.costSettlementMonth) { |
|
|
|
|
if (!queryTop.value.costSettlementYear) { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: '请选择年份', |
|
|
|
|
type: 'warning', |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
// 目的仓 |
|
|
|
|
if (queryTop.value.destinationWarehouseName?.length) { |
|
|
|
|
details.query.destinationWarehouseName = queryTop.value.destinationWarehouseName.join(','); |
|
|
|
|
} else { |
|
|
|
|
delete details.query.destinationWarehouseName; |
|
|
|
|
} |
|
|
|
|
details.query = { ...details.query, ...queryTop.value }; |
|
|
|
|
delete details.query.warehouse; //删除多余字段 |
|
|
|
|
|
|
|
|
|
// 出账时间 |
|
|
|
|
|
|
|
|
|
if (queryTop.value.PaymentTime?.length) { |
|
|
|
|
const date = dayjs(queryTop.value.PaymentTime, 'YYYY年MM月'); |
|
|
|
|
console.log(queryTop.value.PaymentTime, 'queryTop.value.PaymentTime'); |
|
|
|
|
details.query.statisticalYear = date.year(); //年 |
|
|
|
|
details.query.statisticalMonth = date.month() + 1; //月 |
|
|
|
|
} else { |
|
|
|
|
delete details.query.statisticalYear; |
|
|
|
|
delete details.query.statisticalMonth; |
|
|
|
|
} |
|
|
|
|
// 结算时间 |
|
|
|
|
if (queryTop.value.SettlementTime?.length) { |
|
|
|
|
details.query.settlementTimeStart = queryTop.value.SettlementTime[0]; //开始时间 |
|
|
|
|
details.query.settlementTimeEnd = queryTop.value.SettlementTime[1]; //结束时间 |
|
|
|
|
} else { |
|
|
|
|
delete details.query.settlementTimeStart; |
|
|
|
|
delete details.query.settlementTimeEnd; |
|
|
|
|
} |
|
|
|
|
console.log(details.query, 'details.query'); |
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
// 中转仓 |
|
|
|
|
const handleCheckAlla = val => { |
|
|
|
|
indeterminatea.value = false; |
|
|
|
|
if (val) { |
|
|
|
|
queryTop.value.transitWarehouseName = warehouseList.value.map(_ => _.value); |
|
|
|
|
} else { |
|
|
|
|
queryTop.value.transitWarehouseName = []; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
// 目的仓 |
|
|
|
|
const handleCheckAllb = val => { |
|
|
|
|
indeterminateb.value = false; |
|
|
|
|
if (val) { |
|
|
|
|
queryTop.value.destinationWarehouseName = warehouseList.value.map(_ => _.value); |
|
|
|
|
} else { |
|
|
|
|
queryTop.value.destinationWarehouseName = []; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
watch( |
|
|
|
|
() => queryTop.value.transitWarehouseName, |
|
|
|
|
(newValue, oldValue) => { |
|
|
|
|
if (newValue.length === 0) { |
|
|
|
|
checkAlla.value = false; |
|
|
|
|
indeterminatea.value = false; |
|
|
|
|
} else if (newValue.length === warehouseList.value.length) { |
|
|
|
|
checkAlla.value = true; |
|
|
|
|
indeterminatea.value = false; |
|
|
|
|
} else { |
|
|
|
|
indeterminatea.value = true; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ deep: true } |
|
|
|
|
); |
|
|
|
|
watch( |
|
|
|
|
() => queryTop.value.destinationWarehouseName, |
|
|
|
|
(newValue, oldValue) => { |
|
|
|
|
if (newValue.length === 0) { |
|
|
|
|
checkAllb.value = false; |
|
|
|
|
indeterminateb.value = false; |
|
|
|
|
} else if (newValue.length === warehouseList.value.length) { |
|
|
|
|
checkAllb.value = true; |
|
|
|
|
indeterminateb.value = false; |
|
|
|
|
} else { |
|
|
|
|
indeterminateb.value = true; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ deep: true } |
|
|
|
|
); |
|
|
|
|
// 每页多少条 |
|
|
|
|
const sizeChange = val => { |
|
|
|
|
details.page.pageSize = val; |
|
|
|
@ -416,9 +596,16 @@ const currentChange = val => {
|
|
|
|
|
details.page.currentPage = val; |
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
// 清空 |
|
|
|
|
const searchReset = () => { |
|
|
|
|
queryTop.value = {}; |
|
|
|
|
details.query = {}; |
|
|
|
|
handleClearTableQuery(details.columnList); |
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
// 刷新按钮 |
|
|
|
|
const searchChangeS = () => { |
|
|
|
|
details.search = false; //关闭搜索 |
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
// 顶部搜索 |
|
|
|
|
const searchHide = () => { |
|
|
|
@ -480,7 +667,30 @@ const MyWarehouseList = () => {
|
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
// 页面初始化 |
|
|
|
|
const onLoad = () => {}; |
|
|
|
|
const onLoad = async () => { |
|
|
|
|
try { |
|
|
|
|
details.loadingObj.list = true; |
|
|
|
|
let submit = { |
|
|
|
|
current: details.page.currentPage, |
|
|
|
|
size: details.page.pageSize, |
|
|
|
|
...details.query, |
|
|
|
|
}; |
|
|
|
|
let res = await $_Transferwarehousestatistics(submit); |
|
|
|
|
console.log(res, 'res'); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
if (code != 200) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
console.log(data, 'data'); |
|
|
|
|
|
|
|
|
|
details.data = data.records; |
|
|
|
|
details.page.total = data.total; |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log(error); |
|
|
|
|
} finally { |
|
|
|
|
details.loadingObj.list = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
const PageOnload = () => { |
|
|
|
|
onLoad(); //获取列表参数 |
|
|
|
|
MyWarehouseList(); //获取仓库 |
|
|
|
@ -489,21 +699,170 @@ const PageOnload = () => {
|
|
|
|
|
|
|
|
|
|
//页面初始化方法 |
|
|
|
|
PageOnload(); |
|
|
|
|
// 异常信息 |
|
|
|
|
const abnormalinformation = () => { |
|
|
|
|
Abnormalsettlement.value.dialogVisible = true; |
|
|
|
|
// 异常信息,结算信息 |
|
|
|
|
const abnormalinformation = async (row, state) => { |
|
|
|
|
try { |
|
|
|
|
Abnormalsettlement.value.loading = true; |
|
|
|
|
|
|
|
|
|
Abnormalsettlement.value.title = state; |
|
|
|
|
Abnormalsettlement.value.form.money = null; |
|
|
|
|
Abnormalsettlement.value.form.changeNote = ''; |
|
|
|
|
Abnormalsettlement.value.form.changeImageList = []; |
|
|
|
|
Abnormalsettlement.value.dialogVisible = true; |
|
|
|
|
let submit = { |
|
|
|
|
id: row.id, |
|
|
|
|
type: state, |
|
|
|
|
}; |
|
|
|
|
let res = await $_Transferwarehousestatisticsdetail(submit); |
|
|
|
|
console.log(res, 'res'); |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
if (code != 200) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
Abnormalsettlement.value.form = { ...Abnormalsettlement.value.form, ...data }; |
|
|
|
|
details.datarecord = data.changeList; |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log(e); |
|
|
|
|
} finally { |
|
|
|
|
nextTick(() => { |
|
|
|
|
const _node = document.querySelector('.tableNodeRef'); |
|
|
|
|
setNodeHeight(_node, '', true); |
|
|
|
|
}); |
|
|
|
|
Abnormalsettlement.value.loading = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
// 确认结算 |
|
|
|
|
const Confirmsettlement = row => { |
|
|
|
|
if (row.pendingSettlementAmount != 0) { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: '待结算金额不为0,无法确认结算', |
|
|
|
|
type: 'warning', |
|
|
|
|
plain: true, |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
ElMessageBox.confirm('是否确认结算?', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}) |
|
|
|
|
.then(async () => { |
|
|
|
|
try { |
|
|
|
|
details.loadingObj.list = true; |
|
|
|
|
let submit = { |
|
|
|
|
id: row.id, |
|
|
|
|
}; |
|
|
|
|
let res = await $_TransferwarehousestatisticsconfirmSettlement(submit); |
|
|
|
|
const { code, msg } = res.data; |
|
|
|
|
if (code != 200) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
ElMessage({ |
|
|
|
|
type: 'success', |
|
|
|
|
message: msg, |
|
|
|
|
}); |
|
|
|
|
onLoad(); |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log(e); |
|
|
|
|
} finally { |
|
|
|
|
details.loadingObj.list = false; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch(() => {}); |
|
|
|
|
}; |
|
|
|
|
// 提交 |
|
|
|
|
const AbnormalsettlementSubmit = async () => { |
|
|
|
|
await ruleFormRef.value.validate((valid, fields) => { |
|
|
|
|
if (valid) { |
|
|
|
|
console.log('submit!'); |
|
|
|
|
} else { |
|
|
|
|
console.log('error submit!', fields); |
|
|
|
|
ElMessage.error('表单校验未通过,请检查输入'); |
|
|
|
|
// 验证表单 |
|
|
|
|
let state = await ruleFormRef.value.validate(); |
|
|
|
|
if (!state) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
Abnormalsettlement.value.loading = true; |
|
|
|
|
details.loadingObj.list = true; |
|
|
|
|
// 准备提交的数据 |
|
|
|
|
let submit = { |
|
|
|
|
changeAmount: Abnormalsettlement.value.form.money, // 金额 |
|
|
|
|
changeImageList: [], // 图片 |
|
|
|
|
changeNote: Abnormalsettlement.value.form.changeNote, // 备注 |
|
|
|
|
detailId: Abnormalsettlement.value.form.id, // 结算表id |
|
|
|
|
type: Abnormalsettlement.value.title, // 类型(异常/结算) |
|
|
|
|
}; |
|
|
|
|
console.log(Abnormalsettlement.value.form, 'Abnormalsettlement.value.form'); |
|
|
|
|
Abnormalsettlement.value.form.changeImageList.forEach(item => { |
|
|
|
|
let data = { |
|
|
|
|
imageUrl: item.response.data.link, |
|
|
|
|
}; |
|
|
|
|
submit['changeImageList'].push(data); |
|
|
|
|
}); |
|
|
|
|
console.log(submit, '准备提交的数据'); |
|
|
|
|
// 提交数据 |
|
|
|
|
let res = await $_Transferwarehousestatisticssave(submit); |
|
|
|
|
const { msg, code } = res.data; |
|
|
|
|
if (code == 200) { |
|
|
|
|
Abnormalsettlement.value.dialogVisible = false; |
|
|
|
|
ElMessage.success(msg); |
|
|
|
|
onLoad(); |
|
|
|
|
} |
|
|
|
|
} catch (error) { |
|
|
|
|
// 处理错误 |
|
|
|
|
console.error('提交失败:', error); |
|
|
|
|
} finally { |
|
|
|
|
Abnormalsettlement.value.loading = false; |
|
|
|
|
details.loadingObj.list = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
// 明细 |
|
|
|
|
const view = row => { |
|
|
|
|
console.log(row); |
|
|
|
|
const date = dayjs(row.statisticalTime, 'YYYY年MM月'); |
|
|
|
|
$useStore.commit('DEL_ONCE_TAG', '/cost/storagecost/Transferwarehouseorders'); |
|
|
|
|
$router.push({ |
|
|
|
|
path: '/cost/storagecost/Transferwarehouseorders', |
|
|
|
|
query: { |
|
|
|
|
confirmAllocationMonth: date.month() + 1, //确认分摊时间-月 |
|
|
|
|
confirmAllocationYear: date.year(), //确认分摊时间-年 |
|
|
|
|
destinationWarehouseName: row.destinationWarehouseName, //目的仓 |
|
|
|
|
transitWarehouseName: row.transitWarehouseName, //中转仓 |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
/** 查看图片 */ |
|
|
|
|
const handleShowImg = row => { |
|
|
|
|
console.log(row); |
|
|
|
|
if (!row.changeImageList || getObjType(row.changeImageList) !== 'array') |
|
|
|
|
return ElMessage.warning('该结算异常信息没有图片'); |
|
|
|
|
details.imgList = row.changeImageList.map(val => val.imageUrl) || []; |
|
|
|
|
|
|
|
|
|
console.log('details.imgList :>> ', details.imgList); |
|
|
|
|
details.popUpShow.showImgVisited = true; |
|
|
|
|
}; |
|
|
|
|
const exportExcel = () => { |
|
|
|
|
ElMessageBox.confirm('是否导出数据?', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}) |
|
|
|
|
.then(async () => { |
|
|
|
|
try { |
|
|
|
|
details.loadingObj.list = true; |
|
|
|
|
let data = { |
|
|
|
|
...details.query, |
|
|
|
|
}; |
|
|
|
|
let res = await $_exportTransitMonth(data); |
|
|
|
|
downloadXls(res.data, `中转月度作业统计.xlsx`); |
|
|
|
|
ElMessage({ |
|
|
|
|
message: '导出成功', |
|
|
|
|
type: 'success', |
|
|
|
|
}); |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log(error); |
|
|
|
|
} finally { |
|
|
|
|
details.loadingObj.list = false; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch(() => {}); |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
@ -575,4 +934,17 @@ const AbnormalsettlementSubmit = async () => {
|
|
|
|
|
justify-content: center; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.dialog_img { |
|
|
|
|
& > div { |
|
|
|
|
margin: 10px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.el-fr-d{ |
|
|
|
|
display: flex; |
|
|
|
|
width: 100%; |
|
|
|
|
.el-btn{ |
|
|
|
|
margin: 0; |
|
|
|
|
align-items: flex-start; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|