采购计量

This commit is contained in:
‘huanghaiixia’
2026-01-14 17:44:36 +08:00
parent e87d2e18b4
commit 129d138061
8 changed files with 177 additions and 45 deletions

View File

@ -3,7 +3,8 @@ import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
enum Api {
Page = '/dayPlan/pngMeasureSalesPur/page',
// Page = '/dayPlan/pngMeasureSalesPur/page',
Page = '/magic-api/dayPlan/pngMeasureSalesPurPageList',
List = '/dayPlan/pngMeasureSalesPur/list',
Info = '/dayPlan/pngMeasureSalesPur/info',
LngPngMeasureSalesPur = '/dayPlan/pngMeasureSalesPur',

View File

@ -0,0 +1,63 @@
<template>
<div>
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" :showOkBtn="false" :showCancelBtn="false">
<BasicTable @register="registerTable"></BasicTable>
</BasicModal>
</div>
</template>
<script lang="ts" setup>
import { ref, computed, unref, nextTick } from 'vue';
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { getLngSupplierPage } from '/@/api/supplier/Supplier';
const { t } = useI18n();
const columns: BasicColumn[] = [
{ dataIndex: 'suCode', title: '审批人', align: 'left', sorter: true },
{ dataIndex: 'suName', title: '审批时间', align: 'left', sorter: true },
{ dataIndex: 'suSname', title: '通过/驳回', align: 'left', sorter: true },
{ dataIndex: 'dI', title: '驳回原因', align: 'left', sorter: true },
];
const emit = defineEmits(['success', 'register']);
const isUpdate = ref(true);
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
});
const [registerTable, {}] = useTable({
title: t('审批状态'),
api: getLngSupplierPage,
columns,
formConfig: {
rowProps: {
gutter: 16,
},
schemas: [],
showResetButton: false,
showSubmitButton: false
},
bordered: true,
pagination: false,
canResize: false,
useSearchForm: false,
showTableSetting: false,
immediate: true, // 设置为不立即调用
beforeFetch: (params) => {
return { ...params,};
},
});
const getTitle = computed(() => (!unref(isUpdate) ? t('审批状态') : t('')));
</script>
<style lang="less" scoped>
:deep(.ant-table-title) {
display: none !important;
}
</style>

View File

@ -4,7 +4,7 @@
<a-row>
<a-col :span="12">
<a-form-item label="相对方名称" name="cpName" :label-col="{ span: 8 }" :wrapper-col="{ span: 24 }">
<a-input-search v-model:value="formState.cpName" :disabled="isDisable" placeholder="请选择名称" readonly @search="onSearchUser"/>
<a-input-search v-model:value="formState.cpName" placeholder="请选择名称" readonly @search="onSearchUser"/>
</a-form-item>
</a-col>
<a-col :span="12">
@ -14,7 +14,7 @@
</a-col>
<a-col :span="12">
<a-form-item label="对方银行名称" name="cpBankCode" :label-col="{ span: 8 }" :wrapper-col="{ span: 24 }">
<a-select v-model:value="formState.cpBankCode" placeholder="请选择银行名称" :disabled="isDisable" style="width: 100%" allow-clear @change="bankChange">
<a-select v-model:value="formState.cpBankCode" placeholder="请选择银行名称" style="width: 100%" allow-clear @change="bankChange">
<a-select-option v-for="item in optionList" :key="item.bankCode" :value="item.bankCode">
{{ item.bankName }}
</a-select-option>
@ -53,7 +53,7 @@
</a-col>
<a-col :span="24">
<a-form-item label="备注" name="note" :label-col="{ span: 4 }" :wrapper-col="{ span: 24 }">
<a-textarea v-model:value="formState.note" placeholder="请输入备注" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
<a-textarea v-model:value="formState.note" placeholder="请输入备注" :auto-size="{ minRows: 2, maxRows: 5 }"/>
</a-form-item>
</a-col>
</a-row>
@ -84,6 +84,7 @@ const getTitle = computed(() => (!unref(isUpdate) ? t('新增相对方') : t('
let formState = reactive({
});
const list = ref()
const curIdx = ref()
const rules = {
cpName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
cpBankCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
@ -119,8 +120,8 @@ const bankChange = (val) => {
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
isDisable.value = data?.btnType == 'view' ? true : false
list.value = data.list
curIdx.value = data.curIdx
if (unref(isUpdate)) {
Object.assign(formState, {...data.record})
getBankInfo(formState.cpCode, formState.cpTableName, 'code')
@ -137,6 +138,17 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
const handleSubmit = async () => {
try {
await formRef.value.validate();
let arr = []
list.value.forEach(v=> {
if (v.cpCode == formState.cpCode) {
arr.push(v)
}
})
let isFlag = ( curIdx.value != null && formState.cpCode!==list.value[curIdx.value].cpCode)
if (arr.length > 0 && (curIdx.value == null || isFlag)) {
message.warning('相对方名称:'+ arr[0].cpName + '已重复')
return
}
emit('success', formState);
notification.success({
message: t('操作'),

View File

@ -476,7 +476,8 @@
openModalAppro(true,{isUpdate: false})
}
const addUser = (val)=> {
openModalUser(true,{isUpdate: false})
curIdx.value = null
openModalUser(true,{isUpdate: false,list: dataList.value, curIdx: curIdx.value})
}
const handleSuccess = (val) => {
@ -529,7 +530,7 @@
}
if (btn == 'edit') {
curIdx.value = index
openModalUser(true, {record: record,isUpdate: true});
openModalUser(true, {record: record,isUpdate: true, list: dataList.value, curIdx: curIdx.value});
}
}

View File

@ -140,7 +140,7 @@ export const columns: BasicColumn[] = [
title: '变更',
componentType: 'input',
align: 'left',
width: 100,
sorter: true,
},
@ -154,11 +154,11 @@ export const columns: BasicColumn[] = [
},
{
dataIndex: 'approCode',
dataIndex: 'approName',
title: '审批状态',
componentType: 'input',
align: 'left',
width: 120,
sorter: true,
},
];

View File

@ -15,6 +15,9 @@
</template>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'approName'">
<a @click="btnCheck('approName')">{{ record.approName }}</a>
</template>
<template v-if="column.dataIndex === 'action'">
<TableAction :actions="getActions(record)" />
</template>
@ -22,6 +25,7 @@
</BasicTable>
<PngApproModal @register="registerModal" @success="handleSuccess" />
<DataLog :logId="logId" :logPath="logPath" v-model:visible="modalVisible"/>
<approStatusModal @register="registerApproStatus" ></approStatusModal>
</PageWrapper>
</template>
<script lang="ts" setup>
@ -29,9 +33,7 @@
const logId = ref('')
const logPath = ref('/dayPlan/pngAppro/datalog');
import { DataLog } from '/@/components/pcitc';
import { ref, computed, onMounted, onUnmounted,
} from 'vue';
import { ref, computed, onMounted, onUnmounted, } from 'vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getLngPngApproPage, deleteLngPngAppro} from '/@/api/dayPlan/PngAppro';
@ -54,6 +56,7 @@
import {formConfig, searchFormSchema, columns } from './components/config';
import Icon from '/@/components/Icon/index';
import FlowRecord from '/@/views/workflow/task/components/flow/FlowRecord.vue';
import approStatusModal from '/@/components/common/approStatusModal.vue';
import useEventBus from '/@/hooks/event/useEventBus';
import { cloneDeep } from 'lodash-es';
@ -72,7 +75,7 @@
const tableRef = ref();
//所有按钮
const buttons = ref([{"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":"compare","icon":"ant-design:file-done-outlined","isDefault":false},{"isUse":true,"name":"审批通过","code":"batchapprove","icon":"ant-design:check-outlined","isDefault":false},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true}]);
const buttons = ref([{"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":"compare","icon":"ant-design:file-done-outlined","isDefault":false},{"isUse":true,"name":"审批通过","code":"batchapprove","icon":"ant-design:check-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','compare']);
const buttonConfigs = computed(()=>{
@ -87,7 +90,7 @@
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
});
const btnEvent = {refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,approve : handleApprove,compare: handleCompare,batchapprove: handleBachApprove}
const btnEvent = {refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,approve : handleApprove,compare: handleCompare,batchapprove: handleBatchApprove}
const { currentRoute } = useRouter();
const router = useRouter();
@ -108,8 +111,10 @@
const taskIdRef = ref('');
const visibleFlowRecordModal = ref(false);
const [registerModal, { openModal}] = useModal();
const [registerApproStatus, { openModal: openModalApproStatus}] = useModal();
const formName='销售审批';
const [registerTable, { reload, clearSelectedRowKeys, }] = useTable({
const [registerTable, { reload, clearSelectedRowKeys, setTableData }] = useTable({
title: '' || (formName + '列表'),
api: getLngPngApproPage,
rowKey: 'id',
@ -123,7 +128,7 @@
showResetButton: true,
},
beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
return { ...params, FormId: formIdComputedRef.value, PK: 'id'};
},
afterFetch: (res) => {
clearSelectedRowKeys()
@ -150,6 +155,11 @@
},
});
const btnCheck = (type)=> {
if (type == 'approName') {
openModalApproStatus(true,{isUpdate: false});
}
}
function onSelectChange(rowKeys: string[]) {
selectedKeys.value = rowKeys;
}
@ -216,11 +226,11 @@
function handleCompare (record: Recordable) {
}
function handleBachApprove () {
function handleBatchApprove () {
setTableData([{verNo: 5, cuCode: 444, approName: '未提交'}])
}
onMounted(() => {
if (schemaIdComputedRef.value) {
bus.on(FLOW_PROCESSED, handleRefresh);
bus.on(CREATE_FLOW, handleRefresh);

View File

@ -53,7 +53,7 @@ export const columns: BasicColumn[] = [
},
{
dataIndex: 'suCode',
dataIndex: 'cuSname',
title: '供应商简称',
componentType: 'input',
align: 'left',
@ -62,7 +62,7 @@ export const columns: BasicColumn[] = [
},
{
dataIndex: 'pointUpCode',
dataIndex: 'pointUpName',
title: '上载点',
componentType: 'input',
align: 'left',
@ -71,7 +71,7 @@ export const columns: BasicColumn[] = [
},
{
dataIndex: 'pointDelyCode',
dataIndex: 'pointDelyName',
title: '下载点',
componentType: 'input',
align: 'left',
@ -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: 120,
sorter: true,
},
@ -102,7 +102,7 @@ export const columns: BasicColumn[] = [
title: '完成量(吉焦)',
componentType: 'input',
align: 'left',
width: 120,
sorter: true,
},
@ -111,7 +111,7 @@ export const columns: BasicColumn[] = [
title: '完成量(方)',
componentType: 'input',
align: 'left',
width: 120,
sorter: true,
},
@ -120,12 +120,12 @@ export const columns: BasicColumn[] = [
title: '比值(方/吉焦)',
componentType: 'input',
align: 'left',
width: 120,
sorter: true,
},
{
dataIndex: 'cfmCuUserId',
dataIndex: 'cfmCuUserName',
title: '客户确认人',
componentType: 'input',
align: 'left',
@ -143,7 +143,7 @@ export const columns: BasicColumn[] = [
},
{
dataIndex: 'cfmEmpId',
dataIndex: 'cfmEmpName',
title: '内部确认人',
componentType: 'input',
align: 'left',
@ -161,7 +161,7 @@ export const columns: BasicColumn[] = [
},
{
dataIndex: 'kpId',
dataIndex: 'kpName',
title: '采购合同',
componentType: 'input',
align: 'left',
@ -170,7 +170,7 @@ export const columns: BasicColumn[] = [
},
{
dataIndex: 'fileList',
dataIndex: 'lngFileUploadList',
title: '附件',
componentType: 'input',
align: 'left',
@ -179,11 +179,11 @@ export const columns: BasicColumn[] = [
},
{
dataIndex: 'createDate',
dataIndex: 'statusName',
title: '状态',
componentType: 'input',
align: 'left',
width: 120,
sorter: true,
},

View File

@ -14,17 +14,22 @@
</a-button>
</template>
</template>
<template #bodyCell="{ column, record }">
<template #bodyCell="{ column, record, index }">
<template v-if="column.dataIndex === 'qtyMeaGj'">
<a-input-number v-model:value="record.qtyMeaGj" :min="0" style="width: 100%" />
<a-input-number v-model:value="record.qtyMeaGj" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" />
<div v-else>{{ record.qtyMeaGj }}</div>
</template>
<template v-if="column.dataIndex === 'qtyMeaM3'">
<a-input-number v-model:value="record.qtyMeaM3" :min="0" style="width: 100%" />
<a-input-number v-model:value="record.qtyMeaM3" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'fileList'">
<template v-if="column.dataIndex === 'lngFileUploadList'">
<div>
<Upload :file-list="record.fileList" :showUploadList="false" v-model:value="tableId" v-model:tableName="tableName" v-model:columnName="columnName"
:multiple="true" :dataDelete="true" :isShowTip="false" :isShowBtnIcon="false" @click="onUpload" :showDownloadIcon="false"/>
<Upload :file-list="record.lngFileUploadList" :showUploadList="false" v-model:value="tableId" v-model:tableName="tableName" v-model:columnName="columnName"
:multiple="true" :dataDelete="true" :isShowTip="false" :isShowBtnIcon="false" @click="onUpload(index)" @change="uploadChange" :showDownloadIcon="false"/>
<div v-for="(item, idx) in record.lngFileUploadList">
<a @click="handleDownload(item)">{{item.fileOrg}}</a>
<span @click="deleteFile(record, idx)" class="delIcon"><DeleteOutlined /></span>
</div>
</div>
</template>
<template v-if="column.dataIndex === 'action'">
@ -67,6 +72,9 @@
import useEventBus from '/@/hooks/event/useEventBus';
import { cloneDeep } from 'lodash-es';
import Upload from '/@/components/Form/src/components/Upload.vue';
import { parseDownloadUrl} from '/@/api/system/file';
import { downloadByUrl } from '/@/utils/file/download';
import { DeleteOutlined } from '@ant-design/icons-vue';
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
@ -107,6 +115,7 @@
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
const selectedKeys = ref<string[]>([]);
const selectedRowsData = ref<any[]>([]);
const curIdx = ref()
const [registerModal, { openModal }] = useModal();
const [registerImportModal, { openModal: openImportModal }] = useModal();
@ -115,7 +124,7 @@
const columnName = 'PngMeasureSalesPur';
const formName='管道气采购计量';
const [registerTable, { reload, clearSelectedRowKeys }] = useTable({
const [registerTable, { reload, clearSelectedRowKeys, getDataSource, updateTableDataRecord }] = useTable({
title: '' || (formName + '列表'),
api: getLngPngMeasureSalesPurPage,
rowKey: 'id',
@ -125,14 +134,25 @@
gutter: 16,
},
schemas: customSearchFormSchema,
submitButtonOptions: {
text: '搜索',
onClick: () => {
clearSelectedRowKeys()
},
},
resetButtonOptions: {
text: '重置',
onClick: () => {
clearSelectedRowKeys()
},
},
fieldMapToTime: [['datePlan', ['startDate', 'endDate'], 'YYYY-MM-DD HH:mm:ss ', true]],
showResetButton: true,
},
beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page: params.limit};
},
afterFetch: (res) => {
clearSelectedRowKeys()
tableRef.value.setToolBarWidth();
},
@ -156,8 +176,28 @@
},
customRow,
});
const onUpload = () => {
console.log('单击')
const onUpload = (index) => {
curIdx.value = index
}
const uploadChange = (val) => {
let data = getDataSource()
let record = data[curIdx.value]
record.lngFileUploadList = val
updateTableDataRecord(record.id, record)
}
const deleteFile = (record, idx) => {
record.lngFileUploadList.splice(idx, 1)
updateTableDataRecord(record.id, record)
}
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});
};
const numChange = (record) => {
record.rateM3Gj = Number(record.qtyMeaGj) ? (Number(record.qtyMeaM3) || 0 ) / Number(record.qtyMeaGj) : '0'
record.rateM3Gj = record.rateM3Gj.toFixed(6)
updateTableDataRecord(record.id, record)
}
function dbClickRow(record) {
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
@ -390,4 +430,9 @@
.hide{
display: none !important;
}
.delIcon {
margin-left: 10px;
cursor: pointer;
margin-bottom: 5px;
}
</style>