lng销售结算
This commit is contained in:
@ -3,16 +3,50 @@ import { defHttp } from '/@/utils/http/axios';
|
||||
import { ErrorMessageMode } from '/#/axios';
|
||||
|
||||
enum Api {
|
||||
Page = '/dayPlan/lngSettleHdr/page',
|
||||
// Page = '/dayPlan/lngSettleHdr/page',
|
||||
Page = '/magic-api/dayPlan/lngSettleHdr/page',
|
||||
List = '/dayPlan/lngSettleHdr/list',
|
||||
Info = '/dayPlan/lngSettleHdr/info',
|
||||
LngLngSettleHdr = '/dayPlan/lngSettleHdr',
|
||||
|
||||
|
||||
querySettList = '/magic-api/dayPlan/querySettList',
|
||||
cancel = '/dayPlan/lngSettleHdr/cancel',
|
||||
getSettMonth = '/magic-api/dayPlan/getSettMonth'
|
||||
|
||||
|
||||
}
|
||||
|
||||
export async function cancelLngSettleHdr(ids: string[], mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.post<LngLngSettleHdrPageModel>(
|
||||
{
|
||||
url: Api.cancel,
|
||||
data: ids,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
export async function getLngLngSettleHdrMonth(params: LngLngSettleHdrPageParams, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<LngLngSettleHdrPageModel>(
|
||||
{
|
||||
url: Api.getSettMonth,
|
||||
params
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
export async function getLngLngSettleHdrPageAdd(params: LngLngSettleHdrPageParams, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<LngLngSettleHdrPageResult>(
|
||||
{
|
||||
url: Api.querySettList,
|
||||
params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @description: 查询LngLngSettleHdr分页列表
|
||||
*/
|
||||
|
||||
@ -4,16 +4,11 @@
|
||||
@visible-change="handleVisibleChange" >
|
||||
<div class="box">
|
||||
<a-checkbox class="checkItem" v-model:checked="checked" @change="checkChange">仅显示未结算</a-checkbox>
|
||||
<BasicTable @register="registerTable" class="measureListModal">
|
||||
<BasicTable @register="registerTable" class="priceLngHdrListModal">
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'settledSign'">
|
||||
{{ Number(record.settledSign) == 1 ? '已结算': '未结算' }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'file'">
|
||||
<div v-for="item in (record.lngFileUploadList )" class="fileCSS">
|
||||
<a @click="handleDownload(item)">{{item.fileOrg}}</a>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
@ -27,12 +22,10 @@
|
||||
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { getLngPngSettleHdrPageAdd} from '/@/api/dayPlan/PngSettleHdr';
|
||||
import { getLngPngSettleHdrPageAddPur} from '/@/api/dayPlan/PngSettleHdrPur'
|
||||
import { parseDownloadUrl} from '/@/api/system/file';
|
||||
import { downloadByUrl } from '/@/utils/file/download';
|
||||
import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat';
|
||||
|
||||
import { getLngLngSettleHdrPageAdd, } from '/@/api/dayPlan/LngSettleHdr';
|
||||
import {formConfig, searchFormSchema, columns } from '/@/views/dayPlan/LngMeasurePur/components/config';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
const props = defineProps({
|
||||
selectType: { type: String, default: 'checkbox' },
|
||||
pageType: String
|
||||
@ -52,36 +45,12 @@
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const columns: BasicColumn[] = [
|
||||
{ dataIndex: 'datePlan', title: '计划日期', align: 'left', width: 100},
|
||||
{ dataIndex: 'dateMea', title: '计量日期', align: 'left',width: 100},
|
||||
{ dataIndex: 'cuSname', title: '客户', align: 'left', },
|
||||
{ dataIndex: 'pointDelyName', title: '下载点', align: 'left',},
|
||||
{ dataIndex: 'comName', title: '交易主体', align: 'left',},
|
||||
{ dataIndex: 'qtyMeaSalesGj', title: '完成量(吉焦)', align: 'left',width: 120},
|
||||
{ dataIndex: 'qtyMeaPurM3', title: '完成量(方)', align: 'left',width: 120},
|
||||
{ dataIndex: 'rateM3Gj', title: '比值(方/吉焦)', align: 'left',width: 120},
|
||||
{ dataIndex: 'ksName', title: '销售合同', align: 'left',},
|
||||
{ dataIndex: 'file', title: '附件', align: 'left',width: 200},
|
||||
{ dataIndex: 'settledSign', title: '已结算', align: 'left',width: 100},
|
||||
];
|
||||
const columnsPur: BasicColumn[] = [
|
||||
{ dataIndex: 'datePlan', title: '计划日期', align: 'left', width: 100},
|
||||
{ dataIndex: 'dateMea', title: '计量日期', align: 'left',width: 100},
|
||||
{ dataIndex: 'suSname', title: '供应商', align: 'left', },
|
||||
{ dataIndex: 'pointUpName', title: '上载点', align: 'left',},
|
||||
{ dataIndex: 'cuSname', title: '客户', align: 'left',},
|
||||
{ dataIndex: 'pointDelyName', title: '下载点', align: 'left',},
|
||||
{ dataIndex: 'comName', title: '交易主体', align: 'left',},
|
||||
{ dataIndex: 'qtyMeaPurGj', title: '完成量(吉焦)', align: 'left',width: 120},
|
||||
{ dataIndex: 'qtyMeaPurM3', title: '完成量(方)', align: 'left',width: 120},
|
||||
{ dataIndex: 'rateM3Gj', title: '比值(方/吉焦)', align: 'left',width: 120},
|
||||
{ dataIndex: 'kpName', title: '采购合同', align: 'left',},
|
||||
{ dataIndex: 'file', title: '附件', align: 'left',width: 200},
|
||||
{ dataIndex: 'settledSign', title: '已结算', align: 'left',width: 100},
|
||||
];
|
||||
|
||||
let columnsNew = cloneDeep(columns)
|
||||
columnsNew.splice(-5,5)
|
||||
columnsNew.push(
|
||||
{dataIndex: 'kName',title: '销售合同',componentType: 'input',align: 'left',width: 180,sorter: true},
|
||||
{dataIndex: 'comName',title: '供应商',componentType: 'input',align: 'left',width: 180,sorter: true,},
|
||||
{ dataIndex: 'settledSign', title: '已结算', align: 'left',width: 100})
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const { notification } = useMessage();
|
||||
@ -101,9 +70,9 @@
|
||||
|
||||
const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload,clearSelectedRowKeys }] = useTable({
|
||||
title: t('待结算记录'),
|
||||
api: props.pageType=='supplier'?getLngPngSettleHdrPageAddPur: getLngPngSettleHdrPageAdd,
|
||||
rowKey: props.pageType=='supplier' ? 'salesPurId': 'salesId',
|
||||
columns: props.pageType=='supplier' ? columnsPur: columns,
|
||||
api: getLngLngSettleHdrPageAdd,
|
||||
rowKey: 'salesId',
|
||||
columns: columnsNew,
|
||||
|
||||
bordered: true,
|
||||
pagination: true,
|
||||
@ -126,16 +95,6 @@
|
||||
},
|
||||
afterFetch: (res) => {
|
||||
tableData.value = res || []
|
||||
tableData.value.forEach(v => {
|
||||
let a = v.attachList ? v.attachList.split(',') : []
|
||||
v.lngFileUploadList = []
|
||||
a.forEach(k => {
|
||||
v.lngFileUploadList.push({
|
||||
fileOrg: k.split('@')[0],
|
||||
fileUrl: k.split('@')[1]
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
rowSelection: {
|
||||
type: props.selectType,
|
||||
@ -147,8 +106,8 @@
|
||||
(val) => {
|
||||
if (val) {
|
||||
let arr = DataFormat.format(val, [
|
||||
FormatOption.createQty('qtyMeaGj'),
|
||||
FormatOption.createQty('qtyMeaM3'),
|
||||
FormatOption.createQty('qtyMeaGjSales'),
|
||||
FormatOption.createQty('qtyMeaM3Sales'),
|
||||
]);
|
||||
if (arr.length) {
|
||||
setTableData(arr)
|
||||
@ -170,11 +129,6 @@
|
||||
const checkChange = (val) => {
|
||||
reload();
|
||||
}
|
||||
const handleDownload = (info) => {
|
||||
const url = parseDownloadUrl(info.response ? info.response.data.fileUrl : info.fileUrl);
|
||||
const fileName = info.response ? info.response.data.fileOrg : info.fileOrg;
|
||||
downloadByUrl({ url, fileName: fileName});
|
||||
};
|
||||
function onSelectChange(rowKeys: string[], e) {
|
||||
selectedKeys.value = rowKeys;
|
||||
selectedValues.value = e
|
||||
@ -202,11 +156,11 @@
|
||||
|
||||
</script>
|
||||
<style >
|
||||
.measureListModal .basicCol{
|
||||
.priceLngHdrListModal .basicCol{
|
||||
position: inherit !important;
|
||||
top: 0;
|
||||
}
|
||||
.measureListModal .ant-col-8 {
|
||||
.priceLngHdrListModal .ant-col-8 {
|
||||
width: 450px !important;
|
||||
max-width: 450px !important;;
|
||||
}
|
||||
@ -221,10 +175,4 @@
|
||||
left: 17px;
|
||||
z-index: 104;
|
||||
}
|
||||
.fileCSS a{
|
||||
width: 100%;
|
||||
white-space: normal;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
<span>结算总量(吉焦):{{ numObj.qtySettleGjAll }}</span>
|
||||
<span>结算总金额(元):{{ numObj.amount }}</span>
|
||||
</div>
|
||||
<div class="price-box">
|
||||
<div class="price-box" v-if="!disabled">
|
||||
<div>
|
||||
<span class="btn-title">修改价格/吉焦</span>
|
||||
<a-input-search type="number" enter-button="批量修改" style="width: 200px" :min="0" v-model:value="formData.priceGj" placeholder="请输入" @search="editBtn('priceGj')"/>
|
||||
@ -24,6 +24,21 @@
|
||||
</div>
|
||||
<a-table :columns="columns" :data-source="dataList" :scroll="{x: 1800}" :rowKey="rowKey" :pagination="false" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }">
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'qtySettleGj'">
|
||||
<input-number v-model:value="record.qtySettleGj" :disabled="disabled" :digits="3" :min="0" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'qtySettleTon'">
|
||||
<input-number v-model:value="record.qtySettleTon" :disabled="disabled" :digits="3" :min="0" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'priceGj'">
|
||||
<input-number v-model:value="record.priceGj" :disabled="disabled" :digits="4" :min="0" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'priceTon'">
|
||||
<input-number v-model:value="record.priceTon" :disabled="disabled" :digits="4" :min="0" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'amount'">
|
||||
<input-number v-model:value="record.amount" :disabled="disabled" :digits="2" :min="0" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'operation'">
|
||||
<a v-if="!disabled" @click="btnCheck(record, index, 'delete')">删除</a>
|
||||
</template>
|
||||
@ -45,7 +60,6 @@
|
||||
import { message } from 'ant-design-vue';
|
||||
import priceLngHdrListModal from '/@/components/common/priceLngHdrListModal.vue';
|
||||
import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat';
|
||||
import { kStringMaxLength } from 'node:buffer';
|
||||
|
||||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
@ -58,12 +72,12 @@ import { kStringMaxLength } from 'node:buffer';
|
||||
{ title: t('计划日期'), dataIndex: 'datePlan', width:120},
|
||||
{ title: t('车头号'), dataIndex: 'noTractor', width:120},
|
||||
{ title: t('挂车号'), dataIndex: 'noTrailer', width:120},
|
||||
{ title: t('进厂皮重时间'), dataIndex: 'timeIn', width:120},
|
||||
{ title: t('出厂毛重时间'), dataIndex: 'timeOut', width:120},
|
||||
{ title: t('装车量(吉焦)'), dataIndex: 'qtyMeaGj', width:120},
|
||||
{ title: t('装车量(吨)'), dataIndex: 'qtyMeaTon', width:120},
|
||||
{ title: t('结算量(吉焦)'), dataIndex: 'qtySettleGj', width: 140},
|
||||
{ title: t('结算量(吨)'), dataIndex: 'qtySettleTon', width: 130},
|
||||
{ title: t('进厂皮重时间'), dataIndex: 'timeIn', width:160},
|
||||
{ title: t('出厂毛重时间'), dataIndex: 'timeOut', width:160},
|
||||
{ title: t('装车量(吉焦)'), dataIndex: 'qtyMeaGj', width:140},
|
||||
{ title: t('装车量(吨)'), dataIndex: 'qtyMeaTon', width:140},
|
||||
{ title: t('结算量(吉焦)'), dataIndex: 'qtySettleGj', width: 150},
|
||||
{ title: t('结算量(吨)'), dataIndex: 'qtySettleTon', width: 140},
|
||||
{ title: t('结算价格(元/吉焦)'), dataIndex: 'priceGj', width: 180},
|
||||
{ title: t('结算价格(元/吨)'), dataIndex: 'priceTon', width: 170},
|
||||
{ title: t('结算金额(元)'), dataIndex: 'amount', width: 140},
|
||||
@ -95,7 +109,7 @@ import { kStringMaxLength } from 'node:buffer';
|
||||
}
|
||||
dataList.value.forEach(v=> {
|
||||
selectedKeys.value.forEach(i => {
|
||||
if (v.id == i) {
|
||||
if (v.salesId == i) {
|
||||
v[k] = formData[k]
|
||||
}
|
||||
})
|
||||
@ -109,7 +123,7 @@ import { kStringMaxLength } from 'node:buffer';
|
||||
}
|
||||
let obj = {
|
||||
cpCode: props.formState.cpCode,
|
||||
comId: props.formState.comId
|
||||
// comId: props.formState.comId
|
||||
}
|
||||
openModalHdr(true,{isUpdate: false, searchParams: obj})
|
||||
} else {
|
||||
@ -128,8 +142,8 @@ import { kStringMaxLength } from 'node:buffer';
|
||||
}
|
||||
}
|
||||
const handleSuccessHdr = (val) => {
|
||||
val.forEach(i =>{
|
||||
delete i.lngFileUploadList
|
||||
val.forEach(v =>{
|
||||
v.cpCode = v.cuCode
|
||||
})
|
||||
if (!dataList.value.length) {
|
||||
dataList.value = val
|
||||
@ -171,11 +185,11 @@ import { kStringMaxLength } from 'node:buffer';
|
||||
let amount = 0
|
||||
val.forEach(v => {
|
||||
if (Number(v.settleTimes) == 1){
|
||||
qtySettleGjOne+=Number((v.qtySettleGj || '').replace(/,/g, '')) || 0
|
||||
qtySettleGjOne+=Number(v.qtySettleGj || 0)
|
||||
} else {
|
||||
qtySettleGjNum+=Number((v.qtySettleGj || '').replace(/,/g, '')) || 0
|
||||
qtySettleGjNum+=Number(v.qtySettleGj || 0)
|
||||
}
|
||||
amount+=Number((v.amount || '').replace(/,/g, '')) || 0
|
||||
amount+=Number(v.amount|| 0)
|
||||
})
|
||||
numObj.value.qtySettleGjOne = qtySettleGjOne.toFixed(3)
|
||||
numObj.value.qtySettleGjNum = qtySettleGjNum.toFixed(3)
|
||||
|
||||
@ -18,7 +18,7 @@ export const searchFormSchema: FormSchema[] = [
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'cuName',
|
||||
field: 'cpName',
|
||||
label: '客户',
|
||||
component: 'Input',
|
||||
},
|
||||
@ -30,7 +30,7 @@ export const columns: BasicColumn[] = [
|
||||
title: '结算月',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 100,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
@ -39,7 +39,7 @@ export const columns: BasicColumn[] = [
|
||||
title: '结算月开始日期',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 120,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
@ -48,16 +48,16 @@ export const columns: BasicColumn[] = [
|
||||
title: '结算月结束日期',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 120,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'cuSname',
|
||||
dataIndex: 'cpName',
|
||||
title: '客户简称',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 140,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
@ -66,7 +66,7 @@ export const columns: BasicColumn[] = [
|
||||
title: '结算总数量(吨)',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 130,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
@ -75,7 +75,7 @@ export const columns: BasicColumn[] = [
|
||||
title: '结算总金额(元)',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 130,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
@ -84,7 +84,7 @@ export const columns: BasicColumn[] = [
|
||||
title: '交易主体',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 120,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
@ -93,7 +93,7 @@ export const columns: BasicColumn[] = [
|
||||
title: '结算说明',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 150,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
@ -102,7 +102,7 @@ export const columns: BasicColumn[] = [
|
||||
title: '附件',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 150,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
@ -111,7 +111,7 @@ export const columns: BasicColumn[] = [
|
||||
title: '审批状态',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 80,
|
||||
sorter: true,
|
||||
},
|
||||
];
|
||||
|
||||
@ -48,8 +48,8 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="结算总数量(方)" name="qtySettleM3">
|
||||
<a-input v-model:value="formState.qtySettleM3" disabled/>
|
||||
<a-form-item label="结算总数量(吨)" name="qtySettleTon">
|
||||
<a-input v-model:value="formState.qtySettleTon" disabled/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
@ -98,7 +98,7 @@
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import { getDictionary } from '/@/api/sales/Customer';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { addLngPngSettleHdr,updateLngPngSettleHdr, getLngPngSettleHdr, getLngPngSettleHdrDate} from '/@/api/dayPlan/PngSettleHdr';
|
||||
import { addLngLngSettleHdr,updateLngLngSettleHdr, getLngLngSettleHdr,getLngLngSettleHdrMonth} from '/@/api/dayPlan/LngSettleHdr';
|
||||
import dayjs from 'dayjs';
|
||||
import { getAppEnvConfig } from '/@/utils/env';
|
||||
import { message } from 'ant-design-vue';
|
||||
@ -109,8 +109,8 @@
|
||||
import { getAllCom} from '/@/api/contract/ContractPurInt';
|
||||
import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat';
|
||||
|
||||
const tableName = 'PngSettleHdr';
|
||||
const columnName = 'PngSettleHdr'
|
||||
const tableName = 'LngSettleHdr';
|
||||
const columnName = 'LngSettleHdr'
|
||||
|
||||
const formType = ref('2'); // 0 新建 1 修改 2 查看
|
||||
const formRef = ref();
|
||||
@ -196,20 +196,26 @@
|
||||
});
|
||||
|
||||
const uploadChange = (val) => {
|
||||
val.forEach(v=> {
|
||||
v.tableId = ''
|
||||
})
|
||||
dataFileAccount.value = val
|
||||
}
|
||||
const uploadListChange = (val) => {
|
||||
val.forEach(v=> {
|
||||
v.tableId = ''
|
||||
})
|
||||
dataFile.value = val
|
||||
}
|
||||
async function getInfo(id) {
|
||||
spinning.value = true
|
||||
try {
|
||||
let data = await getLngPngSettleHdr(id)
|
||||
let data = await getLngLngSettleHdr(id)
|
||||
spinning.value = false
|
||||
Object.assign(formState, {...data})
|
||||
Object.assign(dataFile.value, formState.lngFileUploadList || [])
|
||||
Object.assign(dataFileAccount.value, formState.billList || [])
|
||||
Object.assign(dataList.value, formState.lngPngSettleSalesList || [])
|
||||
Object.assign(dataList.value, formState.lngLngSettleList || [])
|
||||
formState.settleMonth = formState.settleMonth ? dayjs(formState.settleMonth) : null
|
||||
formState.dateFrom = formState.dateFrom ? dayjs(formState.dateFrom) : null
|
||||
formState.dateTo = formState.dateTo ? dayjs(formState.dateTo) : null
|
||||
@ -222,7 +228,7 @@
|
||||
const numFormat = () => {
|
||||
dataList.value = DataFormat.format(dataList.value, [
|
||||
FormatOption.createQty('qtySettleGj'),
|
||||
FormatOption.createQty('qtySettleM3'),
|
||||
FormatOption.createQty('qtySettleTon'),
|
||||
FormatOption.createQty('qtyMeaGj'),
|
||||
FormatOption.createQty('qtyMeaM3'),
|
||||
FormatOption.createAmt('amount'),
|
||||
@ -231,16 +237,16 @@
|
||||
]);
|
||||
let obj = {
|
||||
qtySettleGj: formState.qtySettleGj,
|
||||
qtySettleM3: formState.qtySettleM3,
|
||||
qtySettleTon: formState.qtySettleTon,
|
||||
amount: formState.amount
|
||||
}
|
||||
let a = DataFormat.format({...obj}, [
|
||||
FormatOption.createQty('qtySettleGj'),
|
||||
FormatOption.createQty('qtySettleM3'),
|
||||
FormatOption.createQty('qtySettleTon'),
|
||||
FormatOption.createAmt('amount'),
|
||||
]);
|
||||
formState.qtySettleGj = a.qtySettleGj
|
||||
formState.qtySettleM3 = a.qtySettleM3
|
||||
formState.qtySettleTon = a.qtySettleTon
|
||||
formState.amount = a.amount
|
||||
}
|
||||
const settleChange = (val) => {
|
||||
@ -251,23 +257,23 @@
|
||||
const numClear = () => {
|
||||
if (!dataList.value.length) {
|
||||
formState.qtySettleGj = ''
|
||||
formState.qtySettleM3 = ''
|
||||
formState.qtySettleTon = ''
|
||||
formState.amount = ''
|
||||
}
|
||||
}
|
||||
const tableCount = () => {
|
||||
let qtySettleGj = 0
|
||||
let qtySettleM3 = 0
|
||||
let qtySettleTon = 0
|
||||
let amount = 0
|
||||
dataList.value.forEach(v => {
|
||||
if (Number(v.settleTimes) == 1){
|
||||
qtySettleGj+=Number(v.qtySettleGj) || 0
|
||||
qtySettleM3+=Number(v.qtySettleM3) || 0
|
||||
qtySettleTon+=Number(v.qtySettleTon) || 0
|
||||
}
|
||||
amount+=Number(v.amount) || 0
|
||||
})
|
||||
formState.qtySettleGj = qtySettleGj.toFixed(3)
|
||||
formState.qtySettleM3 = qtySettleM3.toFixed(3)
|
||||
formState.qtySettleTon = qtySettleTon.toFixed(3)
|
||||
formState.amount = amount.toFixed(2)
|
||||
numFormat()
|
||||
}
|
||||
@ -280,12 +286,11 @@
|
||||
cpCode: formState.cpCode,
|
||||
comId: formState.comId
|
||||
}
|
||||
if (!pageId.value && formState.cpCode && formState.comId && !formState.dateFrom) {
|
||||
let data = await getLngPngSettleHdrDate(obj) || []
|
||||
if (data.length) {
|
||||
formState.dateFrom = data[0]?.dateTo ? dayjs(data[0]?.dateTo) : null
|
||||
formState.dateTo = null
|
||||
}
|
||||
if (formState.cpCode && formState.comId && !formState.dateFrom) {
|
||||
let data = await getLngLngSettleHdrMonth(obj) || []
|
||||
formState.dateFrom = data?.dateFrom ? dayjs(data?.dateFrom) : null
|
||||
formState.dateTo = null
|
||||
|
||||
}
|
||||
})
|
||||
async function getOption() {
|
||||
@ -333,10 +338,10 @@
|
||||
...formState,
|
||||
lngFileUploadList: dataFile.value,
|
||||
billList: dataFileAccount.value,
|
||||
lngPngSettleSalesList: dataList.value,
|
||||
lngLngSettleList: dataList.value,
|
||||
}
|
||||
spinning.value = true;
|
||||
let request = !formState.id ? addLngPngSettleHdr :updateLngPngSettleHdr
|
||||
let request = !formState.id ? addLngLngSettleHdr :updateLngLngSettleHdr
|
||||
|
||||
try {
|
||||
const data = await request(obj);
|
||||
@ -347,7 +352,7 @@
|
||||
// 同意保存不提示
|
||||
if (!type) {
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
message: '提示',
|
||||
description: data?.id ? t('新增成功!') : t('修改成功!')
|
||||
}); //提示消息
|
||||
}
|
||||
|
||||
@ -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 { getLngLngSettleHdrPage, deleteLngLngSettleHdr} from '/@/api/dayPlan/LngSettleHdr';
|
||||
import { getLngLngSettleHdrPage, deleteLngLngSettleHdr,cancelLngSettleHdr} from '/@/api/dayPlan/LngSettleHdr';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
@ -82,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":"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":"check","icon":"ant-design:check-outlined","isDefault":false},{"isUse":true,"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true},{"isUse":true,"name":"取消对账单","code":"cancel","icon":"ant-design:rollback-outlined","isDefault":false},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":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":"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":"check","icon":"ant-design:check-outlined","isDefault":false},{"isUse":true,"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true},{"isUse":true,"name":"取消对账单","code":"cancel","icon":"ant-design:rollback-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true}]);
|
||||
//展示在列表内的按钮
|
||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord','approve']);
|
||||
const buttonConfigs = computed(()=>{
|
||||
@ -97,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,}
|
||||
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,approve : handleApprove,delete : handleDelete,datalog: handleDatalog, cancel: handelCancel}
|
||||
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
@ -115,11 +115,13 @@
|
||||
const draftsId = ref();
|
||||
|
||||
const visibleApproveProcessRef = ref(false);
|
||||
const tableData = ref([])
|
||||
const selectedKeys = ref([])
|
||||
const taskIdRef = ref('');
|
||||
const visibleFlowRecordModal = ref(false);
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const formName=currentRoute.value.meta?.title;
|
||||
const [registerTable, { reload, setTableData }] = useTable({
|
||||
const [registerTable, { reload, setTableData,clearSelectedRowKeys }] = useTable({
|
||||
title: '' || (formName + '列表'),
|
||||
api: getLngLngSettleHdrPage,
|
||||
rowKey: 'id',
|
||||
@ -150,6 +152,10 @@
|
||||
dataIndex: 'action',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
rowSelection: {
|
||||
type: 'checkbox',
|
||||
onChange: onSelectChange
|
||||
},
|
||||
tableSetting: {
|
||||
size: false,
|
||||
setting: false,
|
||||
@ -174,6 +180,9 @@
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
function onSelectChange(rowKeys: string[]) {
|
||||
selectedKeys.value = rowKeys;
|
||||
}
|
||||
const handleDownload = (info) => {
|
||||
const url = parseDownloadUrl(info.response ? info.response.data.fileUrl : info.fileUrl);
|
||||
const fileName = info.response ? info.response.data.fileOrg : info.fileOrg;
|
||||
@ -235,6 +244,22 @@
|
||||
|
||||
btnEvent[code]();
|
||||
}
|
||||
async function handelCancel() {
|
||||
if(!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: '提示',
|
||||
description: t('请选择需要取消对账的数据'),
|
||||
});
|
||||
return
|
||||
}
|
||||
await cancelLngSettleHdr(selectedKeys.value)
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: '提示',
|
||||
description: t('取消成功!'),
|
||||
});
|
||||
clearSelectedRowKeys()
|
||||
}
|
||||
function handleDatalog (record: Recordable) {
|
||||
modalVisible.value = true
|
||||
logId.value = record.id
|
||||
@ -262,17 +287,30 @@
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
|
||||
router.push({
|
||||
path: '/form/LngSettleHdr/' + record.id + '/updateForm',
|
||||
query: {
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||
query: {
|
||||
formPath: 'dayPlan/LngSettleHdr',
|
||||
formName: "编辑"+formName,
|
||||
formId:currentRoute.value.meta.formId,
|
||||
type:'edit',
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/LngSettleHdr/' + record.id + '/updateForm',
|
||||
query: {
|
||||
formPath: 'dayPlan/LngSettleHdr',
|
||||
formName: "编辑"+formName,
|
||||
formId:currentRoute.value.meta.formId,
|
||||
type:'edit',
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
function handleApprove () {
|
||||
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||
@ -302,7 +340,7 @@
|
||||
deleteLngLngSettleHdr(ids).then((_) => {
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
message: '提示',
|
||||
description: t('删除成功!'),
|
||||
});
|
||||
});
|
||||
|
||||
@ -288,7 +288,7 @@
|
||||
cpCode: formState.cpCode,
|
||||
comId: formState.comId
|
||||
}
|
||||
if (!pageId.value && formState.cpCode && formState.comId && !formState.dateFrom) {
|
||||
if ( formState.cpCode && formState.comId && !formState.dateFrom) {
|
||||
let data = await getLngPngSettleHdrDate(obj) || []
|
||||
if (data.length) {
|
||||
formState.dateFrom = data[0]?.dateTo ? dayjs(data[0]?.dateTo) : null
|
||||
|
||||
@ -288,7 +288,7 @@
|
||||
cpCode: formState.cpCode,
|
||||
comId: formState.comId
|
||||
}
|
||||
if (!pageId.value && formState.cpCode && formState.comId && !formState.dateFrom) {
|
||||
if ( formState.cpCode && formState.comId && !formState.dateFrom) {
|
||||
let data = await getLngPngSettleHdrDate(obj) || []
|
||||
if (data.length) {
|
||||
formState.dateFrom = data[0]?.dateTo ? dayjs(data[0]?.dateTo) : null
|
||||
|
||||
Reference in New Issue
Block a user