计量接口
This commit is contained in:
@ -1,43 +1,60 @@
|
||||
<template>
|
||||
<div class="pd">
|
||||
<div>
|
||||
<template v-for="button in tableButtonConfig" :key="button.code" >
|
||||
<a-button class="pr" v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
<a-button class="pr" v-else :type="button.type">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
</template>
|
||||
</div>
|
||||
<div :class="isExpend ? 'formStyle' : ''">
|
||||
<searchForm @toggle="toggle" @search="onSearch" @reset="onReset"></searchForm>
|
||||
</div>
|
||||
</div>
|
||||
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex" class="PngMeasureSalesPurStyle">
|
||||
<BasicTable @register="registerTable" ref="tableRef" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }" @row-dbClick="dbClickRow">
|
||||
|
||||
<template #toolbar>
|
||||
<template v-for="button in tableButtonConfig" :key="button.code">
|
||||
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
<a-button v-else :type="button.type">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
</template>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'qtyMeaGj'">
|
||||
<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" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'lngFileUploadList'">
|
||||
<div>
|
||||
<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'">
|
||||
<TableAction :actions="getActions(record)" />
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<BasicTable @register="registerTable" ref="tableRef" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }" @row-dbClick="dbClickRow">
|
||||
|
||||
<!-- <template #toolbar>
|
||||
<template v-for="button in tableButtonConfig" :key="button.code">
|
||||
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
<a-button v-else :type="button.type">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
</template>
|
||||
</template> -->
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'qtyMeaGj'">
|
||||
<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" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'lngFileUploadList'">
|
||||
<div>
|
||||
<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'">
|
||||
<TableAction :actions="getActions(record)" />
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
|
||||
<PngMeasureSalesPurModal @register="registerModal" @success="handleSuccess" />
|
||||
<ImportModal @register="registerImportModal" importUrl="/dayPlan/pngMeasureSalesPur/import" @success="handleImportSuccess"/>
|
||||
|
||||
@ -54,7 +71,9 @@
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
||||
import { getLngPngMeasureSalesPurPage, deleteLngPngMeasureSalesPur, exportLngPngMeasureSalesPur, addLngPngMeasureSalesPur, updateLngPngMeasureSalesPur} from '/@/api/dayPlan/PngMeasureSalesPur';
|
||||
import { getLngPngMeasureSalesPurPage, deleteLngPngMeasureSalesPur, exportLngPngMeasureSalesPur, addLngPngMeasureSalesPur, updateLngPngMeasureSalesPur,
|
||||
cancelLngPngMeasureSalesPur, rejectLngPngMeasureSalesPur
|
||||
} from '/@/api/dayPlan/PngMeasureSalesPur';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
@ -74,6 +93,7 @@
|
||||
import { parseDownloadUrl} from '/@/api/system/file';
|
||||
import { downloadByUrl } from '/@/utils/file/download';
|
||||
import { DeleteOutlined } from '@ant-design/icons-vue';
|
||||
import searchForm from './components/searchForm.vue'
|
||||
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
@ -104,7 +124,8 @@
|
||||
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
||||
});
|
||||
|
||||
const btnEvent = {add : handleAdd, refresh : handleRefresh,batchdelete : handleBatchdelete,import : handleImport,export : handleExport, save: handleSave, submit: handleSubmit}
|
||||
const btnEvent = {add : handleAdd, refresh : handleRefresh,batchdelete : handleBatchdelete,import : handleImport,export : handleExport,
|
||||
save: handleSave, submit: handleSubmit, cancel: handleCancel, reject: handleReject}
|
||||
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
@ -129,27 +150,12 @@
|
||||
rowKey: 'id',
|
||||
columns: customConfigColums,
|
||||
formConfig: {
|
||||
rowProps: {
|
||||
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,
|
||||
schemas: [],
|
||||
showResetButton: false,
|
||||
showSubmitButton: false
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page: params.limit};
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page: params.limit, ...formState.value};
|
||||
},
|
||||
afterFetch: (res) => {
|
||||
tableRef.value.setToolBarWidth();
|
||||
@ -159,12 +165,6 @@
|
||||
showTableSetting: true,
|
||||
|
||||
striped: false,
|
||||
// actionColumn: {
|
||||
// width: 160,
|
||||
// title: '操作',
|
||||
// dataIndex: 'action',
|
||||
// slots: { customRender: 'action' },
|
||||
// },
|
||||
rowSelection: {
|
||||
type: 'checkbox',
|
||||
onChange: onSelectChange
|
||||
@ -175,6 +175,19 @@
|
||||
},
|
||||
customRow,
|
||||
});
|
||||
const isExpend = ref(false)
|
||||
const formState = ref({})
|
||||
const toggle = (val)=> {
|
||||
isExpend.value = val
|
||||
}
|
||||
const onSearch = (val)=> {
|
||||
formState.value = val
|
||||
reload()
|
||||
}
|
||||
const onReset = (val)=> {
|
||||
formState.value ={ page: 1,size: 10}
|
||||
reload()
|
||||
}
|
||||
const onUpload = (index) => {
|
||||
curIdx.value = index
|
||||
}
|
||||
@ -210,6 +223,39 @@
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
async function handleReject() {
|
||||
if (!selectedRowsData.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要驳回的数据'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
await rejectLngPngMeasureSalesPur(selectedRowsData.value)
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('已驳回!'),
|
||||
});
|
||||
clearSelectedRowKeys()
|
||||
}
|
||||
|
||||
async function handleCancel() {
|
||||
if (!selectedRowsData.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要取消的数据'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
await cancelLngPngMeasureSalesPur(selectedRowsData.value)
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('取消成功!'),
|
||||
});
|
||||
clearSelectedRowKeys()
|
||||
}
|
||||
async function handleSubmit() {
|
||||
if (!selectedRowsData.value.length) {
|
||||
@ -281,7 +327,6 @@
|
||||
}
|
||||
|
||||
function buttonClick(code) {
|
||||
|
||||
btnEvent[code]();
|
||||
}
|
||||
function handleDatalog (record: Recordable) {
|
||||
@ -451,24 +496,6 @@
|
||||
:deep(.ant-table-selection-col) {
|
||||
width: 50px;
|
||||
}
|
||||
:deep( .ant-col-8:nth-child(1)) {
|
||||
width: 320px !important;
|
||||
max-width: 320px !important;;
|
||||
}
|
||||
:deep(.ant-col-8:nth-child(1) .ant-form-item-label) {
|
||||
width: 80px !important;
|
||||
}
|
||||
:deep( .ant-col-8:nth-child(2)) {
|
||||
width: 360px !important;
|
||||
max-width: 320px !important;;
|
||||
}
|
||||
:deep(.ant-col-8:nth-child(2) .ant-form-item-label) {
|
||||
width: 160px !important;
|
||||
}
|
||||
:deep(.ant-col-8:nth-child(2) .ant-form-item-label .ant-form-item-no-colon) {
|
||||
width: 160px !important;
|
||||
max-width: 160px !important;
|
||||
}
|
||||
.show{
|
||||
display: flex;
|
||||
}
|
||||
@ -480,4 +507,33 @@
|
||||
cursor: pointer;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.pd {
|
||||
padding: 6px 4px 0px 8px;
|
||||
position: relative;
|
||||
}
|
||||
.pr {
|
||||
margin-right: 4px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.pr:nth-child(1) {
|
||||
margin-left: 4px;
|
||||
}
|
||||
.formStyle {
|
||||
position: absolute;
|
||||
max-height: 400px;
|
||||
z-index: 6;
|
||||
background: #fff;
|
||||
border: 1px solid rgba(204, 204, 204, 0.47);
|
||||
box-shadow: 1px 2px 10px #ccc;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 12px 0 8px 15px;
|
||||
align-items: self-start !important;
|
||||
justify-content: space-between;
|
||||
margin: 2px 4px 12px 8px;
|
||||
}
|
||||
:deep(.ant-table-title) {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user