diff --git a/src/api/basic/warehouse.ts b/src/api/basic/warehouse.ts index 7d77007..3a3f939 100644 --- a/src/api/basic/warehouse.ts +++ b/src/api/basic/warehouse.ts @@ -13,6 +13,7 @@ enum API { AddOrUpdateWarehouse = '/basic/warehouse/addOrUpdate', DeleteBatch = '/basic/warehouse/delete', UpdateStatus = '/basic/warehouse/updateStatus', + GetWarehouse = '/basic/warehouse/getWarehouse', } export function getWarehouseList(params: QueryWarehouseReq, mode: ErrorMessageMode = 'notice') { @@ -60,4 +61,12 @@ export function deleteBatchWarehouse(ids: number[], mode: ErrorMessageMode = 'no errorMessageMode: mode, }, ); +} + +export function getWarehouse() { + return defHttp.get>( + { + url: API.GetWarehouse, + } + ); } \ No newline at end of file diff --git a/src/api/product/model/productModel.ts b/src/api/product/model/productModel.ts index c1ac52d..ae73675 100644 --- a/src/api/product/model/productModel.ts +++ b/src/api/product/model/productModel.ts @@ -1,3 +1,102 @@ +export interface AddProductStockReq { + warehouseId: number | string; + warehouseName: string; + initStockQuantity: number; + lowStockQuantity: number; + highStockQuantity: number; +} + +export interface AddProductPriceReq { + barCode: number; + productUnit: string; + multiAttribute: string; + purchasePrice: number; + retailPrice: number; + salesPrice: number; + lowSalesPrice: number; +} + +export interface AddProductImageReq { + uid: string; + type: string; + status: string; + imageName: string; + imageUrl: string; + imageSize: number; +} + +export interface AddProductReq { + 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; + priceList: AddProductPriceReq[]; + stockList: AddProductStockReq[]; + imageList: AddProductImageReq[]; +} + +export interface QueryProductReq { + productCategoryId: number | string + keywords: string + productColor: string + extendInfo: string + remark: string + warehouseShelves: string + status: number + enableSerialNumber: number + enableBatchNumber: number +} + +export interface ProductInfoDetailResp { + productId: string; + productCategoryId: string; + productName: string; + productStandard: string; + productModel: string; + productColor: string; + productWeight: number; + productExpiryNum: number; + productCategoryName: string; + enableSerialNumber: number; + enableBatchNumber: number; + warehouseShelves: string; + productManufacturer: string; + otherFieldOne: string; + otherFieldTwo: string; + otherFieldThree: string; + priceList: ProductPriceResp[]; + stockList: ProductStockResp[]; + imageList: ProductImageResp[]; +} + +export interface ProductImageResp { + imageName: string; + iImageUrl: string; +} + +export interface ProductPriceResp { + barCode: number; + productUnit: string; + multiAttribute: string; + purchasePrice: number; + retailPrice: number; + salesPrice: number; + lowSalesPrice: number; +} + export interface ProductStockResp { id: number | string; warehouseId: number | string; diff --git a/src/api/product/product.ts b/src/api/product/product.ts index 6cfe136..2b0ec11 100644 --- a/src/api/product/product.ts +++ b/src/api/product/product.ts @@ -1,10 +1,13 @@ import {defHttp} from '/@/utils/http/axios'; -import {BaseDataResp} from "@/api/model/baseModel"; -import {ProductStockResp} from "@/api/product/model/productModel"; +import {BaseDataResp, BaseResp} from "@/api/model/baseModel"; +import {AddProductReq, ProductInfoDetailResp, QueryProductReq} from "@/api/product/model/productModel"; +import {ErrorMessageMode} from "#/axios"; enum Api { getBarCode = '/product/getBarCode', - getStock = '/product/getStock', + addProduct = '/product/addProduct', + getProductInfo = '/product/getProductInfo', + getProductInfoDetail = '/product/getProductInfoDetail', } export function getBarCode() { @@ -15,10 +18,34 @@ export function getBarCode() { ); } -export function getStock() { - return defHttp.get>( +export function addProduct(params: AddProductReq, mode: ErrorMessageMode = 'notice') { + return defHttp.post( { - url: Api.getStock, + url: Api.addProduct, + params + }, + { + errorMessageMode: mode, + }, + ); +} + +export function getProductInfo(params: QueryProductReq, mode: ErrorMessageMode = 'notice') { + return defHttp.post( + { + url: Api.getProductInfo, + params + }, + { + errorMessageMode: mode, + }, + ); +} + +export function getProductInfoDetail(productId: number) { + return defHttp.get>( + { + url: `${Api.getProductInfoDetail}/${productId}`, } ); } \ No newline at end of file diff --git a/src/views/product/info/components/BatchSetPriceModal.vue b/src/views/product/info/components/BatchSetPriceModal.vue index 1ee0fdc..44de101 100644 --- a/src/views/product/info/components/BatchSetPriceModal.vue +++ b/src/views/product/info/components/BatchSetPriceModal.vue @@ -4,8 +4,6 @@ :width="500" v-model:open="openPriceModal" :confirm-loading="confirmLoading" - :mask-style="{'top':'93px','left':'154px'}" - :mask-closable="false" @ok="handleOk" @cancel="handleCancel" style="top:30%;height: 30%;"> @@ -93,6 +91,7 @@ export default { const handleCancel = () => { close(); + }; return { diff --git a/src/views/product/info/components/BatchSetStockModal.vue b/src/views/product/info/components/BatchSetStockModal.vue index d21b083..b09df29 100644 --- a/src/views/product/info/components/BatchSetStockModal.vue +++ b/src/views/product/info/components/BatchSetStockModal.vue @@ -4,8 +4,6 @@ :width="500" v-model:open="openStockModal" :confirm-loading="confirmLoading" - :mask-style="{'top':'93px','left':'154px'}" - :mask-closable="false" @ok="handleOk" @cancel="handleCancel" style="top:30%;height: 30%;"> diff --git a/src/views/product/info/components/ProductInfoModal.vue b/src/views/product/info/components/ProductInfoModal.vue index 2f5a8de..bfb5075 100644 --- a/src/views/product/info/components/ProductInfoModal.vue +++ b/src/views/product/info/components/ProductInfoModal.vue @@ -9,28 +9,29 @@ switchFullscreen v-model:open="open" @cancel="handleCancel" + @ok="handleOk" style="top:20%;height: 95%;"> - + - + data-intro="名称必填,可以重复" :rules="[{ required: true}]"> + - + - + @@ -40,19 +41,19 @@ :data-step="4" data-title="单位" :data-intro="`此处支持单个单位和多单位,勾选多单位就可以切换到多单位的下拉框,多单位需要先在【计量单位】页面进行录入。 - 比如牛奶有瓶和箱两种单位,12瓶=1箱,这就构成了多单位,多单位中有个换算比例`"> + 比如牛奶有瓶和箱两种单位,12瓶=1箱,这就构成了多单位,多单位中有个换算比例`" + :rules="[{ required: true}]"> - + - + - + @@ -109,7 +109,7 @@ data-step="8" data-title="类别" data-intro="类别需要在【商品类别】页面进行录入,录入之后在此处进行调用"> + :treeData="categoryTree.value" v-model:value="formState.productCategoryId" placeholder="请选择类别"> @@ -120,7 +120,7 @@ data-title="序列号" data-intro="此处是商品的序列号开关,如果选择了有,则在采购入库单据需要录入该商品的序列号,在销售出库单据需要选择该商品的序列号进行出库"> - + @@ -131,7 +131,7 @@ - + @@ -142,17 +142,17 @@ - + - + 需要先录入单位才能激活 - @@ -215,14 +215,13 @@ @@ -232,7 +231,7 @@ - + @@ -241,28 +240,28 @@ - + - + - + - + @@ -286,12 +285,12 @@ - + @@ -313,6 +312,9 @@
上传图片
+ + example + @@ -335,36 +337,63 @@