入库
This commit is contained in:
@ -29,9 +29,7 @@
|
||||
const logId = ref('')
|
||||
const logPath = ref('/inventory/lngInventoryIn/datalog');
|
||||
import { DataLog } from '/@/components/pcitc';
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode,
|
||||
|
||||
} from 'vue';
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode, watch} from 'vue';
|
||||
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
@ -52,6 +50,7 @@
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { getAllCom} from '/@/api/contract/ContractPurInt';
|
||||
import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat';
|
||||
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
@ -87,12 +86,13 @@
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
const formIdComputedRef = ref();
|
||||
const tableData = ref([])
|
||||
formIdComputedRef.value = currentRoute.value.meta.formId
|
||||
const schemaIdComputedRef = ref();
|
||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const formName=currentRoute.value.meta?.title;
|
||||
const [registerTable, { reload, }] = useTable({
|
||||
const [registerTable, { reload, setTableData }] = useTable({
|
||||
title: '' || (formName + '列表'),
|
||||
api: getLngInventoryInPage,
|
||||
rowKey: 'id',
|
||||
@ -109,6 +109,7 @@
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page:params.limit };
|
||||
},
|
||||
afterFetch: (res) => {
|
||||
tableData.value = res || []
|
||||
tableRef.value.setToolBarWidth();
|
||||
|
||||
},
|
||||
@ -128,41 +129,38 @@
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
watch(
|
||||
() => tableData.value,
|
||||
(val) => {
|
||||
if (val) {
|
||||
let arr = DataFormat.format(val, [
|
||||
FormatOption.createQty('qtyMmbtu'),
|
||||
FormatOption.createQty('qtyTon'),
|
||||
FormatOption.createQty('qtyM3L'),
|
||||
FormatOption.createQty('qtyM3'),
|
||||
FormatOption.createQty('qtyGj'),
|
||||
]);
|
||||
if (arr.length) {
|
||||
setTableData(arr)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
function dbClickRow(record) {
|
||||
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
|
||||
return;
|
||||
}
|
||||
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||
if (taskIds && taskIds.length) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||
query: {
|
||||
taskId: taskIds[0],
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else if (schemaId && !taskIds && processId) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
|
||||
query: {
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/LngInventoryIn/' + record.id + '/viewForm',
|
||||
query: {
|
||||
formPath: 'inventory/LngInventoryIn',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
router.push({
|
||||
path: '/inventory/LngInventoryIn/createForm',
|
||||
query: {
|
||||
formPath: 'inventory/LngInventoryIn',
|
||||
formName: '查看'+formName,
|
||||
formId:currentRoute.value.meta.formId,
|
||||
type:'view',
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function buttonClick(code) {
|
||||
@ -184,7 +182,7 @@
|
||||
path: '/inventory/LngInventoryIn/createForm',
|
||||
query: {
|
||||
formPath: 'inventory/LngInventoryIn',
|
||||
formName: formName,
|
||||
formName: '新建'+formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
@ -198,7 +196,9 @@
|
||||
query: {
|
||||
formPath: 'inventory/LngInventoryIn',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId:currentRoute.value.meta.formId,
|
||||
type: 'view',
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user