已修改17个文件
128 ■■■■ 文件已修改
src/api/mdm/item/index.ts 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mes/pro/mps/index.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mes/wm/returnvendor/index.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/mdm/data.ts 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/mdm/index.vue 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/mdm/modules/form.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/business/detail/index.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/clue/detail/index.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/contact/detail/index.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/contract/detail/index.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/customer/detail/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/permission/modules/list.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/permission/modules/transfer-form.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/finance/payment/modules/item-form.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/pro/mps/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/wls/returnvendor/modules/form.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vite.config.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mdm/item/index.ts
@@ -107,6 +107,11 @@
  return requestClient.put('/mdm/item/update-status', { id, status });
}
/** 更新物料同步状态 */
export function updateItemSync(id: number, sync: boolean) {
  return requestClient.put('/mdm/item/update-sync', { id, sync });
}
/** 导出物料 */
export function exportItem(params: Partial<MdmItemApi.Item>) {
  return requestClient.download('/mdm/item/export-excel', { params });
src/api/mes/pro/mps/index.ts
@@ -80,9 +80,9 @@
}
/** 删除 MPS */
export function deleteMps(ids: number[]) {
export function deleteMps(id: number) {
  return requestClient.delete('/mes/pro-mps/delete', {
    params: { ids: ids.join(',') },
    params: { id },
  });
}
src/api/mes/wm/returnvendor/index.ts
@@ -14,7 +14,7 @@
    vendorCode?: string; // 供应商编码
    vendorName?: string; // 供应商名称
    vendorNickname?: string; // 供应商简称
    returnDate?: number; // 退货日期
    returnDate?: number | string; // 退货日期
    returnReason?: string; // 退货原因
    transportCode?: string; // 运单号
    transportTelephone?: string; // 联系电话
src/views/basicData/mdm/data.ts
@@ -333,6 +333,17 @@
      },
    },
    {
      component: 'Switch',
      fieldName: 'syncMes',
      label: '同步到MES',
      defaultValue: true,
      componentProps: {
        checkedChildren: '是',
        unCheckedChildren: '否',
      },
      rules: z.boolean().default(true),
    },
    {
      component: "RadioGroup",
      fieldName: "status",
      label: "状态",
@@ -597,7 +608,7 @@
    {
      field: "syncedMes",
      title: "同步状态",
      width: 90,
      width: 100,
      fixed: "right",
      slots: { default: "syncedMes" },
    },
src/views/basicData/mdm/index.vue
@@ -8,7 +8,7 @@
import { confirm, Page, useVbenModal } from '#/packages/effects/common-ui/src';
import { downloadFileFromBlobPart, isEmpty } from '#/packages/utils/src';
import { message, Tag } from 'ant-design-vue';
import { message, Switch, Tag } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
@@ -17,6 +17,7 @@
  // exportItem,
  getItemPage,
  updateItemStatus,
  updateItemSync,
} from '#/api/mdm/item';
import { getItemTypeSimpleList } from '#/api/mes/md/item/type';
import { $t } from '#/locales';
@@ -138,6 +139,23 @@
  }
}
const syncingId = ref<number | null>(null);
/** 切换同步状态:关闭开关会从 MES 删除物料,需确认 */
async function handleSyncChange(row: MdmItemApi.Item, checked: boolean) {
  if (!checked) {
    await confirm('关闭同步将从 MES 删除该物料及关联配置(BOM/SOP/SIP/批次配置),确认继续?');
  }
  syncingId.value = row.id!;
  try {
    await updateItemSync(row.id!, checked);
    message.success(checked ? '已同步到 MES' : '已取消同步');
    handleRefresh();
  } finally {
    syncingId.value = null;
  }
}
const checkedIds = ref<number[]>([]);
function handleRowCheckboxChange({
  records,
@@ -232,8 +250,13 @@
        <Tag v-else>否</Tag>
      </template>
      <template #syncedMes="{ row }">
        <Tag v-if="row.syncedMes" color="success">已同步</Tag>
        <Tag v-else color="default">未同步</Tag>
        <Switch
          :checked="row.syncedMes"
          :loading="syncingId === row.id"
          checkedChildren="已同步"
          unCheckedChildren="未同步"
          @change="handleSyncChange(row, $event)"
        />
      </template>
      <template #actions="{ row }">
        <TableAction
src/views/basicData/mdm/modules/form.vue
@@ -67,6 +67,8 @@
      modalApi.lock();
      try {
        formData.value = await getItem(data.id);
        // 同步状态映射:详情接口返回 syncedMes,表单字段为 syncMes
        formData.value.syncMes = formData.value.syncedMes ?? true;
        await formApi.setValues(formData.value);
      } finally {
        modalApi.unlock();
src/views/crm/business/detail/index.vue
@@ -87,7 +87,9 @@
/** 转移商机 */
function handleTransfer() {
  transferModalApi.setData({ bizType: BizTypeEnum.CRM_BUSINESS }).open();
  transferModalApi
    .setData({ id: businessId.value, bizType: BizTypeEnum.CRM_BUSINESS })
    .open();
}
/** 更新商机状态操作 */
src/views/crm/clue/detail/index.vue
@@ -78,7 +78,9 @@
/** 转移线索 */
function handleTransfer() {
  transferModalApi.setData({ bizType: BizTypeEnum.CRM_CLUE }).open();
  transferModalApi
    .setData({ id: clueId.value, bizType: BizTypeEnum.CRM_CLUE })
    .open();
}
/** 转化为客户 */
src/views/crm/contact/detail/index.vue
@@ -80,7 +80,9 @@
/** 转移联系人 */
function handleTransfer() {
  transferModalApi.setData({ id: contactId.value }).open();
  transferModalApi
    .setData({ id: contactId.value, bizType: BizTypeEnum.CRM_CONTACT })
    .open();
}
/** 加载数据 */
src/views/crm/contract/detail/index.vue
@@ -85,7 +85,9 @@
/** 转移合同 */
function handleTransfer() {
  transferModalApi.setData({ bizType: BizTypeEnum.CRM_CONTRACT }).open();
  transferModalApi
    .setData({ id: contractId.value, bizType: BizTypeEnum.CRM_CONTRACT })
    .open();
}
/** 加载数据 */
src/views/crm/customer/detail/index.vue
@@ -94,9 +94,11 @@
  formModalApi.setData({ id: customerId.value }).open();
}
/** 转移线索 */
/** 转移客户 */
function handleTransfer() {
  transferModalApi.setData({ id: customerId.value }).open();
  transferModalApi
    .setData({ id: customerId.value, bizType: BizTypeEnum.CRM_CUSTOMER })
    .open();
}
/** 锁定客户 */
src/views/crm/permission/modules/list.vue
@@ -57,6 +57,7 @@
}) {
  if (records.some((item) => item.level === PermissionLevelEnum.OWNER)) {
    message.warning('不能选择负责人!');
    checkedRows.value = [];
    gridApi.grid.setAllCheckboxRow(false);
    return;
  }
@@ -114,17 +115,23 @@
  }
  // 提示并返回成功
  message.success($t('ui.actionMessage.operationSuccess'));
  checkedRows.value = [];
  gridApi.grid.setAllCheckboxRow(false);
  handleRefresh();
  return true;
}
/** 退出团队 */
async function handleQuit() {
  if (checkedRows.value.length > 0) {
    return handleDelete();
  }
  const permission = gridApi.grid
    .getData()
    .find(
      (item) =>
        item.id === userStore.userInfo?.id &&
        item.userId === userStore.userInfo?.id &&
        item.level === PermissionLevelEnum.OWNER,
    );
  if (permission) {
@@ -134,7 +141,7 @@
  const userPermission = gridApi.grid
    .getData()
    .find((item) => item.id === userStore.userInfo?.id);
    .find((item) => item.userId === userStore.userInfo?.id);
  if (!userPermission) {
    message.warning('你不是团队成员!');
    return;
src/views/crm/permission/modules/transfer-form.vue
@@ -103,12 +103,12 @@
      return;
    }
    // 加载数据
    const data = modalApi.getData<{ bizType: number }>();
    if (!data || !data.bizType) {
    const data = modalApi.getData<{ bizType: number; id: number }>();
    if (!data?.bizType || !data.id) {
      return;
    }
    bizType.value = data.bizType;
    await formApi.setFieldValue('id', data.bizType);
    await formApi.setFieldValue('id', data.id);
  },
});
</script>
src/views/erp/finance/payment/modules/item-form.vue
@@ -41,6 +41,14 @@
  'update:paymentPrice',
]);
/** 输入时不补零,失焦后仍按金额格式保留两位小数 */
const paymentPriceFormatter = (
  value: number | string | undefined,
  info: { input: string; userTyping: boolean },
) => {
  return info.userTyping ? info.input : erpPriceInputFormatter(value);
};
const tableData = ref<ErpFinancePaymentApi.FinancePaymentItem[]>([]); // 表格数据
/** 已根据该来票生成的明细,避免重复生成 */
@@ -196,7 +204,7 @@
          v-model:value="row.paymentPrice"
          :precision="2"
          :disabled="disabled"
          :formatter="erpPriceInputFormatter"
          :formatter="paymentPriceFormatter"
          placeholder="请输入本次付款"
          @change="handleRowChange(row)"
        />
src/views/mes/pro/mps/index.vue
@@ -66,13 +66,13 @@
}
/** 删除 */
async function handleDelete(ids: number[]) {
async function handleDelete(row: MesProMpsApi.Mps) {
  const hideLoading = message.loading({
    content: $t('ui.actionMessage.deleting'),
    duration: 0,
  });
  try {
    await deleteMps(ids);
    await deleteMps(row.id!);
    message.success($t('ui.actionMessage.deleteSuccess'));
    handleRefresh();
  } finally {
@@ -310,7 +310,7 @@
              ifShow: () => row.status === MpsStatusEnum.DRAFT,
              popConfirm: {
                title: $t('ui.actionMessage.deleteConfirm', [row.code]),
                confirm: handleDelete.bind(null, [row.id!]),
                confirm: handleDelete.bind(null, row),
              },
            },
          ]"
src/views/wls/returnvendor/modules/form.vue
@@ -7,6 +7,7 @@
import { confirm, useVbenModal } from '@vben/common-ui';
import { MesWmReturnVendorStatusEnum } from '@vben/constants';
import { formatDate } from '@vben/utils';
import { Button, Divider, message, Popconfirm } from 'ant-design-vue';
@@ -69,6 +70,17 @@
  showDefaultActions: false,
  wrapperClass: 'grid-cols-3',
});
function normalizeReturnDate(value: unknown): string | undefined {
  if (Array.isArray(value) && value.length >= 3) {
    const [year, month, day] = value;
    return `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')} 00:00:00`;
  }
  if (typeof value === 'number' || typeof value === 'string') {
    return formatDate(value, 'YYYY-MM-DD HH:mm:ss');
  }
  return undefined;
}
/** 提交退货单:表单有修改时先保存,再调用提交接口 */
async function handleSubmit() {
@@ -187,7 +199,10 @@
      try {
        formData.value = await getReturnVendor(data.id);
        // 设置到 values
        await formApi.setValues(formData.value);
        await formApi.setValues({
          ...formData.value,
          returnDate: normalizeReturnDate(formData.value.returnDate),
        });
      } finally {
        modalApi.unlock();
      }
vite.config.ts
@@ -16,6 +16,7 @@
  const defineVars: Record<string, string> = {
    __APP_LOGO__: JSON.stringify(appLogo),
    __APP_FAVICON__: JSON.stringify(appFavicon),
    __APP_NAME__: JSON.stringify(company?.name ?? ''),
  };
  if (!isDev && appApiUrl) {
    defineVars['import.meta.env.VITE_GLOB_API_URL'] = JSON.stringify(appApiUrl);