银川
1.销售订单页面展示字段修改
2.修改商机中产品时,输入价格与数量,下方滑动条会自动到最前方,需要重新拉动滑动条才能看到价格与数量输入框
已修改7个文件
113 ■■■■ 文件已修改
src/api/erp/sale/order/index.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/business/modules/form.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/product/components/data.ts 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/crm/product/components/edit-table.vue 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/sale/order/data.ts 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/sale/order/index.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/sale/order/modules/form.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/erp/sale/order/index.ts
@@ -27,6 +27,8 @@
    contractId?: number; // 关联 CRM 合同编号
    contractNo?: string; // CRM 合同单号
    needProduction?: number; // 是否需要生产:0-不需要,1-需要
    productionStatus?: number; // 生产状态:0-未完成,1-已完成
    productionFinishTime?: Date; // 生产完成时间
    hasSalesNotice?: boolean; // 是否已生成发货通知单
    canCreateSalesNotice?: boolean; // 是否可以生成发货通知单
    items?: SaleOrderItem[]; // 销售订单产品明细列表
src/views/crm/business/modules/form.vue
@@ -105,7 +105,7 @@
</script>
<template>
  <Modal :title="getTitle" class="w-1/2">
  <Modal :title="getTitle" class="w-3/4">
    <Form class="mx-4">
      <template #product="slotProps">
        <ProductEditTable
src/views/crm/product/components/data.ts
@@ -67,11 +67,6 @@
      minWidth: 120,
    },
    {
      field: 'itemBarCode',
      title: '条码',
      minWidth: 150,
    },
    {
      field: 'itemUnitName',
      title: '单位',
      minWidth: 80,
src/views/crm/product/components/edit-table.vue
@@ -3,15 +3,15 @@
import type { CrmContractApi } from '#/api/crm/contract';
import type { MdmItemApi } from '#/api/mdm/item';
import { nextTick, onMounted, ref, watch } from 'vue';
import { nextTick, ref, watch } from 'vue';
import { erpPriceMultiply } from '@vben/utils';
import { InputNumber, Select } from 'ant-design-vue';
import { InputNumber } from 'ant-design-vue';
import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { BizTypeEnum } from '#/api/crm/permission';
import { getItemPage } from '#/api/mdm/item';
import { MdmItemSelect } from '#/views/basicData/mdm/components';
import { $t } from '#/locales';
import { useProductEditTableColumns } from './data';
@@ -39,12 +39,11 @@
}
/** 切换产品时同步基础信息 */
function handleProductChange(itemId: any, row: any) {
  const product = productOptions.value.find((p) => p.id === itemId);
function handleProductChange(product: MdmItemApi.Item | undefined, row: any) {
  if (!product) {
    return;
  }
  row.itemId = itemId;
  row.itemId = product.id;
  row.itemName = product.name;
  row.itemCode = product.code;
  row.itemBarCode = product.barCode;
@@ -118,23 +117,15 @@
    immediate: true,
  },
);
/** 初始化 */
const productOptions = ref<MdmItemApi.Item[]>([]); // 物料下拉选项
onMounted(async () => {
  const res = await getItemPage({ pageNo: 1, pageSize: 100, status: 0 });
  productOptions.value = res.list || [];
});
</script>
<template>
  <Grid class="w-full">
    <template #itemId="{ row }">
      <Select
        v-model:value="row.itemId"
        :options="productOptions"
        :field-names="{ label: 'name', value: 'id' }"
        class="w-full"
      <MdmItemSelect
        :model-value="row.itemId"
        placeholder="请选择产品"
        @update:model-value="row.itemId = $event"
        @change="handleProductChange($event, row)"
      />
    </template>
src/views/erp/sale/order/data.ts
@@ -36,6 +36,35 @@
      },
    },
    {
      fieldName: 'productionStatus',
      label: '生产状态',
      component: 'Input',
      dependencies: {
        triggerFields: ['needProduction', 'productionStatus'],
        show: (values) => {
          return formType === 'detail' && values.needProduction === 1;
        },
      },
      componentProps: {
        disabled: true,
      },
      slots: { default: 'productionStatus' },
    },
    {
      fieldName: 'productionFinishTime',
      label: '生产完成时间',
      component: 'Input',
      dependencies: {
        triggerFields: ['productionStatus'],
        show: (values) => {
          return formType === 'detail' && values.productionStatus === 1;
        },
      },
      componentProps: {
        disabled: true,
      },
    },
    {
      fieldName: 'orderTime',
      label: '订单时间',
      component: 'DatePicker',
@@ -375,6 +404,19 @@
      },
    },
    {
      fieldName: 'productionStatus',
      label: '生产状态',
      component: 'Select',
      componentProps: {
        options: [
          { label: '未完成', value: 0 },
          { label: '已完成', value: 1 },
        ],
        placeholder: '请选择生产状态',
        allowClear: true,
      },
    },
    {
      fieldName: 'returnStatus',
      label: '退货状态',
      component: 'Select',
@@ -441,12 +483,6 @@
      minWidth: 120,
    },
    {
      field: 'outStatus',
      title: '出库状态',
      minWidth: 100,
      slots: { default: 'outStatus' },
    },
    {
      field: 'totalProductPrice',
      title: '金额合计',
      formatter: 'formatAmount2',
@@ -465,6 +501,20 @@
      minWidth: 120,
    },
    {
      field: 'outStatus',
      title: '出库状态',
      minWidth: 100,
      fixed: 'right',
      slots: { default: 'outStatus' },
    },
    {
      field: 'productionStatus',
      title: '生产状态',
      minWidth: 100,
      fixed: 'right',
      slots: { default: 'productionStatus' },
    },
    {
      field: 'status',
      title: '状态',
      minWidth: 100,
src/views/erp/sale/order/index.vue
@@ -266,6 +266,15 @@
        <Tag v-else-if="row.outStatus === 2" color="warning">部分出库</Tag>
        <Tag v-else-if="row.outStatus === 3" color="success">全部出库</Tag>
      </template>
      <template #productionStatus="{ row }">
        <template v-if="row.needProduction !== 1">
          <Tag color="default">无需生产</Tag>
        </template>
        <template v-else>
          <Tag v-if="row.productionStatus === 0" color="warning">未完成</Tag>
          <Tag v-else-if="row.productionStatus === 1" color="success">已完成</Tag>
        </template>
      </template>
      <template #actions="{ row }">
        <TableAction
          :actions="[
src/views/erp/sale/order/modules/form.vue
@@ -7,7 +7,7 @@
import { useVbenModal } from '@vben/common-ui';
import { message } from 'ant-design-vue';
import { message, Tag } from 'ant-design-vue';
import { useVbenForm } from '#/adapter/form';
import { getAccountSimpleList } from '#/api/erp/finance/account';
@@ -148,6 +148,10 @@
    :show-confirm-button="formType !== 'detail'"
  >
    <Form class="mx-3">
      <template #productionStatus="{ modelValue }">
        <Tag v-if="modelValue === 0" color="warning">未完成</Tag>
        <Tag v-else-if="modelValue === 1" color="success">已完成</Tag>
      </template>
      <template #items>
        <ItemForm
          ref="itemFormRef"