销售结算接口
This commit is contained in:
@ -11,9 +11,21 @@ enum Api {
|
||||
PageAdd = '/magic-api/dayPlan/pngSettleSalesHdrSelectPage',
|
||||
date = '/magic-api/dayPlan/pngSettleSalesHdrSelectDateTo',
|
||||
DtlList = '/magic-api/dayPlan/pngSettleSalesHdrDtlList',
|
||||
LngPngSettleHdrCancel = '/dayPlan/pngSettleHdr/cancel',
|
||||
|
||||
|
||||
|
||||
}
|
||||
export async function cancelLngPngSettleHdr(ids: string[], mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.post<boolean>(
|
||||
{
|
||||
url: Api.LngPngSettleHdrCancel,
|
||||
data: ids,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
export async function getLngPngSettleHdrDtlList(params, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<LngPngSettleHdrPageModel>(
|
||||
|
||||
@ -6,19 +6,19 @@
|
||||
<template v-if="column.dataIndex === 'priceDesc'">
|
||||
{{ record.uomName + (record.uomCode == 'M3' ? record.rateQtyM3 : record.rateQtyGj) + record.priceName }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'qtySettleGj'">
|
||||
<template v-if="column.dataIndex === 'qtySettleGj' && !isDisable">
|
||||
<a-input-number v-model:value="record.qtySettleGj" :min="0" :precision="3" @change="numChange('qtySettleGj', record, index)" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'qtySettleM3'">
|
||||
<template v-if="column.dataIndex === 'qtySettleM3'&& !isDisable">
|
||||
<a-input-number v-model:value="record.qtySettleM3" :min="0" :precision="3" @change="numChange('qtySettleM3', record, index)" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'priceM3'">
|
||||
<template v-if="column.dataIndex === 'priceM3'&& !isDisable">
|
||||
<a-input-number v-model:value="record.priceM3" :min="0" :precision="4" @change="numChange('priceM3', record, index)" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'priceGj'">
|
||||
<template v-if="column.dataIndex === 'priceGj'&& !isDisable">
|
||||
<a-input-number v-model:value="record.priceGj" :min="0" :precision="4" @change="numChange('priceGj', record, index)" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'amount'">
|
||||
<template v-if="column.dataIndex === 'amount'&& !isDisable">
|
||||
<a-input-number v-model:value="record.amount" :min="0" :precision="2" @change="numChange('amount', record, index)" style="width: 100%" />
|
||||
</template>
|
||||
</template>
|
||||
@ -32,10 +32,12 @@
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { getLngPngSettleHdrDtlList} from '/@/api/dayPlan/PngSettleHdr';
|
||||
import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat';
|
||||
|
||||
const { t } = useI18n();
|
||||
const tableData = ref([])
|
||||
const curRecord = ref({})
|
||||
const isDisable = ref(false)
|
||||
const columns= [
|
||||
{ title: t('序号'), dataIndex: 'index', key: 'index', customRender: (column) => `${column.index + 1}` ,width: 80},
|
||||
{ title: t('价格描述'), dataIndex: 'priceDesc', width:130},
|
||||
@ -55,10 +57,18 @@
|
||||
setModalProps({ confirmLoading: false });
|
||||
curRecord.value = data.record || {}
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
isDisable.value = data.isDisable
|
||||
if (!(curRecord.value.lngPngSettleSalesDtlList || []).length) {
|
||||
getList()
|
||||
} else {
|
||||
tableData.value = curRecord.value.lngPngSettleSalesDtlList || []
|
||||
tableData.value = DataFormat.format(tableData.value, [
|
||||
FormatOption.createQty('qtySettleGj'),
|
||||
FormatOption.createQty('qtySettleM3'),
|
||||
FormatOption.createAmt('amount'),
|
||||
FormatOption.createQty('priceGj',4),
|
||||
FormatOption.createQty('priceM3',4),
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -240,7 +240,7 @@
|
||||
async function handleReject() {
|
||||
if (!selectedRowsData.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
message: '提示',
|
||||
description: t('请选择需要驳回的数据'),
|
||||
});
|
||||
return;
|
||||
@ -248,7 +248,7 @@
|
||||
await rejectLngPngMeasureSalesPur(selectedRowsData.value)
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
message: '提示',
|
||||
description: t('已驳回!'),
|
||||
});
|
||||
}
|
||||
@ -256,7 +256,7 @@
|
||||
async function handleCancel() {
|
||||
if (!selectedRowsData.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
message: '提示',
|
||||
description: t('请选择需要取消的数据'),
|
||||
});
|
||||
return;
|
||||
@ -264,14 +264,14 @@
|
||||
await cancelLngPngMeasureSalesPur(selectedRowsData.value)
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
message: '提示',
|
||||
description: t('取消成功!'),
|
||||
});
|
||||
}
|
||||
async function handleSubmit() {
|
||||
if (!selectedRowsData.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
message: '提示',
|
||||
description: t('请选择需要确认的数据'),
|
||||
});
|
||||
return;
|
||||
@ -283,14 +283,14 @@
|
||||
await updateLngPngMeasureSalesPur(selectedRowsData.value)
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
message: '提示',
|
||||
description: t('确认成功!'),
|
||||
});
|
||||
}
|
||||
async function handleSave() {
|
||||
if (!selectedRowsData.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
message: '提示',
|
||||
description: t('请选择需要保存的数据'),
|
||||
});
|
||||
return;
|
||||
@ -302,7 +302,7 @@
|
||||
await addLngPngMeasureSalesPur(selectedRowsData.value)
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
message: '提示',
|
||||
description: t('保存成功!'),
|
||||
});
|
||||
|
||||
@ -353,7 +353,7 @@
|
||||
function handleBatchdelete() {
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
message: '提示',
|
||||
description: t('请选择需要删除的数据'),
|
||||
});
|
||||
return;
|
||||
@ -367,7 +367,7 @@
|
||||
});
|
||||
if (cantDelete.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
message: '提示',
|
||||
description: t('含有不能删除的数据'),
|
||||
});
|
||||
return;
|
||||
@ -385,7 +385,7 @@
|
||||
deleteLngPngMeasureSalesPur(ids).then((_) => {
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
message: '提示',
|
||||
description: t('删除成功!'),
|
||||
});
|
||||
});
|
||||
|
||||
@ -108,7 +108,7 @@ export const columns: BasicColumn[] = [
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'deptId',
|
||||
dataIndex: 'billList',
|
||||
title: '附件',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="账期内含预收付款" name="rpSign">
|
||||
<a-select v-model:value="formState.rpSign" style="width: 100%" allow-clear>
|
||||
<a-select v-model:value="formState.rpSign" style="width: 100%" allow-clear :disabled="isDisable">
|
||||
<a-select-option v-for="item in optionSelect.signList" :key="item.code" :value="item.code">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
@ -89,7 +89,7 @@
|
||||
<a v-if="!isDisable" @click="btnCheck(record, index, 'delete')">删除</a>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'priceDesc'">
|
||||
<a v-if="!isDisable" @click="btnCheck(record, index, 'price')">{{record.priceDesc}}</a>
|
||||
<a @click="btnCheck(record, index, 'price')">{{record.priceDesc}}</a>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
@ -355,7 +355,7 @@
|
||||
if (type == 'delete') {
|
||||
dataList.value.splice(index, 1)
|
||||
} else {
|
||||
openModalPrice(true,{isUpdate: false, record})
|
||||
openModalPrice(true,{isUpdate: false, record,isDisable: isDisable.value})
|
||||
}
|
||||
}
|
||||
const handleSuccessPrice = (arr, curRecord) => {
|
||||
|
||||
@ -18,8 +18,8 @@
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<TableAction :actions="getActions(record)" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'lngFileUploadList'">
|
||||
<div v-for="(item, idx) in record.lngFileUploadList">
|
||||
<template v-if="column.dataIndex === 'billList'">
|
||||
<div v-for="(item, idx) in record.billList">
|
||||
<a @click="handleDownload(item)">{{item.fileOrg}}</a>
|
||||
</div>
|
||||
</template>
|
||||
@ -39,7 +39,7 @@
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
||||
import { getLngPngSettleHdrPage, deleteLngPngSettleHdr} from '/@/api/dayPlan/PngSettleHdr';
|
||||
import { getLngPngSettleHdrPage, deleteLngPngSettleHdr, cancelLngPngSettleHdr} from '/@/api/dayPlan/PngSettleHdr';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
@ -55,6 +55,7 @@
|
||||
import { getDraftInfo } from '/@/api/workflow/process';
|
||||
import { isValidJSON } from '/@/utils/event/design';
|
||||
import { downloadByUrl } from '/@/utils/file/download';
|
||||
import { parseDownloadUrl} from '/@/api/system/file';
|
||||
|
||||
import PngSettleHdrModal from './components/PngSettleHdrModal.vue';
|
||||
import {formConfig, searchFormSchema, columns } from './components/config';
|
||||
@ -81,7 +82,7 @@
|
||||
|
||||
const tableRef = ref();
|
||||
//所有按钮
|
||||
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"生成对账单","code":"check","icon":"ant-design:check-outlined","isDefault":true},{"isUse":true,"name":"取消结算","code":"cancel","icon":"ant-design:close-outlined","isDefault":false},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true},{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"审批","code":"approve","icon":"ant-design:check-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true},{"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true,"isUse":true}]);
|
||||
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"生成对账单","code":"check","icon":"ant-design:check-outlined","isDefault":true},{"isUse":true,"name":"取消结算","code":"cancel","icon":"ant-design:close-outlined","isDefault":true},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true},{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"审批","code":"approve","icon":"ant-design:check-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true},{"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true,"isUse":true}]);
|
||||
//展示在列表内的按钮
|
||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord','approve']);
|
||||
const buttonConfigs = computed(()=>{
|
||||
@ -96,7 +97,7 @@
|
||||
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
||||
});
|
||||
|
||||
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,approve : handleApprove,delete : handleDelete,datalog : handleDatalog}
|
||||
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,approve : handleApprove,delete : handleDelete,datalog : handleDatalog,cancel:handleCancel}
|
||||
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
@ -120,7 +121,7 @@
|
||||
const visibleFlowRecordModal = ref(false);
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const formName=currentRoute.value.meta?.title
|
||||
const [registerTable, { reload, setTableData, getDataSource }] = useTable({
|
||||
const [registerTable, { reload, setTableData, getDataSource,clearSelectedRowKeys }] = useTable({
|
||||
title: '' || (formName + '列表'),
|
||||
api: getLngPngSettleHdrPage,
|
||||
rowKey: 'id',
|
||||
@ -298,7 +299,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
function handleApprove () {
|
||||
function handleApprove (record: Recordable) {
|
||||
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||
if (taskIds && taskIds.length) {
|
||||
router.push({
|
||||
@ -312,6 +313,23 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
function handleCancel () {
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: '提示',
|
||||
description: t('请选择需要取消结算的数据'),
|
||||
});
|
||||
return
|
||||
}
|
||||
cancelLngPngSettleHdr(selectedKeys.value).then((_) => {
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('取消成功!'),
|
||||
});
|
||||
clearSelectedRowKeys()
|
||||
});
|
||||
}
|
||||
function handleDelete(record: Recordable) {
|
||||
deleteList([record.id]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user