gaoluyang
6 天以前 20eae58b25403e8cc58f9e72e411f40798f0bd2c
银川
1.确认收货与质检流程
已修改10个文件
134 ■■■■■ 文件已修改
src/api/erp/purchase/order/index.ts 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mes/wm/arrivalnotice/line/index.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/purchase/order/index.vue 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/purchase/order/modules/form.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/purchase/request/data.ts 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/purchase/request/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/purchase/request/modules/item-form.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/qc/template/data.ts 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/wls/arrivalnotice/data.ts 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/wls/arrivalnotice/modules/line-list.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/erp/purchase/order/index.ts
@@ -110,3 +110,10 @@
  name: string; // 流程名称
  version: number; // 版本号
}
/** 确认收货 */
export function confirmReceipt(id: number) {
  return requestClient.post<number>('/erp/purchase-order/confirm-receipt', null, {
    params: { id },
  });
}
src/api/mes/wm/arrivalnotice/line/index.ts
@@ -17,6 +17,7 @@
    iqcCheckFlag?: boolean; // 是否检验
    iqcId?: number; // 来料检验单编号
    iqcCode?: string; // 来料检验单编码
    iqcCheckResult?: number; // 质检结果:1合格 2特采 3不合格退货 4不合格报废
    remark?: string; // 备注
  }
}
src/views/erp/purchase/order/index.vue
@@ -11,6 +11,7 @@
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
  confirmReceipt,
  deletePurchaseOrder,
  exportPurchaseOrder,
  getPurchaseOrderPage,
@@ -77,6 +78,21 @@
  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();
@@ -200,6 +216,17 @@
              },
            },
            {
              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,
src/views/erp/purchase/order/modules/form.vue
@@ -7,11 +7,12 @@
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,
@@ -112,6 +113,20 @@
  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() {
@@ -204,5 +219,8 @@
        />
      </template>
    </Form>
    <template v-if="formType === 'detail' && formData?.status === 20 && formData?.inStatus !== 2" #prepend-footer>
      <Button type="primary" @click="handleConfirmReceipt">确认收货</Button>
    </template>
  </Modal>
</template>
src/views/erp/purchase/request/data.ts
@@ -3,7 +3,6 @@
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';
@@ -55,7 +54,7 @@
      rules: 'required',
    },
    {
      label: '供应商(可选)',
      label: '供应商',
      fieldName: 'supplierId',
      component: 'ApiSelect',
      componentProps: {
@@ -67,6 +66,7 @@
        valueField: 'id',
        disabled: formType === 'detail',
      },
      rules: 'required',
    },
    {
      fieldName: 'discountPercent',
@@ -76,6 +76,17 @@
        placeholder: '请输入优惠率',
        min: 0,
        max: 100,
        precision: 2,
        disabled: formType === 'detail',
      },
    },
    {
      fieldName: 'depositPrice',
      label: '定金',
      component: 'InputNumber',
      componentProps: {
        placeholder: '请输入定金',
        min: 0,
        precision: 2,
        disabled: formType === 'detail',
      },
@@ -186,6 +197,13 @@
      title: '备注',
      minWidth: 150,
      slots: { default: 'remark' },
    },
    {
      field: 'qcCheckFlag',
      title: '是否质检',
      minWidth: 80,
      fixed: 'right',
      slots: { default: 'qcCheckFlag' },
    },
    {
      title: '操作',
@@ -311,6 +329,18 @@
      minWidth: 120,
    },
    {
      field: 'depositPrice',
      title: '定金',
      formatter: 'formatAmount2',
      minWidth: 120,
    },
    {
      field: 'qcCheckFlag',
      title: '是否质检',
      minWidth: 80,
      slots: { default: 'qcCheckFlag' },
    },
    {
      field: 'productNames',
      title: '申请产品',
      minWidth: 150,
src/views/erp/purchase/request/index.vue
@@ -197,6 +197,10 @@
        <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="[
src/views/erp/purchase/request/modules/item-form.vue
@@ -10,7 +10,7 @@
  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';
@@ -98,6 +98,7 @@
    demandTime: undefined,
    remark: undefined,
    totalPrice: 0,
    qcCheckFlag: false,
  };
  tableData.value.push(newRow);
  emit('update:items', [...tableData.value]);
@@ -239,6 +240,16 @@
      <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="[
src/views/mes/qc/template/data.ts
@@ -17,7 +17,7 @@
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';
@@ -421,9 +421,18 @@
    {
      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',
src/views/wls/arrivalnotice/data.ts
@@ -307,6 +307,12 @@
      },
    },
    {
      field: 'iqcCheckResult',
      title: '质检结果',
      width: 100,
      slots: { default: 'iqcCheckResult' },
    },
    {
      field: 'qualifiedQuantity',
      title: '合格数量',
      width: 100,
src/views/wls/arrivalnotice/modules/line-list.vue
@@ -10,7 +10,7 @@
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 {
@@ -133,6 +133,13 @@
        </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="[