采购计量
This commit is contained in:
@ -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});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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,
|
||||
},
|
||||
];
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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,
|
||||
},
|
||||
|
||||
|
||||
@ -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>
|
||||
Reference in New Issue
Block a user