emis-frontend/src/views/emis/emisSettleBill/panel/CancelAccountCheckListPanel.vue

522 lines
22 KiB
Vue

<template>
<XdPageContainer>
<SearchForm slot="pageHeader" class="queryForm" :model="queryParams" ref="queryForm" size="mini" :maxShow="30"
label-width="100px" v-show="showSearch" @search="handleQuery" @reset="resetQuery">
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
<el-col :span="8">
<el-form-item label="" prop="queryOrderType">
<div slot="label">
<el-radio-group class="query-label" v-model="queryOrderType">
<el-radio label="1">运单号</el-radio>
<el-radio label="0">账单号</el-radio>
</el-radio-group>
</div>
<XdTextareaInput v-model="queryParams.queryKey" :placeholder="$t('多个流水号逗号或换行隔开')" clearable
:rows="2" />
</el-form-item>
<el-form-item label="创建时间" prop="dateTimeRange">
<div slot="label">
<el-radio-group class="query-label" v-model="queryETDType">
<el-radio label="1">登记时间</el-radio>
<!-- <el-radio label="2">发出时间</el-radio> -->
</el-radio-group>
</div>
<elDateAdvPicker clearable v-model="dateTimeRange" style="width:260px"></elDateAdvPicker>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item label="账单名称" prop="settleBillName">
<el-input v-model="queryParams.settleBillName" :placeholder="$t('账单名称')" clearable />
</el-form-item>
<el-form-item :label="$t('审核状态')" prop="blCenterConfirmed">
<el-select clearable v-model="queryParams.blCenterConfirmed" placeholder="请选择">
<el-option v-for="item in dict.type.center_confirme_status" :key="item.value"
:label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('销售联系人')" prop="salesmen">
<SalemanPicker :placeholder="$t('销售联系人')" v-model="queryParams.salesmen"></SalemanPicker>
</el-form-item>
<el-form-item :label="$t('回款联系人')" prop="payee">
<PayeePicker :placeholder="$t('回款联系人')" v-model="queryParams.payee"></PayeePicker>
</el-form-item>
<el-form-item :label="$t('申请人')" prop="applyManName">
<EmpNamePicker :placeholder="$t('申请人')" v-model="queryParams.applyManName"></EmpNamePicker>
</el-form-item>
</el-col>
</el-row>
</SearchForm>
<XdTable v-loading="loading" slot="pageContent" slot-scope="slotProps"
:height="(slotProps.contentHeight) + 'px'" ref="refTable" storageName="BigBatchPanel_main_241116" border
size="mini" :data="emisTmsBatchList" :showSearch.sync="showSearch" :queryParams="queryParams" :total="total"
@queryTable="getList" @selection-change="handleSelectionChange" @sort-change="handleSortChange"
@row-dblclick="handleShowBatchInfo">
<div slot="toolbar">
<el-button style="margin-right: 5px;" type="primary" plain size="mini"
@click="handleFinancialCenterPass" v-hasPermi="['emis:writeoffApply:centerPass']" :disabled="multiple">财务中心通过</el-button>
<el-button style="margin-right: 5px;" type="danger" plain size="mini" :disabled="multiple"
@click="handleFinancialCenterNoPass" v-hasPermi="['emis:writeoffApply:centerReject']">财务中心驳回</el-button>
<el-button style="margin-right: 5px;" type="primary" plain size="mini" :disabled="multiple"
@click="handleauditHeadPass" v-hasPermi="['emis:writeoffApply:headquartersConfirm']">总部确认</el-button>
<el-button style="margin-right: 5px;" type="danger" plain size="mini" :disabled="multiple"
@click="handleauditHeadNoPass" v-hasPermi="['emis:writeoffApply:headquartersReject']">总部驳回</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['emis:writeoffApply:export']">导出</el-button>
<el-button style="margin-right: 5px;" type="danger" plain size="mini" :disabled="multiple || coRevokeFlag"
@click="handleRevoke" v-hasPermi="['emis:writeoffApply:revoke']">财务中心审核撤销</el-button>
<el-button style="margin-right: 5px;" type="danger" plain size="mini" :disabled="multiple"
@click="handleHeadquartersRevoke" v-hasPermi="['emis:writeoffApply:headquartersRevoke']">总部确认撤销</el-button>
</div>
<el-table-column type="selection" width="55" align="center" />
<el-table-column :label="$t('申请编号')" align="center" prop="applyNo" min-width="100" />
<el-table-column :label="$t('账单号')" align="center" prop="applySettleBillNo" min-width="100" />
<el-table-column :label="$t('账单名称')" align="center" prop="applySettleBillName" min-width="100" />
<!-- <el-table-column :label="$t('开票状态')" align="center" prop="batchNo" min-width="100" /> -->
<el-table-column :label="$t('申请人')" align="center" prop="applyManName" min-width="130"
:show-overflow-tooltip="true" />
<el-table-column :label="$t('账单金额')" align="center" prop="emisWaybill.freight" min-width="100" >
<template slot-scope="scope">
<!-- 求和-->
{{ scope.row.detailList.reduce((total, item) => total + (item.emisWaybill.freight || 0), 0).toFixed(2) }}
</template>
</el-table-column>
<el-table-column :label="$t('已收金额')" align="center" prop="emisSettleSubBill.recedMoney" min-width="100" >
<template slot-scope="scope">
<!-- 求和 -->
{{ scope.row.detailList.reduce((total, item) => total + (item.emisSettleSubBill.recedMoney || 0), 0).toFixed(2) }}
</template>
</el-table-column>
<el-table-column :label="$t('本次销账金额')" align="center" prop="writeoffAmount" min-width="140" />
<!-- <el-table-column :label="$t('未收金额')" align="center" prop="emisSettleSubBill.unrecedMoney" min-width="100" >
<template slot-scope="scope">
{{ scope.row.detailList.reduce((total, item) => total + (item.emisWaybill.freight -item.emisSettleSubBill.recedMoney || 0), 0) }}
</template>
</el-table-column> -->
<el-table-column :label="$t('申请说明')" align="center" prop="applyMemo" min-width="100">
</el-table-column>
<el-table-column :label="$t('申请时间')" align="center" prop="applyDate" min-width="80">
</el-table-column>
<el-table-column :label="$t('财务中心审核状态')" align="center" prop="blCenterConfirmed" min-width="140">
<template slot-scope="scope">
<dict-tag :options="dict.type.center_confirme_status" :value="scope.row.blCenterConfirmed" />
</template>
</el-table-column>
<el-table-column :label="$t('总部审核状态')" align="center" prop="blHeadquartersConfirmed" min-width="120">
<template slot-scope="scope">
<dict-tag :options="dict.type.center_confirme_status" :value="scope.row.blHeadquartersConfirmed" />
</template>
</el-table-column>
<el-table-column :label="$t('中心审核时间')" align="center" prop="centerConfirmDate" min-width="120" />
<el-table-column :label="$t('中心审核人姓名')" align="center" prop="centerConfirmManName" min-width="120" />
<el-table-column :label="$t('中心驳回原因')" align="center" prop="centerRejectReason" min-width="110">
</el-table-column>
<el-table-column :label="$t('总部审核时间')" align="center" prop="eadquartersConfirmDate;" min-width="120" />
<el-table-column :label="$t('总部审核人姓名')" align="center" prop="headquartersConfirmManName" min-width="120" />
<el-table-column :label="$t('总部驳回原因')" align="center" prop="headquartersRejectReason" min-width="110">
</el-table-column>
</XdTable>
</XdPageContainer>
</template>
<script>
import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker';
import PayeePicker from '@/views/emis/EmisBaseTools/PayeePicker.vue';
import SalemanPicker from '@/views/emis/EmisBaseTools/SalemanPicker.vue';
import EmpNamePicker from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
import CancelAccountApplicationFormPanel from '@/views/emis/emisSettleBill/panel/CancelAccountApplicationFormPanel.vue';
import { getWriteoffApplyList, auditCenterPass, auditCenterReject, auditHeadquartersConfirm, auditHeadquartersReject, auditCenterRevoke, auditHeadquartersRevoke } from "@/api/emis/emisSettleCancelAccount";
export default {
name: "CancelAccountCheckListPanel",
components: { elDateAdvPicker, PayeePicker, SalemanPicker, EmpNamePicker, CancelAccountApplicationFormPanel
},
dicts: [ 'center_confirme_status'],
data() {
return {
// 遮罩层
loading: false,
loading2: false,
loadingWait: false,
loadingDone: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
coSingle: true,
coMultiple: true,
addWayBillDisabled: true,
// packDisabled: true,
activeName: 'third',
// 显示搜索条件
showSearch: true,
// 创建时间搜索
dateTimeRange: [],
// 总条数
total: 0,
// TMS组批次表格数据
emisTmsBatchList: [],
// 待组批次列表
emisTmsWaitPackList: [],
waitTotal: 0,
// 已组批次列表
emisTmsDonePackList: [],
doneTotal: 0,
waitPackList: [],//选择未组包的运单先保存起来,在后续新增组批次的弹框中使用
// 新增/修改弹窗数据
coData: {
},
openBatchUpdateForm: false,
titleBatchForm: "",
openBatch: false,
titleBatch: "",
formBatchBillList: "",
// 新增/修改包详情数据
emisCoPackDetail: [],
blUnpack: "1",
// 追加的运单查询数据
wayBillData: {
pageNum: 1,
pageSize: 20,
params: {
dataTimeType: '1',
queryOrderType: '1'
}
},
// 追加的运单数据
emisWayBillList: [],
selectionList: [],
wayBillotal: 0,
currentId: null,
openForm: false,
titleForm: "",
queryOrderType: '1',
queryETDType: '1',
titleWayBill: null,
openWayBillForm: false,
tempCoPackList: [],
coSelection: [],
//区分当前是新增还是修改
coPackType: '',
// 临时存储已有组批次的运单号
tempExistCoPackWayBillList: [],
tempCoPackInfo: {},
// 弹出展示层
id: null,
titleView: "",
openView: false,
// 更新网点时间范围
daterangeCreateTime: [],
// 更新网点时间范围
daterangeUpdateTime: [],
// 财务中心 撤销按钮 flag
coRevokeFlag: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
queryKey: null,
applyDate: null,
settleBillName: null,
applyManName: null,
blCenterConfirmed: null,
blHeadquartersConfirmed: null,
payee: null,
salesmen: null,
applyDateStart: null,
applyDateEnd: null,
params: {
queryParams: null,
}
},
};
},
created() {
console.log("===> created "); // created
this.getList();
},
methods: {
getList() {
this.loading = true;
let rqParams = { ...this.queryParams };
if (this.queryParams.queryKey) {
rqParams.params.queryParams = this.queryParams.queryKey;
}else{
rqParams.params.queryParams = null;
}
if (this.dateTimeRange) {
rqParams = this.addDateRange(rqParams, this.dateTimeRange, "applyDate");
rqParams.applyDateStart = this.dateTimeRange[0];
rqParams.applyDateEnd = this.dateTimeRange[1];
this.removeDateRange(rqParams, "etd");
}
getWriteoffApplyList(rqParams).then(response => {
this.emisTmsBatchList = response.rows;
this.total = response.total;
this.loading = false;
});
},
initQueryParams() {
if (this.queryParams.queryKey) {
this.queryParams.params.queryParams = this.queryParams.queryKey;
}else{
this.queryParams.params.queryParams = null;
}
if (this.dateTimeRange) {
this.queryParams = this.addDateRange(this.queryParams, this.dateTimeRange, "applyDate");
this.queryParams.applyDateStart = this.dateTimeRange[0];
this.queryParams.applyDateEnd = this.dateTimeRange[1];
this.removeDateRange(this.queryParams, "etd");
}
return this.queryParams;
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.selection = selection;
this.selectionList = selection;
this.single = selection.length !== 1
this.multiple = !selection.length
//判断是否有 中部审核通过的
this.coRevokeFlag = selection.some(item => item.blHeadquartersConfirmed === '1');
},
// 排序 查询字段是表格中字段名字 动态取值排序顺序
handleSortChange(column) {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
this.getList();
},
handleFinancialCenterNoPass(row) {
const ids = row.id || this.ids;
this.$prompt('请输入财务中心驳回原因', "操作确认", {
confirmButtonText: "确定",
cancelButtonText: "取消",
closeOnClickModal: false,
inputPattern: /^.{5,30}$/,
inputErrorMessage: "驳回原因长度必须介于 5 和 30 之间"
}).then(({ value }) => {
auditCenterReject({ids:ids, centerRejectReason: value}).then(response => {
this.$modal.msgSuccess("操作成功");
this.getList();
});
}).catch(() => { });
},
handleauditHeadNoPass(row) {
const ids = row.id || this.ids;
this.$prompt('请输入总部驳回原因', "操作确认", {
confirmButtonText: "确定",
cancelButtonText: "取消",
closeOnClickModal: false,
inputPattern: /^.{5,30}$/,
inputErrorMessage: "驳回原因长度必须介于 5 和 30 之间"
}).then(({ value }) => {
auditHeadquartersReject({ids:ids, headquartersRejectReason: value}).then(response => {
this.$modal.msgSuccess("操作成功");
this.getList();
});
}).catch(() => { });
},
handleFinancialCenterPass(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否财务中心审核通过').then(function () {
return auditCenterPass(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => { });
},
handleauditHeadPass(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否总部审核通过').then(function () {
console.log('总部审核通过', ids);
return auditHeadquartersConfirm(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => { });
},
handleBatchAdd() {
this.openForm = true;
this.titleForm = "批量导入";
},
/** 修改按钮操作 */
handleBatchUpdate(row) {
// this.currentId= row.id;
this.openBatchUpdateForm = true;
this.titleBatchForm = "批量修改";
},
handleBatchFormChanged() {
this.openBatchUpdateForm = false;
this.getList();
},
cancelBatchForm() {
this.openBatchUpdateForm = false;
},
/** 修改按钮操作 */
handleUpdate() {
// let id = this.ids[0]
this.$emit("onUpdate", this.ids);
},
handleCopy() {
this.$emit("onCopy", this.ids);
},
handleShowBatchInfo(row) {
this.$emit("onView", row);
},
handleFormChanged() {
this.openForm = false;
this.getList();
},
cancelForm() {
this.openForm = false;
},
/** 导出按钮操作 */
handleExport() {
const loadingInstance = this.$loading({
text: '正在导出...'
})
if (this.selectionList && this.selectionList.length > 0) {
this.exportData(this.selectionList, loadingInstance);
}
else {
let qExportParam = this.initQueryParams();
qExportParam.pageNum = 1;
qExportParam.pageSize = 20000;
getWriteoffApplyList(qExportParam).then(response => {
if (response.code === 200) {
this.exportData(response.rows, loadingInstance);
}
});
}
},
exportData(selData, loadingInstance) {
const curList = selData
import('@/vendor/Export2Excel').then(excel => {
const exportParam = this.$refs.refTable.getExportParam();
const tHeader = exportParam.header;
const filterVal = exportParam.filter;
const data = this.formatJson(filterVal, curList, selData)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '销账列表',
autoWidth: true
})
loadingInstance.close()
})
},
formatJson(filterVal, jsonData, resData) {
return jsonData.map(v => filterVal.map(j => {
if (j === 'blCenterConfirmed') {
return this.selectDictLabel(this.dict.type.center_confirme_status, v[j]);
}
return v[j]
}))
},
/** 列索引函数 */
getIndex($index) {
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
},
/** 时间搜索响应函数 */
dateTimeChange(value) {
this.dateTimeRange = value;
},
/** 财务中心审核撤销 */
handleRevoke(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否财务中心审核撤销?').then(function () {
return auditCenterRevoke(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => { });
},
/** 总部确认撤销 */
handleHeadquartersRevoke(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否总部审核撤销?').then(function () {
return auditHeadquartersRevoke(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => { });
},
}
};
</script>
<style scoped>
.el-divider {
margin-top: 0px;
background: 0 0;
border-top: 1px solid #E6EBF5;
}
.el-divider__text {
color: #0955ee;
cursor: pointer;
}
.query-label {
.el-radio {
display: block;
line-height: 23px;
white-space: normal;
margin-right: 0;
}
}
.overflowhidden {
overflow: hidden;
}
.ellipsis {
width: 100px;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: top;
white-space: nowrap;
}
</style>