| | |
| | | name: string; // 流程名称 |
| | | version: number; // 版本号 |
| | | } |
| | | |
| | | /** 确认收货 */ |
| | | export function confirmReceipt(id: number) { |
| | | return requestClient.post<number>('/erp/purchase-order/confirm-receipt', null, { |
| | | params: { id }, |
| | | }); |
| | | } |
| | |
| | | iqcCheckFlag?: boolean; // 是否检验 |
| | | iqcId?: number; // 来料检验单编号 |
| | | iqcCode?: string; // 来料检验单编码 |
| | | iqcCheckResult?: number; // 质检结果:1合格 2特采 3不合格退货 4不合格报废 |
| | | remark?: string; // 备注 |
| | | } |
| | | } |
| | |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { |
| | | confirmReceipt, |
| | | deletePurchaseOrder, |
| | | exportPurchaseOrder, |
| | | getPurchaseOrderPage, |
| | |
| | | try { |
| | | await updatePurchaseOrderStatus(row.id!, status); |
| | | message.success(`${status === 20 ? '审批' : '反审批'}成功`); |
| | | handleRefresh(); |
| | | } finally { |
| | | hideLoading(); |
| | | } |
| | | } |
| | | |
| | | /** 确认收货 */ |
| | | async function handleConfirmReceipt(row: ErpPurchaseOrderApi.PurchaseOrder) { |
| | | const hideLoading = message.loading({ |
| | | content: '确认收货中...', |
| | | duration: 0, |
| | | }); |
| | | try { |
| | | const arrivalNoticeId = await confirmReceipt(row.id!); |
| | | message.success(`确认收货成功,已生成到货通知单`); |
| | | handleRefresh(); |
| | | } finally { |
| | | hideLoading(); |
| | |
| | | }, |
| | | }, |
| | | { |
| | | label: '确认收货', |
| | | type: 'link', |
| | | icon: ACTION_ICON.VIEW, |
| | | auth: ['erp:purchase-order:confirm-receipt'], |
| | | ifShow: () => row.status === 20 && row.inStatus !== 2, |
| | | popConfirm: { |
| | | title: `确认收货${row.no}吗?`, |
| | | confirm: handleConfirmReceipt.bind(null, row), |
| | | }, |
| | | }, |
| | | { |
| | | label: $t('common.delete'), |
| | | type: 'link', |
| | | danger: true, |
| | |
| | | |
| | | import { useVbenModal } from '@vben/common-ui'; |
| | | |
| | | import { message } from 'ant-design-vue'; |
| | | import { message, Button } from 'ant-design-vue'; |
| | | |
| | | import { useVbenForm } from '#/adapter/form'; |
| | | import { getAccountSimpleList } from '#/api/erp/finance/account'; |
| | | import { |
| | | confirmReceipt, |
| | | createPurchaseOrder, |
| | | getPurchaseApproveProcessList, |
| | | getPurchaseOrder, |
| | |
| | | message.success($t('ui.actionMessage.operationSuccess')); |
| | | } |
| | | |
| | | /** 确认收货 */ |
| | | async function handleConfirmReceipt() { |
| | | if (!formData.value?.id) return; |
| | | const hideLoading = message.loading({ content: '确认收货中...', duration: 0 }); |
| | | try { |
| | | await confirmReceipt(formData.value.id); |
| | | message.success('确认收货成功,已生成到货通知单'); |
| | | await modalApi.close(); |
| | | emit('success'); |
| | | } finally { |
| | | hideLoading(); |
| | | } |
| | | } |
| | | |
| | | /** 创建或更新采购订单 */ |
| | | const [Modal, modalApi] = useVbenModal({ |
| | | async onConfirm() { |
| | |
| | | /> |
| | | </template> |
| | | </Form> |
| | | <template v-if="formType === 'detail' && formData?.status === 20 && formData?.inStatus !== 2" #prepend-footer> |
| | | <Button type="primary" @click="handleConfirmReceipt">确认收货</Button> |
| | | </template> |
| | | </Modal> |
| | | </template> |
| | |
| | | |
| | | import { DICT_TYPE } from '@vben/constants'; |
| | | import { getDictOptions } from '@vben/hooks'; |
| | | import { erpPriceInputFormatter } from '@vben/utils'; |
| | | |
| | | import { getSupplierSimpleList } from '#/api/erp/purchase/supplier'; |
| | | import { getSimpleUserList } from '#/api/system/user'; |
| | |
| | | rules: 'required', |
| | | }, |
| | | { |
| | | label: '供应商(可选)', |
| | | label: '供应商', |
| | | fieldName: 'supplierId', |
| | | component: 'ApiSelect', |
| | | componentProps: { |
| | |
| | | valueField: 'id', |
| | | disabled: formType === 'detail', |
| | | }, |
| | | rules: 'required', |
| | | }, |
| | | { |
| | | fieldName: 'discountPercent', |
| | |
| | | placeholder: '请输入优惠率', |
| | | min: 0, |
| | | max: 100, |
| | | precision: 2, |
| | | disabled: formType === 'detail', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'depositPrice', |
| | | label: '定金', |
| | | component: 'InputNumber', |
| | | componentProps: { |
| | | placeholder: '请输入定金', |
| | | min: 0, |
| | | precision: 2, |
| | | disabled: formType === 'detail', |
| | | }, |
| | |
| | | title: '备注', |
| | | minWidth: 150, |
| | | slots: { default: 'remark' }, |
| | | }, |
| | | { |
| | | field: 'qcCheckFlag', |
| | | title: '是否质检', |
| | | minWidth: 80, |
| | | fixed: 'right', |
| | | slots: { default: 'qcCheckFlag' }, |
| | | }, |
| | | { |
| | | title: '操作', |
| | |
| | | minWidth: 120, |
| | | }, |
| | | { |
| | | field: 'depositPrice', |
| | | title: '定金', |
| | | formatter: 'formatAmount2', |
| | | minWidth: 120, |
| | | }, |
| | | { |
| | | field: 'qcCheckFlag', |
| | | title: '是否质检', |
| | | minWidth: 80, |
| | | slots: { default: 'qcCheckFlag' }, |
| | | }, |
| | | { |
| | | field: 'productNames', |
| | | title: '申请产品', |
| | | minWidth: 150, |
| | |
| | | <Tag v-else-if="row.status === 30" color="error">审核不通过</Tag> |
| | | <Tag v-else-if="row.status === 40" color="warning">已取消</Tag> |
| | | </template> |
| | | <template #qcCheckFlag="{ row }"> |
| | | <Tag v-if="row.qcCheckFlag" color="success">是</Tag> |
| | | <Tag v-else color="default">否</Tag> |
| | | </template> |
| | | <template #actions="{ row }"> |
| | | <TableAction |
| | | :actions="[ |
| | |
| | | erpPriceMultiply, |
| | | } from '@vben/utils'; |
| | | |
| | | import { Input, InputNumber, Select, DatePicker } from 'ant-design-vue'; |
| | | import { Input, InputNumber, Select, DatePicker, Switch } from 'ant-design-vue'; |
| | | |
| | | import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { getItemPage } from '#/api/mdm/item'; |
| | |
| | | demandTime: undefined, |
| | | remark: undefined, |
| | | totalPrice: 0, |
| | | qcCheckFlag: false, |
| | | }; |
| | | tableData.value.push(newRow); |
| | | emit('update:items', [...tableData.value]); |
| | |
| | | <Input v-if="!disabled" v-model:value="row.remark" class="w-full" @change="handleRowChange(row)" /> |
| | | <span v-else>{{ row.remark || '-' }}</span> |
| | | </template> |
| | | <template #qcCheckFlag="{ row }"> |
| | | <Switch |
| | | v-if="!disabled" |
| | | v-model:checked="row.qcCheckFlag" |
| | | checked-children="是" |
| | | un-checked-children="否" |
| | | @change="handleRowChange(row)" |
| | | /> |
| | | <span v-else>{{ row.qcCheckFlag ? '是' : '否' }}</span> |
| | | </template> |
| | | <template #actions="{ row }"> |
| | | <TableAction |
| | | :actions="[ |
| | |
| | | |
| | | import { z } from '#/adapter/form'; |
| | | import { generateAutoCode } from '#/api/mes/md/autocode/record'; |
| | | import { MdItemSelect } from '#/views/mes/md/item/components'; |
| | | import { getItemList } from '#/api/mdm/item'; |
| | | import { MdUnitMeasureSelect } from '#/views/mes/md/unitmeasure/components'; |
| | | import { QcIndicatorSelect } from '#/views/mes/qc/indicator/components'; |
| | | |
| | |
| | | { |
| | | fieldName: 'itemId', |
| | | label: '产品物料', |
| | | component: markRaw(MdItemSelect), |
| | | component: 'ApiSelect', |
| | | componentProps: { |
| | | placeholder: '请选择产品物料', |
| | | allowClear: true, |
| | | showSearch: true, |
| | | api: getItemList, |
| | | labelField: 'name', |
| | | valueField: 'id', |
| | | optionRender: (option: any) => { |
| | | const item = option.data; |
| | | return `${item.code} - ${item.name}`; |
| | | }, |
| | | }, |
| | | formItemClass: 'col-span-3', |
| | | rules: 'required', |
| | |
| | | }, |
| | | }, |
| | | { |
| | | field: 'iqcCheckResult', |
| | | title: '质检结果', |
| | | width: 100, |
| | | slots: { default: 'iqcCheckResult' }, |
| | | }, |
| | | { |
| | | field: 'qualifiedQuantity', |
| | | title: '合格数量', |
| | | width: 100, |
| | |
| | | |
| | | import { useVbenModal } from '@vben/common-ui'; |
| | | |
| | | import { Button, message } from 'ant-design-vue'; |
| | | import { Button, message, Tag } from 'ant-design-vue'; |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { |
| | |
| | | </Button> |
| | | <span v-else>-</span> |
| | | </template> |
| | | <template #iqcCheckResult="{ row }"> |
| | | <Tag v-if="row.iqcCheckResult === 1" color="success">合格</Tag> |
| | | <Tag v-else-if="row.iqcCheckResult === 2" color="warning">特采</Tag> |
| | | <Tag v-else-if="row.iqcCheckResult === 3" color="error">不合格退货</Tag> |
| | | <Tag v-else-if="row.iqcCheckResult === 4" color="error">不合格报废</Tag> |
| | | <span v-else>-</span> |
| | | </template> |
| | | <template #actions="{ row }"> |
| | | <TableAction |
| | | :actions="[ |