Commit 67ef1de4 by linjinhong Committed by wusiyi

feat:【工厂端】工厂端-供应模块新增供应商管理#1001007

parent 40cfb810
import { BasePaginationData, BaseRespData } from '@/types/api'
import axios from './../axios'
import {
IListPage,
IsupplierType,
} from '@/views/supply/supplierManagement/types/index'
export interface IListPage {
pageSize: number | string
currentPage: number | string
}
//供应商分页查询
export function getSupplierListApi(params: IListPage) {
return axios.post<never, BasePaginationData<never>>(
return axios.get<never, BasePaginationData<never>>(
'/factory/supplier/list_page',
params,
{ params },
)
}
......@@ -19,3 +19,46 @@ export function deleteSupplierApi(params: { ids: string }) {
params,
})
}
// 编辑回显接口
export function getSupplierDetailApi(id: string | number) {
return axios.get<never, BaseRespData<never>>('factory/supplier/get', {
params: { id },
})
}
// 根据分类id获取属性信息
export function getPropertyByCateIdApi(cateId: string | number) {
return axios.get<never, BaseRespData<never>>(
'/factory/supplier/getPropertyByCateId',
{
params: { cateId },
},
)
}
// 根据spu获取商品信息
export function getProductInfoBySpuApi(spu: string | number) {
return axios.get<never, BaseRespData<never>>(
'/factory/supplier/getProductInfoBySpu',
{
params: { spu },
},
)
}
// 获取币种接口
export function getBaseCurrencyInfoApi() {
return axios.get<never, BaseRespData<never>>(
'factory/supplier/getBaseCurrencyInfo',
)
}
//新增
export function addSupplierApi(params: IsupplierType) {
return axios.post<never, BaseRespData<never>>('/factory/supplier/add', params)
}
//修改
export function updateSupplierApi(params: IsupplierType) {
return axios.post<never, BaseRespData<never>>(
'/factory/supplier/update',
params,
)
}
......@@ -110,6 +110,13 @@ export default defineComponent({
emit('getCheckboxRecords', selectRecords)
}
}
//获取设置多选框
const setCheckboxRow = (row: TableRowData, checked: boolean) => {
const $table = tableRef.value
if ($table) {
$table.setCheckboxRow(row, checked)
}
}
//设置高亮行
const selectRowEvent = (row: TableRowData) => {
const $table = tableRef.value
......@@ -129,6 +136,7 @@ export default defineComponent({
editConfig,
getSelectEvent,
selectRowEvent,
setCheckboxRow,
attrs,
}
},
......
......@@ -32,23 +32,25 @@ export default defineComponent({
return () => {
return (
<ElDialog
ref={formRef}
v-model={isShow.value}
title={props.title}
width={props.dialogWidth}
onClose={() => {
emit('close')
}}
destroy-on-close={true}
close-on-click-modal={false}
{...attrs}
>
<div class="dialog-form">
{slots.default?.()}
{slots.footer?.()}
</div>
</ElDialog>
<div>
<ElDialog
ref={formRef}
v-model={isShow.value}
title={props.title}
width={props.dialogWidth}
onClose={() => {
emit('close')
}}
destroy-on-close={true}
close-on-click-modal={false}
{...attrs}
>
<div class="dialog-form">
{slots.default?.()}
{slots.footer?.()}
</div>
</ElDialog>
</div>
)
}
},
......
import { Ref, ref } from 'vue'
import { cloneDeep } from 'lodash-es'
export function useValue<T extends object>(
initialValue: T,
): [Ref<T>, () => void] {
const value = ref<T>(cloneDeep(initialValue)) as Ref<T>
const resetToDefault = () => {
value.value = cloneDeep(initialValue)
}
return [value, resetToDefault]
}
export interface DeclarationRuleList {
countries: string
createTime: string
currency: string
defaulted: string
fixedValue: string
fixedWeight: string
id: number
name: string
orderPercent: number
remark: string
shops: string
type: number
valueUp: number
wayIds: string
wayNames: string
weightPercent: number
weightUp: number
}
export interface AddDeclarationRuleObj {
currency?: string
fixedValue?: string
fixedWeight?: string
id?: number
limitAmountType?: string
limitWeightType?: string
name?: string
orderPercent?: number | string | null
remark?: string
shops?: string
type?: number
valueUp?: number | string | null
weightPercent?: number | string | null
weightUp?: number | string | null
logisticsWay?: string
logisticsWayId?: (string | number)[]
}
export interface IListPage {
pageSize: number | string
currentPage: number | string
}
export interface IgoodsType {
imgUrl?: string
productImage?: string
sku?: string
productSpu?: string
productNo?: string
id?: string
productId?: string
categoryId?: string
currencyCode?: string
currencyName?: string
name?: string
productName?: string
createTime?: string
updateTime?: string
customProductItemList?: Iprice[]
supplierPriceItemList?: Iprice[]
customProductInfo?: IgoodsType
propertyList?: []
supplyPriceRange?: string
}
export interface IsupplierType {
supplierName?: string
contacts?: string
contactsNumber?: string
address?: string
id?: string
supplierProductInfoList?: IgoodsType[]
remark?: string
}
export interface IcurrencyCode {
currencyName?: string
currencyCode?: string
id?: string
}
export interface IcolorType {
bgColor?: string
code?: string
fontColor?: string
cnname?: string
enname?: string
id?: string | number
}
export interface IsizeType {
code?: string
cnname?: string
id?: string | number
}
export interface IPropertyResponseItem {
id: string | number
valueList: IcolorType[] | IsizeType[]
}
export interface Iprice {
productItemSku?: string
productItemImage?: string
sku?: string
id?: string
image?: string
supplyPrice?: string | number
propertyCode1?: string
propertyCode2?: string
productItemId?: string
}
export interface IListPage {
pageSize: number | string
currentPage: number | string
}
export interface LogisticsMethod {
id?: number | string
name?: string
warehouseId?: number
warehouseName?: string
companyId?: number
company?: string
serviceCode?: string
siteUrl?: string
status: number | string
platformList: platformObj[]
ruleRef: ruleRefObj
ruleId?: string | number
ruleList?: ruleRefObj[]
uinuinWarehouseId?: number | string | null
companyWarehouseCode?: number | string | null
}
export interface LogisticsMethodList {
name?: string
status?: number | string
serviceCode?: number | string
pageSize: number | string
currentPage: number | string
}
export interface UpdateLogisticsMethodStatus {
id?: number | string
status?: number | string
}
export interface LogisticsResponse {
code: number
data: {
total: number
size: number
current: number
records: LogisticsMethod[]
}
message: string
}
export interface platformObj {
platform: string
logisticsName: string | number
showPlatform: (string | number)[]
}
interface ruleRefObj {
ruleId: string | number
ruleName: string | number
}
export interface LogisticsTrackingTree {
name: string
status: number
num: number
}
export interface LogisticsTrackingParams {
trackNumber?: number | string
shopNumber?: string | number
trackingStatus?: number
}
export interface LogisticsPartitionObj {
zoneName?: string
logistics?: string
codePrefix?: string
logisticsId?: string
}
export interface LogisticsQuotation {
factoryId?: number
id?: number
logistics?: string
logisticsId?: number
rate?: number
rateG?: number
rateKg?: number
rateType?: string
seq?: number
unit?: string
zone1?: string
zone2?: string
zone3?: string
zone4?: string
zone5?: string
zone6?: string
zone7?: string
zone8?: string
zone9?: string
logisticsQuotationList?: LogisticsQuotation[]
}
export interface ShippingAddressObj {
addressLine1?: string
addressLine2?: string
addressLine3?: string
city?: string
cityCode?: string
countryCode?: string
countryName?: string
createTime?: string
cspAccount?: string
district?: string
districtCode?: string
factoryId?: number
id?: number
phoneNumber?: string
postalCode?: string
rfcTaxId?: string
shipperName?: string
stateProvince?: string
stateProvinceAbbr?: string
swDefault?: boolean
updateTime?: string
checked?: boolean
}
export interface ICountryObj {
aeCountryCode: string
continentCode: string
countryCode: string
id: number
nameCn: string
nameEn: string
needProviceAbbr: number
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment