49 changed files with 6062 additions and 0 deletions
@ -0,0 +1,68 @@ |
|||
import { defHttp } from '@/utils/http/axios'; |
|||
import { ID, IDS, commonExport } from '@/api/base'; |
|||
import { |
|||
CompanyProductModelDetailsVO, |
|||
CompanyProductModelDetailsForm, |
|||
CompanyProductModelDetailsQuery, |
|||
} from './model'; |
|||
|
|||
/** |
|||
* 查询公司产品模型详情表列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function companyProductModelDetailsList(params?: CompanyProductModelDetailsQuery) { |
|||
return defHttp.get<CompanyProductModelDetailsVO[]>({ |
|||
url: '/productManagement/companyProductModelDetails/list', |
|||
params, |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 导出公司产品模型详情表列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function companyProductModelDetailsExport(params?: CompanyProductModelDetailsQuery) { |
|||
return commonExport('/productManagement/companyProductModelDetails/export', params ?? {}); |
|||
} |
|||
|
|||
/** |
|||
* 查询公司产品模型详情表详细 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function companyProductModelDetailsInfo(id: ID) { |
|||
return defHttp.get<CompanyProductModelDetailsVO>({ |
|||
url: '/productManagement/companyProductModelDetails/' + id, |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 新增公司产品模型详情表 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function companyProductModelDetailsAdd(data: CompanyProductModelDetailsForm) { |
|||
return defHttp.postWithMsg<void>({ url: '/productManagement/companyProductModelDetails', data }); |
|||
} |
|||
|
|||
/** |
|||
* 更新公司产品模型详情表 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function companyProductModelDetailsUpdate(data: CompanyProductModelDetailsForm) { |
|||
return defHttp.putWithMsg<void>({ url: '/productManagement/companyProductModelDetails', data }); |
|||
} |
|||
|
|||
/** |
|||
* 删除公司产品模型详情表 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function companyProductModelDetailsRemove(id: ID | IDS) { |
|||
return defHttp.deleteWithMsg<void>({ |
|||
url: '/productManagement/companyProductModelDetails/' + id, |
|||
}); |
|||
} |
@ -0,0 +1,97 @@ |
|||
import { BaseEntity, PageQuery } from '@/api/base'; |
|||
|
|||
export interface CompanyProductModelDetailsVO { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id: string | number; |
|||
|
|||
/** |
|||
* 公司产品型号表id |
|||
*/ |
|||
modelId: string | number; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
paramName: string; |
|||
|
|||
/** |
|||
* 指标参数 |
|||
*/ |
|||
parameterValue: string; |
|||
|
|||
/** |
|||
* 是否关键指标 |
|||
*/ |
|||
isKeyParameter: string; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary: string; |
|||
} |
|||
|
|||
export interface CompanyProductModelDetailsForm extends BaseEntity { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id?: string | number; |
|||
|
|||
/** |
|||
* 公司产品型号表id |
|||
*/ |
|||
modelId?: string | number; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
paramName?: string; |
|||
|
|||
/** |
|||
* 指标参数 |
|||
*/ |
|||
parameterValue?: string; |
|||
|
|||
/** |
|||
* 是否关键指标 |
|||
*/ |
|||
isKeyParameter?: string; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary?: string; |
|||
} |
|||
|
|||
export interface CompanyProductModelDetailsQuery extends PageQuery { |
|||
/** |
|||
* 公司产品型号表id |
|||
*/ |
|||
modelId?: string | number; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
paramName?: string; |
|||
|
|||
/** |
|||
* 指标参数 |
|||
*/ |
|||
parameterValue?: string; |
|||
|
|||
/** |
|||
* 是否关键指标 |
|||
*/ |
|||
isKeyParameter?: string; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary?: string; |
|||
|
|||
/** |
|||
* 日期范围参数 |
|||
*/ |
|||
params?: any; |
|||
} |
@ -0,0 +1,90 @@ |
|||
import { defHttp } from '@/utils/http/axios'; |
|||
import { ID, IDS, commonExport } from '@/api/base'; |
|||
import { CompanyProductModelVO, CompanyProductModelForm, CompanyProductModelQuery } from './model'; |
|||
import { CompanyProductModelDetailsVO } from './companyProductModelDetails/model'; |
|||
|
|||
/** |
|||
* 公司产品 |
|||
* @param id 公司产品 |
|||
* @returns |
|||
*/ |
|||
export function companyProductGetModelDetails(id: ID) { |
|||
return defHttp.get<CompanyProductModelDetailsVO[]>({ |
|||
url: '/productManagement/companyProductModel/getModelDetails/' + id, |
|||
}); |
|||
} |
|||
/** |
|||
* 新增公司产品模型 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function addCompanyProductModel(data: CompanyProductModelForm) { |
|||
return defHttp.post<string>({ url: '/productManagement/companyProductModel/addModel', data }); |
|||
} |
|||
|
|||
/** |
|||
* 更新公司产品模型 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function updateCompanyProductModel(data: CompanyProductModelForm) { |
|||
return defHttp.put<string>({ url: '/productManagement/companyProductModel/editModel', data }); |
|||
} |
|||
/** |
|||
* 查询公司产品模型列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function companyProductModelList(params?: CompanyProductModelQuery) { |
|||
return defHttp.get<CompanyProductModelVO[]>({ |
|||
url: '/productManagement/companyProductModel/list', |
|||
params, |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 导出公司产品模型列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function companyProductModelExport(params?: CompanyProductModelQuery) { |
|||
return commonExport('/productManagement/companyProductModel/export', params ?? {}); |
|||
} |
|||
|
|||
/** |
|||
* 查询公司产品模型详细 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function companyProductModelInfo(id: ID) { |
|||
return defHttp.get<CompanyProductModelVO>({ |
|||
url: '/productManagement/companyProductModel/' + id, |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 新增公司产品模型 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function companyProductModelAdd(data: CompanyProductModelForm) { |
|||
return defHttp.postWithMsg<void>({ url: '/productManagement/companyProductModel', data }); |
|||
} |
|||
|
|||
/** |
|||
* 更新公司产品模型 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function companyProductModelUpdate(data: CompanyProductModelForm) { |
|||
return defHttp.putWithMsg<void>({ url: '/productManagement/companyProductModel', data }); |
|||
} |
|||
|
|||
/** |
|||
* 删除公司产品模型 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function companyProductModelRemove(id: ID | IDS) { |
|||
return defHttp.deleteWithMsg<void>({ url: '/productManagement/companyProductModel/' + id }); |
|||
} |
@ -0,0 +1,67 @@ |
|||
import { BaseEntity, PageQuery } from '@/api/base'; |
|||
|
|||
export interface CompanyProductModelVO { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id: string | number; |
|||
|
|||
/** |
|||
* 公司产品指标描述 |
|||
*/ |
|||
description: string; |
|||
|
|||
/** |
|||
* 产品型号模板id |
|||
*/ |
|||
productModelTemplateId: string | number; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary: string; |
|||
} |
|||
|
|||
export interface CompanyProductModelForm extends BaseEntity { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id?: string | number; |
|||
|
|||
/** |
|||
* 公司产品指标描述 |
|||
*/ |
|||
description?: string; |
|||
|
|||
/** |
|||
* 产品型号模板id |
|||
*/ |
|||
productModelTemplateId?: string | number; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary?: string; |
|||
} |
|||
|
|||
export interface CompanyProductModelQuery extends PageQuery { |
|||
/** |
|||
* 公司产品指标描述 |
|||
*/ |
|||
description?: string; |
|||
|
|||
/** |
|||
* 产品型号模板id |
|||
*/ |
|||
productModelTemplateId?: string | number; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary?: string; |
|||
|
|||
/** |
|||
* 日期范围参数 |
|||
*/ |
|||
params?: any; |
|||
} |
@ -0,0 +1,59 @@ |
|||
import { defHttp } from '@/utils/http/axios'; |
|||
import { ID, IDS, commonExport } from '@/api/base'; |
|||
import { CompanyProductsVO, CompanyProductsForm, CompanyProductsQuery } from './model'; |
|||
/** |
|||
* 查询公司产品管理列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function companyProductsList(params?: CompanyProductsQuery) { |
|||
return defHttp.get<CompanyProductsVO[]>({ |
|||
url: '/productManagement/companyProducts/list', |
|||
params, |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 导出公司产品管理列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function companyProductsExport(params?: CompanyProductsQuery) { |
|||
return commonExport('/productManagement/companyProducts/export', params ?? {}); |
|||
} |
|||
|
|||
/** |
|||
* 查询公司产品管理详细 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function companyProductsInfo(id: ID) { |
|||
return defHttp.get<CompanyProductsVO>({ url: '/productManagement/companyProducts/' + id }); |
|||
} |
|||
|
|||
/** |
|||
* 新增公司产品管理 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function companyProductsAdd(data: CompanyProductsForm) { |
|||
return defHttp.postWithMsg<void>({ url: '/productManagement/companyProducts', data }); |
|||
} |
|||
|
|||
/** |
|||
* 更新公司产品管理 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function companyProductsUpdate(data: CompanyProductsForm) { |
|||
return defHttp.putWithMsg<void>({ url: '/productManagement/companyProducts', data }); |
|||
} |
|||
|
|||
/** |
|||
* 删除公司产品管理 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function companyProductsRemove(id: ID | IDS) { |
|||
return defHttp.deleteWithMsg<void>({ url: '/productManagement/companyProducts/' + id }); |
|||
} |
@ -0,0 +1,227 @@ |
|||
import { BaseEntity, PageQuery } from '@/api/base'; |
|||
|
|||
export interface CompanyProductsVO { |
|||
/** |
|||
* 关联厂商产品id |
|||
*/ |
|||
supplierProductsId: string | number; |
|||
|
|||
/** |
|||
* 供应商id |
|||
*/ |
|||
supplierInformationId: string | number; |
|||
|
|||
/** |
|||
* 公司产品规格 |
|||
*/ |
|||
productSpecifications: string; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
productName: string; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
productIdentity: string | number; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
productPrice: number; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
sourceInformation: string; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
remarks: string; |
|||
|
|||
/** |
|||
* 图片 |
|||
*/ |
|||
image: string; |
|||
|
|||
/** |
|||
* 品牌 |
|||
*/ |
|||
brand: string; |
|||
|
|||
/** |
|||
* 单位 |
|||
*/ |
|||
unit: string; |
|||
|
|||
/** |
|||
* 除税价 |
|||
*/ |
|||
exTaxPrice: number; |
|||
|
|||
/** |
|||
* 税率 |
|||
*/ |
|||
taxrate: number; |
|||
|
|||
/** |
|||
* 分类id |
|||
*/ |
|||
categoryId: string | number; |
|||
|
|||
/** |
|||
* 型号id |
|||
*/ |
|||
modelId: string | number; |
|||
} |
|||
|
|||
export interface CompanyProductsForm extends BaseEntity { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id?: string | number; |
|||
|
|||
/** |
|||
* 关联厂商产品id |
|||
*/ |
|||
supplierProductsId?: string | number; |
|||
|
|||
/** |
|||
* 供应商id |
|||
*/ |
|||
supplierInformationId?: string | number; |
|||
|
|||
/** |
|||
* 公司产品规格 |
|||
*/ |
|||
productSpecifications?: string; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
productName?: string; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
productIdentity?: string | number; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
productPrice?: number; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
sourceInformation?: string; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
remarks?: string; |
|||
|
|||
/** |
|||
* 图片 |
|||
*/ |
|||
image?: string; |
|||
|
|||
/** |
|||
* 品牌 |
|||
*/ |
|||
brand?: string; |
|||
|
|||
/** |
|||
* 单位 |
|||
*/ |
|||
unit?: string; |
|||
|
|||
/** |
|||
* 除税价 |
|||
*/ |
|||
exTaxPrice?: number; |
|||
|
|||
/** |
|||
* 税率 |
|||
*/ |
|||
taxrate?: number; |
|||
|
|||
/** |
|||
* 分类id |
|||
*/ |
|||
categoryId?: string | number; |
|||
|
|||
/** |
|||
* 型号id |
|||
*/ |
|||
modelId?: string | number; |
|||
} |
|||
|
|||
export interface CompanyProductsQuery extends PageQuery { |
|||
/** |
|||
* 关联厂商产品id |
|||
*/ |
|||
supplierProductsId?: string | number; |
|||
|
|||
/** |
|||
* 供应商id |
|||
*/ |
|||
supplierInformationId?: string | number; |
|||
|
|||
/** |
|||
* 公司产品规格 |
|||
*/ |
|||
productSpecifications?: string; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
productName?: string; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
productIdentity?: string | number; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
productPrice?: number; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
sourceInformation?: string; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
remarks?: string; |
|||
|
|||
/** |
|||
* 品牌 |
|||
*/ |
|||
brand?: string; |
|||
|
|||
/** |
|||
* 单位 |
|||
*/ |
|||
unit?: string; |
|||
|
|||
/** |
|||
* 除税价 |
|||
*/ |
|||
exTaxPrice?: number; |
|||
|
|||
/** |
|||
* 税率 |
|||
*/ |
|||
taxrate?: number; |
|||
|
|||
/** |
|||
* 日期范围参数 |
|||
*/ |
|||
params?: any; |
|||
} |
@ -0,0 +1,63 @@ |
|||
import { defHttp } from '@/utils/http/axios'; |
|||
import { ID, IDS, commonExport } from '@/api/base'; |
|||
import { CostItemDetailVO, CostItemDetailForm, CostItemDetailQuery, ProductsVO } from './model'; |
|||
|
|||
export function getProductsPageByType(params?: ProductsVO) { |
|||
return defHttp.get<ProductsVO[]>({ |
|||
url: '/productManagement/costItemDetail/getProductsPageByType', |
|||
params, |
|||
}); |
|||
} |
|||
/** |
|||
* 查询造价编制详情列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function costItemDetailList(params?: CostItemDetailQuery) { |
|||
return defHttp.get<CostItemDetailVO[]>({ url: '/productManagement/costItemDetail/list', params }); |
|||
} |
|||
|
|||
/** |
|||
* 导出造价编制详情列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function costItemDetailExport(params?: CostItemDetailQuery) { |
|||
return commonExport('/productManagement/costItemDetail/export', params ?? {}); |
|||
} |
|||
|
|||
/** |
|||
* 查询造价编制详情详细 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function costItemDetailInfo(id: ID) { |
|||
return defHttp.get<CostItemDetailVO>({ url: '/productManagement/costItemDetail/' + id }); |
|||
} |
|||
|
|||
/** |
|||
* 新增造价编制详情 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function costItemDetailAdd(data: CostItemDetailForm) { |
|||
return defHttp.postWithMsg<void>({ url: '/productManagement/costItemDetail', data }); |
|||
} |
|||
|
|||
/** |
|||
* 更新造价编制详情 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function costItemDetailUpdate(data: CostItemDetailForm) { |
|||
return defHttp.putWithMsg<void>({ url: '/productManagement/costItemDetail', data }); |
|||
} |
|||
|
|||
/** |
|||
* 删除造价编制详情 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function costItemDetailRemove(id: ID | IDS) { |
|||
return defHttp.deleteWithMsg<void>({ url: '/productManagement/costItemDetail/' + id }); |
|||
} |
@ -0,0 +1,225 @@ |
|||
import { BaseEntity, PageQuery } from '@/api/base'; |
|||
|
|||
export interface CostItemDetailVO { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id: string | number; |
|||
|
|||
/** |
|||
* 造价表id |
|||
*/ |
|||
costTableId: string | number; |
|||
|
|||
/** |
|||
* 父类id |
|||
*/ |
|||
parentId: string | number; |
|||
|
|||
/** |
|||
* 费用类型 |
|||
*/ |
|||
costType: string; |
|||
|
|||
/** |
|||
* 建设内容 |
|||
*/ |
|||
constructContent: string; |
|||
|
|||
/** |
|||
* 费用名称 |
|||
*/ |
|||
costName: string; |
|||
|
|||
/** |
|||
* 费用描述 |
|||
*/ |
|||
costDescribe: string; |
|||
|
|||
/** |
|||
* 单位 |
|||
*/ |
|||
unit: string; |
|||
|
|||
/** |
|||
* 数量 |
|||
*/ |
|||
quantity: number; |
|||
|
|||
/** |
|||
* 单价 |
|||
*/ |
|||
unitPrice: number; |
|||
|
|||
/** |
|||
* 总价 |
|||
*/ |
|||
totalPrice: number; |
|||
|
|||
/** |
|||
* 是否明细 |
|||
*/ |
|||
isDetail: string; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
remarks: string; |
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
orderNo: string; |
|||
} |
|||
|
|||
export interface CostItemDetailForm extends BaseEntity { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id?: string | number; |
|||
|
|||
/** |
|||
* 造价表id |
|||
*/ |
|||
costTableId?: string | number; |
|||
|
|||
/** |
|||
* 父类id |
|||
*/ |
|||
parentId?: string | number; |
|||
|
|||
/** |
|||
* 费用类型 |
|||
*/ |
|||
costType?: string; |
|||
|
|||
/** |
|||
* 建设内容 |
|||
*/ |
|||
constructContent?: string; |
|||
|
|||
/** |
|||
* 费用名称 |
|||
*/ |
|||
costName?: string; |
|||
|
|||
/** |
|||
* 费用描述 |
|||
*/ |
|||
costDescribe?: string; |
|||
|
|||
/** |
|||
* 单位 |
|||
*/ |
|||
unit?: string; |
|||
|
|||
/** |
|||
* 数量 |
|||
*/ |
|||
quantity?: number; |
|||
|
|||
/** |
|||
* 单价 |
|||
*/ |
|||
unitPrice?: number; |
|||
|
|||
/** |
|||
* 总价 |
|||
*/ |
|||
totalPrice?: number; |
|||
|
|||
/** |
|||
* 是否明细 |
|||
*/ |
|||
isDetail?: string; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
remarks?: string; |
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
orderNo?: string; |
|||
} |
|||
|
|||
export interface CostItemDetailQuery extends PageQuery { |
|||
/** |
|||
* 日期范围参数 |
|||
*/ |
|||
params?: any; |
|||
} |
|||
export interface ProductsVO { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id: string | number; |
|||
|
|||
/** |
|||
* 供应商id |
|||
*/ |
|||
supplierInformationId: string | number; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
productName: string; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
productIdentity: string | number; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
productPrice: number; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
sourceInformation: string; |
|||
|
|||
/** |
|||
* 个人产品规格 |
|||
*/ |
|||
productSpecifications: string; |
|||
|
|||
/** |
|||
* 关联厂商产品id |
|||
*/ |
|||
supplierProductsId: string | number; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
remarks: string; |
|||
|
|||
/** |
|||
* 图片 |
|||
*/ |
|||
image: string; |
|||
|
|||
/** |
|||
* 品牌 |
|||
*/ |
|||
brand: string; |
|||
|
|||
/** |
|||
* 单位 |
|||
*/ |
|||
unit: string; |
|||
|
|||
/** |
|||
* 除税价 |
|||
*/ |
|||
exTaxPrice: number; |
|||
|
|||
/** |
|||
* 税率 |
|||
*/ |
|||
taxrate: number; |
|||
|
|||
productType: string; |
|||
} |
@ -0,0 +1,90 @@ |
|||
import { defHttp } from '@/utils/http/axios'; |
|||
import { ID, IDS, commonExport } from '@/api/base'; |
|||
import { CostTableVO, CostTableForm, CostTableQuery, CostDetailViewVo } from './model'; |
|||
/** |
|||
* 新增造价编制信息 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function addCostTable(data: CostTableForm) { |
|||
return defHttp.postWithMsg<void>({ url: '/productManagement/costTable/addCostTable', data }); |
|||
} |
|||
|
|||
/** |
|||
* 更新造价编制信息 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function modifyCostTable(data: CostTableForm) { |
|||
return defHttp.putWithMsg<void>({ url: '/productManagement/costTable/modifyCostTable', data }); |
|||
} |
|||
/** |
|||
* 查询造价编制信息列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function costTableList(params?: CostTableQuery) { |
|||
return defHttp.get<CostTableVO[]>({ url: '/productManagement/costTable/list', params }); |
|||
} |
|||
|
|||
/** |
|||
* 导出造价编制信息列表详情 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function exportDataDetail(params?) { |
|||
return commonExport('/productManagement/costTable/exportData', params ?? {}); |
|||
} |
|||
/** |
|||
* 导出造价编制信息列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function costTableExport(params?: CostTableQuery) { |
|||
return commonExport('/productManagement/costTable/export', params ?? {}); |
|||
} |
|||
|
|||
// /**
|
|||
// * 查询造价编制信息详细
|
|||
// * @param id id
|
|||
// * @returns
|
|||
// */
|
|||
// export function costTableInfo(id: ID) {
|
|||
// return defHttp.get<CostTableVO>({ url: '/productManagement/costTable/' + id });
|
|||
// }
|
|||
/** |
|||
* 查询造价编制信息详细 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function costTableInfo(id: ID) { |
|||
return defHttp.get<CostDetailViewVo>({ |
|||
url: '/productManagement/costTable/getCostTableDetail/' + id, |
|||
}); |
|||
} |
|||
/** |
|||
* 新增造价编制信息 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function costTableAdd(data: CostTableForm) { |
|||
return defHttp.postWithMsg<void>({ url: '/productManagement/costTable', data }); |
|||
} |
|||
|
|||
/** |
|||
* 更新造价编制信息 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function costTableUpdate(data: CostTableForm) { |
|||
return defHttp.putWithMsg<void>({ url: '/productManagement/costTable', data }); |
|||
} |
|||
|
|||
/** |
|||
* 删除造价编制信息 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function costTableRemove(id: ID | IDS) { |
|||
return defHttp.deleteWithMsg<void>({ url: '/productManagement/costTable/' + id }); |
|||
} |
@ -0,0 +1,70 @@ |
|||
import { BaseEntity, PageQuery } from '@/api/base'; |
|||
import { CostItemDetailVO } from '../costItemDetail/model'; |
|||
export interface CostTableVO { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id: string | number; |
|||
|
|||
/** |
|||
* 项目名称 |
|||
*/ |
|||
projectName: string; |
|||
|
|||
/** |
|||
* 造价日期 |
|||
*/ |
|||
costDate: string; |
|||
|
|||
/** |
|||
* 总投资 |
|||
*/ |
|||
totalInvestment: number; |
|||
} |
|||
|
|||
export interface CostTableForm extends BaseEntity { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id?: string | number; |
|||
|
|||
/** |
|||
* 项目名称 |
|||
*/ |
|||
projectName?: string; |
|||
|
|||
/** |
|||
* 造价日期 |
|||
*/ |
|||
costDate?: string; |
|||
|
|||
/** |
|||
* 总投资 |
|||
*/ |
|||
totalInvestment?: number; |
|||
} |
|||
|
|||
export interface CostTableQuery extends PageQuery { |
|||
/** |
|||
* 项目名称 |
|||
*/ |
|||
projectName?: string; |
|||
|
|||
/** |
|||
* 造价日期 |
|||
*/ |
|||
costDate?: string; |
|||
|
|||
/** |
|||
* 总投资 |
|||
*/ |
|||
totalInvestment?: number; |
|||
|
|||
/** |
|||
* 日期范围参数 |
|||
*/ |
|||
params?: any; |
|||
} |
|||
export interface CostDetailViewVo extends CostTableVO { |
|||
costItemDetailList?: CostItemDetailVO[]; |
|||
} |
@ -0,0 +1,87 @@ |
|||
import { defHttp } from '@/utils/http/axios'; |
|||
import { ID, IDS, commonExport } from '@/api/base'; |
|||
import { PersonProductModelVO, PersonProductModelForm, PersonProductModelQuery } from './model'; |
|||
import { PersonProductModelDetailsVO } from './personProductModelDetails/model'; |
|||
/** |
|||
* 根据id查询个人产品模型详情 |
|||
* @param id |
|||
* @returns |
|||
*/ |
|||
export function personProductGetModelDetails(id: ID) { |
|||
return defHttp.get<PersonProductModelDetailsVO[]>({ |
|||
url: '/productManagement/personProductModel/getModelDetails/' + id, |
|||
}); |
|||
} |
|||
/** |
|||
* 新增个人产品模型 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function addPersonProductModel(data: PersonProductModelForm) { |
|||
return defHttp.post<string>({ url: '/productManagement/personProductModel/addModel', data }); |
|||
} |
|||
|
|||
/** |
|||
* 更新个人产品模型 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function updatePersonProductModel(data: PersonProductModelForm) { |
|||
return defHttp.put<string>({ url: '/productManagement/personProductModel/editModel', data }); |
|||
} |
|||
/** |
|||
* 查询个人产品模型列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function personProductModelList(params?: PersonProductModelQuery) { |
|||
return defHttp.get<PersonProductModelVO[]>({ |
|||
url: '/productManagement/personProductModel/list', |
|||
params, |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 导出个人产品模型列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function personProductModelExport(params?: PersonProductModelQuery) { |
|||
return commonExport('/productManagement/personProductModel/export', params ?? {}); |
|||
} |
|||
|
|||
/** |
|||
* 查询个人产品模型详细 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function personProductModelInfo(id: ID) { |
|||
return defHttp.get<PersonProductModelVO>({ url: '/productManagement/personProductModel/' + id }); |
|||
} |
|||
|
|||
/** |
|||
* 新增个人产品模型 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function personProductModelAdd(data: PersonProductModelForm) { |
|||
return defHttp.postWithMsg<void>({ url: '/productManagement/personProductModel', data }); |
|||
} |
|||
|
|||
/** |
|||
* 更新个人产品模型 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function personProductModelUpdate(data: PersonProductModelForm) { |
|||
return defHttp.putWithMsg<void>({ url: '/productManagement/personProductModel', data }); |
|||
} |
|||
|
|||
/** |
|||
* 删除个人产品模型 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function personProductModelRemove(id: ID | IDS) { |
|||
return defHttp.deleteWithMsg<void>({ url: '/productManagement/personProductModel/' + id }); |
|||
} |
@ -0,0 +1,67 @@ |
|||
import { BaseEntity, PageQuery } from '@/api/base'; |
|||
|
|||
export interface PersonProductModelVO { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id: string | number; |
|||
|
|||
/** |
|||
* 个人产品指标描述 |
|||
*/ |
|||
description: string; |
|||
|
|||
/** |
|||
* 产品型号模板id |
|||
*/ |
|||
productModelTemplateId: string | number; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary: string; |
|||
} |
|||
|
|||
export interface PersonProductModelForm extends BaseEntity { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id?: string | number; |
|||
|
|||
/** |
|||
* 个人产品指标描述 |
|||
*/ |
|||
description?: string; |
|||
|
|||
/** |
|||
* 产品型号模板id |
|||
*/ |
|||
productModelTemplateId?: string | number; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary?: string; |
|||
} |
|||
|
|||
export interface PersonProductModelQuery extends PageQuery { |
|||
/** |
|||
* 个人产品指标描述 |
|||
*/ |
|||
description?: string; |
|||
|
|||
/** |
|||
* 产品型号模板id |
|||
*/ |
|||
productModelTemplateId?: string | number; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary?: string; |
|||
|
|||
/** |
|||
* 日期范围参数 |
|||
*/ |
|||
params?: any; |
|||
} |
@ -0,0 +1,66 @@ |
|||
import { defHttp } from '@/utils/http/axios'; |
|||
import { ID, IDS, commonExport } from '@/api/base'; |
|||
import { |
|||
PersonProductModelDetailsVO, |
|||
PersonProductModelDetailsForm, |
|||
PersonProductModelDetailsQuery, |
|||
} from './model'; |
|||
|
|||
/** |
|||
* 查询个人产品模型详情列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function personProductModelDetailsList(params?: PersonProductModelDetailsQuery) { |
|||
return defHttp.get<PersonProductModelDetailsVO[]>({ |
|||
url: '/productManagement/personProductModelDetails/list', |
|||
params, |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 导出个人产品模型详情列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function personProductModelDetailsExport(params?: PersonProductModelDetailsQuery) { |
|||
return commonExport('/productManagement/personProductModelDetails/export', params ?? {}); |
|||
} |
|||
|
|||
/** |
|||
* 查询个人产品模型详情详细 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function personProductModelDetailsInfo(id: ID) { |
|||
return defHttp.get<PersonProductModelDetailsVO>({ |
|||
url: '/productManagement/personProductModelDetails/' + id, |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 新增个人产品模型详情 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function personProductModelDetailsAdd(data: PersonProductModelDetailsForm) { |
|||
return defHttp.postWithMsg<void>({ url: '/productManagement/personProductModelDetails', data }); |
|||
} |
|||
|
|||
/** |
|||
* 更新个人产品模型详情 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function personProductModelDetailsUpdate(data: PersonProductModelDetailsForm) { |
|||
return defHttp.putWithMsg<void>({ url: '/productManagement/personProductModelDetails', data }); |
|||
} |
|||
|
|||
/** |
|||
* 删除个人产品模型详情 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function personProductModelDetailsRemove(id: ID | IDS) { |
|||
return defHttp.deleteWithMsg<void>({ url: '/productManagement/personProductModelDetails/' + id }); |
|||
} |
@ -0,0 +1,97 @@ |
|||
import { BaseEntity, PageQuery } from '@/api/base'; |
|||
|
|||
export interface PersonProductModelDetailsVO { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id: string | number; |
|||
|
|||
/** |
|||
* 个人产品型号表id |
|||
*/ |
|||
modelId: string | number; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
paramName: string; |
|||
|
|||
/** |
|||
* 指标参数 |
|||
*/ |
|||
parameterValue: string; |
|||
|
|||
/** |
|||
* 是否关键指标 |
|||
*/ |
|||
isKeyParameter: string; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary: string; |
|||
} |
|||
|
|||
export interface PersonProductModelDetailsForm extends BaseEntity { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id?: string | number; |
|||
|
|||
/** |
|||
* 个人产品型号表id |
|||
*/ |
|||
modelId?: string | number; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
paramName?: string; |
|||
|
|||
/** |
|||
* 指标参数 |
|||
*/ |
|||
parameterValue?: string; |
|||
|
|||
/** |
|||
* 是否关键指标 |
|||
*/ |
|||
isKeyParameter?: string; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary?: string; |
|||
} |
|||
|
|||
export interface PersonProductModelDetailsQuery extends PageQuery { |
|||
/** |
|||
* 个人产品型号表id |
|||
*/ |
|||
modelId?: string | number; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
paramName?: string; |
|||
|
|||
/** |
|||
* 指标参数 |
|||
*/ |
|||
parameterValue?: string; |
|||
|
|||
/** |
|||
* 是否关键指标 |
|||
*/ |
|||
isKeyParameter?: string; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary?: string; |
|||
|
|||
/** |
|||
* 日期范围参数 |
|||
*/ |
|||
params?: any; |
|||
} |
@ -0,0 +1,57 @@ |
|||
import { defHttp } from '@/utils/http/axios'; |
|||
import { ID, IDS, commonExport } from '@/api/base'; |
|||
import { PersonProductsVO, PersonProductsForm, PersonProductsQuery } from './model'; |
|||
|
|||
/** |
|||
* 查询个人产品管理列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function personProductsList(params?: PersonProductsQuery) { |
|||
return defHttp.get<PersonProductsVO[]>({ url: '/productManagement/personProducts/list', params }); |
|||
} |
|||
|
|||
/** |
|||
* 导出个人产品管理列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function personProductsExport(params?: PersonProductsQuery) { |
|||
return commonExport('/productManagement/personProducts/export', params ?? {}); |
|||
} |
|||
|
|||
/** |
|||
* 查询个人产品管理详细 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function personProductsInfo(id: ID) { |
|||
return defHttp.get<PersonProductsVO>({ url: '/productManagement/personProducts/' + id }); |
|||
} |
|||
|
|||
/** |
|||
* 新增个人产品管理 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function personProductsAdd(data: PersonProductsForm) { |
|||
return defHttp.postWithMsg<void>({ url: '/productManagement/personProducts', data }); |
|||
} |
|||
|
|||
/** |
|||
* 更新个人产品管理 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function personProductsUpdate(data: PersonProductsForm) { |
|||
return defHttp.putWithMsg<void>({ url: '/productManagement/personProducts', data }); |
|||
} |
|||
|
|||
/** |
|||
* 删除个人产品管理 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function personProductsRemove(id: ID | IDS) { |
|||
return defHttp.deleteWithMsg<void>({ url: '/productManagement/personProducts/' + id }); |
|||
} |
@ -0,0 +1,222 @@ |
|||
import { BaseEntity, PageQuery } from '@/api/base'; |
|||
|
|||
export interface PersonProductsVO { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id: string | number; |
|||
|
|||
/** |
|||
* 供应商id |
|||
*/ |
|||
supplierInformationId: string | number; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
productName: string; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
productIdentity: string | number; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
productPrice: number; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
sourceInformation: string; |
|||
|
|||
/** |
|||
* 个人产品规格 |
|||
*/ |
|||
productSpecifications: string; |
|||
|
|||
/** |
|||
* 关联厂商产品id |
|||
*/ |
|||
supplierProductsId: string | number; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
remarks: string; |
|||
|
|||
/** |
|||
* 图片 |
|||
*/ |
|||
image: string; |
|||
|
|||
/** |
|||
* 品牌 |
|||
*/ |
|||
brand: string; |
|||
|
|||
/** |
|||
* 单位 |
|||
*/ |
|||
unit: string; |
|||
|
|||
/** |
|||
* 除税价 |
|||
*/ |
|||
exTaxPrice: number; |
|||
|
|||
/** |
|||
* 税率 |
|||
*/ |
|||
taxrate: number; |
|||
} |
|||
|
|||
export interface PersonProductsForm extends BaseEntity { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id?: string | number; |
|||
|
|||
/** |
|||
* 供应商id |
|||
*/ |
|||
supplierInformationId?: string | number; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
productName?: string; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
productIdentity?: string | number; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
productPrice?: number; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
sourceInformation?: string; |
|||
|
|||
/** |
|||
* 个人产品规格 |
|||
*/ |
|||
productSpecifications?: string; |
|||
|
|||
/** |
|||
* 关联厂商产品id |
|||
*/ |
|||
supplierProductsId?: string | number; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
remarks?: string; |
|||
|
|||
/** |
|||
* 图片 |
|||
*/ |
|||
image?: string; |
|||
|
|||
/** |
|||
* 品牌 |
|||
*/ |
|||
brand?: string; |
|||
|
|||
/** |
|||
* 单位 |
|||
*/ |
|||
unit?: string; |
|||
|
|||
/** |
|||
* 除税价 |
|||
*/ |
|||
exTaxPrice?: number; |
|||
|
|||
/** |
|||
* 税率 |
|||
*/ |
|||
taxrate?: number; |
|||
|
|||
/** |
|||
* 分类id |
|||
*/ |
|||
categoryId?: string | number; |
|||
|
|||
/** |
|||
* 型号id |
|||
*/ |
|||
modelId?: string | number; |
|||
} |
|||
|
|||
export interface PersonProductsQuery extends PageQuery { |
|||
/** |
|||
* 供应商id |
|||
*/ |
|||
supplierInformationId?: string | number; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
productName?: string; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
productIdentity?: string | number; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
productPrice?: number; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
sourceInformation?: string; |
|||
|
|||
/** |
|||
* 个人产品规格 |
|||
*/ |
|||
productSpecifications?: string; |
|||
|
|||
/** |
|||
* 关联厂商产品id |
|||
*/ |
|||
supplierProductsId?: string | number; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
remarks?: string; |
|||
|
|||
/** |
|||
* 品牌 |
|||
*/ |
|||
brand?: string; |
|||
|
|||
/** |
|||
* 单位 |
|||
*/ |
|||
unit?: string; |
|||
|
|||
/** |
|||
* 除税价 |
|||
*/ |
|||
exTaxPrice?: number; |
|||
|
|||
/** |
|||
* 税率 |
|||
*/ |
|||
taxrate?: number; |
|||
|
|||
/** |
|||
* 日期范围参数 |
|||
*/ |
|||
params?: any; |
|||
} |
@ -0,0 +1,89 @@ |
|||
import { defHttp } from '@/utils/http/axios'; |
|||
import { ID, IDS, commonExport } from '@/api/base'; |
|||
import { |
|||
SupplierProductModelVO, |
|||
SupplierProductModelForm, |
|||
SupplierProductModelQuery, |
|||
} from './model'; |
|||
import { SupplierProductModelDetailsVO } from './supplierProductModelDetails/model'; |
|||
|
|||
export function supplierProductGetModelDetails(id: ID) { |
|||
return defHttp.get<SupplierProductModelDetailsVO[]>({ |
|||
url: '/productManagement/supplierProductModel/getModelDetails/' + id, |
|||
}); |
|||
} |
|||
/** |
|||
* 新增个人产品模型 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function addSupplierProductModel(data: SupplierProductModelForm) { |
|||
return defHttp.post<string>({ url: '/productManagement/supplierProductModel/addModel', data }); |
|||
} |
|||
|
|||
/** |
|||
* 更新个人产品模型 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function updateSupplierProductModel(data: SupplierProductModelForm) { |
|||
return defHttp.put<string>({ url: '/productManagement/supplierProductModel/editModel', data }); |
|||
} |
|||
/** |
|||
* 查询供应商产品模型列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function supplierProductModelList(params?: SupplierProductModelQuery) { |
|||
return defHttp.get<SupplierProductModelVO[]>({ |
|||
url: '/productManagement/supplierProductModel/list', |
|||
params, |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 导出供应商产品模型列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function supplierProductModelExport(params?: SupplierProductModelQuery) { |
|||
return commonExport('/productManagement/supplierProductModel/export', params ?? {}); |
|||
} |
|||
|
|||
/** |
|||
* 查询供应商产品模型详细 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function supplierProductModelInfo(id: ID) { |
|||
return defHttp.get<SupplierProductModelVO>({ |
|||
url: '/productManagement/supplierProductModel/' + id, |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 新增供应商产品模型 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function supplierProductModelAdd(data: SupplierProductModelForm) { |
|||
return defHttp.postWithMsg<void>({ url: '/productManagement/supplierProductModel', data }); |
|||
} |
|||
|
|||
/** |
|||
* 更新供应商产品模型 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function supplierProductModelUpdate(data: SupplierProductModelForm) { |
|||
return defHttp.putWithMsg<void>({ url: '/productManagement/supplierProductModel', data }); |
|||
} |
|||
|
|||
/** |
|||
* 删除供应商产品模型 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function supplierProductModelRemove(id: ID | IDS) { |
|||
return defHttp.deleteWithMsg<void>({ url: '/productManagement/supplierProductModel/' + id }); |
|||
} |
@ -0,0 +1,67 @@ |
|||
import { BaseEntity, PageQuery } from '@/api/base'; |
|||
|
|||
export interface SupplierProductModelVO { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id: string | number; |
|||
|
|||
/** |
|||
* 供应商产品指标描述 |
|||
*/ |
|||
description: string; |
|||
|
|||
/** |
|||
* 产品型号模板id |
|||
*/ |
|||
productModelTemplateId: string | number; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary: string; |
|||
} |
|||
|
|||
export interface SupplierProductModelForm extends BaseEntity { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id?: string | number; |
|||
|
|||
/** |
|||
* 供应商产品指标描述 |
|||
*/ |
|||
description?: string; |
|||
|
|||
/** |
|||
* 产品型号模板id |
|||
*/ |
|||
productModelTemplateId?: string | number; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary?: string; |
|||
} |
|||
|
|||
export interface SupplierProductModelQuery extends PageQuery { |
|||
/** |
|||
* 供应商产品指标描述 |
|||
*/ |
|||
description?: string; |
|||
|
|||
/** |
|||
* 产品型号模板id |
|||
*/ |
|||
productModelTemplateId?: string | number; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary?: string; |
|||
|
|||
/** |
|||
* 日期范围参数 |
|||
*/ |
|||
params?: any; |
|||
} |
@ -0,0 +1,68 @@ |
|||
import { defHttp } from '@/utils/http/axios'; |
|||
import { ID, IDS, commonExport } from '@/api/base'; |
|||
import { |
|||
SupplierProductModelDetailsVO, |
|||
SupplierProductModelDetailsForm, |
|||
SupplierProductModelDetailsQuery, |
|||
} from './model'; |
|||
|
|||
/** |
|||
* 查询供应商产品模型详细列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function supplierProductModelDetailsList(params?: SupplierProductModelDetailsQuery) { |
|||
return defHttp.get<SupplierProductModelDetailsVO[]>({ |
|||
url: '/productManagement/supplierProductModelDetails/list', |
|||
params, |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 导出供应商产品模型详细列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function supplierProductModelDetailsExport(params?: SupplierProductModelDetailsQuery) { |
|||
return commonExport('/productManagement/supplierProductModelDetails/export', params ?? {}); |
|||
} |
|||
|
|||
/** |
|||
* 查询供应商产品模型详细详细 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function supplierProductModelDetailsInfo(id: ID) { |
|||
return defHttp.get<SupplierProductModelDetailsVO>({ |
|||
url: '/productManagement/supplierProductModelDetails/' + id, |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 新增供应商产品模型详细 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function supplierProductModelDetailsAdd(data: SupplierProductModelDetailsForm) { |
|||
return defHttp.postWithMsg<void>({ url: '/productManagement/supplierProductModelDetails', data }); |
|||
} |
|||
|
|||
/** |
|||
* 更新供应商产品模型详细 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function supplierProductModelDetailsUpdate(data: SupplierProductModelDetailsForm) { |
|||
return defHttp.putWithMsg<void>({ url: '/productManagement/supplierProductModelDetails', data }); |
|||
} |
|||
|
|||
/** |
|||
* 删除供应商产品模型详细 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function supplierProductModelDetailsRemove(id: ID | IDS) { |
|||
return defHttp.deleteWithMsg<void>({ |
|||
url: '/productManagement/supplierProductModelDetails/' + id, |
|||
}); |
|||
} |
@ -0,0 +1,97 @@ |
|||
import { BaseEntity, PageQuery } from '@/api/base'; |
|||
|
|||
export interface SupplierProductModelDetailsVO { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id: string | number; |
|||
|
|||
/** |
|||
* 供应商产品型号表id |
|||
*/ |
|||
modelId: string | number; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
paramName: string; |
|||
|
|||
/** |
|||
* 指标参数 |
|||
*/ |
|||
parameterValue: string; |
|||
|
|||
/** |
|||
* 是否关键指标 |
|||
*/ |
|||
isKeyParameter: string; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary: string; |
|||
} |
|||
|
|||
export interface SupplierProductModelDetailsForm extends BaseEntity { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id?: string | number; |
|||
|
|||
/** |
|||
* 供应商产品型号表id |
|||
*/ |
|||
modelId?: string | number; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
paramName?: string; |
|||
|
|||
/** |
|||
* 指标参数 |
|||
*/ |
|||
parameterValue?: string; |
|||
|
|||
/** |
|||
* 是否关键指标 |
|||
*/ |
|||
isKeyParameter?: string; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary?: string; |
|||
} |
|||
|
|||
export interface SupplierProductModelDetailsQuery extends PageQuery { |
|||
/** |
|||
* 供应商产品型号表id |
|||
*/ |
|||
modelId?: string | number; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
paramName?: string; |
|||
|
|||
/** |
|||
* 指标参数 |
|||
*/ |
|||
parameterValue?: string; |
|||
|
|||
/** |
|||
* 是否关键指标 |
|||
*/ |
|||
isKeyParameter?: string; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
isTemporary?: string; |
|||
|
|||
/** |
|||
* 日期范围参数 |
|||
*/ |
|||
params?: any; |
|||
} |
@ -0,0 +1,60 @@ |
|||
import { defHttp } from '@/utils/http/axios'; |
|||
import { ID, IDS, commonExport } from '@/api/base'; |
|||
import { SupplierProductsVO, SupplierProductsForm, SupplierProductsQuery } from './model'; |
|||
|
|||
/** |
|||
* 查询供应商产品管理列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function supplierProductsList(params?: SupplierProductsQuery) { |
|||
return defHttp.get<SupplierProductsVO[]>({ |
|||
url: '/productManagement/supplierProducts/list', |
|||
params, |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 导出供应商产品管理列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function supplierProductsExport(params?: SupplierProductsQuery) { |
|||
return commonExport('/productManagement/supplierProducts/export', params ?? {}); |
|||
} |
|||
|
|||
/** |
|||
* 查询供应商产品管理详细 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function supplierProductsInfo(id: ID) { |
|||
return defHttp.get<SupplierProductsVO>({ url: '/productManagement/supplierProducts/' + id }); |
|||
} |
|||
|
|||
/** |
|||
* 新增供应商产品管理 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function supplierProductsAdd(data: SupplierProductsForm) { |
|||
return defHttp.postWithMsg<void>({ url: '/productManagement/supplierProducts', data }); |
|||
} |
|||
|
|||
/** |
|||
* 更新供应商产品管理 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function supplierProductsUpdate(data: SupplierProductsForm) { |
|||
return defHttp.putWithMsg<void>({ url: '/productManagement/supplierProducts', data }); |
|||
} |
|||
|
|||
/** |
|||
* 删除供应商产品管理 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function supplierProductsRemove(id: ID | IDS) { |
|||
return defHttp.deleteWithMsg<void>({ url: '/productManagement/supplierProducts/' + id }); |
|||
} |
@ -0,0 +1,222 @@ |
|||
import { BaseEntity, PageQuery } from '@/api/base'; |
|||
|
|||
export interface SupplierProductsVO { |
|||
/** |
|||
* 供应商id |
|||
*/ |
|||
supplierInformationId: string | number; |
|||
|
|||
/** |
|||
* 供应商产品规格 |
|||
*/ |
|||
productSpecifications: string; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
productName: string; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
productIdentity: string | number; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
productPrice: number; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
sourceInformation: string; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
remarks: string; |
|||
|
|||
/** |
|||
* 图片 |
|||
*/ |
|||
image: string; |
|||
|
|||
/** |
|||
* 品牌 |
|||
*/ |
|||
brand: string; |
|||
|
|||
/** |
|||
* 单位 |
|||
*/ |
|||
unit: string; |
|||
|
|||
/** |
|||
* 除税价 |
|||
*/ |
|||
exTaxPrice: number; |
|||
|
|||
/** |
|||
* 税率 |
|||
*/ |
|||
taxrate: number; |
|||
|
|||
/** |
|||
* 分类id |
|||
*/ |
|||
categoryId: string | number; |
|||
|
|||
/** |
|||
* 型号id |
|||
*/ |
|||
modelId: string | number; |
|||
} |
|||
|
|||
export interface SupplierProductsForm extends BaseEntity { |
|||
/** |
|||
* 供应商id |
|||
*/ |
|||
supplierInformationId?: string | number; |
|||
|
|||
/** |
|||
* 供应商产品规格 |
|||
*/ |
|||
productSpecifications?: string; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
productName?: string; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
productIdentity?: string | number; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
productPrice?: number; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
sourceInformation?: string; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
remarks?: string; |
|||
|
|||
/** |
|||
* 图片 |
|||
*/ |
|||
image?: string; |
|||
|
|||
/** |
|||
* 品牌 |
|||
*/ |
|||
brand?: string; |
|||
|
|||
/** |
|||
* 单位 |
|||
*/ |
|||
unit?: string; |
|||
|
|||
/** |
|||
* 除税价 |
|||
*/ |
|||
exTaxPrice?: number; |
|||
|
|||
/** |
|||
* 税率 |
|||
*/ |
|||
taxrate?: number; |
|||
|
|||
/** |
|||
* 分类id |
|||
*/ |
|||
categoryId?: string | number; |
|||
|
|||
/** |
|||
* 型号id |
|||
*/ |
|||
modelId?: string | number; |
|||
} |
|||
|
|||
export interface SupplierProductsQuery extends PageQuery { |
|||
/** |
|||
* 供应商id |
|||
*/ |
|||
supplierInformationId?: string | number; |
|||
|
|||
/** |
|||
* 供应商产品规格 |
|||
*/ |
|||
productSpecifications?: string; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
productName?: string; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
productIdentity?: string | number; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
productPrice?: number; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
sourceInformation?: string; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
remarks?: string; |
|||
|
|||
/** |
|||
* 图片 |
|||
*/ |
|||
image?: string; |
|||
|
|||
/** |
|||
* 品牌 |
|||
*/ |
|||
brand?: string; |
|||
|
|||
/** |
|||
* 单位 |
|||
*/ |
|||
unit?: string; |
|||
|
|||
/** |
|||
* 除税价 |
|||
*/ |
|||
exTaxPrice?: number; |
|||
|
|||
/** |
|||
* 税率 |
|||
*/ |
|||
taxrate?: number; |
|||
|
|||
/** |
|||
* 分类id |
|||
*/ |
|||
categoryId?: string | number; |
|||
|
|||
/** |
|||
* 型号id |
|||
*/ |
|||
modelId?: string | number; |
|||
|
|||
/** |
|||
* 日期范围参数 |
|||
*/ |
|||
params?: any; |
|||
} |
@ -0,0 +1,62 @@ |
|||
import { defHttp } from '@/utils/http/axios'; |
|||
import { ID, IDS, commonExport } from '@/api/base'; |
|||
import { SupplierInformationVO, SupplierInformationForm, SupplierInformationQuery } from './model'; |
|||
|
|||
/** |
|||
* 查询供应商信息管理列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function supplierInformationList(params?: SupplierInformationQuery) { |
|||
return defHttp.get<SupplierInformationVO[]>({ |
|||
url: '/productManagement/supplierInformation/list', |
|||
params, |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 导出供应商信息管理列表 |
|||
* @param params |
|||
* @returns |
|||
*/ |
|||
export function supplierInformationExport(params?: SupplierInformationQuery) { |
|||
return commonExport('/productManagement/supplierInformation/export', params ?? {}); |
|||
} |
|||
|
|||
/** |
|||
* 查询供应商信息管理详细 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function supplierInformationInfo(id: ID) { |
|||
return defHttp.get<SupplierInformationVO>({ |
|||
url: '/productManagement/supplierInformation/' + id, |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* 新增供应商信息管理 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function supplierInformationAdd(data: SupplierInformationForm) { |
|||
return defHttp.postWithMsg<void>({ url: '/productManagement/supplierInformation', data }); |
|||
} |
|||
|
|||
/** |
|||
* 更新供应商信息管理 |
|||
* @param data |
|||
* @returns |
|||
*/ |
|||
export function supplierInformationUpdate(data: SupplierInformationForm) { |
|||
return defHttp.putWithMsg<void>({ url: '/productManagement/supplierInformation', data }); |
|||
} |
|||
|
|||
/** |
|||
* 删除供应商信息管理 |
|||
* @param id id |
|||
* @returns |
|||
*/ |
|||
export function supplierInformationRemove(id: ID | IDS) { |
|||
return defHttp.deleteWithMsg<void>({ url: '/productManagement/supplierInformation/' + id }); |
|||
} |
@ -0,0 +1,97 @@ |
|||
import { BaseEntity, PageQuery } from '@/api/base'; |
|||
|
|||
export interface SupplierInformationVO { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id: string | number; |
|||
|
|||
/** |
|||
* 供应商名称 |
|||
*/ |
|||
supplierName: string; |
|||
|
|||
/** |
|||
* 供应商联系人 |
|||
*/ |
|||
supplierContacts: string; |
|||
|
|||
/** |
|||
* 职位 |
|||
*/ |
|||
position: string; |
|||
|
|||
/** |
|||
* 供应商联系电话 |
|||
*/ |
|||
supplierContactsPhone: string; |
|||
|
|||
/** |
|||
* 供应商类型 |
|||
*/ |
|||
supplierType: string; |
|||
} |
|||
|
|||
export interface SupplierInformationForm extends BaseEntity { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
id?: string | number; |
|||
|
|||
/** |
|||
* 供应商名称 |
|||
*/ |
|||
supplierName?: string; |
|||
|
|||
/** |
|||
* 供应商联系人 |
|||
*/ |
|||
supplierContacts?: string; |
|||
|
|||
/** |
|||
* 职位 |
|||
*/ |
|||
position?: string; |
|||
|
|||
/** |
|||
* 供应商联系电话 |
|||
*/ |
|||
supplierContactsPhone?: string; |
|||
|
|||
/** |
|||
* 供应商类型 |
|||
*/ |
|||
supplierType?: string; |
|||
} |
|||
|
|||
export interface SupplierInformationQuery extends PageQuery { |
|||
/** |
|||
* 供应商名称 |
|||
*/ |
|||
supplierName?: string; |
|||
|
|||
/** |
|||
* 供应商联系人 |
|||
*/ |
|||
supplierContacts?: string; |
|||
|
|||
/** |
|||
* 职位 |
|||
*/ |
|||
position?: string; |
|||
|
|||
/** |
|||
* 供应商联系电话 |
|||
*/ |
|||
supplierContactsPhone?: string; |
|||
|
|||
/** |
|||
* 供应商类型 |
|||
*/ |
|||
supplierType?: string; |
|||
|
|||
/** |
|||
* 日期范围参数 |
|||
*/ |
|||
params?: any; |
|||
} |
@ -0,0 +1,234 @@ |
|||
<template> |
|||
<div> |
|||
<Upload |
|||
v-bind="$attrs" |
|||
v-model:file-list="fileList" |
|||
:list-type="listType" |
|||
:accept="getStringAccept" |
|||
:multiple="multiple" |
|||
:maxCount="maxNumber" |
|||
:before-upload="beforeUpload" |
|||
:custom-request="request" |
|||
:disabled="disabled" |
|||
@preview="handlePreview" |
|||
@remove="handleRemove" |
|||
> |
|||
<div v-if="fileList && fileList.length < maxNumber"> |
|||
<plus-outlined /> |
|||
<div style="margin-top: 8px">{{ t('component.upload.upload') }}</div> |
|||
</div> |
|||
</Upload> |
|||
<Modal :open="previewOpen" :title="previewTitle" :footer="null" @cancel="handleCancel"> |
|||
<img alt="" style="width: 100%" :src="previewImage" /> |
|||
</Modal> |
|||
</div> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, toRefs, watch } from 'vue'; |
|||
import { PlusOutlined } from '@ant-design/icons-vue'; |
|||
import type { UploadFile, UploadProps } from 'ant-design-vue'; |
|||
import { Modal, Upload } from 'ant-design-vue'; |
|||
import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface'; |
|||
import { useMessage } from '@/hooks/web/useMessage'; |
|||
import { isArray, isFunction, isObject, isString } from '@/utils/is'; |
|||
import { warn } from '@/utils/log'; |
|||
import { useI18n } from '@/hooks/web/useI18n'; |
|||
import { useUploadType } from '../hooks/useUpload'; |
|||
import { uploadContainerProps } from '../props'; |
|||
import { checkFileType } from '../helper'; |
|||
import { UploadResultStatus } from '@/components/Upload/src/types/typing'; |
|||
import { get, omit } from 'lodash-es'; |
|||
|
|||
defineOptions({ name: 'ImageUpload' }); |
|||
|
|||
const emit = defineEmits(['change', 'update:value', 'delete']); |
|||
const props = defineProps({ |
|||
...omit(uploadContainerProps, ['previewColumns', 'beforePreviewData']), |
|||
}); |
|||
const { t } = useI18n(); |
|||
const { createMessage } = useMessage(); |
|||
const { accept, helpText, maxNumber, maxSize } = toRefs(props); |
|||
const isInnerOperate = ref<boolean>(false); |
|||
const { getStringAccept } = useUploadType({ |
|||
acceptRef: accept, |
|||
helpTextRef: helpText, |
|||
maxNumberRef: maxNumber, |
|||
maxSizeRef: maxSize, |
|||
}); |
|||
const previewOpen = ref<boolean>(false); |
|||
const previewImage = ref<string>(''); |
|||
const previewTitle = ref<string>(''); |
|||
|
|||
const fileList = ref<UploadProps['fileList']>([]); |
|||
const isLtMsg = ref<boolean>(true); |
|||
const isActMsg = ref<boolean>(true); |
|||
const isFirstRender = ref<boolean>(true); |
|||
let fileData = ref() |
|||
watch( |
|||
() => props.value, |
|||
(v) => { |
|||
if (isInnerOperate.value) { |
|||
isInnerOperate.value = false; |
|||
return; |
|||
} |
|||
let value: string[] = []; |
|||
if (v) { |
|||
if (isArray(v)) { |
|||
value = v; |
|||
} else { |
|||
value.push(v); |
|||
} |
|||
fileList.value = value.map((item, i) => { |
|||
if (item && isString(item)) { |
|||
return { |
|||
uid: -i + '', |
|||
name: item.substring(item.lastIndexOf('/') + 1), |
|||
status: 'done', |
|||
url: item, |
|||
}; |
|||
} else if (item && isObject(item)) { |
|||
return item; |
|||
} else { |
|||
return; |
|||
} |
|||
}) as UploadProps['fileList']; |
|||
} |
|||
emit('update:value', value); |
|||
if (!isFirstRender.value) { |
|||
emit('change', value); |
|||
isFirstRender.value = false; |
|||
} |
|||
}, |
|||
{ |
|||
immediate: true, |
|||
deep: true, |
|||
}, |
|||
); |
|||
|
|||
function getBase64<T extends string | ArrayBuffer | null>(file: File) { |
|||
return new Promise<T>((resolve, reject) => { |
|||
const reader = new FileReader(); |
|||
reader.readAsDataURL(file); |
|||
reader.onload = () => { |
|||
resolve(reader.result as T); |
|||
}; |
|||
reader.onerror = (error) => reject(error); |
|||
}); |
|||
} |
|||
|
|||
const handlePreview = async (file: UploadFile) => { |
|||
if (!file.url && !file.preview) { |
|||
file.preview = await getBase64<string>(file.originFileObj!); |
|||
} |
|||
previewImage.value = file.url || file.preview || ''; |
|||
previewOpen.value = true; |
|||
previewTitle.value = |
|||
file.name || previewImage.value.substring(previewImage.value.lastIndexOf('/') + 1); |
|||
}; |
|||
|
|||
const handleRemove = async (file: UploadFile) => { |
|||
if (fileList.value) { |
|||
const index = fileList.value.findIndex((item) => item.uid === file.uid); |
|||
index !== -1 && fileList.value.splice(index, 1); |
|||
const value = getValue(); |
|||
isInnerOperate.value = true; |
|||
emit('update:value', value); |
|||
emit('change', value); |
|||
emit('delete', file); |
|||
} |
|||
}; |
|||
|
|||
const handleCancel = () => { |
|||
previewOpen.value = false; |
|||
previewTitle.value = ''; |
|||
}; |
|||
|
|||
const beforeUpload = (file: File) => { |
|||
const { maxSize, accept } = props; |
|||
const isAct = checkFileType(file, accept); |
|||
if (!isAct) { |
|||
createMessage.error(t('component.upload.acceptUpload', [accept])); |
|||
isActMsg.value = false; |
|||
// 防止弹出多个错误提示 |
|||
setTimeout(() => (isActMsg.value = true), 1000); |
|||
} |
|||
const isLt = file.size / 1024 / 1024 > maxSize; |
|||
if (isLt) { |
|||
createMessage.error(t('component.upload.maxSizeMultiple', [maxSize])); |
|||
isLtMsg.value = false; |
|||
// 防止弹出多个错误提示 |
|||
setTimeout(() => (isLtMsg.value = true), 1000); |
|||
} |
|||
return (isAct && !isLt) || Upload.LIST_IGNORE; |
|||
}; |
|||
async function request(info: UploadRequestOption<any>) { |
|||
fileData.value=info |
|||
isInnerOperate.value = true; |
|||
const value = getValue(); |
|||
let a= fileList.value |
|||
emit('update:value', a); |
|||
emit('change', value); |
|||
} |
|||
function submit(){ |
|||
customRequest(fileData.value) |
|||
} |
|||
async function customRequest(info: UploadRequestOption<any>) { |
|||
const { api, uploadParams = {}, name, filename, resultField } = props; |
|||
if (!api || !isFunction(api)) { |
|||
return warn('upload api must exist and be a function'); |
|||
} |
|||
try { |
|||
const res = await api?.({ |
|||
data: { |
|||
...uploadParams, |
|||
}, |
|||
file: info.file, |
|||
name: name, |
|||
filename: filename, |
|||
}); |
|||
if (props.resultField) { |
|||
let result = get(res, resultField); |
|||
info.onSuccess!(result); |
|||
} else { |
|||
// 不传入 resultField 的情况 |
|||
info.onSuccess!(res); |
|||
} |
|||
const value = getValue(); |
|||
isInnerOperate.value = true; |
|||
emit('update:value', value); |
|||
emit('change', value); |
|||
} catch (e: any) { |
|||
console.log(e); |
|||
info.onError!(e); |
|||
} |
|||
} |
|||
|
|||
function getValue() { |
|||
const list = (fileList.value || []) |
|||
.filter((item) => item?.status === UploadResultStatus.DONE) |
|||
.map((item: any) => { |
|||
if (item?.response && props?.resultField) { |
|||
return item?.response; |
|||
} |
|||
//注意这里取的key为 url |
|||
return item?.url || item?.response?.url; |
|||
}); |
|||
return list; |
|||
} |
|||
defineExpose({ |
|||
submit |
|||
}); |
|||
</script> |
|||
|
|||
<style lang="less"> |
|||
.ant-upload-select-picture-card i { |
|||
color: #999; |
|||
font-size: 32px; |
|||
} |
|||
|
|||
.ant-upload-select-picture-card .ant-upload-text { |
|||
margin-top: 8px; |
|||
color: #666; |
|||
} |
|||
</style> |
@ -0,0 +1,261 @@ |
|||
<template> |
|||
<BasicModal |
|||
v-bind="$attrs" |
|||
:title="title" |
|||
@register="registerInnerModal" |
|||
@ok="handleSubmit" |
|||
@cancel="resetForm" |
|||
width="80%" |
|||
> |
|||
<Form ref="formRef" :model="entityData" :label-col="{ span: 2 }" :rules="formRules"> |
|||
<!--表单区域 --> |
|||
<FormItem label="项目名称" name="projectName"> |
|||
<a-input v-model:value="entityData.projectName" /> |
|||
</FormItem> |
|||
<FormItem label="总投资" name="totalInvestment"> |
|||
<a-input type="number" v-model:value="entityData.totalInvestment" disabled /> |
|||
</FormItem> |
|||
</Form> |
|||
<!--表格区域--> |
|||
<BasicTable @register="registerTable"> |
|||
<template #toolbar> |
|||
<a-button type="primary" @click="handleAdd" v-auth="'productManagement:costItemDetail:add'" |
|||
>新增</a-button |
|||
> |
|||
</template> |
|||
<template #bodyCell="{ column, record }"> |
|||
<template v-if="column.key === 'action'"> |
|||
<TableAction |
|||
stopButtonPropagation |
|||
:actions="[ |
|||
{ |
|||
label: '新增子项', |
|||
icon: IconEnum.ADD, |
|||
type: 'primary', |
|||
ghost: true, |
|||
auth: 'productManagement:costItemDetail:add', |
|||
onClick: handleAddChild.bind(null, record), |
|||
}, |
|||
{ |
|||
label: '修改', |
|||
icon: IconEnum.EDIT, |
|||
type: 'primary', |
|||
ghost: true, |
|||
auth: 'productManagement:costItemDetail:edit', |
|||
onClick: handleEdit.bind(null, record), |
|||
}, |
|||
]" |
|||
:dropDownActions="[ |
|||
{ |
|||
label: '删除', |
|||
icon: IconEnum.DELETE, |
|||
type: 'primary', |
|||
danger: true, |
|||
ghost: true, |
|||
auth: 'productManagement:costItemDetail:remove', |
|||
onClick: handleDelete.bind(null, record), |
|||
}, |
|||
]" |
|||
/> |
|||
</template> |
|||
</template> |
|||
</BasicTable> |
|||
<CostItemDetailModal @register="registerModal" @reload="reload" @getFormData="getFormData" /> |
|||
</BasicModal> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { BasicTable, useTable, TableAction } from '@/components/Table'; |
|||
import { computed, reactive, ref, unref } from 'vue'; |
|||
import { BasicModal, useModalInner, useModal } from '@/components/Modal'; |
|||
import { |
|||
costTableInfo, |
|||
modifyCostTable, |
|||
addCostTable, |
|||
} from '@/api/zaojiaManagement/productManagement/costTable'; |
|||
import { IconEnum } from '@/enums/appEnum'; |
|||
import { FormItem, Form } from 'ant-design-vue'; |
|||
import { detailColumns } from './components/costItemDetail.data'; |
|||
import { buildUUID } from '@/utils/uuid'; |
|||
|
|||
import CostItemDetailModal from './components/CostItemDetailModal.vue'; |
|||
const emit = defineEmits(['register', 'reload']); |
|||
const currentRow = ref<Recordable>([]); |
|||
const isUpdate = ref<boolean>(false); |
|||
const formRef = ref(null); |
|||
const entityData = reactive({ |
|||
id: '', |
|||
projectName: '', |
|||
totalInvestment: 0 as number, |
|||
costItemDetailList: [], |
|||
}); |
|||
const title = computed<string>(() => { |
|||
return isUpdate.value ? '编辑造价编制信息' : '新增造价编制信息'; |
|||
}); |
|||
const [registerModal, { openModal }] = useModal(); |
|||
const [registerInnerModal, { modalLoading, closeModal }] = useModalInner( |
|||
async (data: { record?: Recordable; update: boolean }) => { |
|||
modalLoading(true); |
|||
const { record, update } = data; |
|||
isUpdate.value = update; |
|||
if (update && record) { |
|||
const ret = await costTableInfo(record.id); |
|||
entityData.id = ret.id as string; |
|||
entityData.projectName = ret.projectName; |
|||
entityData.totalInvestment = ret.totalInvestment; |
|||
setTableData(ret.costItemDetailList); |
|||
removeEmptyChildren(ret.costItemDetailList); |
|||
//表格数据加载 |
|||
// await setFieldsValue(ret); |
|||
} else { |
|||
entityData.id = buildUUID(); |
|||
entityData.projectName = ''; |
|||
entityData.totalInvestment = 0; |
|||
setTableData([]); |
|||
} |
|||
modalLoading(false); |
|||
}, |
|||
); |
|||
|
|||
const [ |
|||
registerTable, |
|||
{ |
|||
reload, |
|||
getDataSource, |
|||
setTableData, |
|||
deleteTableDataRecord, |
|||
updateTableDataRecord, |
|||
insertTableDataRecord, |
|||
}, |
|||
] = useTable({ |
|||
title: '造价编制详情', |
|||
dataSource: [], |
|||
rowKey: 'id', |
|||
showIndexColumn: false, |
|||
useSearchForm: false, |
|||
columns: detailColumns, |
|||
actionColumn: { |
|||
width: 200, |
|||
title: '操作', |
|||
key: 'action', |
|||
fixed: 'right', |
|||
}, |
|||
}); |
|||
|
|||
const formRules = reactive({ |
|||
//前端验证规则 |
|||
projectName: [{ required: true, message: '【项目名称】不能为空', trigger: 'blur' }], |
|||
totalInvestment: [{ required: true, message: '【总投资】不能为空', trigger: 'blur' }], |
|||
}); |
|||
|
|||
function handleEdit(record) { |
|||
currentRow.value = record; |
|||
openModal(true, { record, update: true }); |
|||
} |
|||
|
|||
function handleAdd() { |
|||
openModal(true, { update: false }); |
|||
currentRow.value = []; |
|||
} |
|||
|
|||
async function handleDelete(record: Recordable) { |
|||
// await costItemDetailRemove([record.id]); |
|||
deleteTableDataRecord(record.id); |
|||
//有父类id校验父类是否还存在子类 |
|||
if (record.parentId) { |
|||
let res = getDataSource(); |
|||
removeEmptyChildren(res); |
|||
} |
|||
} |
|||
function handleAddChild(record: Recordable) { |
|||
currentRow.value = record; |
|||
openModal(true, { record, update: false }); |
|||
} |
|||
function getFormData(formData: Recordable, isChild: boolean, isUpdate: boolean) { |
|||
if (unref(isUpdate)) { |
|||
updateTableDataRecord(currentRow.value.id, formData); |
|||
//表格数据更新完成,计算金额 |
|||
updatePrice(); |
|||
return; |
|||
} |
|||
formData.costTableId = entityData.id; |
|||
if (!unref(isChild)) { |
|||
insertTableDataRecord(formData); |
|||
} else { |
|||
if (currentRow.value.children) { |
|||
currentRow.value.children.push(formData); |
|||
} else { |
|||
currentRow.value.children = [formData]; |
|||
} |
|||
updateTableDataRecord(currentRow.value.id, currentRow); |
|||
} |
|||
//表格数据更新完成,计算金额 |
|||
updatePrice(); |
|||
} |
|||
//检查父类是否还含有子类,没有子类就把children 变null |
|||
function removeEmptyChildren(obj) { |
|||
if (Array.isArray(obj)) { |
|||
for (const item of obj) { |
|||
removeEmptyChildren(item); |
|||
} |
|||
} else if (typeof obj === 'object' && obj !== null) { |
|||
if (obj.children && obj.children.length === 0) { |
|||
delete obj.children; |
|||
updateTableDataRecord(obj.id, obj); |
|||
} else if (obj.children && obj.children.length > 0) { |
|||
removeEmptyChildren(obj.children); |
|||
} |
|||
} |
|||
} |
|||
function calculateSubtotal(item) { |
|||
if (item.isDetail == '1') { |
|||
return Number(item.totalPrice); |
|||
} |
|||
let subtotal = 0; |
|||
if (item.children && item.children.length > 0) { |
|||
subtotal += item.children.reduce((acc, child) => acc + calculateSubtotal(child), 0); |
|||
} |
|||
item.totalPrice = subtotal; |
|||
if (item.children && item.children.length > 0) { |
|||
for (let i = 0; i < item.children.length; i++) { |
|||
if (item.children[i].isDetail == '0') { |
|||
//不是设备计算总价 |
|||
item.children[i].totalPrice = calculateSubtotal(item.children[i]); |
|||
} |
|||
} |
|||
} |
|||
return subtotal; |
|||
} |
|||
function updatePrice() { |
|||
entityData.totalInvestment = 0; |
|||
const tableData = getDataSource(); |
|||
if (tableData.length > 0) { |
|||
tableData.forEach((item) => { |
|||
calculateSubtotal(item); |
|||
entityData.totalInvestment += Number(item.totalPrice); |
|||
console.log('calculateSubtotal', item, entityData); |
|||
}); |
|||
} |
|||
} |
|||
async function handleSubmit() { |
|||
entityData.costItemDetailList = getDataSource(); |
|||
formRef.value |
|||
.validate() |
|||
.then(async () => { |
|||
if (unref(isUpdate)) { |
|||
await modifyCostTable(entityData); |
|||
} else { |
|||
await addCostTable(entityData); |
|||
} |
|||
emit('reload'); |
|||
closeModal(); |
|||
}) |
|||
.catch((error) => {}); |
|||
} |
|||
|
|||
function resetForm() { |
|||
closeModal(); |
|||
} |
|||
</script> |
|||
|
|||
<style></style> |
@ -0,0 +1,76 @@ |
|||
<template> |
|||
<BasicModal |
|||
v-bind="$attrs" |
|||
:title="title" |
|||
@register="registerInnerModal" |
|||
@ok="handleSubmit" |
|||
@cancel="resetForm" |
|||
> |
|||
<BasicForm @register="registerForm"> |
|||
<template #costNameSlot="{ model, field }"> |
|||
<CostTypeSelector v-model="model[field]" @updateCostInfo="updateCostInfo" /> |
|||
</template> |
|||
</BasicForm> |
|||
</BasicModal> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { BasicModal, useModalInner } from '@/components/Modal'; |
|||
import { BasicForm, useForm } from '@/components/Form'; |
|||
import { computed, ref } from 'vue'; |
|||
import { modalSchemas } from './costItemDetail.data'; |
|||
import { buildUUID } from '@/utils/uuid'; |
|||
import CostTypeSelector from './CostTypeSelector.vue'; |
|||
defineOptions({ name: 'CostItemDetailModal' }); |
|||
const emit = defineEmits(['register', 'reload', 'getFormData']); |
|||
const isChild = ref<boolean>(false); |
|||
const isUpdate = ref<boolean>(false); |
|||
const title = computed<string>(() => { |
|||
return isUpdate.value ? '编辑造价编制详情' : '新增造价编制详情'; |
|||
}); |
|||
|
|||
const [registerInnerModal, { modalLoading, closeModal }] = useModalInner( |
|||
async (data: { record?: Recordable; update: boolean }) => { |
|||
modalLoading(true); |
|||
const { record, update } = data; |
|||
isUpdate.value = update; |
|||
//更新 |
|||
if (update && record) { |
|||
await setFieldsValue(record); |
|||
} |
|||
//新增子项 |
|||
if (!update && record) { |
|||
isChild.value = true; |
|||
await setFieldsValue({ isDetail: record.isDetail, parentId: record.id }); |
|||
} else { |
|||
isChild.value = false; |
|||
} |
|||
modalLoading(false); |
|||
}, |
|||
); |
|||
|
|||
const [registerForm, { setFieldsValue, resetForm, validate }] = useForm({ |
|||
labelWidth: 100, |
|||
showActionButtonGroup: false, |
|||
baseColProps: { span: 24 }, |
|||
schemas: modalSchemas, |
|||
}); |
|||
|
|||
async function handleSubmit() { |
|||
const data = await validate(); |
|||
if (!isUpdate.value) { |
|||
data.id = buildUUID(); |
|||
} |
|||
emit('getFormData', data, isChild, isUpdate); |
|||
closeModal(); |
|||
} |
|||
function updateCostInfo(rowData) { |
|||
setFieldsValue({ |
|||
unit: rowData.unit, |
|||
unitPrice: rowData.productPrice, |
|||
costDescribe: rowData.productSpecifications, |
|||
}); |
|||
} |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,151 @@ |
|||
<template> |
|||
<PageWrapper dense> |
|||
<a-input v-model:value="displayName" disabled style="width: 80%" /> |
|||
<a-button :icon="h(EditFilled)" type="primary" @click="init" /> |
|||
<a-button :icon="h(DeleteFilled)" @click="clear" /> |
|||
<BasicModal |
|||
title="费用选择" |
|||
@register="registerTabelModal" |
|||
@ok="handleSubmit" |
|||
@cancel="closeTableModal" |
|||
width="80%" |
|||
> |
|||
<a-layout> |
|||
<a-layout-sider> <BasicTree :treeData="treeData" @select="clickNode" /> </a-layout-sider> |
|||
<a-layout-content |
|||
><BasicTable @register="registerTable"> |
|||
<template #toolbar> |
|||
<a-button |
|||
type="primary" |
|||
@click="handleAdd" |
|||
v-auth="'productManagement:personProducts:add'" |
|||
>新增个人费用</a-button |
|||
> |
|||
</template> |
|||
<template #bodyCell="{ column, record }"> |
|||
<template v-if="column.dataIndex === 'image'"> |
|||
<Image v-if="record.image" :src="record.image" :height="30" /> |
|||
</template> |
|||
</template> </BasicTable |
|||
></a-layout-content> |
|||
</a-layout> |
|||
</BasicModal> |
|||
<PersonProductsModal @register="registerModal" @reload="reload" /> |
|||
</PageWrapper> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { PageWrapper } from '@/components/Page'; |
|||
import { BasicTable, useTable } from '@/components/Table'; |
|||
import { BasicModal, useModal } from '@/components/Modal'; |
|||
import { BasicTree } from '@/components/Tree'; |
|||
import { getProductsPageByType } from '@/api/zaojiaManagement/productManagement/costTable/costItemDetail'; |
|||
import PersonProductsModal from '@/views/zaojiaManagement/productManagement/personProducts/PersonProductsModal.vue'; |
|||
import { |
|||
formSchemas, |
|||
columns, |
|||
} from '@/views/zaojiaManagement/productManagement/personProducts/personProducts.data'; |
|||
import { ref, h, watch } from 'vue'; |
|||
import { DeleteFilled, EditFilled } from '@ant-design/icons-vue'; |
|||
import { useMessage } from '@/hooks/web/useMessage'; |
|||
import { TreeItem } from '@/components/Tree'; |
|||
import { Image } from 'ant-design-vue'; |
|||
|
|||
const { createWarningModal } = useMessage(); |
|||
const emit = defineEmits(['update:modelValue', 'updateCostInfo']); |
|||
defineOptions({ name: 'SupplierSelector' }); |
|||
const prop = defineProps(['modelValue']); |
|||
|
|||
const [registerTabelModal, { openModal: openTableModal, closeModal: closeTableModal }] = |
|||
useModal(); |
|||
|
|||
const [registerTable, { reload, getSelectRows }] = useTable({ |
|||
rowSelection: { |
|||
type: 'radio', |
|||
}, |
|||
title: '产品信息管理列表', |
|||
api: getProductsPageByType, |
|||
showIndexColumn: false, |
|||
rowKey: 'id', |
|||
useSearchForm: true, |
|||
formConfig: { |
|||
schemas: formSchemas, |
|||
baseColProps: { |
|||
xs: 24, |
|||
sm: 24, |
|||
md: 24, |
|||
lg: 6, |
|||
}, |
|||
}, |
|||
columns: columns, |
|||
beforeFetch: (params) => { |
|||
params.productType = productType.value; |
|||
}, |
|||
}); |
|||
|
|||
const [registerModal, { openModal }] = useModal(); |
|||
|
|||
let displayName = ref(''); |
|||
let productType = ref('all'); |
|||
const treeData: TreeItem[] = [ |
|||
{ |
|||
title: '全产品库', |
|||
key: 'all', |
|||
icon: 'home|svg', |
|||
}, |
|||
{ |
|||
title: '供应商产品库', |
|||
key: 'supplierProducts', |
|||
icon: 'home|svg', |
|||
}, |
|||
{ |
|||
title: '公司产品库', |
|||
key: 'companyProducts', |
|||
icon: 'home|svg', |
|||
}, |
|||
{ |
|||
title: '个人产品库', |
|||
key: 'personProducts', |
|||
icon: 'home|svg', |
|||
}, |
|||
]; |
|||
function handleAdd() { |
|||
openModal(true, { update: false }); |
|||
} |
|||
function init() { |
|||
openTableModal(); |
|||
} |
|||
function handleSubmit() { |
|||
let row = getSelectRows(); |
|||
console.log(row); |
|||
if (row.length > 0) { |
|||
displayName.value = row[0].productName; |
|||
emit('update:modelValue', row[0].productName); |
|||
emit('updateCostInfo', row[0]); |
|||
closeTableModal(); |
|||
} else { |
|||
createWarningModal({ title: '警告信息', content: '请选择一个费用产品' }); |
|||
} |
|||
} |
|||
function clear() { |
|||
displayName.value = ''; |
|||
emit('update:modelValue', ''); |
|||
} |
|||
function clickNode(selectedKeys) { |
|||
console.log('selectedKeys', selectedKeys); |
|||
let nodeKey = selectedKeys[0]; |
|||
productType.value = nodeKey; |
|||
reload(); |
|||
} |
|||
watch( |
|||
() => prop.modelValue, |
|||
(newval) => { |
|||
if (newval) { |
|||
displayName.value = newval; |
|||
} |
|||
}, |
|||
{ immediate: true }, |
|||
); |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,246 @@ |
|||
import { BasicColumn } from '@/components/Table'; |
|||
import { FormSchema } from '@/components/Form'; |
|||
// import { h } from 'vue';
|
|||
// import { Input } from 'ant-design-vue';
|
|||
export const formSchemas: FormSchema[] = []; |
|||
|
|||
export const detailColumns: BasicColumn[] = [ |
|||
// {
|
|||
// title: '排序',
|
|||
// dataIndex: 'orderNo',
|
|||
// },
|
|||
// {
|
|||
// title: '父类id',
|
|||
// dataIndex: 'parentId',
|
|||
// ifShow:false
|
|||
// },
|
|||
{ |
|||
title: '费用类型', |
|||
dataIndex: 'costType', |
|||
}, |
|||
{ |
|||
title: '建设内容', |
|||
dataIndex: 'constructContent', |
|||
}, |
|||
{ |
|||
title: '费用名称', |
|||
dataIndex: 'costName', |
|||
}, |
|||
|
|||
{ |
|||
title: '费用描述', |
|||
dataIndex: 'costDescribe', |
|||
}, |
|||
{ |
|||
title: '单位', |
|||
dataIndex: 'unit', |
|||
}, |
|||
{ |
|||
title: '数量', |
|||
dataIndex: 'quantity', |
|||
}, |
|||
{ |
|||
title: '单价', |
|||
dataIndex: 'unitPrice', |
|||
}, |
|||
{ |
|||
title: '总价', |
|||
dataIndex: 'totalPrice', |
|||
}, |
|||
{ |
|||
title: '是否明细', |
|||
dataIndex: 'isDetail', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
title: '备注', |
|||
dataIndex: 'remarks', |
|||
}, |
|||
]; |
|||
|
|||
export const modalSchemas: FormSchema[] = [ |
|||
{ |
|||
label: '主键', |
|||
field: 'id', |
|||
ifShow: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '造价表id', |
|||
field: 'costTableId', |
|||
component: 'Input', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
label: '父类id', |
|||
field: 'parentId', |
|||
required: false, |
|||
component: 'Input', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
label: '是否明细', |
|||
field: 'isDetail', |
|||
required: true, |
|||
component: 'Switch', |
|||
componentProps: ({ formActionType }) => { |
|||
return { |
|||
checkedValue: '1', |
|||
checkedChildren: '是', |
|||
unCheckedValue: '0', |
|||
unCheckedChildren: '否', |
|||
onChange: (value) => { |
|||
const { setFieldsValue } = formActionType; |
|||
if (value == '0') { |
|||
setFieldsValue({ |
|||
costName: '', |
|||
constructContent: '', |
|||
}); |
|||
} else { |
|||
setFieldsValue({ |
|||
costType: '', |
|||
costDescribe: '', |
|||
unit: '', |
|||
quantity: '', |
|||
unitPrice: '', |
|||
totalPrice: '', |
|||
}); |
|||
} |
|||
}, |
|||
}; |
|||
}, |
|||
defaultValue: '0', |
|||
}, |
|||
{ |
|||
label: '费用类型', |
|||
field: 'costType', |
|||
required: true, |
|||
component: 'Input', |
|||
ifShow: ({ values }) => { |
|||
return values.isDetail == '0'; |
|||
}, |
|||
}, |
|||
{ |
|||
label: '建设内容', |
|||
field: 'constructContent', |
|||
required: true, |
|||
component: 'InputTextArea', |
|||
ifShow: ({ values }) => { |
|||
return values.isDetail == '0'; |
|||
}, |
|||
}, |
|||
{ |
|||
label: '费用名称', |
|||
field: 'costName', |
|||
required: false, |
|||
slot: 'costNameSlot', |
|||
ifShow: ({ values }) => { |
|||
return values.isDetail == '1'; |
|||
}, |
|||
}, |
|||
{ |
|||
label: '费用描述', |
|||
field: 'costDescribe', |
|||
required: false, |
|||
component: 'InputTextArea', |
|||
ifShow: ({ values }) => { |
|||
return values.isDetail == '1'; |
|||
}, |
|||
}, |
|||
{ |
|||
label: '单位', |
|||
field: 'unit', |
|||
required: false, |
|||
component: 'Input', |
|||
ifShow: ({ values }) => { |
|||
return values.isDetail == '1'; |
|||
}, |
|||
}, |
|||
{ |
|||
label: '数量', |
|||
field: 'quantity', |
|||
required: false, |
|||
component: 'InputNumber', |
|||
componentProps: ({ formModel, formActionType }) => { |
|||
return { |
|||
min: 0, |
|||
precision: 0, |
|||
onChange: async () => { |
|||
let price = formModel.unitPrice ? formModel.unitPrice : 0; |
|||
let buyNums = formModel.quantity ? formModel.quantity : 0; |
|||
const { setFieldsValue } = formActionType; |
|||
setFieldsValue({ |
|||
totalPrice: price * buyNums, |
|||
}); |
|||
}, |
|||
}; |
|||
}, |
|||
ifShow: ({ values }) => { |
|||
return values.isDetail == '1'; |
|||
}, |
|||
}, |
|||
{ |
|||
label: '单价', |
|||
field: 'unitPrice', |
|||
required: false, |
|||
component: 'InputNumber', |
|||
componentProps: ({ formModel, formActionType }) => { |
|||
return { |
|||
min: 0, |
|||
precision: 2, |
|||
onChange: async () => { |
|||
let price = formModel.unitPrice ? formModel.unitPrice : 0; |
|||
let buyNums = formModel.quantity ? formModel.quantity : 0; |
|||
const { setFieldsValue } = formActionType; |
|||
setFieldsValue({ |
|||
totalPrice: price * buyNums, |
|||
}); |
|||
}, |
|||
}; |
|||
}, |
|||
ifShow: ({ values }) => { |
|||
return values.isDetail == '1'; |
|||
}, |
|||
}, |
|||
{ |
|||
label: '总价', |
|||
field: 'totalPrice', |
|||
required: false, |
|||
component: 'Input', |
|||
dynamicDisabled: true, |
|||
ifShow: ({ values }) => { |
|||
return values.isDetail == '1'; |
|||
}, |
|||
//渲染 values当前表单所有值
|
|||
// render: ({ values }) => {
|
|||
// let price = values.unitPrice ? values.unitPrice : 0;
|
|||
// let buyNums = values.quantity ? values.quantity : 0;
|
|||
// return String(price * buyNums);
|
|||
// },
|
|||
// render: ({ model, field }) => {
|
|||
// //渲染自定义组件,以Input为例
|
|||
// return h(Input, {
|
|||
// value: model["unitPrice"]*model["quantity"],
|
|||
// style: { width: '100%' },
|
|||
// type: 'number',
|
|||
// disabled:true,
|
|||
// onchange: (e: ChangeEvent) => {
|
|||
// model[field] = 123;
|
|||
// },
|
|||
// });
|
|||
// },
|
|||
}, |
|||
|
|||
{ |
|||
label: '备注', |
|||
field: 'remarks', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
// {
|
|||
// label: '排序',
|
|||
// field: 'orderNo',
|
|||
// required: false,
|
|||
// component: 'Input',
|
|||
// },
|
|||
]; |
@ -0,0 +1,134 @@ |
|||
import { BasicColumn } from '@/components/Table'; |
|||
import { FormSchema } from '@/components/Form'; |
|||
export const formSchemas: FormSchema[] = [ |
|||
{ |
|||
label: '主键', |
|||
field: 'id', |
|||
show: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '项目名称', |
|||
field: 'projectName', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '造价日期', |
|||
field: 'costDate', |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
showTime: true, |
|||
format: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
}, |
|||
}, |
|||
{ |
|||
label: '总投资', |
|||
field: 'totalInvestment', |
|||
component: 'Input', |
|||
}, |
|||
]; |
|||
|
|||
export const columns: BasicColumn[] = [ |
|||
{ |
|||
title: '主键', |
|||
dataIndex: 'id', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
title: '项目名称', |
|||
dataIndex: 'projectName', |
|||
}, |
|||
{ |
|||
title: '造价日期', |
|||
dataIndex: 'costDate', |
|||
}, |
|||
{ |
|||
title: '总投资', |
|||
dataIndex: 'totalInvestment', |
|||
}, |
|||
]; |
|||
|
|||
export const modalSchemas: FormSchema[] = [ |
|||
{ |
|||
label: '主键', |
|||
field: 'id', |
|||
required: true, |
|||
component: 'Input', |
|||
show: false, |
|||
}, |
|||
{ |
|||
label: '项目名称', |
|||
field: 'projectName', |
|||
required: true, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '造价日期', |
|||
field: 'costDate', |
|||
required: true, |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
showTime: true, |
|||
format: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
}, |
|||
}, |
|||
{ |
|||
label: '总投资', |
|||
field: 'totalInvestment', |
|||
required: true, |
|||
component: 'Input', |
|||
}, |
|||
]; |
|||
export const detailColumns: BasicColumn[] = [ |
|||
{ |
|||
title: '排序', |
|||
dataIndex: 'orderNo', |
|||
}, |
|||
{ |
|||
title: '父类id', |
|||
dataIndex: 'parentId', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
title: '费用类型', |
|||
dataIndex: 'costType', |
|||
}, |
|||
{ |
|||
title: '建设内容', |
|||
dataIndex: 'constructContent', |
|||
}, |
|||
{ |
|||
title: '费用名称', |
|||
dataIndex: 'costName', |
|||
}, |
|||
{ |
|||
title: '费用描述', |
|||
dataIndex: 'costDescribe', |
|||
}, |
|||
{ |
|||
title: '单位', |
|||
dataIndex: 'unit', |
|||
}, |
|||
{ |
|||
title: '数量', |
|||
dataIndex: 'quantity', |
|||
}, |
|||
{ |
|||
title: '单价', |
|||
dataIndex: 'unitPrice', |
|||
}, |
|||
{ |
|||
title: '总价', |
|||
dataIndex: 'totalPrice', |
|||
}, |
|||
{ |
|||
title: '是否明细', |
|||
dataIndex: 'isDetail', |
|||
}, |
|||
{ |
|||
title: '备注', |
|||
dataIndex: 'remarks', |
|||
}, |
|||
]; |
@ -0,0 +1,161 @@ |
|||
<template> |
|||
<PageWrapper dense> |
|||
<BasicTable @register="registerTable"> |
|||
<template #toolbar> |
|||
<a-button |
|||
@click="exportData" |
|||
v-auth="'productManagement:costTable:export'" |
|||
:disabled="!selected" |
|||
>获取文档</a-button |
|||
> |
|||
<a-button |
|||
@click="downloadExcel(costTableExport, '造价编制信息数据', getForm().getFieldsValue())" |
|||
v-auth="'productManagement:costTable:export'" |
|||
>导出</a-button |
|||
> |
|||
<a-button |
|||
type="primary" |
|||
danger |
|||
@click="multipleRemove(costTableRemove)" |
|||
:disabled="!selected" |
|||
v-auth="'productManagement:costTable:remove'" |
|||
>删除</a-button |
|||
> |
|||
<a-button type="primary" @click="handleAdd" v-auth="'productManagement:costTable:add'" |
|||
>新增</a-button |
|||
> |
|||
</template> |
|||
<template #bodyCell="{ column, record }"> |
|||
<template v-if="column.key === 'action'"> |
|||
<TableAction |
|||
stopButtonPropagation |
|||
:actions="[ |
|||
{ |
|||
label: '修改', |
|||
icon: IconEnum.EDIT, |
|||
type: 'primary', |
|||
ghost: true, |
|||
auth: 'productManagement:costTable:edit', |
|||
onClick: handleEdit.bind(null, record), |
|||
}, |
|||
{ |
|||
label: '删除', |
|||
icon: IconEnum.DELETE, |
|||
type: 'primary', |
|||
danger: true, |
|||
ghost: true, |
|||
auth: 'productManagement:costTable:remove', |
|||
popConfirm: { |
|||
placement: 'left', |
|||
title: '是否删除造价编制信息[' + record.projectName + ']?', |
|||
confirm: handleDelete.bind(null, record), |
|||
}, |
|||
}, |
|||
]" |
|||
/> |
|||
</template> |
|||
</template> |
|||
</BasicTable> |
|||
<CostTableModal ref="addPage" @register="registerModal" @reload="reload" /> |
|||
<!-- <ModifyPage ref="modifyPage" @refresh="onLoad" /> |
|||
<ViewPage ref="viewPage" /> --> |
|||
</PageWrapper> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { PageWrapper } from '@/components/Page'; |
|||
import { BasicTable, useTable, TableAction } from '@/components/Table'; |
|||
import { |
|||
costTableList, |
|||
costTableExport, |
|||
costTableRemove, |
|||
exportDataDetail, |
|||
} from '@/api/zaojiaManagement/productManagement/costTable'; |
|||
import { downloadExcel } from '@/utils/file/download'; |
|||
import { useModal } from '@/components/Modal'; |
|||
import CostTableModal from './CostTableModal.vue'; |
|||
import { formSchemas, columns } from './costTable.data'; |
|||
import { IconEnum } from '@/enums/appEnum'; |
|||
defineOptions({ name: 'CostTable' }); |
|||
|
|||
// import ModifyPage from './modify.vue'; |
|||
// import ViewPage from './view.vue'; |
|||
const [registerModal, { openModal }] = useModal(); |
|||
// function rowSave(row, done, loading) { |
|||
// proxy.$refs.addPage.init(); |
|||
// } |
|||
// function rowDel(row, index) { |
|||
// api.remove(row.id); |
|||
// onLoad(); |
|||
// } |
|||
// function rowUpdate(row, index, done, loading) { |
|||
// proxy.$refs.modifyPage.init(row.id); |
|||
// } |
|||
// function onLoad() { |
|||
// pageInfo.pageNum = page.currentPage; |
|||
// const params = Object.assign(queryCondition.value, pageInfo, sortInfo); |
|||
// api.page(params).then((res) => { |
|||
// data.value = res.data.records; |
|||
// page.total = res.data.total; |
|||
// // res.data.total |
|||
// }); |
|||
// } |
|||
// function rowDblclick(row, index) { |
|||
// proxy.$refs.viewPage.init(row.id); |
|||
// } |
|||
// function searchChange(val, done) { |
|||
// onLoad(); |
|||
// done(); |
|||
// } |
|||
|
|||
const [registerTable, { reload, multipleRemove, selected, getForm, getSelectRows }] = useTable({ |
|||
rowSelection: { |
|||
type: 'radio', |
|||
}, |
|||
title: '造价编制信息列表', |
|||
api: costTableList, |
|||
showIndexColumn: false, |
|||
rowKey: 'id', |
|||
useSearchForm: true, |
|||
formConfig: { |
|||
schemas: formSchemas, |
|||
baseColProps: { |
|||
xs: 24, |
|||
sm: 24, |
|||
md: 24, |
|||
lg: 6, |
|||
}, |
|||
}, |
|||
columns: columns, |
|||
actionColumn: { |
|||
width: 200, |
|||
title: '操作', |
|||
key: 'action', |
|||
fixed: 'right', |
|||
}, |
|||
}); |
|||
|
|||
function handleEdit(record: Recordable) { |
|||
openModal(true, { record, update: true }); |
|||
} |
|||
|
|||
function handleAdd() { |
|||
openModal(true, { update: false }); |
|||
} |
|||
|
|||
async function handleDelete(record: Recordable) { |
|||
await costTableRemove([record.id]); |
|||
await reload(); |
|||
} |
|||
function exportData() { |
|||
if (selected) { |
|||
let rows = getSelectRows(); |
|||
downloadExcel(exportDataDetail, '造价编制信息数据', { id: rows[0].id }); |
|||
} |
|||
} |
|||
</script> |
|||
<style> |
|||
.el-input, |
|||
.el-input-number { |
|||
width: 100% !important; |
|||
} |
|||
</style> |
@ -0,0 +1,95 @@ |
|||
<template> |
|||
<BasicModal |
|||
v-bind="$attrs" |
|||
:title="title" |
|||
@register="registerInnerModal" |
|||
@ok="handleSubmit" |
|||
@cancel="resetForm" |
|||
:closeFunc="closeFunc" |
|||
> |
|||
<BasicForm @register="registerForm"> |
|||
<template #supplierInformationIdSlot="{ model, field }"> |
|||
<SupplierSelector v-model="model[field]" /> |
|||
</template> |
|||
<template #productSpecificationsSlot="{ model, field }"> |
|||
<productModelSet |
|||
v-model="model[field]" |
|||
:moduleParam="moduleParam" |
|||
v-model:modelId="model['modelId']" |
|||
/> |
|||
</template> |
|||
<template #imageSlot="{ model, field }"> |
|||
<ImageUpload v-model:value="model[field]" :api="uploadApi" /> |
|||
</template> |
|||
</BasicForm> |
|||
</BasicModal> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { BasicModal, useModalInner } from '@/components/Modal'; |
|||
import { BasicForm, useForm } from '@/components/Form'; |
|||
import { computed, ref, unref } from 'vue'; |
|||
import { |
|||
companyProductsInfo, |
|||
companyProductsAdd, |
|||
companyProductsUpdate, |
|||
} from '@/api/zaojiaManagement/productManagement/companyProducts'; |
|||
import { modalSchemas } from './companyProducts.data'; |
|||
import SupplierSelector from '@/views/zaojiaManagement/productManagement/components/SupplierSelector.vue'; |
|||
import productModelSet from '@/views/zaojiaManagement/productManagement/components/productModelSet.vue'; |
|||
import { ImageUpload } from '@/components/Upload'; |
|||
|
|||
import { uploadApi } from '@/api/upload'; |
|||
defineOptions({ name: 'CompanyProductsModal' }); |
|||
const emit = defineEmits(['register', 'reload']); |
|||
const isUpdate = ref<boolean>(false); |
|||
const title = computed<string>(() => { |
|||
return isUpdate.value ? '编辑公司产品管理' : '新增公司产品管理'; |
|||
}); |
|||
const moduleParam = ref<Object>({ name: '个人产品管理', value: 'companyProducts' }); |
|||
|
|||
const [registerInnerModal, { modalLoading, closeModal }] = useModalInner( |
|||
async (data: { record?: Recordable; update: boolean }) => { |
|||
modalLoading(true); |
|||
const { record, update } = data; |
|||
isUpdate.value = update; |
|||
if (update && record) { |
|||
const ret = await companyProductsInfo(record.id); |
|||
await setFieldsValue(ret); |
|||
} |
|||
modalLoading(false); |
|||
}, |
|||
); |
|||
|
|||
const [registerForm, { setFieldsValue, resetForm, validate }] = useForm({ |
|||
labelWidth: 100, |
|||
showActionButtonGroup: false, |
|||
baseColProps: { span: 24 }, |
|||
schemas: modalSchemas, |
|||
}); |
|||
|
|||
async function handleSubmit() { |
|||
try { |
|||
modalLoading(true); |
|||
const data = await validate(); |
|||
if (unref(isUpdate)) { |
|||
data['image'] = data['image'][0]; |
|||
await companyProductsUpdate(data); |
|||
} else { |
|||
data['image'] = data['image'][0]; |
|||
await companyProductsAdd(data); |
|||
} |
|||
emit('reload'); |
|||
closeModal(); |
|||
await resetForm(); |
|||
} catch (e) { |
|||
} finally { |
|||
modalLoading(false); |
|||
} |
|||
} |
|||
async function closeFunc() { |
|||
return true; |
|||
} |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,240 @@ |
|||
import { BasicColumn } from '@/components/Table'; |
|||
import { FormSchema } from '@/components/Form'; |
|||
export const formSchemas: FormSchema[] = [ |
|||
{ |
|||
label: '关联厂商产品id', |
|||
field: 'supplierProductsId', |
|||
component: 'Input', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
label: '供应商', |
|||
field: 'supplierInformationId', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '公司产品规格', |
|||
field: 'productSpecifications', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '产品名称', |
|||
field: 'productName', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '产品标识', |
|||
field: 'productIdentity', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '产品价格', |
|||
field: 'productPrice', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '信息来源', |
|||
field: 'sourceInformation', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remarks', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '品牌', |
|||
field: 'brand', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '单位', |
|||
field: 'unit', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '除税价', |
|||
field: 'exTaxPrice', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '税率', |
|||
field: 'taxrate', |
|||
component: 'Input', |
|||
}, |
|||
]; |
|||
|
|||
export const columns: BasicColumn[] = [ |
|||
{ |
|||
title: '主键', |
|||
dataIndex: 'id', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
title: '关联厂商产品id', |
|||
dataIndex: 'supplierProductsId', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
title: '供应商', |
|||
dataIndex: 'supplierInformationId', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
title: '公司产品规格', |
|||
dataIndex: 'productSpecifications', |
|||
}, |
|||
{ |
|||
title: '产品名称', |
|||
dataIndex: 'productName', |
|||
}, |
|||
{ |
|||
title: '产品标识', |
|||
dataIndex: 'productIdentity', |
|||
}, |
|||
{ |
|||
title: '产品价格', |
|||
dataIndex: 'productPrice', |
|||
}, |
|||
{ |
|||
title: '信息来源', |
|||
dataIndex: 'sourceInformation', |
|||
}, |
|||
{ |
|||
title: '备注', |
|||
dataIndex: 'remarks', |
|||
}, |
|||
{ |
|||
title: '图片', |
|||
dataIndex: 'image', |
|||
}, |
|||
{ |
|||
title: '品牌', |
|||
dataIndex: 'brand', |
|||
}, |
|||
{ |
|||
title: '单位', |
|||
dataIndex: 'unit', |
|||
}, |
|||
{ |
|||
title: '除税价', |
|||
dataIndex: 'exTaxPrice', |
|||
}, |
|||
{ |
|||
title: '税率', |
|||
dataIndex: 'taxrate', |
|||
}, |
|||
{ |
|||
title: '分类id', |
|||
dataIndex: 'categoryId', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
title: '型号id', |
|||
dataIndex: 'modelId', |
|||
ifShow: false, |
|||
}, |
|||
]; |
|||
|
|||
export const modalSchemas: FormSchema[] = [ |
|||
{ |
|||
label: '主键', |
|||
field: 'id', |
|||
required: false, |
|||
component: 'Input', |
|||
show: false, |
|||
}, |
|||
{ |
|||
label: '关联厂商产品id', |
|||
field: 'supplierProductsId', |
|||
required: false, |
|||
component: 'Input', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
label: '供应商', |
|||
field: 'supplierInformationId', |
|||
required: false, |
|||
slot: 'supplierInformationIdSlot', |
|||
}, |
|||
{ |
|||
label: '公司产品规格', |
|||
field: 'productSpecifications', |
|||
required: false, |
|||
slot: 'productSpecificationsSlot', |
|||
}, |
|||
{ |
|||
label: '产品名称', |
|||
field: 'productName', |
|||
required: true, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '产品标识', |
|||
field: 'productIdentity', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '产品价格', |
|||
field: 'productPrice', |
|||
required: true, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '信息来源', |
|||
field: 'sourceInformation', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remarks', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '图片', |
|||
field: 'image', |
|||
required: false, |
|||
slot: 'imageSlot', |
|||
}, |
|||
{ |
|||
label: '品牌', |
|||
field: 'brand', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '单位', |
|||
field: 'unit', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '除税价', |
|||
field: 'exTaxPrice', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '税率', |
|||
field: 'taxrate', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '分类id', |
|||
field: 'categoryId', |
|||
required: false, |
|||
component: 'Input', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
label: '型号id', |
|||
field: 'modelId', |
|||
required: false, |
|||
component: 'Input', |
|||
ifShow: false, |
|||
}, |
|||
]; |
@ -0,0 +1,122 @@ |
|||
<template> |
|||
<PageWrapper dense> |
|||
<BasicTable @register="registerTable"> |
|||
<template #toolbar> |
|||
<a-button |
|||
@click=" |
|||
downloadExcel(companyProductsExport, '公司产品管理数据', getForm().getFieldsValue()) |
|||
" |
|||
v-auth="'productManagement:companyProducts:export'" |
|||
>导出</a-button |
|||
> |
|||
<a-button |
|||
type="primary" |
|||
danger |
|||
@click="multipleRemove(companyProductsRemove)" |
|||
:disabled="!selected" |
|||
v-auth="'productManagement:companyProducts:remove'" |
|||
>删除</a-button |
|||
> |
|||
<a-button type="primary" @click="handleAdd" v-auth="'productManagement:companyProducts:add'" |
|||
>新增</a-button |
|||
> |
|||
</template> |
|||
<template #bodyCell="{ column, record }"> |
|||
<template v-if="column.key === 'action'"> |
|||
<TableAction |
|||
stopButtonPropagation |
|||
:actions="[ |
|||
{ |
|||
label: '修改', |
|||
icon: IconEnum.EDIT, |
|||
type: 'primary', |
|||
ghost: true, |
|||
auth: 'productManagement:companyProducts:edit', |
|||
onClick: handleEdit.bind(null, record), |
|||
}, |
|||
{ |
|||
label: '删除', |
|||
icon: IconEnum.DELETE, |
|||
type: 'primary', |
|||
danger: true, |
|||
ghost: true, |
|||
auth: 'productManagement:companyProducts:remove', |
|||
popConfirm: { |
|||
placement: 'left', |
|||
title: '是否删除公司产品管理[' + record.id + ']?', |
|||
confirm: handleDelete.bind(null, record), |
|||
}, |
|||
}, |
|||
]" |
|||
/> |
|||
</template> |
|||
<template v-if="column.dataIndex === 'image'"> |
|||
<Image v-if="record.image" :src="record.image" :height="30" /> |
|||
</template> |
|||
</template> |
|||
</BasicTable> |
|||
<CompanyProductsModal @register="registerModal" @reload="reload" /> |
|||
</PageWrapper> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { PageWrapper } from '@/components/Page'; |
|||
import { BasicTable, useTable, TableAction } from '@/components/Table'; |
|||
import { |
|||
companyProductsList, |
|||
companyProductsExport, |
|||
companyProductsRemove, |
|||
} from '@/api/zaojiaManagement/productManagement/companyProducts'; |
|||
import { downloadExcel } from '@/utils/file/download'; |
|||
import { useModal } from '@/components/Modal'; |
|||
import CompanyProductsModal from './CompanyProductsModal.vue'; |
|||
import { formSchemas, columns } from './companyProducts.data'; |
|||
import { IconEnum } from '@/enums/appEnum'; |
|||
import { Image } from 'ant-design-vue'; |
|||
|
|||
defineOptions({ name: 'CompanyProducts' }); |
|||
|
|||
const [registerTable, { reload, multipleRemove, selected, getForm }] = useTable({ |
|||
rowSelection: { |
|||
type: 'checkbox', |
|||
}, |
|||
title: '公司产品管理列表', |
|||
api: companyProductsList, |
|||
showIndexColumn: false, |
|||
rowKey: 'id', |
|||
useSearchForm: true, |
|||
formConfig: { |
|||
schemas: formSchemas, |
|||
baseColProps: { |
|||
xs: 24, |
|||
sm: 24, |
|||
md: 24, |
|||
lg: 6, |
|||
}, |
|||
}, |
|||
columns: columns, |
|||
actionColumn: { |
|||
width: 200, |
|||
title: '操作', |
|||
key: 'action', |
|||
fixed: 'right', |
|||
}, |
|||
}); |
|||
|
|||
const [registerModal, { openModal }] = useModal(); |
|||
|
|||
function handleEdit(record: Recordable) { |
|||
openModal(true, { record, update: true }); |
|||
} |
|||
|
|||
function handleAdd() { |
|||
openModal(true, { update: false }); |
|||
} |
|||
|
|||
async function handleDelete(record: Recordable) { |
|||
await companyProductsRemove([record.id]); |
|||
await reload(); |
|||
} |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,107 @@ |
|||
<template> |
|||
<PageWrapper dense> |
|||
<a-input v-model:value="displayName" disabled style="width: 80%" /> |
|||
<a-button :icon="h(EditFilled)" type="primary" @click="init" /> |
|||
<a-button :icon="h(DeleteFilled)" @click="clear" /> |
|||
<BasicModal |
|||
title="供应商选择" |
|||
@register="registerTabelModal" |
|||
@ok="handleSubmit" |
|||
@cancel="closeTableModal" |
|||
width="80%" |
|||
> |
|||
<BasicTable @register="registerTable"> |
|||
<template #toolbar> |
|||
<a-button |
|||
type="primary" |
|||
@click="handleAdd" |
|||
v-auth="'productManagement:supplierInformation:add'" |
|||
>新增</a-button |
|||
> |
|||
</template> |
|||
</BasicTable> |
|||
</BasicModal> |
|||
<SupplierInformationModal @register="registerModal" @reload="reload" /> |
|||
</PageWrapper> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { PageWrapper } from '@/components/Page'; |
|||
import { BasicTable, useTable } from '@/components/Table'; |
|||
import { BasicModal, useModal } from '@/components/Modal'; |
|||
|
|||
import { |
|||
supplierInformationList, |
|||
supplierInformationInfo, |
|||
} from '@/api/zaojiaManagement/supplierManagement'; |
|||
import SupplierInformationModal from '../../supplierManagement/SupplierInformationModal.vue'; |
|||
import { formSchemas, columns } from '../../supplierManagement/supplierInformation.data'; |
|||
import { ref, h, watch } from 'vue'; |
|||
import { DeleteFilled, EditFilled } from '@ant-design/icons-vue'; |
|||
import { useMessage } from '@/hooks/web/useMessage'; |
|||
const { createWarningModal } = useMessage(); |
|||
const emit = defineEmits(['update:modelValue']); |
|||
defineOptions({ name: 'SupplierSelector' }); |
|||
const prop = defineProps(['modelValue']); |
|||
const [registerTabelModal, { openModal: openTableModal, closeModal: closeTableModal }] = |
|||
useModal(); |
|||
|
|||
const [registerTable, { reload, getSelectRows }] = useTable({ |
|||
rowSelection: { |
|||
type: 'radio', |
|||
}, |
|||
title: '供应商信息管理列表', |
|||
api: supplierInformationList, |
|||
showIndexColumn: false, |
|||
rowKey: 'id', |
|||
useSearchForm: true, |
|||
formConfig: { |
|||
schemas: formSchemas, |
|||
baseColProps: { |
|||
xs: 24, |
|||
sm: 24, |
|||
md: 24, |
|||
lg: 6, |
|||
}, |
|||
}, |
|||
columns: columns, |
|||
}); |
|||
|
|||
const [registerModal, { openModal }] = useModal(); |
|||
|
|||
let displayName = ref(''); |
|||
function handleAdd() { |
|||
openModal(true, { update: false }); |
|||
} |
|||
function init() { |
|||
openTableModal(); |
|||
} |
|||
function handleSubmit() { |
|||
let row = getSelectRows(); |
|||
console.log(row); |
|||
if (row.length > 0) { |
|||
displayName.value = row[0].supplierName; |
|||
emit('update:modelValue', row[0].id); |
|||
closeTableModal(); |
|||
} else { |
|||
createWarningModal({ title: '警告信息', content: '请选择一个供应商' }); |
|||
} |
|||
} |
|||
function clear() { |
|||
displayName.value = ''; |
|||
emit('update:modelValue', ''); |
|||
} |
|||
watch( |
|||
() => prop.modelValue, |
|||
(newVal) => { |
|||
if (newVal) { |
|||
supplierInformationInfo(newVal).then((res) => { |
|||
displayName.value = res.supplierName as string; |
|||
}); |
|||
} |
|||
}, |
|||
{ immediate: true }, |
|||
); |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,64 @@ |
|||
import { FormSchema } from '@/components/Form'; |
|||
import { BasicColumn } from '@/components/Table'; |
|||
export const productModelSetSchemas: FormSchema[] = [ |
|||
{ |
|||
label: 'id', |
|||
field: 'id', |
|||
show: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '型号模板', |
|||
field: 'productModelTemplateId', |
|||
required: false, |
|||
slot: 'productModelTemplateIdSlot', |
|||
}, |
|||
{ |
|||
label: '产品描述', |
|||
field: 'description', |
|||
required: false, |
|||
component: 'InputTextArea', |
|||
dynamicDisabled: true, |
|||
componentProps: { |
|||
rows: 3, |
|||
}, |
|||
}, |
|||
{ |
|||
label: '产品规格', |
|||
field: 'modelDeatils', |
|||
required: false, |
|||
slot: 'modelDeatilsSlot', |
|||
}, |
|||
]; |
|||
export const modelTemplateSetColumns: BasicColumn[] = [ |
|||
{ |
|||
title: '主键', |
|||
dataIndex: 'id', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
title: '指标名称', |
|||
dataIndex: 'paramName', |
|||
edit: true, //是否开启单元格编辑
|
|||
editable: true, //是否处于编辑状态
|
|||
}, |
|||
{ |
|||
title: '指标参数', |
|||
dataIndex: 'parameterValue', |
|||
edit: true, //是否开启单元格编辑
|
|||
editable: true, //是否处于编辑状态
|
|||
}, |
|||
{ |
|||
title: '是否关键指标', |
|||
dataIndex: 'isKeyParameter', |
|||
edit: true, //是否开启单元格编辑
|
|||
editable: true, //是否处于编辑状态
|
|||
editComponent: 'Switch', |
|||
editComponentProps: { |
|||
checkedValue: '1', |
|||
unCheckedValue: '0', |
|||
unCheckedChildren: '否', |
|||
checkedChildren: '是', |
|||
}, |
|||
}, |
|||
]; |
@ -0,0 +1,100 @@ |
|||
<template> |
|||
<PageWrapper dense> |
|||
<BasicTable @register="registerTable" @edit-change="handleEditChange"> |
|||
<template #toolbar> |
|||
<a-button type="primary" @click="handleAdd" v-auth="'system:supplierInformation:add'" |
|||
>新增</a-button |
|||
> |
|||
</template> |
|||
<template #bodyCell="{ column, record }"> |
|||
<template v-if="column.key === 'action'"> |
|||
<TableAction |
|||
stopButtonPropagation |
|||
:actions="[ |
|||
{ |
|||
label: '删除', |
|||
icon: IconEnum.DELETE, |
|||
type: 'primary', |
|||
danger: true, |
|||
ghost: true, |
|||
auth: 'productManagement:personProducts:remove', |
|||
onClick: handleDelete.bind(null, record), |
|||
}, |
|||
]" |
|||
/> |
|||
</template> |
|||
</template> |
|||
</BasicTable> |
|||
</PageWrapper> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { PageWrapper } from '@/components/Page'; |
|||
import { BasicTable, useTable, TableAction, EditRecordRow } from '@/components/Table'; |
|||
import { IconEnum } from '@/enums/appEnum'; |
|||
|
|||
import { modelTemplateSetColumns } from './components.data'; |
|||
const emit = defineEmits(['update:modelValue', 'getDescription']); |
|||
defineOptions({ name: 'SupplierSelector' }); |
|||
const prop = defineProps(['modelValue']); |
|||
const [ |
|||
registerTable, |
|||
{ getDataSource, insertTableDataRecord, deleteTableDataRecord, setTableData }, |
|||
] = useTable({ |
|||
title: '模型规格列表', |
|||
dataSource: [{ paramName: '', parameterValue: '', isKeyParameter: '1' }], |
|||
showIndexColumn: false, |
|||
useSearchForm: false, |
|||
// formConfig: { |
|||
// schemas: modelTemplateSetColumns, |
|||
// baseColProps: { |
|||
// xs: 24, |
|||
// sm: 24, |
|||
// md: 24, |
|||
// lg: 6, |
|||
// }, |
|||
// }, |
|||
columns: modelTemplateSetColumns, |
|||
actionColumn: { |
|||
width: 200, |
|||
title: '操作', |
|||
key: 'action', |
|||
fixed: 'right', |
|||
}, |
|||
}); |
|||
|
|||
function handleAdd() { |
|||
insertTableDataRecord({ isKeyParameter: '0' }); |
|||
} |
|||
function handleDelete(record) { |
|||
console.log('handleDelete', record); |
|||
deleteTableDataRecord(record.key); |
|||
let res = getDescriptionDetail(); |
|||
emit('getDescription', res); |
|||
} |
|||
function handleEditChange(record: EditRecordRow) { |
|||
let res = getDescriptionDetail(); |
|||
emit('getDescription', res); |
|||
} |
|||
function getDescriptionDetail() { |
|||
let tabListData = getDataSource(); |
|||
console.log('handleEditEnd', tabListData); |
|||
let description = ''; |
|||
for (let i = 0; i < tabListData.length; i++) { |
|||
let rowData = tabListData[i]; |
|||
if (rowData.paramName) { |
|||
description = |
|||
// this.formData.description + rowData.paramName + ':' + rowData.parameterIndex + ';\n' |
|||
description + rowData.paramName + ':' + rowData.parameterValue + ';'; |
|||
} |
|||
} |
|||
return description; |
|||
} |
|||
|
|||
defineExpose({ |
|||
setTableData, |
|||
getDataSource, |
|||
}); |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,140 @@ |
|||
<template> |
|||
<PageWrapper dense> |
|||
<a-textarea rows="4" v-model:value="displayName" disabled style="width: 100%" /> |
|||
<a-button :icon="h(EditFilled)" type="primary" @click="init" /> |
|||
<a-button :icon="h(DeleteFilled)" @click="clear" /> |
|||
<BasicModal |
|||
title="产品规格设置" |
|||
@register="registerTabelModal" |
|||
@ok="handleSubmit" |
|||
@cancel="closeTableModal" |
|||
width="80%" |
|||
> |
|||
<BasicForm @register="registerForm"> |
|||
<template #modelDeatilsSlot="{ model, field }"> |
|||
<modelTemplateSet |
|||
ref="modelTemplateSetRef" |
|||
v-model="model[field]" |
|||
@getDescription="getDescription" |
|||
/> |
|||
</template> |
|||
<!-- <template #productSpecificationsSlot="{ model, field }"> |
|||
<productModelSet v-model="model[field]" /> |
|||
</template> --> |
|||
</BasicForm> |
|||
</BasicModal> |
|||
</PageWrapper> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
defineOptions({ name: 'SupplierSelector' }); |
|||
import { PageWrapper } from '@/components/Page'; |
|||
import { BasicForm, useForm } from '@/components/Form'; |
|||
import { BasicModal, useModal } from '@/components/Modal'; |
|||
|
|||
import { productModelSetSchemas } from './components.data'; |
|||
import { ref, h, watch, nextTick, reactive } from 'vue'; |
|||
import { DeleteFilled, EditFilled } from '@ant-design/icons-vue'; |
|||
import { useMessage } from '@/hooks/web/useMessage'; |
|||
import modelTemplateSet from './modelTemplateSet.vue'; |
|||
import { |
|||
personProductModelInfo, |
|||
personProductGetModelDetails, |
|||
updatePersonProductModel, |
|||
addPersonProductModel, |
|||
} from '@/api/zaojiaManagement/productManagement/personProductModel'; |
|||
|
|||
import { |
|||
supplierProductModelInfo, |
|||
supplierProductGetModelDetails, |
|||
updateSupplierProductModel, |
|||
addSupplierProductModel, |
|||
} from '@/api/zaojiaManagement/productManagement/supplierProductModel'; |
|||
import { |
|||
companyProductModelInfo, |
|||
companyProductGetModelDetails, |
|||
updateCompanyProductModel, |
|||
addCompanyProductModel, |
|||
} from '@/api/zaojiaManagement/productManagement/companyProductModel'; |
|||
const prop = defineProps(['modelValue', 'moduleParam', 'modelId']); |
|||
const emit = defineEmits(['update:modelValue', 'update:modelId']); |
|||
const modelTemplateSetRef = ref(null); |
|||
|
|||
const [registerTabelModal, { openModal: openTableModal, closeModal: closeTableModal }] = |
|||
useModal(); |
|||
const [registerForm, { setFieldsValue, getFieldsValue }] = useForm({ |
|||
labelWidth: 100, |
|||
showActionButtonGroup: false, |
|||
baseColProps: { span: 24 }, |
|||
schemas: productModelSetSchemas, |
|||
}); |
|||
let modelInfo = reactive<any>({}); |
|||
let addModel = reactive<any>(addPersonProductModel); |
|||
let updateModel = reactive<any>(updatePersonProductModel); |
|||
let getModelInfo = reactive<any>(personProductModelInfo); |
|||
let getModelDetails = reactive<any>(personProductGetModelDetails); |
|||
if (prop.moduleParam.value == 'personProducts') { |
|||
addModel = addPersonProductModel; |
|||
updateModel = updatePersonProductModel; |
|||
getModelInfo = personProductModelInfo; |
|||
getModelDetails = personProductGetModelDetails; |
|||
} else if (prop.moduleParam.value == 'supplierProducts') { |
|||
addModel = addSupplierProductModel; |
|||
updateModel = updateSupplierProductModel; |
|||
getModelInfo = supplierProductModelInfo; |
|||
getModelDetails = supplierProductGetModelDetails; |
|||
} else { |
|||
addModel = addCompanyProductModel; |
|||
updateModel = updateCompanyProductModel; |
|||
getModelInfo = companyProductModelInfo; |
|||
getModelDetails = companyProductGetModelDetails; |
|||
} |
|||
let displayName = ref(''); |
|||
async function init() { |
|||
let res = await getModelDetails(prop.modelId); |
|||
openTableModal(); |
|||
nextTick(() => { |
|||
if (res.length != 0 && res) { |
|||
modelTemplateSetRef.value.setTableData(res); |
|||
setFieldsValue({ id: modelInfo.id }); |
|||
setFieldsValue({ productModelTemplateId: modelInfo.productModelTemplateId }); |
|||
setFieldsValue({ description: modelInfo.description }); |
|||
} |
|||
}); |
|||
} |
|||
async function handleSubmit() { |
|||
//modelValue存在说明已有数据,是修改操作,否则是新增操作 |
|||
let id = ''; |
|||
let res = await getFieldsValue(); |
|||
res['modelDeatils'] = modelTemplateSetRef.value.getDataSource(); |
|||
if (!prop.modelId) { |
|||
id = await addModel(res); |
|||
} else { |
|||
id = await updateModel(res); |
|||
} |
|||
emit('update:modelId', id); |
|||
emit('update:modelValue', displayName.value); |
|||
closeTableModal(); |
|||
} |
|||
function clear() { |
|||
displayName.value = ''; |
|||
emit('update:modelId', null); |
|||
emit('update:modelValue', null); |
|||
} |
|||
function getDescription(description: string) { |
|||
displayName.value = description; |
|||
setFieldsValue({ description: description }); |
|||
} |
|||
watch( |
|||
() => prop.modelId, |
|||
async (newVal) => { |
|||
modelInfo = await getModelInfo(newVal); |
|||
if (modelInfo) { |
|||
displayName.value = modelInfo.description; |
|||
} |
|||
}, |
|||
{ immediate: true }, |
|||
); |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,214 @@ |
|||
<template> |
|||
<div> |
|||
<Upload |
|||
v-bind="$attrs" |
|||
v-model:file-list="fileList" |
|||
list-type="picture" |
|||
accept=".png, .jpg" |
|||
:maxCount="1" |
|||
:before-upload="beforeUpload" |
|||
:custom-request="customRequest" |
|||
@preview="handlePreview" |
|||
@remove="handleRemove" |
|||
> |
|||
<div v-if="fileList && fileList.length < maxNumber"> |
|||
<plus-outlined /> |
|||
<div style="margin-top: 8px">{{ t('component.upload.upload') }}</div> |
|||
</div> |
|||
</Upload> |
|||
<Modal :open="previewOpen" :title="previewTitle" :footer="null" @cancel="handleCancel"> |
|||
<img alt="" style="width: 100%" :src="previewImage" /> |
|||
</Modal> |
|||
</div> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref, toRefs, watch } from 'vue'; |
|||
import { PlusOutlined } from '@ant-design/icons-vue'; |
|||
import type { UploadFile, UploadProps } from 'ant-design-vue'; |
|||
import { Modal, Upload } from 'ant-design-vue'; |
|||
import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface'; |
|||
import { useMessage } from '@/hooks/web/useMessage'; |
|||
import { isArray, isFunction, isObject, isString } from '@/utils/is'; |
|||
import { warn } from '@/utils/log'; |
|||
import { useI18n } from '@/hooks/web/useI18n'; |
|||
import { useUploadType } from '../hooks/useUpload'; |
|||
import { uploadContainerProps } from '../props'; |
|||
import { checkFileType } from '../helper'; |
|||
import { UploadResultStatus } from '@/components/Upload/src/types/typing'; |
|||
import { get, omit } from 'lodash-es'; |
|||
|
|||
defineOptions({ name: 'ImageUpload' }); |
|||
|
|||
const emit = defineEmits(['change', 'update:value', 'delete']); |
|||
const props = defineProps({ |
|||
...omit(uploadContainerProps, ['previewColumns', 'beforePreviewData']), |
|||
}); |
|||
const { t } = useI18n(); |
|||
const { createMessage } = useMessage(); |
|||
const { accept, helpText, maxNumber, maxSize } = toRefs(props); |
|||
const isInnerOperate = ref<boolean>(false); |
|||
|
|||
const previewOpen = ref<boolean>(false); |
|||
const previewImage = ref<string>(''); |
|||
const previewTitle = ref<string>(''); |
|||
|
|||
const fileList = ref<UploadProps['fileList']>([]); |
|||
const isLtMsg = ref<boolean>(true); |
|||
const isActMsg = ref<boolean>(true); |
|||
const isFirstRender = ref<boolean>(true); |
|||
|
|||
watch( |
|||
() => props.value, |
|||
(v) => { |
|||
if (isInnerOperate.value) { |
|||
isInnerOperate.value = false; |
|||
return; |
|||
} |
|||
let value: string[] = []; |
|||
if (v) { |
|||
if (isArray(v)) { |
|||
value = v; |
|||
} else { |
|||
value.push(v); |
|||
} |
|||
fileList.value = value.map((item, i) => { |
|||
if (item && isString(item)) { |
|||
return { |
|||
uid: -i + '', |
|||
name: item.substring(item.lastIndexOf('/') + 1), |
|||
status: 'done', |
|||
url: item, |
|||
}; |
|||
} else if (item && isObject(item)) { |
|||
return item; |
|||
} else { |
|||
return; |
|||
} |
|||
}) as UploadProps['fileList']; |
|||
} |
|||
emit('update:value', value); |
|||
if (!isFirstRender.value) { |
|||
emit('change', value); |
|||
isFirstRender.value = false; |
|||
} |
|||
}, |
|||
{ |
|||
immediate: true, |
|||
deep: true, |
|||
}, |
|||
); |
|||
|
|||
function getBase64<T extends string | ArrayBuffer | null>(file: File) { |
|||
return new Promise<T>((resolve, reject) => { |
|||
const reader = new FileReader(); |
|||
reader.readAsDataURL(file); |
|||
reader.onload = () => { |
|||
resolve(reader.result as T); |
|||
}; |
|||
reader.onerror = (error) => reject(error); |
|||
}); |
|||
} |
|||
|
|||
const handlePreview = async (file: UploadFile) => { |
|||
if (!file.url && !file.preview) { |
|||
file.preview = await getBase64<string>(file.originFileObj!); |
|||
} |
|||
previewImage.value = file.url || file.preview || ''; |
|||
previewOpen.value = true; |
|||
previewTitle.value = |
|||
file.name || previewImage.value.substring(previewImage.value.lastIndexOf('/') + 1); |
|||
}; |
|||
|
|||
const handleRemove = async (file: UploadFile) => { |
|||
if (fileList.value) { |
|||
const index = fileList.value.findIndex((item) => item.uid === file.uid); |
|||
index !== -1 && fileList.value.splice(index, 1); |
|||
const value = getValue(); |
|||
isInnerOperate.value = true; |
|||
emit('update:value', value); |
|||
emit('change', value); |
|||
emit('delete', file); |
|||
} |
|||
}; |
|||
|
|||
const handleCancel = () => { |
|||
previewOpen.value = false; |
|||
previewTitle.value = ''; |
|||
}; |
|||
|
|||
const beforeUpload = (file: File) => { |
|||
const { maxSize, accept } = props; |
|||
const isAct = checkFileType(file, accept); |
|||
if (!isAct) { |
|||
createMessage.error(t('component.upload.acceptUpload', [accept])); |
|||
isActMsg.value = false; |
|||
// 防止弹出多个错误提示 |
|||
setTimeout(() => (isActMsg.value = true), 1000); |
|||
} |
|||
const isLt = file.size / 1024 / 1024 > maxSize; |
|||
if (isLt) { |
|||
createMessage.error(t('component.upload.maxSizeMultiple', [maxSize])); |
|||
isLtMsg.value = false; |
|||
// 防止弹出多个错误提示 |
|||
setTimeout(() => (isLtMsg.value = true), 1000); |
|||
} |
|||
return (isAct && !isLt) || Upload.LIST_IGNORE; |
|||
}; |
|||
|
|||
async function customRequest(info: UploadRequestOption<any>) { |
|||
const { api, uploadParams = {}, name, filename, resultField } = props; |
|||
if (!api || !isFunction(api)) { |
|||
return warn('upload api must exist and be a function'); |
|||
} |
|||
try { |
|||
const res = await api?.({ |
|||
data: { |
|||
...uploadParams, |
|||
}, |
|||
file: info.file, |
|||
name: name, |
|||
filename: filename, |
|||
}); |
|||
if (props.resultField) { |
|||
let result = get(res, resultField); |
|||
info.onSuccess!(result); |
|||
} else { |
|||
// 不传入 resultField 的情况 |
|||
info.onSuccess!(res); |
|||
} |
|||
const value = getValue(); |
|||
isInnerOperate.value = true; |
|||
emit('update:value', value); |
|||
emit('change', value); |
|||
} catch (e: any) { |
|||
console.log(e); |
|||
info.onError!(e); |
|||
} |
|||
} |
|||
|
|||
function getValue() { |
|||
const list = (fileList.value || []) |
|||
.filter((item) => item?.status === UploadResultStatus.DONE) |
|||
.map((item: any) => { |
|||
if (item?.response && props?.resultField) { |
|||
return item?.response; |
|||
} |
|||
//注意这里取的key为 url |
|||
return item?.url || item?.response?.url; |
|||
}); |
|||
return list; |
|||
} |
|||
</script> |
|||
|
|||
<style lang="less"> |
|||
.ant-upload-select-picture-card i { |
|||
color: #999; |
|||
font-size: 32px; |
|||
} |
|||
|
|||
.ant-upload-select-picture-card .ant-upload-text { |
|||
margin-top: 8px; |
|||
color: #666; |
|||
} |
|||
</style> |
@ -0,0 +1,106 @@ |
|||
<template> |
|||
<el-upload |
|||
v-model:file-list="fileList" |
|||
class="upload-demo" |
|||
action |
|||
:on-preview="handlePreview" |
|||
:on-remove="handleRemove" |
|||
list-type="picture-card" |
|||
:limit="1" |
|||
:http-request="ImgUploadSectionFile" |
|||
:before-upload="beforeAvatarUpload" |
|||
:on-change="handleEditChange" |
|||
:on-exceed="handleExceed" |
|||
accept=".png, .jpg" |
|||
> |
|||
<!-- <el-button type="primary">上传图片</el-button> --> |
|||
<template #tip> |
|||
<div class="el-upload__tip">支持 jpg/png 最大尺寸为10Mb</div> |
|||
</template> |
|||
</el-upload> |
|||
<el-dialog v-model="dialogVisible"> |
|||
<img w-full :src="dialogImageUrl" alt="Preview Image" /> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { ref,defineEmits,defineProps} from 'vue' |
|||
import { ElMessage } from 'element-plus' |
|||
|
|||
import type { UploadProps, UploadUserFile } from 'element-plus' |
|||
const propsData= defineProps(["modelValue","moduleParam"]) |
|||
const emits= defineEmits(['update:modelValue']) |
|||
const fileList = ref<UploadUserFile[]>([]) |
|||
let dialogVisible = ref(false) |
|||
let dialogImageUrl = ref() |
|||
|
|||
if(propsData.modelValue){ |
|||
fileList.value.push({url:propsData.modelValue,name:propsData.modelValue.split('/')[propsData.modelValue.split('/').length-1]}) |
|||
console.log(fileList.value) |
|||
} |
|||
// const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => { |
|||
// console.log(uploadFile, uploadFiles) |
|||
// } |
|||
|
|||
const handlePreview: UploadProps['onPreview'] = (file) => { |
|||
console.log(file) |
|||
dialogImageUrl.value = file.url |
|||
dialogVisible.value = true |
|||
} |
|||
|
|||
// 删除图片 |
|||
function handleRemove(file, fileList) { |
|||
if (fileList.length === 0) { |
|||
fileList = [] |
|||
} else { |
|||
let dl = fileList.indexOf(file) |
|||
fileList.splice(dl, 1) |
|||
} |
|||
console.log('remove', file, fileList) |
|||
// hideUploadEdit = fileList.length >= limitNum |
|||
} |
|||
|
|||
// on-change添加文件,上传成功和上传失败时都会被调用 |
|||
function handleEditChange(file, fileList) { |
|||
console.log('file:', file, fileList) |
|||
// hideUploadEdit = fileList.length >= limitNum |
|||
// console.log("this.fileList:", this.fileList); |
|||
// console.log("this.hideUploadEdit:", this.hideUploadEdit); |
|||
} |
|||
// http-request自定义上传 |
|||
function ImgUploadSectionFile(param) { |
|||
console.log('param', param) |
|||
emits("update:modelValue",param.file) |
|||
} |
|||
|
|||
// before-upload上传文件之前的钩子,参数为上传的文件 |
|||
// 若返回 false 或者返回 Promise 且被 reject,则停止上传 |
|||
function beforeAvatarUpload(file) { |
|||
const isJPG = file.type === 'image/jpeg' || file.type === 'image/png' |
|||
const isLt2M = file.size / 1024 / 1024 < 10 |
|||
if (!isJPG) { |
|||
ElMessage.error('上传图片只能是 JPG 或 PNG 格式!') |
|||
} |
|||
if (!isLt2M) { |
|||
ElMessage.error('上传图片大小不能超过 10MB!') |
|||
} |
|||
return isJPG && isLt2M |
|||
} |
|||
function handleExceed() { |
|||
ElMessage.warning('最多只能上传一个文件') |
|||
} |
|||
</script> |
|||
|
|||
<!-- :limit="limitNum" //最大允许上传个数 |
|||
:class="{hide:hideUploadEdit}" //加类名为了隐藏上传样式 |
|||
:on-remove="handleRemove" //文件列表移除文件时的钩子 |
|||
:on-change="handleEditChange" //文件状态改变时的钩子(可以限制文件数量和文件大小) |
|||
:http-request="ImgUploadSectionFile" //覆盖默认的上传行为,实现手动上传 |
|||
:before-upload="beforeAvatarUpload" //上传文件之前的钩子 |
|||
:with-credentials="true" //支持发送 cookie 凭证信息 |
|||
:auto-upload="true" //是否在选取文件后立即进行上传(不知什么原因false没效果) |
|||
accept=".png, .jpg" //接受上传的文件类型 |
|||
action="" //手动上传不需要填写url |
|||
list-type="picture-card" //设置文件列表的样式 |
|||
:file-list="fileList" //上传的文件列表 |
|||
--> |
@ -0,0 +1,100 @@ |
|||
<template> |
|||
<BasicModal |
|||
v-bind="$attrs" |
|||
:title="title" |
|||
@register="registerInnerModal" |
|||
@ok="handleSubmit" |
|||
@cancel="resetForm" |
|||
:closeFunc="closeFunc" |
|||
> |
|||
<BasicForm @register="registerForm"> |
|||
<template #supplierInformationIdSlot="{ model, field }"> |
|||
<SupplierSelector v-model="model[field]" /> |
|||
</template> |
|||
<template #productSpecificationsSlot="{ model, field }"> |
|||
<productModelSet |
|||
v-model="model[field]" |
|||
:moduleParam="moduleParam" |
|||
v-model:modelId="model['modelId']" |
|||
/> |
|||
</template> |
|||
<template #imageSlot="{ model, field }"> |
|||
<ImageUpload v-model:value="model[field]" :api="uploadApi" /> |
|||
</template> |
|||
</BasicForm> |
|||
</BasicModal> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { BasicModal, useModalInner } from '@/components/Modal'; |
|||
import { BasicForm, useForm } from '@/components/Form'; |
|||
import { computed, ref, unref } from 'vue'; |
|||
import { |
|||
personProductsInfo, |
|||
personProductsAdd, |
|||
personProductsUpdate, |
|||
} from '@/api/zaojiaManagement/productManagement/personProducts'; |
|||
import { modalSchemas } from './personProducts.data'; |
|||
import SupplierSelector from '@/views/zaojiaManagement/productManagement/components/SupplierSelector.vue'; |
|||
import productModelSet from '@/views/zaojiaManagement/productManagement/components/productModelSet.vue'; |
|||
import { uploadApi } from '@/api/upload'; |
|||
import { ImageUpload } from '@/components/Upload'; |
|||
|
|||
defineOptions({ name: 'PersonProductsModal' }); |
|||
|
|||
const emit = defineEmits(['register', 'reload']); |
|||
const isUpdate = ref<boolean>(false); |
|||
const title = computed<string>(() => { |
|||
return isUpdate.value ? '编辑个人产品管理' : '新增个人产品管理'; |
|||
}); |
|||
const moduleParam = ref<Object>({ name: '个人产品管理', value: 'personProducts' }); |
|||
const [registerInnerModal, { modalLoading, closeModal }] = useModalInner( |
|||
async (data: { record?: Recordable; update: boolean }) => { |
|||
modalLoading(true); |
|||
const { record, update } = data; |
|||
isUpdate.value = update; |
|||
if (update && record) { |
|||
const ret = await personProductsInfo(record.id); |
|||
await setFieldsValue(ret); |
|||
} |
|||
modalLoading(false); |
|||
}, |
|||
); |
|||
|
|||
const [registerForm, { setFieldsValue, resetForm, validate }] = useForm({ |
|||
labelWidth: 100, |
|||
showActionButtonGroup: false, |
|||
baseColProps: { span: 24 }, |
|||
schemas: modalSchemas, |
|||
}); |
|||
|
|||
async function handleSubmit() { |
|||
try { |
|||
modalLoading(true); |
|||
console.log(); |
|||
const data = await validate(); |
|||
if (unref(isUpdate)) { |
|||
if (data['image'] && data['image'].length > 0) { |
|||
data['image'] = data['image'][0]; |
|||
} |
|||
await personProductsUpdate(data); |
|||
} else { |
|||
if (data['image'] && data['image'].length > 0) { |
|||
data['image'] = data['image'][0]; |
|||
} |
|||
await personProductsAdd(data); |
|||
} |
|||
emit('reload'); |
|||
closeModal(); |
|||
await resetForm(); |
|||
} catch (e) { |
|||
} finally { |
|||
modalLoading(false); |
|||
} |
|||
} |
|||
async function closeFunc() { |
|||
return true; |
|||
} |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,122 @@ |
|||
<template> |
|||
<PageWrapper dense> |
|||
<BasicTable @register="registerTable"> |
|||
<template #toolbar> |
|||
<a-button |
|||
@click=" |
|||
downloadExcel(personProductsExport, '个人产品管理数据', getForm().getFieldsValue()) |
|||
" |
|||
v-auth="'productManagement:personProducts:export'" |
|||
>导出</a-button |
|||
> |
|||
<a-button |
|||
type="primary" |
|||
danger |
|||
@click="multipleRemove(personProductsRemove)" |
|||
:disabled="!selected" |
|||
v-auth="'productManagement:personProducts:remove'" |
|||
>删除</a-button |
|||
> |
|||
<a-button type="primary" @click="handleAdd" v-auth="'productManagement:personProducts:add'" |
|||
>新增</a-button |
|||
> |
|||
</template> |
|||
<template #bodyCell="{ column, record }"> |
|||
<template v-if="column.key === 'action'"> |
|||
<TableAction |
|||
stopButtonPropagation |
|||
:actions="[ |
|||
{ |
|||
label: '修改', |
|||
icon: IconEnum.EDIT, |
|||
type: 'primary', |
|||
ghost: true, |
|||
auth: 'productManagement:personProducts:edit', |
|||
onClick: handleEdit.bind(null, record), |
|||
}, |
|||
{ |
|||
label: '删除', |
|||
icon: IconEnum.DELETE, |
|||
type: 'primary', |
|||
danger: true, |
|||
ghost: true, |
|||
auth: 'productManagement:personProducts:remove', |
|||
popConfirm: { |
|||
placement: 'left', |
|||
title: '是否删除个人产品管理[' + record.id + ']?', |
|||
confirm: handleDelete.bind(null, record), |
|||
}, |
|||
}, |
|||
]" |
|||
/> |
|||
</template> |
|||
<template v-if="column.dataIndex === 'image'"> |
|||
<Image v-if="record.image" :src="record.image" :height="30" /> |
|||
</template> |
|||
</template> |
|||
</BasicTable> |
|||
<PersonProductsModal @register="registerModal" @reload="reload" /> |
|||
</PageWrapper> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { PageWrapper } from '@/components/Page'; |
|||
import { BasicTable, useTable, TableAction } from '@/components/Table'; |
|||
import { |
|||
personProductsList, |
|||
personProductsExport, |
|||
personProductsRemove, |
|||
} from '@/api/zaojiaManagement/productManagement/personProducts'; |
|||
import { downloadExcel } from '@/utils/file/download'; |
|||
import { useModal } from '@/components/Modal'; |
|||
import PersonProductsModal from './PersonProductsModal.vue'; |
|||
import { formSchemas, columns } from './personProducts.data'; |
|||
import { IconEnum } from '@/enums/appEnum'; |
|||
import { Image } from 'ant-design-vue'; |
|||
|
|||
defineOptions({ name: 'PersonProducts' }); |
|||
|
|||
const [registerTable, { reload, multipleRemove, selected, getForm }] = useTable({ |
|||
rowSelection: { |
|||
type: 'checkbox', |
|||
}, |
|||
title: '个人产品管理列表', |
|||
api: personProductsList, |
|||
showIndexColumn: false, |
|||
rowKey: 'id', |
|||
useSearchForm: true, |
|||
formConfig: { |
|||
schemas: formSchemas, |
|||
baseColProps: { |
|||
xs: 24, |
|||
sm: 24, |
|||
md: 24, |
|||
lg: 6, |
|||
}, |
|||
}, |
|||
columns: columns, |
|||
actionColumn: { |
|||
width: 200, |
|||
title: '操作', |
|||
key: 'action', |
|||
fixed: 'right', |
|||
}, |
|||
}); |
|||
|
|||
const [registerModal, { openModal }] = useModal(); |
|||
|
|||
function handleEdit(record: Recordable) { |
|||
openModal(true, { record, update: true }); |
|||
} |
|||
|
|||
function handleAdd() { |
|||
openModal(true, { update: false }); |
|||
} |
|||
|
|||
async function handleDelete(record: Recordable) { |
|||
await personProductsRemove([record.id]); |
|||
await reload(); |
|||
} |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,229 @@ |
|||
import { BasicColumn } from '@/components/Table'; |
|||
import { FormSchema } from '@/components/Form'; |
|||
export const formSchemas: FormSchema[] = [ |
|||
{ |
|||
label: '供应商', |
|||
field: 'supplierInformationId', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '产品名称', |
|||
field: 'productName', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '产品型号', |
|||
field: 'productIdentity', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '产品价格', |
|||
field: 'productPrice', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '信息来源', |
|||
field: 'sourceInformation', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '个人产品规格', |
|||
field: 'productSpecifications', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '关联厂商产品id', |
|||
field: 'supplierProductsId', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remarks', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '品牌', |
|||
field: 'brand', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '单位', |
|||
field: 'unit', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '除税价', |
|||
field: 'exTaxPrice', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '税率', |
|||
field: 'taxrate', |
|||
component: 'Input', |
|||
}, |
|||
]; |
|||
|
|||
export const columns: BasicColumn[] = [ |
|||
{ |
|||
title: '主键', |
|||
dataIndex: 'id', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
title: '供应商', |
|||
dataIndex: 'supplierInformationId', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
title: '产品名称', |
|||
dataIndex: 'productName', |
|||
}, |
|||
{ |
|||
title: '产品型号', |
|||
dataIndex: 'productIdentity', |
|||
}, |
|||
{ |
|||
title: '个人产品规格', |
|||
dataIndex: 'productSpecifications', |
|||
}, |
|||
{ |
|||
title: '产品价格', |
|||
dataIndex: 'productPrice', |
|||
}, |
|||
{ |
|||
title: '信息来源', |
|||
dataIndex: 'sourceInformation', |
|||
}, |
|||
|
|||
{ |
|||
title: '关联厂商产品id', |
|||
dataIndex: 'supplierProductsId', |
|||
}, |
|||
{ |
|||
title: '备注', |
|||
dataIndex: 'remarks', |
|||
}, |
|||
{ |
|||
title: '图片', |
|||
dataIndex: 'image', |
|||
}, |
|||
{ |
|||
title: '品牌', |
|||
dataIndex: 'brand', |
|||
}, |
|||
{ |
|||
title: '单位', |
|||
dataIndex: 'unit', |
|||
}, |
|||
{ |
|||
title: '除税价', |
|||
dataIndex: 'exTaxPrice', |
|||
}, |
|||
{ |
|||
title: '税率', |
|||
dataIndex: 'taxrate', |
|||
}, |
|||
]; |
|||
|
|||
export const modalSchemas: FormSchema[] = [ |
|||
{ |
|||
label: '主键', |
|||
field: 'id', |
|||
required: false, |
|||
component: 'Input', |
|||
show: false, |
|||
}, |
|||
{ |
|||
label: '供应商', |
|||
field: 'supplierInformationId', |
|||
required: false, |
|||
slot: 'supplierInformationIdSlot', |
|||
}, |
|||
{ |
|||
label: '产品名称', |
|||
field: 'productName', |
|||
required: true, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '产品型号', |
|||
field: 'productIdentity', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '个人产品规格', |
|||
field: 'productSpecifications', |
|||
required: false, |
|||
slot: 'productSpecificationsSlot', |
|||
}, |
|||
{ |
|||
label: '产品价格', |
|||
field: 'productPrice', |
|||
required: true, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '信息来源', |
|||
field: 'sourceInformation', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '关联厂商产品id', |
|||
field: 'supplierProductsId', |
|||
required: false, |
|||
component: 'Input', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remarks', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '图片', |
|||
field: 'image', |
|||
required: false, |
|||
slot: 'imageSlot', |
|||
}, |
|||
{ |
|||
label: '品牌', |
|||
field: 'brand', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '单位', |
|||
field: 'unit', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '除税价', |
|||
field: 'exTaxPrice', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '税率', |
|||
field: 'taxrate', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '分类id', |
|||
field: 'categoryId', |
|||
required: false, |
|||
component: 'Input', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
label: '型号id', |
|||
field: 'modelId', |
|||
required: true, |
|||
component: 'Input', |
|||
ifShow: false, |
|||
}, |
|||
]; |
@ -0,0 +1,95 @@ |
|||
<template> |
|||
<BasicModal |
|||
v-bind="$attrs" |
|||
:title="title" |
|||
@register="registerInnerModal" |
|||
@ok="handleSubmit" |
|||
@cancel="resetForm" |
|||
:closeFunc="closeFunc" |
|||
> |
|||
<BasicForm @register="registerForm"> |
|||
<template #supplierInformationIdSlot="{ model, field }"> |
|||
<SupplierSelector v-model="model[field]" /> |
|||
</template> |
|||
<template #productSpecificationsSlot="{ model, field }"> |
|||
<productModelSet |
|||
v-model="model[field]" |
|||
:moduleParam="moduleParam" |
|||
v-model:modelId="model['modelId']" |
|||
/> |
|||
</template> |
|||
<template #imageSlot="{ model, field }"> |
|||
<ImageUpload v-model:value="model[field]" :api="uploadApi" /> |
|||
</template> |
|||
</BasicForm> |
|||
</BasicModal> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { BasicModal, useModalInner } from '@/components/Modal'; |
|||
import { BasicForm, useForm } from '@/components/Form'; |
|||
import { computed, ref, unref } from 'vue'; |
|||
import { |
|||
supplierProductsInfo, |
|||
supplierProductsAdd, |
|||
supplierProductsUpdate, |
|||
} from '@/api/zaojiaManagement/productManagement/supplierProducts'; |
|||
import { modalSchemas } from './supplierProducts.data'; |
|||
import SupplierSelector from '@/views/zaojiaManagement/productManagement/components/SupplierSelector.vue'; |
|||
import productModelSet from '@/views/zaojiaManagement/productManagement/components/productModelSet.vue'; |
|||
import { uploadApi } from '@/api/upload'; |
|||
import { ImageUpload } from '@/components/Upload'; |
|||
|
|||
defineOptions({ name: 'SupplierProductsModal' }); |
|||
|
|||
const emit = defineEmits(['register', 'reload']); |
|||
const isUpdate = ref<boolean>(false); |
|||
const title = computed<string>(() => { |
|||
return isUpdate.value ? '编辑供应商产品管理' : '新增供应商产品管理'; |
|||
}); |
|||
const moduleParam = ref<Object>({ name: '个人产品管理', value: 'supplierProducts' }); |
|||
const [registerInnerModal, { modalLoading, closeModal }] = useModalInner( |
|||
async (data: { record?: Recordable; update: boolean }) => { |
|||
modalLoading(true); |
|||
const { record, update } = data; |
|||
isUpdate.value = update; |
|||
if (update && record) { |
|||
const ret = await supplierProductsInfo(record.id); |
|||
await setFieldsValue(ret); |
|||
} |
|||
modalLoading(false); |
|||
}, |
|||
); |
|||
|
|||
const [registerForm, { setFieldsValue, resetForm, validate }] = useForm({ |
|||
labelWidth: 100, |
|||
showActionButtonGroup: false, |
|||
baseColProps: { span: 24 }, |
|||
schemas: modalSchemas, |
|||
}); |
|||
|
|||
async function handleSubmit() { |
|||
try { |
|||
modalLoading(true); |
|||
const data = await validate(); |
|||
if (unref(isUpdate)) { |
|||
data['image'] = data['image'][0]; |
|||
await supplierProductsUpdate(data); |
|||
} else { |
|||
data['image'] = data['image'][0]; |
|||
await supplierProductsAdd(data); |
|||
} |
|||
emit('reload'); |
|||
closeModal(); |
|||
await resetForm(); |
|||
} catch (e) { |
|||
} finally { |
|||
modalLoading(false); |
|||
} |
|||
} |
|||
async function closeFunc() { |
|||
return true; |
|||
} |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,122 @@ |
|||
<template> |
|||
<PageWrapper dense> |
|||
<BasicTable @register="registerTable"> |
|||
<template #toolbar> |
|||
<a-button |
|||
@click=" |
|||
downloadExcel(supplierProductsExport, '供应商产品管理数据', getForm().getFieldsValue()) |
|||
" |
|||
v-auth="'supplierProducts:supplierProducts:export'" |
|||
>导出</a-button |
|||
> |
|||
<a-button |
|||
type="primary" |
|||
danger |
|||
@click="multipleRemove(supplierProductsRemove)" |
|||
:disabled="!selected" |
|||
v-auth="'supplierProducts:supplierProducts:remove'" |
|||
>删除</a-button |
|||
> |
|||
<a-button type="primary" @click="handleAdd" v-auth="'supplierProducts:supplierProducts:add'" |
|||
>新增</a-button |
|||
> |
|||
</template> |
|||
<template #bodyCell="{ column, record }"> |
|||
<template v-if="column.key === 'action'"> |
|||
<TableAction |
|||
stopButtonPropagation |
|||
:actions="[ |
|||
{ |
|||
label: '修改', |
|||
icon: IconEnum.EDIT, |
|||
type: 'primary', |
|||
ghost: true, |
|||
auth: 'supplierProducts:supplierProducts:edit', |
|||
onClick: handleEdit.bind(null, record), |
|||
}, |
|||
{ |
|||
label: '删除', |
|||
icon: IconEnum.DELETE, |
|||
type: 'primary', |
|||
danger: true, |
|||
ghost: true, |
|||
auth: 'supplierProducts:supplierProducts:remove', |
|||
popConfirm: { |
|||
placement: 'left', |
|||
title: '是否删除供应商产品管理[' + record.id + ']?', |
|||
confirm: handleDelete.bind(null, record), |
|||
}, |
|||
}, |
|||
]" |
|||
/> |
|||
</template> |
|||
<template v-if="column.dataIndex === 'image'"> |
|||
<Image v-if="record.image" :src="record.image" :height="30" /> |
|||
</template> |
|||
</template> |
|||
</BasicTable> |
|||
<SupplierProductsModal @register="registerModal" @reload="reload" /> |
|||
</PageWrapper> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { PageWrapper } from '@/components/Page'; |
|||
import { BasicTable, useTable, TableAction } from '@/components/Table'; |
|||
import { |
|||
supplierProductsList, |
|||
supplierProductsExport, |
|||
supplierProductsRemove, |
|||
} from '@/api/zaojiaManagement/productManagement/supplierProducts'; |
|||
import { downloadExcel } from '@/utils/file/download'; |
|||
import { useModal } from '@/components/Modal'; |
|||
import SupplierProductsModal from './SupplierProductsModal.vue'; |
|||
import { formSchemas, columns } from './supplierProducts.data'; |
|||
import { IconEnum } from '@/enums/appEnum'; |
|||
import { Image } from 'ant-design-vue'; |
|||
|
|||
defineOptions({ name: 'SupplierProducts' }); |
|||
|
|||
const [registerTable, { reload, multipleRemove, selected, getForm }] = useTable({ |
|||
rowSelection: { |
|||
type: 'checkbox', |
|||
}, |
|||
title: '供应商产品管理列表', |
|||
api: supplierProductsList, |
|||
showIndexColumn: false, |
|||
rowKey: 'id', |
|||
useSearchForm: true, |
|||
formConfig: { |
|||
schemas: formSchemas, |
|||
baseColProps: { |
|||
xs: 24, |
|||
sm: 24, |
|||
md: 24, |
|||
lg: 6, |
|||
}, |
|||
}, |
|||
columns: columns, |
|||
actionColumn: { |
|||
width: 200, |
|||
title: '操作', |
|||
key: 'action', |
|||
fixed: 'right', |
|||
}, |
|||
}); |
|||
|
|||
const [registerModal, { openModal }] = useModal(); |
|||
|
|||
function handleEdit(record: Recordable) { |
|||
openModal(true, { record, update: true }); |
|||
} |
|||
|
|||
function handleAdd() { |
|||
openModal(true, { update: false }); |
|||
} |
|||
|
|||
async function handleDelete(record: Recordable) { |
|||
await supplierProductsRemove([record.id]); |
|||
await reload(); |
|||
} |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,225 @@ |
|||
import { BasicColumn } from '@/components/Table'; |
|||
import { FormSchema } from '@/components/Form'; |
|||
export const formSchemas: FormSchema[] = [ |
|||
{ |
|||
label: '供应商', |
|||
field: 'supplierInformationId', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '供应商产品规格', |
|||
field: 'productSpecifications', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '产品名称', |
|||
field: 'productName', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '产品标识', |
|||
field: 'productIdentity', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '产品价格', |
|||
field: 'productPrice', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '信息来源', |
|||
field: 'sourceInformation', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remarks', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '品牌', |
|||
field: 'brand', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '单位', |
|||
field: 'unit', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '除税价', |
|||
field: 'exTaxPrice', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '税率', |
|||
field: 'taxrate', |
|||
component: 'Input', |
|||
}, |
|||
]; |
|||
|
|||
export const columns: BasicColumn[] = [ |
|||
{ |
|||
title: '主键', |
|||
dataIndex: 'id', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
title: '供应商', |
|||
dataIndex: 'supplierInformationId', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
title: '供应商产品规格', |
|||
dataIndex: 'productSpecifications', |
|||
// ellipsis:false,
|
|||
// width:300,
|
|||
// customRender
|
|||
}, |
|||
{ |
|||
title: '产品名称', |
|||
dataIndex: 'productName', |
|||
// ellipsis:false
|
|||
}, |
|||
{ |
|||
title: '产品标识', |
|||
dataIndex: 'productIdentity', |
|||
}, |
|||
{ |
|||
title: '产品价格', |
|||
dataIndex: 'productPrice', |
|||
}, |
|||
{ |
|||
title: '信息来源', |
|||
dataIndex: 'sourceInformation', |
|||
}, |
|||
{ |
|||
title: '备注', |
|||
dataIndex: 'remarks', |
|||
}, |
|||
{ |
|||
title: '图片', |
|||
dataIndex: 'image', |
|||
}, |
|||
{ |
|||
title: '品牌', |
|||
dataIndex: 'brand', |
|||
}, |
|||
{ |
|||
title: '单位', |
|||
dataIndex: 'unit', |
|||
}, |
|||
{ |
|||
title: '除税价', |
|||
dataIndex: 'exTaxPrice', |
|||
}, |
|||
{ |
|||
title: '税率', |
|||
dataIndex: 'taxrate', |
|||
}, |
|||
{ |
|||
title: '分类id', |
|||
dataIndex: 'categoryId', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
title: '型号id', |
|||
dataIndex: 'modelId', |
|||
ifShow: false, |
|||
}, |
|||
]; |
|||
|
|||
export const modalSchemas: FormSchema[] = [ |
|||
{ |
|||
label: '主键', |
|||
field: 'id', |
|||
required: false, |
|||
component: 'Input', |
|||
show: false, |
|||
}, |
|||
{ |
|||
label: '供应商', |
|||
field: 'supplierInformationId', |
|||
required: true, |
|||
slot: 'supplierInformationIdSlot', |
|||
}, |
|||
{ |
|||
label: '供应商产品规格', |
|||
field: 'productSpecifications', |
|||
required: true, |
|||
slot: 'productSpecificationsSlot', |
|||
}, |
|||
{ |
|||
label: '产品名称', |
|||
field: 'productName', |
|||
required: true, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '产品标识', |
|||
field: 'productIdentity', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '产品价格', |
|||
field: 'productPrice', |
|||
required: true, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '信息来源', |
|||
field: 'sourceInformation', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remarks', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '图片', |
|||
field: 'image', |
|||
required: false, |
|||
slot: 'imageSlot', |
|||
}, |
|||
{ |
|||
label: '品牌', |
|||
field: 'brand', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '单位', |
|||
field: 'unit', |
|||
required: true, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '除税价', |
|||
field: 'exTaxPrice', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '税率', |
|||
field: 'taxrate', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '分类id', |
|||
field: 'categoryId', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '型号id', |
|||
field: 'modelId', |
|||
required: false, |
|||
component: 'Input', |
|||
ifShow: false, |
|||
}, |
|||
]; |
@ -0,0 +1,72 @@ |
|||
<template> |
|||
<BasicModal |
|||
v-bind="$attrs" |
|||
:title="title" |
|||
@register="registerInnerModal" |
|||
@ok="handleSubmit" |
|||
@cancel="resetForm" |
|||
> |
|||
<BasicForm @register="registerForm" /> |
|||
</BasicModal> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { BasicModal, useModalInner } from '@/components/Modal'; |
|||
import { BasicForm, useForm } from '@/components/Form'; |
|||
import { computed, ref, unref } from 'vue'; |
|||
import { |
|||
supplierInformationInfo, |
|||
supplierInformationAdd, |
|||
supplierInformationUpdate, |
|||
} from '@/api/zaojiaManagement/supplierManagement'; |
|||
import { modalSchemas } from './supplierInformation.data'; |
|||
|
|||
defineOptions({ name: 'SupplierInformationModal' }); |
|||
|
|||
const emit = defineEmits(['register', 'reload']); |
|||
|
|||
const isUpdate = ref<boolean>(false); |
|||
const title = computed<string>(() => { |
|||
return isUpdate.value ? '编辑供应商信息管理' : '新增供应商信息管理'; |
|||
}); |
|||
|
|||
const [registerInnerModal, { modalLoading, closeModal }] = useModalInner( |
|||
async (data: { record?: Recordable; update: boolean }) => { |
|||
modalLoading(true); |
|||
const { record, update } = data; |
|||
isUpdate.value = update; |
|||
if (update && record) { |
|||
const ret = await supplierInformationInfo(record.id); |
|||
await setFieldsValue(ret); |
|||
} |
|||
modalLoading(false); |
|||
}, |
|||
); |
|||
|
|||
const [registerForm, { setFieldsValue, resetForm, validate }] = useForm({ |
|||
labelWidth: 100, |
|||
showActionButtonGroup: false, |
|||
baseColProps: { span: 24 }, |
|||
schemas: modalSchemas, |
|||
}); |
|||
|
|||
async function handleSubmit() { |
|||
try { |
|||
modalLoading(true); |
|||
const data = await validate(); |
|||
if (unref(isUpdate)) { |
|||
await supplierInformationUpdate(data); |
|||
} else { |
|||
await supplierInformationAdd(data); |
|||
} |
|||
emit('reload'); |
|||
closeModal(); |
|||
await resetForm(); |
|||
} catch (e) { |
|||
} finally { |
|||
modalLoading(false); |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,125 @@ |
|||
<template> |
|||
<PageWrapper dense> |
|||
<BasicTable @register="registerTable"> |
|||
<template #toolbar> |
|||
<a-button |
|||
@click=" |
|||
downloadExcel( |
|||
supplierInformationExport, |
|||
'供应商信息管理数据', |
|||
getForm().getFieldsValue(), |
|||
) |
|||
" |
|||
v-auth="'productManagement:supplierInformation:export'" |
|||
>导出</a-button |
|||
> |
|||
<a-button |
|||
type="primary" |
|||
danger |
|||
@click="multipleRemove(supplierInformationRemove)" |
|||
:disabled="!selected" |
|||
v-auth="'productManagement:supplierInformation:remove'" |
|||
>删除</a-button |
|||
> |
|||
<a-button |
|||
type="primary" |
|||
@click="handleAdd" |
|||
v-auth="'productManagement:supplierInformation:add'" |
|||
>新增</a-button |
|||
> |
|||
</template> |
|||
<template #bodyCell="{ column, record }"> |
|||
<template v-if="column.key === 'action'"> |
|||
<TableAction |
|||
stopButtonPropagation |
|||
:actions="[ |
|||
{ |
|||
label: '修改', |
|||
icon: IconEnum.EDIT, |
|||
type: 'primary', |
|||
ghost: true, |
|||
auth: 'productManagement:supplierInformation:edit', |
|||
onClick: handleEdit.bind(null, record), |
|||
}, |
|||
{ |
|||
label: '删除', |
|||
icon: IconEnum.DELETE, |
|||
type: 'primary', |
|||
danger: true, |
|||
ghost: true, |
|||
auth: 'productManagement:supplierInformation:remove', |
|||
popConfirm: { |
|||
placement: 'left', |
|||
title: '是否删除供应商信息管理[' + record.id + ']?', |
|||
confirm: handleDelete.bind(null, record), |
|||
}, |
|||
}, |
|||
]" |
|||
/> |
|||
</template> |
|||
</template> |
|||
</BasicTable> |
|||
<SupplierInformationModal @register="registerModal" @reload="reload" /> |
|||
</PageWrapper> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { PageWrapper } from '@/components/Page'; |
|||
import { BasicTable, useTable, TableAction } from '@/components/Table'; |
|||
import { |
|||
supplierInformationList, |
|||
supplierInformationExport, |
|||
supplierInformationRemove, |
|||
} from '@/api/zaojiaManagement/supplierManagement'; |
|||
import { downloadExcel } from '@/utils/file/download'; |
|||
import { useModal } from '@/components/Modal'; |
|||
import SupplierInformationModal from './SupplierInformationModal.vue'; |
|||
import { formSchemas, columns } from './supplierInformation.data'; |
|||
import { IconEnum } from '@/enums/appEnum'; |
|||
|
|||
defineOptions({ name: 'SupplierInformation' }); |
|||
|
|||
const [registerTable, { reload, multipleRemove, selected, getForm }] = useTable({ |
|||
rowSelection: { |
|||
type: 'checkbox', |
|||
}, |
|||
title: '供应商信息管理列表', |
|||
api: supplierInformationList, |
|||
showIndexColumn: false, |
|||
rowKey: 'id', |
|||
useSearchForm: true, |
|||
formConfig: { |
|||
schemas: formSchemas, |
|||
baseColProps: { |
|||
xs: 24, |
|||
sm: 24, |
|||
md: 24, |
|||
lg: 6, |
|||
}, |
|||
}, |
|||
columns: columns, |
|||
actionColumn: { |
|||
width: 200, |
|||
title: '操作', |
|||
key: 'action', |
|||
fixed: 'right', |
|||
}, |
|||
}); |
|||
|
|||
const [registerModal, { openModal }] = useModal(); |
|||
|
|||
function handleEdit(record: Recordable) { |
|||
openModal(true, { record, update: true }); |
|||
} |
|||
|
|||
function handleAdd() { |
|||
openModal(true, { update: false }); |
|||
} |
|||
|
|||
async function handleDelete(record: Recordable) { |
|||
await supplierInformationRemove([record.id]); |
|||
await reload(); |
|||
} |
|||
</script> |
|||
|
|||
<style scoped></style> |
@ -0,0 +1,107 @@ |
|||
import { BasicColumn } from '@/components/Table'; |
|||
import { FormSchema } from '@/components/Form'; |
|||
import { getDictOptions } from '@/utils/dict'; |
|||
import { useRender } from '@/hooks/component/useRender'; |
|||
export const formSchemas: FormSchema[] = [ |
|||
{ |
|||
label: '供应商名称', |
|||
field: 'supplierName', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '供应商联系人', |
|||
field: 'supplierContacts', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '职位', |
|||
field: 'position', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '供应商联系电话', |
|||
field: 'supplierContactsPhone', |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '供应商类型', |
|||
field: 'supplierType', |
|||
component: 'Select', |
|||
componentProps: { |
|||
options: getDictOptions('supplier_type'), |
|||
}, |
|||
}, |
|||
]; |
|||
|
|||
const { renderDict } = useRender(); |
|||
export const columns: BasicColumn[] = [ |
|||
{ |
|||
title: '主键', |
|||
dataIndex: 'id', |
|||
ifShow: false, |
|||
}, |
|||
{ |
|||
title: '供应商名称', |
|||
dataIndex: 'supplierName', |
|||
}, |
|||
{ |
|||
title: '供应商联系人', |
|||
dataIndex: 'supplierContacts', |
|||
}, |
|||
{ |
|||
title: '职位', |
|||
dataIndex: 'position', |
|||
}, |
|||
{ |
|||
title: '供应商联系电话', |
|||
dataIndex: 'supplierContactsPhone', |
|||
}, |
|||
{ |
|||
title: '供应商类型', |
|||
dataIndex: 'supplierType', |
|||
customRender: ({ value }) => renderDict(value, 'supplier_type'), |
|||
}, |
|||
]; |
|||
|
|||
export const modalSchemas: FormSchema[] = [ |
|||
{ |
|||
label: '主键', |
|||
field: 'id', |
|||
// required: true,
|
|||
component: 'Input', |
|||
show: false, |
|||
}, |
|||
{ |
|||
label: '供应商名称', |
|||
field: 'supplierName', |
|||
required: true, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '供应商联系人', |
|||
field: 'supplierContacts', |
|||
required: true, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '职位', |
|||
field: 'position', |
|||
required: false, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '供应商电话', |
|||
field: 'supplierContactsPhone', |
|||
required: true, |
|||
component: 'Input', |
|||
}, |
|||
{ |
|||
label: '供应商类型', |
|||
field: 'supplierType', |
|||
required: false, |
|||
component: 'Select', |
|||
componentProps: { |
|||
options: getDictOptions('supplier_type'), |
|||
}, |
|||
}, |
|||
]; |
Loading…
Reference in new issue