diff --git a/src/api/product/model/productAttributeModel.ts b/src/api/product/model/productAttributeModel.ts index 104e790..0a82fac 100644 --- a/src/api/product/model/productAttributeModel.ts +++ b/src/api/product/model/productAttributeModel.ts @@ -24,5 +24,7 @@ export interface AddOrUpdateProductAttributeReq { } export interface ProductAttributeListReq { - attributeName: string; + attributeName: string | undefined; + page: number; + pageSize: number; } \ No newline at end of file diff --git a/src/api/product/model/productModel.ts b/src/api/product/model/productModel.ts index edc7db4..8750fd7 100644 --- a/src/api/product/model/productModel.ts +++ b/src/api/product/model/productModel.ts @@ -19,34 +19,34 @@ export interface AddProductPriceReq { } export interface AddProductImageReq { - productImageId: number | string; - uid: string; - type: string; - status: string; - imageName: string; - imageUrl: string; - imageSize: number; + productImageId: number | string | null; + uid: string | null; + type: string | null | undefined; + status: string | null | undefined; + imageName: string | null; + imageUrl: string | null; + imageSize: number | null | undefined; } export interface AddProductReq { productId: number | string; productName: string; productStandard: string; - productModel: string; - productUnit: string | undefined, - productUnitId: number | string | undefined; - productColor: string; - productWeight: number; - productExpiryNum: number; - productCategoryId: number | string | undefined; - enableSerialNumber: number; - enableBatchNumber: number; - warehouseShelves: string; - remark: string; - productManufacturer: string; - otherFieldOne: string; - otherFieldTwo: string; - otherFieldThree: string; + productModel: string + productUnit: string + productUnitId: number | string; + productColor: string + productWeight: number | string; + productExpiryNum: number | string; + productCategoryId: number | string; + enableSerialNumber: number | string; + enableBatchNumber: number | string; + warehouseShelves: string + remark: string + productManufacturer: string + otherFieldOne: string + otherFieldTwo: string + otherFieldThree: string priceList: AddProductPriceReq[]; stockList: AddProductStockReq[]; imageList: AddProductImageReq[]; @@ -67,6 +67,8 @@ export interface QueryProductReq { export interface ProductInfoDetailResp { productId: string; productCategoryId: string; + productUnitId: string; + productUnit: string; productName: string; productStandard: string; productModel: string; @@ -81,17 +83,20 @@ export interface ProductInfoDetailResp { otherFieldOne: string; otherFieldTwo: string; otherFieldThree: string; + remark: string; priceList: ProductPriceResp[]; stockList: ProductStockResp[]; imageList: ProductImageResp[]; } export interface ProductImageResp { + productImageId: string; imageName: string; - iImageUrl: string; + imageUrl: string; } export interface ProductPriceResp { + productPriceId: string; barCode: number; productUnit: string; multiAttribute: string; @@ -102,7 +107,7 @@ export interface ProductPriceResp { } export interface ProductStockResp { - id: number | string; + productStockId: number | string; warehouseId: number | string; warehouseName: string; initStockQuantity: number; diff --git a/src/api/product/model/productUnitModel.ts b/src/api/product/model/productUnitModel.ts index 9a4065f..f23b9ed 100644 --- a/src/api/product/model/productUnitModel.ts +++ b/src/api/product/model/productUnitModel.ts @@ -22,7 +22,7 @@ export interface AddOrUpdateProductUnitReq { } export interface ProductUnitQueryReq { - computeUnit: string; + computeUnit: string | undefined; page: number; pageSize: number; } \ No newline at end of file diff --git a/src/api/product/productAttribute.ts b/src/api/product/productAttribute.ts index 75949a5..3a89d3a 100644 --- a/src/api/product/productAttribute.ts +++ b/src/api/product/productAttribute.ts @@ -10,16 +10,12 @@ enum Api { GetAttributeById = '/product/attribute/getValuesById', } -export function getAttributeList(params: ProductAttributeListReq ,mode: ErrorMessageMode = 'notice') { +export function getAttributeList(params: ProductAttributeListReq) { return defHttp.post>( { url: Api.List, params, - }, - { - errorMessageMode: mode, - successMessageMode: mode, - }, + } ); } diff --git a/src/api/product/productCategory.ts b/src/api/product/productCategory.ts index 10f3309..6097d0a 100644 --- a/src/api/product/productCategory.ts +++ b/src/api/product/productCategory.ts @@ -9,14 +9,11 @@ enum Api { deleteBatch = '/product/category/deleteBatch', } -export function getCategoryList(mode: ErrorMessageMode = 'notice') { +export function getCategoryList() { return defHttp.get>( { url: Api.List, - }, - { - errorMessageMode: mode, - }, + } ); } diff --git a/src/api/product/productUnit.ts b/src/api/product/productUnit.ts index cad1037..8f69c71 100644 --- a/src/api/product/productUnit.ts +++ b/src/api/product/productUnit.ts @@ -10,16 +10,12 @@ enum Api { UpdateStatus = '/product/unit/updateUnitStatus', } -export function getUnitList(params: ProductUnitQueryReq ,mode: ErrorMessageMode = 'notice') { +export function getUnitList(params: ProductUnitQueryReq) { return defHttp.post>( { url: Api.List, params, - }, - { - errorMessageMode: mode, - successMessageMode: mode, - }, + } ); } diff --git a/src/views/product/info/info.data.ts b/src/views/product/info/info.data.ts index f756915..21c9e3b 100644 --- a/src/views/product/info/info.data.ts +++ b/src/views/product/info/info.data.ts @@ -1,15 +1,18 @@ import {FormSchema} from "@/components/Form"; import {BasicColumn} from "@/components/Table"; -import { h } from 'vue'; +import {h, reactive, ref} from 'vue'; import {Switch} from "ant-design-vue"; import {useMessage} from "@/hooks/web/useMessage"; import {useI18n} from "@/hooks/web/useI18n"; import {updateProductStatus} from "@/api/product/product"; import {getCategoryList} from "@/api/product/productCategory"; +import {FormState, MeTable, ProductInfo, ProductStockModel, Stock} from "@/views/product/info/model/productInfoModel"; +import {UnwrapRef} from "vue/dist/vue"; +import {AddProductReq, AddProductStockReq} from "@/api/product/model/productModel"; const { t } = useI18n(); -export const columns: BasicColumn[] = [ +const columns: BasicColumn[] = [ { title: '条码', dataIndex: 'productBarcode', @@ -109,7 +112,7 @@ export const columns: BasicColumn[] = [ } ] -export const searchFormSchema: FormSchema[] = [ +const searchFormSchema: FormSchema[] = [ { label: '商品类别', field: 'productCategoryId', @@ -217,6 +220,129 @@ export const searchFormSchema: FormSchema[] = [ }, ] -export const formSchema: FormSchema[] = [ +const meTable: MeTable = reactive({ + loading: false, + dataSource: ref([]), + columns: [ + { + title: '条码', + key: 'barCode', + type: 'inputNumber', + placeholder: '请输入${title}', + validateRules: [ + { required: true, message: '条码不能为空' }, + { pattern: /^.{4,40}$/, message: '长度为4到40位' }, + ], + }, + { + title: '单位', + key: 'productUnit', + type: 'input', + placeholder: '请输入${title}', + validateRules: [{ required: true, message: '单位不能为空' }], + }, + { + title: '多属性', + key: 'multiAttribute', + type: 'input', + readonly: true, + placeholder: '请输入${title}', + }, + { + title: '采购价', + key: 'purchasePrice', + type: 'inputNumber', + defaultValue: '', + placeholder: '请输入${title}', + }, + { + title: '零售价', + key: 'retailPrice', + type: 'inputNumber', + defaultValue: '', + placeholder: '请输入${title}', + }, + { + title: '销售价', + key: 'salesPrice', + type: 'inputNumber', + defaultValue: '', + placeholder: '请输入${title}', + }, + { + title: '最低售价', + key: 'lowSalesPrice', + type: 'inputNumber', + defaultValue: '', + placeholder: '请输入${title}', + }, + ], +}); + +const stock: Stock = reactive({ + loading: false, + dataSource: ref([]), + columns: [ + { + title: '仓库', + key: 'warehouseName', + type: 'input', + }, + { + title: '期初库存数量', + key: 'initStockQuantity', + type: 'inputNumber', + placeholder: '请输入${title}', + }, + { + title: '最低安全库存数量', + key: 'lowStockQuantity', + type: 'inputNumber', + placeholder: '请输入${title}', + }, + { + title: '最高安全库存数量', + key: 'highStockQuantity', + type: 'inputNumber', + placeholder: '请输入${title}', + }, + ], +}); + +const formState: AddProductReq = reactive({ + productId: '', + productName: '', + productStandard: '', + productModel: '', + productUnit: '', + productUnitId: null, + productColor: '', + productWeight: null, + productExpiryNum: null, + productCategoryId: null, + enableSerialNumber: null, + enableBatchNumber: null, + remark: '', + warehouseShelves: '', + productManufacturer: '', + otherFieldOne: '', + otherFieldTwo: '', + otherFieldThree: '', +}); + +const productInfo: ProductInfo = reactive({ + mfrs: '制造商', + otherField1: '自定义1', + otherField2: '自定义2', + otherField3: '自定义3', +}); + -] \ No newline at end of file +export { + columns, + searchFormSchema, + meTable, + stock, + formState, + productInfo, +}; \ No newline at end of file