银川
1.点击合同号进入合同详情,点击销售订单号,出现404页面
| | |
| | | } else { |
| | | value.push(v); |
| | | } |
| | | const existingMap = new Map<string | number, UploadFile>(); |
| | | for (const f of fileList.value ?? []) { |
| | | const id = (f as any)?.response?.[props.valueKey] ?? (f as any)?.[props.valueKey] ?? f?.uid; |
| | | if (id != null) existingMap.set(id, f); |
| | | } |
| | | fileList.value = value |
| | | .map((item, i) => { |
| | | if (item && isString(item)) { |
| | | return { |
| | | return existingMap.get(item) ?? { |
| | | uid: `${-i}`, |
| | | name: item.slice(Math.max(0, item.lastIndexOf('/') + 1)), |
| | | status: UploadResultStatus.DONE, |
| | | url: item, |
| | | }; |
| | | } else if (item && isObject(item)) { |
| | | return item; |
| | | const key = item[props.valueKey] ?? item.uid; |
| | | return (key != null && existingMap.get(key)) || { ...item, url: String((item as any).url ?? '') }; |
| | | } else if (item && (typeof item === 'number' || typeof item === 'string')) { |
| | | return { |
| | | return existingMap.get(item) ?? { |
| | | uid: `${-i}`, |
| | | name: `文件 ${String(item)}`, |
| | | status: UploadResultStatus.DONE, |
| | | url: item, |
| | | url: String(item), |
| | | response: { [props.valueKey]: item }, |
| | | } as UploadFile; |
| | | } |
| | |
| | | fileList.value?.splice(index!, 1); |
| | | } |
| | | |
| | | const fileUrl = res?.url || res?.data || res; |
| | | const fileUrl = res?.url || res?.data || (typeof res === 'string' ? res : ''); |
| | | uploadList.value.push({ |
| | | name: res?.name || file.name, |
| | | url: fileUrl, |
| | |
| | | nextTick, |
| | | onUnmounted, |
| | | ref, |
| | | toRaw, |
| | | useTemplateRef, |
| | | watch, |
| | | } from 'vue'; |
| | |
| | | return formApi; |
| | | } |
| | | |
| | | const FieldComponent = computed(() => { |
| | | const finalComponent = isString(component) |
| | | ? componentMap.value[component] |
| | | : component; |
| | | if (!finalComponent) { |
| | | // 组件未注册 |
| | | const FieldComponent = isString(component) |
| | | ? computed(() => { |
| | | const comp = componentMap.value[component]; |
| | | if (!comp) { |
| | | console.warn(`Component ${component} is not registered`); |
| | | } |
| | | return finalComponent; |
| | | }); |
| | | return comp; |
| | | }) |
| | | : toRaw(component); |
| | | |
| | | const { |
| | | dynamicComponentProps, |
| | |
| | | function handleViewOrder() { |
| | | if (props.contract.orderId) { |
| | | router.push({ |
| | | path: '/erp/sale/order', |
| | | query: { orderId: props.contract.orderId }, |
| | | name: 'ErpSaleOrder', |
| | | query: { id: props.contract.orderId }, |
| | | }); |
| | | } |
| | | } |
| | |
| | | title: '入库数量', |
| | | minWidth: 100, |
| | | fixed: 'right', |
| | | formatter: 'formatAmount6', |
| | | formatter: 'formatAmount3', |
| | | }, |
| | | { |
| | | field: 'productPrice', |
| | |
| | | <script lang="ts" setup> |
| | | import type { MdmItemApi } from '#/api/mdm/item'; |
| | | import type { ErpPurchaseRequestApi } from '#/api/erp/purchase/request'; |
| | | |
| | | import { computed, nextTick, onMounted, ref, watch } from 'vue'; |
| | |
| | | erpPriceMultiply, |
| | | } from '@vben/utils'; |
| | | |
| | | import { Input, InputNumber, Select, DatePicker, Switch } from 'ant-design-vue'; |
| | | import { Input, InputNumber, DatePicker, Switch } from 'ant-design-vue'; |
| | | |
| | | import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { getItemPage } from '#/api/mdm/item'; |
| | | import { MdmItemSelect } from '#/views/basicData/mdm/components'; |
| | | |
| | | import { useFormItemColumns } from '../data'; |
| | | |
| | |
| | | const emit = defineEmits(['update:items']); |
| | | |
| | | const tableData = ref<ErpPurchaseRequestApi.PurchaseRequestItem[]>([]); |
| | | const productOptions = ref<MdmItemApi.Item[]>([]); |
| | | |
| | | /** 获取表格合计数据 */ |
| | | const summaries = computed(() => { |
| | |
| | | } |
| | | |
| | | /** 处理产品变更 */ |
| | | async function handleProductChange(productId: any, row: any) { |
| | | const product = productOptions.value.find((p) => p.id === productId); |
| | | function handleProductChange(product: any, row: any) { |
| | | if (!product) { |
| | | return; |
| | | } |
| | | row.productId = productId; |
| | | row.productId = product.id; |
| | | row.productBarCode = product.barCode; |
| | | row.productUnitId = product.unitMeasureId; |
| | | row.productUnitName = product.unitMeasureName; |
| | |
| | | }); |
| | | |
| | | /** 初始化 */ |
| | | onMounted(async () => { |
| | | const res = await getItemPage({ pageNo: 1, pageSize: 100, status: 0 }); |
| | | productOptions.value = res.list || []; |
| | | onMounted(() => { |
| | | if (tableData.value.length === 0) { |
| | | handleAdd(); |
| | | } |
| | |
| | | <template> |
| | | <Grid class="w-full"> |
| | | <template #productId="{ row }"> |
| | | <Select |
| | | <MdmItemSelect |
| | | v-if="!disabled" |
| | | v-model:value="row.productId" |
| | | :options="productOptions" |
| | | :field-names="{ label: 'name', value: 'id' }" |
| | | class="w-full" |
| | | :model-value="row.productId" |
| | | placeholder="请选择产品" |
| | | show-search |
| | | @update:model-value="row.productId = $event" |
| | | @change="handleProductChange($event, row)" |
| | | /> |
| | | <span v-else>{{ row.productName || '-' }}</span> |
| | |
| | | import type { VxeTableGridOptions } from '#/adapter/vxe-table'; |
| | | import type { ErpSaleOrderApi } from '#/api/erp/sale/order'; |
| | | |
| | | import { ref } from 'vue'; |
| | | import { useRouter } from 'vue-router'; |
| | | import { onMounted, ref } from 'vue'; |
| | | import { useRoute, useRouter } from 'vue-router'; |
| | | |
| | | import { Page, useVbenModal } from '@vben/common-ui'; |
| | | import { downloadFileFromBlobPart, isEmpty } from '@vben/utils'; |
| | |
| | | defineOptions({ name: 'ErpSaleOrder' }); |
| | | |
| | | const router = useRouter(); |
| | | const route = useRoute(); |
| | | |
| | | const [FormModal, formModalApi] = useVbenModal({ |
| | | connectedComponent: Form, |
| | |
| | | checkboxChange: handleRowCheckboxChange, |
| | | }, |
| | | }); |
| | | |
| | | /** 处理从合同跳转过来的查询参数 */ |
| | | onMounted(() => { |
| | | const orderId = route.query.id; |
| | | if (orderId) { |
| | | formModalApi.setData({ formType: 'detail', id: Number(orderId) }).open(); |
| | | } |
| | | }); |
| | | </script> |
| | | |
| | | <template> |