银川
1.销售订单页面展示字段修改
2.修改商机中产品时,输入价格与数量,下方滑动条会自动到最前方,需要重新拉动滑动条才能看到价格与数量输入框
| | |
| | | contractId?: number; // 关联 CRM 合同编号 |
| | | contractNo?: string; // CRM 合同单号 |
| | | needProduction?: number; // 是否需要生产:0-不需要,1-需要 |
| | | productionStatus?: number; // 生产状态:0-未完成,1-已完成 |
| | | productionFinishTime?: Date; // 生产完成时间 |
| | | hasSalesNotice?: boolean; // 是否已生成发货通知单 |
| | | canCreateSalesNotice?: boolean; // 是否可以生成发货通知单 |
| | | items?: SaleOrderItem[]; // 销售订单产品明细列表 |
| | |
| | | </script> |
| | | |
| | | <template> |
| | | <Modal :title="getTitle" class="w-1/2"> |
| | | <Modal :title="getTitle" class="w-3/4"> |
| | | <Form class="mx-4"> |
| | | <template #product="slotProps"> |
| | | <ProductEditTable |
| | |
| | | minWidth: 120, |
| | | }, |
| | | { |
| | | field: 'itemBarCode', |
| | | title: '条码', |
| | | minWidth: 150, |
| | | }, |
| | | { |
| | | field: 'itemUnitName', |
| | | title: '单位', |
| | | minWidth: 80, |
| | |
| | | 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'; |
| | |
| | | } |
| | | |
| | | /** 切换产品时同步基础信息 */ |
| | | 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; |
| | |
| | | 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> |
| | |
| | | }, |
| | | }, |
| | | { |
| | | 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', |
| | |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'productionStatus', |
| | | label: '生产状态', |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: [ |
| | | { label: '未完成', value: 0 }, |
| | | { label: '已完成', value: 1 }, |
| | | ], |
| | | placeholder: '请选择生产状态', |
| | | allowClear: true, |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'returnStatus', |
| | | label: '退货状态', |
| | | component: 'Select', |
| | |
| | | minWidth: 120, |
| | | }, |
| | | { |
| | | field: 'outStatus', |
| | | title: '出库状态', |
| | | minWidth: 100, |
| | | slots: { default: 'outStatus' }, |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | title: '金额合计', |
| | | formatter: 'formatAmount2', |
| | |
| | | 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, |
| | |
| | | <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="[ |
| | |
| | | |
| | | 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'; |
| | |
| | | :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" |