Commit cd413969 by linjinhong

Merge branch 'task2_lin_528' of…

Merge branch 'task2_lin_528' of http://47.122.114.111:9999/qinjianhui/factory_front into task2_lin_528
parents 5949aa2c 94050e88
...@@ -8,6 +8,7 @@ export {} ...@@ -8,6 +8,7 @@ export {}
declare module 'vue' { declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
AmountInput: typeof import('./src/components/Form.vue/AmountInput.vue')['default'] AmountInput: typeof import('./src/components/Form.vue/AmountInput.vue')['default']
AmountInput: typeof import('./src/components/Form.vue/AmountInput.vue')['default']
CommonCard: typeof import('./src/components/CommonCard.vue')['default'] CommonCard: typeof import('./src/components/CommonCard.vue')['default']
DatePicker: typeof import('./src/components/Form.vue/DatePicker.vue')['default'] DatePicker: typeof import('./src/components/Form.vue/DatePicker.vue')['default']
DateRangePicker: typeof import('./src/components/Form.vue/DateRangePicker.vue')['default'] DateRangePicker: typeof import('./src/components/Form.vue/DateRangePicker.vue')['default']
...@@ -58,13 +59,8 @@ declare module 'vue' { ...@@ -58,13 +59,8 @@ declare module 'vue' {
RenderColumn: typeof import('./src/components/RenderColumn.vue')['default'] RenderColumn: typeof import('./src/components/RenderColumn.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView'] RouterView: typeof import('vue-router')['RouterView']
SearchForm: typeof import('./src/components/SearchForm.vue')['default']
Select: typeof import('./src/components/Form.vue/Select.vue')['default']
ShipmentOrderDetail: typeof import('./src/components/ShipmentOrderDetail.vue')['default'] ShipmentOrderDetail: typeof import('./src/components/ShipmentOrderDetail.vue')['default']
SplitDiv: typeof import('./src/components/splitDiv/splitDiv.vue')['default'] SplitDiv: typeof import('./src/components/splitDiv/splitDiv.vue')['default']
'Switch ': typeof import('./src/components/Form.vue/Switch .vue')['default']
Swtich: typeof import('./src/components/Form.vue/Swtich.vue')['default']
TableList: typeof import('./src/components/TableList.vue')['default']
TableRightMenu: typeof import('./src/components/TableRightMenu.vue')['default'] TableRightMenu: typeof import('./src/components/TableRightMenu.vue')['default']
TableView: typeof import('./src/components/TableView.vue')['default'] TableView: typeof import('./src/components/TableView.vue')['default']
UploadExcel: typeof import('./src/components/UploadExcel.vue')['default'] UploadExcel: typeof import('./src/components/UploadExcel.vue')['default']
...@@ -72,7 +68,4 @@ declare module 'vue' { ...@@ -72,7 +68,4 @@ declare module 'vue' {
VxeTable: typeof import('./src/components/VxeTable.vue')['default'] VxeTable: typeof import('./src/components/VxeTable.vue')['default']
WangEditor: typeof import('./src/components/WangEditor.vue')['default'] WangEditor: typeof import('./src/components/WangEditor.vue')['default']
} }
export interface ComponentCustomProperties {
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
}
} }
...@@ -3273,7 +3273,8 @@ ...@@ -3273,7 +3273,8 @@
"type": "github", "type": "github",
"url": "https://github.com/sponsors/ai" "url": "https://github.com/sponsors/ai"
} }
] ],
"license": "CC-BY-4.0"
}, },
"node_modules/cfb": { "node_modules/cfb": {
"version": "1.2.2", "version": "1.2.2",
...@@ -3319,9 +3320,6 @@ ...@@ -3319,9 +3320,6 @@
}, },
"funding": { "funding": {
"url": "https://paulmillr.com/funding/" "url": "https://paulmillr.com/funding/"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
} }
}, },
"node_modules/codepage": { "node_modules/codepage": {
...@@ -3389,7 +3387,8 @@ ...@@ -3389,7 +3387,8 @@
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-2.0.0.tgz", "resolved": "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-2.0.0.tgz",
"integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
"dev": true "dev": true,
"license": "MIT"
}, },
"node_modules/crc-32": { "node_modules/crc-32": {
"version": "1.2.2", "version": "1.2.2",
...@@ -5696,6 +5695,9 @@ ...@@ -5696,6 +5695,9 @@
"license": "MIT", "license": "MIT",
"funding": { "funding": {
"url": "https://github.com/sponsors/antoniandre" "url": "https://github.com/sponsors/antoniandre"
},
"peerDependencies": {
"vue": "^3.2.0"
} }
}, },
"node_modules/ssf": { "node_modules/ssf": {
...@@ -6468,8 +6470,9 @@ ...@@ -6468,8 +6470,9 @@
}, },
"node_modules/wildcard": { "node_modules/wildcard": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/wildcard/-/wildcard-1.1.2.tgz", "resolved": "https://registry.npmmirror.com/wildcard/-/wildcard-1.1.2.tgz",
"integrity": "sha512-DXukZJxpHA8LuotRwL0pP1+rS6CS7FF2qStDDE1C7DDg2rLud2PXRMuEDYIPhgEezwnlHNL4c+N6MfMTjCGTng==" "integrity": "sha512-DXukZJxpHA8LuotRwL0pP1+rS6CS7FF2qStDDE1C7DDg2rLud2PXRMuEDYIPhgEezwnlHNL4c+N6MfMTjCGTng==",
"license": "MIT"
}, },
"node_modules/wmf": { "node_modules/wmf": {
"version": "1.0.2", "version": "1.0.2",
...@@ -6503,7 +6506,14 @@ ...@@ -6503,7 +6506,14 @@
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz", "resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
"dev": true "dev": true,
"license": "ISC"
},
"node_modules/xe-utils": {
"version": "3.7.4",
"resolved": "https://registry.npmmirror.com/xe-utils/-/xe-utils-3.7.4.tgz",
"integrity": "sha512-9yuCHLOU+og4OEkPWWtzrYk1Zt1hgN66U/NCJ0+vYJSx1MplBtoQRz8aEA+2RmCr3leLru98vQxNpw/vJsu/sg==",
"license": "MIT"
}, },
"node_modules/xe-utils": { "node_modules/xe-utils": {
"version": "3.7.4", "version": "3.7.4",
......
...@@ -10,7 +10,13 @@ import { ...@@ -10,7 +10,13 @@ import {
} from '@/types/api/podUsOrder' } from '@/types/api/podUsOrder'
import axios from './axios' import axios from './axios'
import { PodMakeOrderData } from '@/types/api/podMakeOrder' import { PodMakeOrderData } from '@/types/api/podMakeOrder'
export interface LogisticsData {
logisticsWayName: string; // 物流名称
warehouseName: string; // 发货仓库
status: boolean;
logisticsWayCode: string; // 物流编码
partition: string; // 所在分区
}
export function getOrderTabData() { export function getOrderTabData() {
return axios.get<never, BaseRespData<Tab[]>>( return axios.get<never, BaseRespData<Tab[]>>(
'/factory/podJomallOrderUs/findStateGroupList', '/factory/podJomallOrderUs/findStateGroupList',
...@@ -44,11 +50,13 @@ export function getCardOrderList( ...@@ -44,11 +50,13 @@ export function getCardOrderList(
}, },
) )
} }
export function confirmOrderApi(data: number[], productionClient: string) { export function confirmOrderApi(data: number[], productionClient: string,type:string,logisticsTrialCalculation?:LogisticsData) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/confirmOrders', 'factory/podJomallOrderUs/confirmOrders',
{ {
ids: data.join(','), ids: data.join(','),
type,
logisticsTrialCalculation,
productionClient, productionClient,
}, },
) )
...@@ -226,8 +234,24 @@ export function updateRemarkApi(id: number, content: string) { ...@@ -226,8 +234,24 @@ export function updateRemarkApi(id: number, content: string) {
{ id, content }, { id, content },
) )
} }
export function getLogisticsCalculation(id: number) {
return axios.get<never, BaseRespData<never>>(
'factory/podJomallOrderUs/getLogisticsCalculation',
{ params:{id} },
)
}
export function loadWarehouseListApi() { export function loadWarehouseListApi() {
return axios.get<never, BaseRespData<WarehouseListData[]>>( return axios.get<never, BaseRespData<WarehouseListData[]>>(
'factoryWarehouseInfo/getAll', 'factoryWarehouseInfo/getAll',
) )
} }
export function refreshMaterialApi(data: {
orderIds: string | undefined
productIds: string | undefined
}) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderProductUs/refreshDesignImages ',
data,
)
}
...@@ -8,12 +8,37 @@ import { ...@@ -8,12 +8,37 @@ import {
InterskuList, InterskuList,
InterWarehouseList, InterWarehouseList,
ILocation, ILocation,
AnyObject,
} from '@/types/api/warehouse' } from '@/types/api/warehouse'
export interface LogListData { export interface LogListData {
createTime: string createTime: string
description: string description: string
createdTime?: string | null createdTime?: string | null
} }
export interface Address {
id: number; // 主键,自动递增
shipperName: string; // 发货人姓名
addressLine1: string; // 地址 1
addressLine2?: string | null; // 地址 2
addressLine3?: string | null; // 地址 3
city: string; // 城市
cityCode?: string | null; // 城市编码
district?: string | null; // 区
districtCode?: string | null; // 区编码
cspAccount?: string | null; // CSP账号
stateProvince?: string | null; // 州/省
stateProvinceAbbr?: string | null; // 州/省简称
postalCode?: string | null; // 邮编
countryName: string; // 国家名称
countryCode?: string | null; // 国家代码
phoneNumber?: string | null; // 电话
rfcTaxId?: string | null; // RFC税号
swDefault?: number | null; // 是否默认 1是,0不是
createTime: string; // 创建时间
updateTime: string; // 更新时间
}
export interface PrintData { export interface PrintData {
code: string code: string
list: { list: {
...@@ -78,6 +103,7 @@ export interface warehouseInfo { ...@@ -78,6 +103,7 @@ export interface warehouseInfo {
id?: number | string id?: number | string
name: string name: string
code: string code: string
addressId: string
sort: string sort: string
defaulted: number defaulted: number
factoryId?: number factoryId?: number
...@@ -229,6 +255,12 @@ export function updateWarehouseApi(data: positionInfo | UpdateDefaulted) { ...@@ -229,6 +255,12 @@ export function updateWarehouseApi(data: positionInfo | UpdateDefaulted) {
) )
} }
export function logisticsAddressGetAllList() {
return axios.get<never, BaseRespData<Address[]>>(
'/logisticsAddress/getAllList'
)
}
export function updatePositionApi(data: positionInfo) { export function updatePositionApi(data: positionInfo) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'/factoryWarehouseLocation/update', '/factoryWarehouseLocation/update',
...@@ -319,7 +351,9 @@ export function exportOrder(ids: number[], status: string | number) { ...@@ -319,7 +351,9 @@ export function exportOrder(ids: number[], status: string | number) {
{ ids: ids, status }, { ids: ids, status },
) )
} }
export function updateInRecordApi(form: InterWarehouseDetail) { export function updateInRecordApi(
form: InterWarehouseDetail | AnyObject | null,
) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'factory/warehouseInRecord/update', 'factory/warehouseInRecord/update',
{ {
...@@ -337,7 +371,7 @@ export function getWarehouseInRecordDetailApi(id: number | undefined) { ...@@ -337,7 +371,7 @@ export function getWarehouseInRecordDetailApi(id: number | undefined) {
}, },
) )
} }
export function getBySkuApi(warehouseId: number | string, sku: string | null) { export function getBySkuApi(warehouseId: number | null | undefined, sku: string | null) {
return axios.get<never, BaseRespData<InterskuList[]>>( return axios.get<never, BaseRespData<InterskuList[]>>(
'customProductItem/getBySku', 'customProductItem/getBySku',
{ {
...@@ -349,7 +383,7 @@ export function getBySkuApi(warehouseId: number | string, sku: string | null) { ...@@ -349,7 +383,7 @@ export function getBySkuApi(warehouseId: number | string, sku: string | null) {
) )
} }
export function getByWareHouseIdAndCodeApi( export function getByWareHouseIdAndCodeApi(
wareHouseId: number | string | undefined, wareHouseId: number | null | undefined,
code: string | null, code: string | null,
) { ) {
return axios.get<never, BaseRespData<ILocation[]>>( return axios.get<never, BaseRespData<ILocation[]>>(
......
...@@ -27,7 +27,7 @@ import WarehouseManage from '@/views/warehouse/manage.vue' ...@@ -27,7 +27,7 @@ import WarehouseManage from '@/views/warehouse/manage.vue'
import WarehouseWarning from '@/views/warehouse/warning.vue' import WarehouseWarning from '@/views/warehouse/warning.vue'
import WarehousePosition from '@/views/warehouse/position.vue' import WarehousePosition from '@/views/warehouse/position.vue'
import receiptDoc from '@/views/warehouse/receiptDoc.vue' import receiptDoc from '@/views/warehouse/receiptDoc.vue'
import issueDoc from '@/views/warehouse/issueDoc.vue' // import issueDoc from '@/views/warehouse/issueDoc.vue'
const router = createRouter({ const router = createRouter({
history: createWebHistory(), history: createWebHistory(),
routes: [ routes: [
...@@ -176,14 +176,92 @@ const router = createRouter({ ...@@ -176,14 +176,92 @@ const router = createRouter({
}, },
component: receiptDoc, component: receiptDoc,
}, },
// {
// path: '/warehouse/issue-doc',
// meta: {
// title: '出库单',
// },
// component: issueDoc,
// },
{
path: '/warehouse/warning',
meta: {
title: '仓库预警',
},
component: WarehouseWarning,
},
{
path: '/warehouse/position',
meta: {
title: '库位管理',
},
component: WarehousePosition,
},
{
path: '/logistics/logisticsMethod',
meta: {
title: '物流方式',
},
component: () => import('@/views/logistics/logisticsMethod.vue'),
},
{
path: '/logistics/shippingAddress',
meta: {
title: '发货地址',
},
component: () => import('@/views/logistics/shippingAddress.vue'),
},
{
path: '/logistics/logisticsQuotation',
meta: {
title: '物流报价',
},
component: () => import('@/views/logistics/logisticsQuotation.vue'),
},
{ {
path: '/warehouse/issue-doc', path: '/logistics/declarationRule',
meta: { meta: {
title: '出库单', title: '申报规则',
}, },
component: issueDoc, component: () => import('@/views/logistics/declarationRule.vue'),
},
{
path: '/logistics/logisticsPartition',
meta: {
title: '物流分区',
},
component: () => import('@/views/logistics/logisticsPartition.vue'),
},
{
path: '/logistics/logisticsCalculate',
meta: {
title: '运费试算',
},
component: () => import('@/views/logistics/logisticsCalculate.vue'),
}, },
{ {
path: '/warehouse/manage',
meta: {
title: '仓库管理',
},
component: WarehouseManage,
},
{
path: '/warehouse/receipt-doc',
meta: {
title: '入库单',
},
component: receiptDoc,
},
// {
// path: '/warehouse/issue-doc',
// meta: {
// title: '出库单',
// },
// component: issueDoc,
// },
{
path: '/warehouse/warning', path: '/warehouse/warning',
meta: { meta: {
title: '仓库预警', title: '仓库预警',
......
...@@ -31,11 +31,11 @@ const menu: MenuItem[] = [ ...@@ -31,11 +31,11 @@ const menu: MenuItem[] = [
id: 123, id: 123,
label: '入库单', label: '入库单',
}, },
{ // {
index: '/warehouse/issue-doc', // index: '/warehouse/issue-doc',
id: 124, // id: 124,
label: '出库单', // label: '出库单',
}, // },
{ {
index: '/warehouse/manage', index: '/warehouse/manage',
......
export type AnyObject = {
[propName: string]: string | number | boolean | undefined | unknown
}
export interface warehouseSearchForm { export interface warehouseSearchForm {
billStatus?: string billStatus?: string
batchNumber?: string batchNumber?: string
...@@ -5,7 +8,7 @@ export interface warehouseSearchForm { ...@@ -5,7 +8,7 @@ export interface warehouseSearchForm {
createTimeStart?: string createTimeStart?: string
orderNumber?: string orderNumber?: string
sku?: string sku?: string
warehouseId?: number warehouseId?: number | null
id?: number id?: number
} }
export interface InterProductList { export interface InterProductList {
...@@ -29,8 +32,8 @@ export interface InterWarehouseBase { ...@@ -29,8 +32,8 @@ export interface InterWarehouseBase {
id?: number id?: number
factoryId?: number factoryId?: number
factoryCode?: string factoryCode?: string
warehouseId?: number | string warehouseId?: number | null
warehouseName?: string warehouseName?: string | null
inNo?: string inNo?: string
shipmentNumber?: string shipmentNumber?: string
skuAmount?: number skuAmount?: number
......
export type AnyObject = {
// 允许通用对象类型 [propName: string]: string | number | boolean | undefined | unknown
export type AnyObject = { [key: string]: unknown } }
type IdType = string | number type IdType = string | number
function itemIsArray(obj: AnyObject): boolean { function itemIsArray(obj: AnyObject): boolean {
...@@ -16,40 +16,50 @@ function isChange(arr: AnyObject[], arr1: AnyObject[]): boolean { ...@@ -16,40 +16,50 @@ function isChange(arr: AnyObject[], arr1: AnyObject[]): boolean {
if (!arr1) return true if (!arr1) return true
if (arr.length !== arr1.length) return true if (arr.length !== arr1.length) return true
for (const iterator of arr) { for (const iterator of arr) {
const item = arr1.find((item: AnyObject) => item.id === iterator.id) const item = arr1.find((item) => item.id === iterator.id)
if (!item) return true if (!item) return true
} }
return false return false
} }
/**
* 更新参数处理 只提交更新的
* @param {UpdateParams} newParams 新的数据
* @param {UpdateParams} oldParams 旧的数据
* @param {string} id 数组唯一值
* @param {Record<string, string>} other 其他属性
* @param {boolean} bool 是否为布尔值
*/
export function checkUpdateParams( export function checkUpdateParams(
newParams: AnyObject, newParams: AnyObject,
oldParams: AnyObject, oldParams: AnyObject,
id: string = 'id', id: string = 'id',
other: Record<string, string> = {}, other: Record<string, string> = {},
bool: boolean = false bool: boolean = false,
): AnyObject | null { ): AnyObject | null {
oldParams = JSON.parse(JSON.stringify(oldParams)) oldParams = JSON.parse(JSON.stringify(oldParams))
if (!oldParams) return newParams if (!oldParams) return newParams
if ((newParams as { id?: unknown })?.id !== (oldParams as { id?: unknown })?.id) return newParams if (newParams[id] !== oldParams?.[id]) return newParams
const params: AnyObject = { const params: AnyObject = {
id: (newParams as { id?: unknown }).id [id]: newParams[id],
} }
for (const key in newParams) { for (const key in newParams) {
if (typeof newParams[key] === 'object') { if (typeof newParams[key] === 'object') {
if (Array.isArray(newParams[key])) { if (Array.isArray(newParams[key])) {
const arr: AnyObject[] = newParams[key] as AnyObject[] const arr = newParams[key] as AnyObject[]
const arr1: AnyObject[] = (oldParams[key] as AnyObject[]) || [] const arr1 = (oldParams[key] as AnyObject[]) || []
const addList: AnyObject[] = [] const addList: AnyObject[] = []
const updateList: AnyObject[] = [] const updateList: AnyObject[] = []
let removeList: IdType[] = [] let removeList: IdType[] = []
const list: AnyObject[] = [] const list: AnyObject[] = []
const keyname: string = other[key] || id const keyname = other[key] || id
for (const iterator of arr) { for (const iterator of arr) {
const obj: AnyObject = {} const obj: AnyObject = {}
const index = arr1.findIndex((item: AnyObject) => item[keyname] === iterator[keyname]) const index = arr1.findIndex(
(item: AnyObject) => item[keyname] === iterator[keyname],
)
const isArray = itemIsArray(iterator) const isArray = itemIsArray(iterator)
if (index !== -1) { if (index !== -1) {
const item = arr1[index] const item = arr1[index]
...@@ -57,7 +67,12 @@ export function checkUpdateParams( ...@@ -57,7 +67,12 @@ export function checkUpdateParams(
for (const key1 in iterator) { for (const key1 in iterator) {
if (key1 === keyname) continue if (key1 === keyname) continue
if (Array.isArray(iterator[key1])) { if (Array.isArray(iterator[key1])) {
if (isChange(iterator[key1] as AnyObject[], item[key1] as AnyObject[])) { if (
isChange(
iterator[key1] as AnyObject[],
item[key1] as AnyObject[],
)
) {
obj[key1] = iterator[key1] obj[key1] = iterator[key1]
} }
} else if (iterator[key1] !== item[key1]) { } else if (iterator[key1] !== item[key1]) {
...@@ -69,13 +84,13 @@ export function checkUpdateParams( ...@@ -69,13 +84,13 @@ export function checkUpdateParams(
list.push({ list.push({
[keyname]: iterator[keyname], [keyname]: iterator[keyname],
...obj, ...obj,
id: item.id id: item.id,
}) })
} else { } else {
updateList.push({ updateList.push({
[keyname]: iterator[keyname], [keyname]: iterator[keyname],
...obj, ...obj,
id: item.id id: item.id,
}) })
} }
} }
...@@ -88,20 +103,20 @@ export function checkUpdateParams( ...@@ -88,20 +103,20 @@ export function checkUpdateParams(
} }
} }
if (arr1.length > 0) { if (arr1.length > 0) {
removeList = arr1.map((item: AnyObject) => item['id'] as IdType) removeList = arr1.map((item) => item['id'] as IdType)
} }
const key_name = key.replace('List', 'Change') const key_name = key.replace('List', 'Change')
params[key_name] = {} params[key_name] = {}
if (addList.length > 0) { if (addList.length > 0) {
(params[key_name] as AnyObject).addList = addList ;(params[key_name] as AnyObject).addList = addList
} }
if (updateList.length > 0) { if (updateList.length > 0) {
(params[key_name] as AnyObject).updateList = updateList ;(params[key_name] as AnyObject).updateList = updateList
} }
if (removeList.length > 0) { if (removeList.length > 0) {
(params[key_name] as AnyObject).removeList = removeList ;(params[key_name] as AnyObject).removeList = removeList
} }
if (list.length > 0) { if (list.length > 0) {
params[key_name] = list params[key_name] = list
...@@ -112,13 +127,11 @@ export function checkUpdateParams( ...@@ -112,13 +127,11 @@ export function checkUpdateParams(
} }
} else { } else {
// 基础信息 // 基础信息
// if (newParams[key] !== oldParams[key]) {
params[key] = newParams[key] params[key] = newParams[key]
// }
} }
} }
if (Object.keys(params).length === 1) { if (Object.keys(params).length === 1) {
return null return null
} }
return params return params
} }
\ No newline at end of file
...@@ -179,9 +179,15 @@ ...@@ -179,9 +179,15 @@
转至待确认 转至待确认
</ElButton> </ElButton>
</span> </span>
<span class="item"> <span class="item">
<ElButton type="primary" @click="downloadMaterial">下载素材</ElButton> <ElButton type="primary" @click="downloadMaterial">下载素材</ElButton>
</span> </span>
<span class="item">
<ElButton type="success" @click="refreshMaterial">
刷新素材图
</ElButton>
</span>
</div> </div>
<div <div
v-if="status !== 'IN_PRODUCTION'" v-if="status !== 'IN_PRODUCTION'"
...@@ -197,7 +203,6 @@ ...@@ -197,7 +203,6 @@
:selectionable="true" :selectionable="true"
:paginated-data="tableData" :paginated-data="tableData"
:cell-style="onCellStyle" :cell-style="onCellStyle"
:row-style="getRowStyle"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<template #goods="{ row }"> <template #goods="{ row }">
...@@ -223,18 +228,21 @@ ...@@ -223,18 +228,21 @@
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ item.baseSku }} {{ item.baseSku }}
</span> </span>
<el-icon class="icon" @click="copy(item.baseSku || '')" <el-icon class="icon" @click="copy(item.baseSku || '')">
><DocumentCopy <DocumentCopy />
/></el-icon> </el-icon>
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">变体SKU:</span> <span class="goods-item-info-item-label">变体SKU:</span>
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ item.variantSku }} {{ item.variantSku }}
</span> </span>
<el-icon class="icon" @click="copy(item.variantSku || '')" <el-icon
><DocumentCopy class="icon"
/></el-icon> @click="copy(item.variantSku || '')"
>
<DocumentCopy />
</el-icon>
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">工艺:</span> <span class="goods-item-info-item-label">工艺:</span>
...@@ -255,8 +263,9 @@ ...@@ -255,8 +263,9 @@
class="icon" class="icon"
style="color: #e6a23c" style="color: #e6a23c"
@click="handleUpdateRemark(item)" @click="handleUpdateRemark(item)"
><EditPen >
/></el-icon> <EditPen />
</el-icon>
</div> </div>
</div> </div>
<div class="goods-item-info"> <div class="goods-item-info">
...@@ -271,8 +280,9 @@ ...@@ -271,8 +280,9 @@
<el-icon <el-icon
class="icon" class="icon"
@click="copy(item.factorySubOrderNumber || '')" @click="copy(item.factorySubOrderNumber || '')"
><DocumentCopy >
/></el-icon> <DocumentCopy />
</el-icon>
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label" <span class="goods-item-info-item-label"
...@@ -287,8 +297,9 @@ ...@@ -287,8 +297,9 @@
<el-icon <el-icon
class="icon" class="icon"
@click="copy(item.thirdSubOrderNumber || '')" @click="copy(item.thirdSubOrderNumber || '')"
><DocumentCopy >
/></el-icon> <DocumentCopy />
</el-icon>
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">工厂:</span> <span class="goods-item-info-item-label">工厂:</span>
...@@ -305,7 +316,7 @@ ...@@ -305,7 +316,7 @@
</div> </div>
<div class="goods-item-info"> <div class="goods-item-info">
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">单价:</span> <span class="goods-item-info-item-label">价格:</span>
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ item.productPrice }}() {{ item.productPrice }}()
</span> </span>
...@@ -365,8 +376,9 @@ ...@@ -365,8 +376,9 @@
<el-icon <el-icon
class="icon" class="icon"
@click="copy(row.factoryOrderNumber || '')" @click="copy(row.factoryOrderNumber || '')"
><DocumentCopy >
/></el-icon> <DocumentCopy />
</el-icon>
</div> </div>
<div class="order-detail-item"> <div class="order-detail-item">
<span class="order-detail-item-label">第三方订单号:</span> <span class="order-detail-item-label">第三方订单号:</span>
...@@ -376,18 +388,60 @@ ...@@ -376,18 +388,60 @@
> >
{{ row.thirdOrderNumber }} {{ row.thirdOrderNumber }}
</span> </span>
<el-icon class="icon" @click="copy(row.thirdOrderNumber || '')" <el-icon class="icon" @click="copy(row.thirdOrderNumber || '')">
><DocumentCopy <DocumentCopy />
/></el-icon> </el-icon>
</div> </div>
<div class="order-detail-item"> <div class="order-detail-item">
<span class="order-detail-item-label">店铺单号:</span> <span class="order-detail-item-label">店铺单号:</span>
<span class="order-detail-item-value" :title="row.shopNumber"> <span class="order-detail-item-value" :title="row.shopNumber">
{{ row.shopNumber }} {{ row.shopNumber }}
</span> </span>
<el-icon class="icon" @click="copy(row.shopNumber || '')" <el-icon class="icon" @click="copy(row.shopNumber || '')">
><DocumentCopy <DocumentCopy />
/></el-icon> </el-icon>
</div>
<div
v-if="row.status !== 'TO_BE_CONFIRMED'"
class="order-detail-item"
>
<span class="order-detail-item-label">生产端:</span>
<span
class="order-detail-item-value"
:title="row.productionClient"
>
{{ row.productionClient }}
</span>
</div>
<div
v-if="
row.productionClient === 'JOMALL' &&
row.status !== 'TO_BE_CONFIRMED'
"
class="order-detail-item"
>
<span class="order-detail-item-label">发货仓库:</span>
<span
class="order-detail-item-value"
:title="row.warehouseName"
>
{{ row.warehouseName }}
</span>
</div>
<div
v-if="
row.productionClient === 'JOMALL' &&
row.status !== 'TO_BE_CONFIRMED'
"
class="order-detail-item"
>
<span class="order-detail-item-label">物流方式:</span>
<span
class="order-detail-item-value"
:title="row.logisticsWayName"
>
{{ row.logisticsWayName }}
</span>
</div> </div>
<div class="order-detail-item"> <div class="order-detail-item">
<span class="order-detail-item-label">收货人:</span> <span class="order-detail-item-label">收货人:</span>
...@@ -427,11 +481,20 @@ ...@@ -427,11 +481,20 @@
<template #price="{ row }"> <template #price="{ row }">
<div class="order-price-box"> <div class="order-price-box">
<div class="order-price-item"> <div class="order-price-item">
<span class="order-price-item-label">总价:</span> <span class="order-price-item-label">商品总价:</span>
<span class="order-price-item-value"> <span class="order-price-item-value">
{{ row.totalAmount }}() {{ row.totalAmount }}()
</span> </span>
</div> </div>
<div
v-if="row.status !== 'TO_BE_CONFIRMED'"
class="order-price-item"
>
<span class="order-price-item-label">物流运费:</span>
<span class="order-price-item-value">
{{ row.payFreight }}($)
</span>
</div>
</div> </div>
</template> </template>
<template #time="{ row }"> <template #time="{ row }">
...@@ -480,6 +543,9 @@ ...@@ -480,6 +543,9 @@
<template #operate="{ row }"> <template #operate="{ row }">
<div class="operate-box"> <div class="operate-box">
<span class="operate-item"> <span class="operate-item">
<ElButton link type="primary" @click="confirm(row)">
确认
</ElButton>
<ElButton <ElButton
link link
type="primary" type="primary"
...@@ -630,7 +696,84 @@ ...@@ -630,7 +696,84 @@
</div> </div>
</div> </div>
<right-menu ref="rightMenuRef" @change="rightChange" /> <right-menu ref="rightMenuRef" @change="rightChange" />
<el-dialog
v-model="confirmDialogShow"
:close-on-click-modal="false"
title="确认"
>
<div
class="production-client"
style="margin-bottom: 10px; display: flex; align-items: center; gap: 8px"
>
<label style="white-space: nowrap" for="">生产端:</label>
<ElSelect
v-model="productionClientValue"
clearable
placeholder="请选择生产端"
>
<ElOption
v-for="(item, index) in productionClient"
:key="index"
:value="item.code"
:label="`${item.remark}(${item.code})`"
></ElOption>
</ElSelect>
</div>
<el-table
@selection-change="selectionChange"
height="400px"
:data="confirmData"
border
>
<el-table-column
label=""
width="60"
align="center"
type="selection"
></el-table-column>
<el-table-column
label="序号"
width="60"
align="center"
type="index"
></el-table-column>
<el-table-column
label="物流名称"
align="center"
prop="logisticsWayName"
></el-table-column>
<el-table-column
label="发货仓库"
align="center"
prop="warehouseName"
></el-table-column>
<el-table-column
label="物流编码"
align="center"
prop="logisticsWayCode"
></el-table-column>
<el-table-column
label="所在分区"
align="center"
prop="partition"
></el-table-column>
<el-table-column label="状态" align="center">
<template #default="{ row }">
<b v-if="row.status" style="color: green">成功</b>
<b v-else-if="!row.status" style="color: red">失败</b>
</template>
</el-table-column>
<el-table-column label="预计运费($)" align="center" prop="payFreight">
<!-- <template #default="{row}">-->
<!-- {{row.payFreight || '0.00'}}-->
<!-- </template>-->
</el-table-column>
</el-table>
<template #footer>
<el-button @click="confirmDialogShow = false">取消</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button>
</template>
</el-dialog>
<el-dialog <el-dialog
v-model="logVisible" v-model="logVisible"
title="操作日志" title="操作日志"
...@@ -660,7 +803,21 @@ ...@@ -660,7 +803,21 @@
width="600px" width="600px"
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<div class="production-client"> <template #header>
<div class="dialog-header">
<span style="margin-right: 8px; font-size: 18px">确认</span>
<el-tooltip content="默认最低运费分派">
<el-icon color="red">
<WarningFilled />
</el-icon>
</el-tooltip>
</div>
</template>
<div
class="production-client"
style="display: flex; align-items: center; gap: 8px"
>
<label style="white-space: nowrap" for="">生产端:</label>
<ElSelect <ElSelect
v-model="productionClientValue" v-model="productionClientValue"
clearable clearable
...@@ -684,6 +841,7 @@ ...@@ -684,6 +841,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getUserMarkList } from '@/api/common' import { getUserMarkList } from '@/api/common'
import { WarningFilled } from '@element-plus/icons-vue'
import { import {
getCardOrderList, getCardOrderList,
getOrderList, getOrderList,
...@@ -703,6 +861,9 @@ import { ...@@ -703,6 +861,9 @@ import {
stockOutCheckApi, stockOutCheckApi,
toBeConfirmedApi, toBeConfirmedApi,
loadWarehouseListApi, loadWarehouseListApi,
getLogisticsCalculation,
LogisticsData,
refreshMaterialApi,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import TableView from '@/components/TableView.vue' import TableView from '@/components/TableView.vue'
import { import {
...@@ -727,6 +888,7 @@ import PodMakeOrder from './PodMakeOrder.vue' ...@@ -727,6 +888,7 @@ import PodMakeOrder from './PodMakeOrder.vue'
import { OrderData } from '@/types/api/podMakeOrder' import { OrderData } from '@/types/api/podMakeOrder'
import useLodop, { LODOPObject } from '@/utils/hooks/useLodop' import useLodop, { LODOPObject } from '@/utils/hooks/useLodop'
import dayjs from 'dayjs' import dayjs from 'dayjs'
declare global { declare global {
interface Window { interface Window {
ActiveXObject: { ActiveXObject: {
...@@ -736,11 +898,16 @@ declare global { ...@@ -736,11 +898,16 @@ declare global {
(data: unknown): { toArray(): number[] } (data: unknown): { toArray(): number[] }
} }
} }
interface XMLHttpRequest { interface XMLHttpRequest {
responseBody?: unknown responseBody?: unknown
} }
} }
const tabsNav = ref<Tab[]>() const tabsNav = ref<Tab[]>()
const confirmDialogShow = ref(false)
const confirmData = ref([])
const confirmSelectionData = ref<LogisticsData[]>([])
const confirmRowData = ref<ProductList | null>(null)
const status = ref('TO_BE_CONFIRMED') const status = ref('TO_BE_CONFIRMED')
const detailData = ref({}) const detailData = ref({})
const [searchForm] = useValue<SearchForm>({ const [searchForm] = useValue<SearchForm>({
...@@ -970,6 +1137,41 @@ const { ...@@ -970,6 +1137,41 @@ const {
} }
}, },
}) })
const confirm = async (row: ProductList) => {
confirmDialogShow.value = true
productionClientValue.value = ''
confirmRowData.value = row
confirmData.value = []
confirmSelectionData.value = []
const { data } = await getLogisticsCalculation(row.id)
confirmData.value = data
}
const selectionChange = (data: LogisticsData[]) => {
confirmSelectionData.value = data
}
const handleConfirm = async () => {
if (!productionClientValue.value) {
return ElMessage.warning('请选择生产端')
}
if (confirmSelectionData.value.length !== 1) {
return ElMessage.warning('请选择一条物流方式')
}
if (confirmSelectionData.value.some((el) => !el.status)) {
return ElMessage.warning('请选择状态为成功的物流方式')
}
const id = confirmRowData.value?.id
const res = await confirmOrderApi(
[Number(id)],
productionClientValue.value,
'customize',
confirmSelectionData.value[0],
)
if (res.code !== 200) return
ElMessage.success('操作成功')
confirmDialogShow.value = false
search()
loadTabData()
}
const copy = (text: string) => { const copy = (text: string) => {
navigator.clipboard.writeText(text) navigator.clipboard.writeText(text)
ElMessage.success('复制成功') ElMessage.success('复制成功')
...@@ -1028,7 +1230,11 @@ const submit = async () => { ...@@ -1028,7 +1230,11 @@ const submit = async () => {
const submitConfirm = async () => { const submitConfirm = async () => {
const ids = selection.value.map((item) => item.id) const ids = selection.value.map((item) => item.id)
try { try {
const res = await confirmOrderApi(ids, productionClientValue.value) const res = await confirmOrderApi(
ids,
productionClientValue.value,
'minimumCost',
)
if (res.code !== 200) return if (res.code !== 200) return
ElMessage.success('操作成功') ElMessage.success('操作成功')
productionClientVisible.value = false productionClientVisible.value = false
...@@ -1222,11 +1428,9 @@ const downloadMaterial = async () => { ...@@ -1222,11 +1428,9 @@ const downloadMaterial = async () => {
.map((item: ProductList) => item.id) .map((item: ProductList) => item.id)
.filter((id): id is number => id !== undefined) .filter((id): id is number => id !== undefined)
} else { } else {
selectedIds = selection.value selectedIds = (tableData.value as PodUsOrderListData[]).map(
.map((item: PodUsOrderListData) => item.productList) (item) => item.id,
.flat() )
.map((e) => e?.id)
.filter((id): id is number => id !== undefined)
} }
if (selectedIds.length === 0) { if (selectedIds.length === 0) {
return ElMessage({ return ElMessage({
...@@ -1532,16 +1736,16 @@ const onFastRefresh = () => { ...@@ -1532,16 +1736,16 @@ const onFastRefresh = () => {
loadTabData() loadTabData()
search() search()
} }
// 修改行样式方法 // // 修改行样式方法
const getRowStyle = ({ row }: { row: PodUsOrderListData }) => { // const getRowStyle = ({ row }: { row: PodUsOrderListData }) => {
if (stockOutSuccessIds.value.includes(row.id)) { // if (stockOutSuccessIds.value.includes(row.id)) {
return { // return {
backgroundColor: '#f0f9eb', // backgroundColor: '#f0f9eb',
color: '#67c23a', // color: '#67c23a',
} // }
} // }
return {} // return {}
} // }
// 添加表格ref // 添加表格ref
const tableRef = ref() const tableRef = ref()
const warehouseList = ref<WarehouseListData[]>([]) const warehouseList = ref<WarehouseListData[]>([])
...@@ -1554,6 +1758,38 @@ const loadWarehouseList = async () => { ...@@ -1554,6 +1758,38 @@ const loadWarehouseList = async () => {
console.error(e) console.error(e)
} }
} }
const refreshMaterial = async () => {
let selectedIds = []
const data: {
orderIds: string | undefined
productIds: string | undefined
} = {
orderIds: undefined,
productIds: undefined,
}
if (status.value == 'IN_PRODUCTION') {
selectedIds = cardSelection.value.map((item) => item.id)
data.orderIds = selectedIds.join(',')
data.productIds = undefined
} else {
selectedIds = (selection.value as PodUsOrderListData[]).map(
(item) => item.id,
)
data.productIds = selectedIds.join(',')
data.orderIds = undefined
}
if (selectedIds.length === 0) {
return ElMessage.warning('请选择数据')
}
try {
const res = await refreshMaterialApi(data)
if (res.code !== 200) return
ElMessage.success('刷新成功')
search()
} catch (e) {
console.error(e)
}
}
onMounted(() => { onMounted(() => {
loadTabData() loadTabData()
getUserMark() getUserMark()
...@@ -1568,6 +1804,7 @@ onMounted(() => { ...@@ -1568,6 +1804,7 @@ onMounted(() => {
margin-bottom: 10px; margin-bottom: 10px;
} }
} }
.tabs { .tabs {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -1593,6 +1830,7 @@ onMounted(() => { ...@@ -1593,6 +1830,7 @@ onMounted(() => {
font-weight: 600; font-weight: 600;
} }
} }
.goods-item { .goods-item {
display: grid; display: grid;
grid-template-columns: 100px 1fr minmax(180px, 1fr) 140px; grid-template-columns: 100px 1fr minmax(180px, 1fr) 140px;
...@@ -1601,16 +1839,19 @@ onMounted(() => { ...@@ -1601,16 +1839,19 @@ onMounted(() => {
.goods-item-img { .goods-item-img {
width: 100px; width: 100px;
height: 100px; height: 100px;
img { img {
width: 100%; width: 100%;
} }
} }
&:not(:last-child) { &:not(:last-child) {
padding-bottom: 10px; padding-bottom: 10px;
margin-bottom: 10px; margin-bottom: 10px;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
} }
.goods-item-info-item { .goods-item-info-item {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -1623,6 +1864,7 @@ onMounted(() => { ...@@ -1623,6 +1864,7 @@ onMounted(() => {
white-space: nowrap; white-space: nowrap;
} }
} }
.order-detail-item { .order-detail-item {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -1635,6 +1877,7 @@ onMounted(() => { ...@@ -1635,6 +1877,7 @@ onMounted(() => {
white-space: nowrap; white-space: nowrap;
} }
} }
.card-list { .card-list {
display: grid; display: grid;
grid-template-columns: repeat(6, 1fr); grid-template-columns: repeat(6, 1fr);
...@@ -1643,6 +1886,7 @@ onMounted(() => { ...@@ -1643,6 +1886,7 @@ onMounted(() => {
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
} }
.empty { .empty {
height: 100%; height: 100%;
display: flex; display: flex;
...@@ -1650,17 +1894,21 @@ onMounted(() => { ...@@ -1650,17 +1894,21 @@ onMounted(() => {
justify-content: center; justify-content: center;
color: #999; color: #999;
} }
.card-list-item { .card-list-item {
cursor: pointer; cursor: pointer;
} }
.images-position { .images-position {
display: flex; display: flex;
gap: 5px; gap: 5px;
.item-image { .item-image {
cursor: pointer; cursor: pointer;
border: 1px solid #eee; border: 1px solid #eee;
} }
} }
.grid-container { .grid-container {
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
...@@ -1668,6 +1916,7 @@ onMounted(() => { ...@@ -1668,6 +1916,7 @@ onMounted(() => {
font-size: 12px; font-size: 12px;
margin-top: 10px; margin-top: 10px;
} }
.factory-sub-order-number { .factory-sub-order-number {
font-size: 12px; font-size: 12px;
} }
......
...@@ -125,10 +125,10 @@ ...@@ -125,10 +125,10 @@
> >
删除 删除
</el-button> </el-button>
<el-button type="success" @click="handleExport"> 导出 </el-button> <!-- <el-button type="success" @click="handleExport"> 导出 </el-button>
<el-button type="primary" @click="printProductTag"> <el-button type="primary" @click="printProductTag">
打印商品SKU标签 打印商品SKU标签
</el-button> </el-button> -->
<el-button <el-button
v-if="nodeCode === 'PENDING_AUDIT'" v-if="nodeCode === 'PENDING_AUDIT'"
type="warning" type="warning"
...@@ -481,6 +481,7 @@ ...@@ -481,6 +481,7 @@
clearable clearable
placeholder="请选择仓库" placeholder="请选择仓库"
style="width: 160px" style="width: 160px"
@change="handleWarehouseChange(editForm.warehouseId)"
> >
<ElOption <ElOption
v-for="item in warehouseList" v-for="item in warehouseList"
...@@ -565,8 +566,7 @@ ...@@ -565,8 +566,7 @@
<!-- +后有就正常展示,没有则通过搜索接口自己添加 --> <!-- +后有就正常展示,没有则通过搜索接口自己添加 -->
<!-- remote <!-- remote
:remote-method="(query) => handleLocationSearch(query, row)" :remote-method="(query) => handleLocationSearch(query, row)"
:loading="locationLoading" :loading="locationLoading"-->
@change="(val) => handleLocationChange(val, row)" -->
<span v-if="row.loacationCode">{{ row.loacationCode }}</span> <span v-if="row.loacationCode">{{ row.loacationCode }}</span>
<ElSelect <ElSelect
v-else v-else
...@@ -797,7 +797,7 @@ import { CirclePlusFilled } from '@element-plus/icons-vue' ...@@ -797,7 +797,7 @@ import { CirclePlusFilled } from '@element-plus/icons-vue'
import splitDiv from '@/components/splitDiv/splitDiv.vue' import splitDiv from '@/components/splitDiv/splitDiv.vue'
import { ElTable } from 'element-plus' import { ElTable } from 'element-plus'
import usePageList from '@/utils/hooks/usePageList' import usePageList from '@/utils/hooks/usePageList'
// import { checkUpdateParams } from '@/utils/hooks/commonUtil' import { checkUpdateParams, AnyObject } from '@/utils/hooks/commonUtil'
import { useValue } from '@/utils/hooks/useValue' import { useValue } from '@/utils/hooks/useValue'
import { import {
getInRecordStatusTree, getInRecordStatusTree,
...@@ -990,6 +990,7 @@ const { ...@@ -990,6 +990,7 @@ const {
pageSize, pageSize,
).then((res) => res.data) as never, ).then((res) => res.data) as never,
}) })
const setCostPrice = (item: InterProductList) => { const setCostPrice = (item: InterProductList) => {
if (!item.costPrice) { if (!item.costPrice) {
ElMessage.warning('商品成本价为空,请完善商品成本价') ElMessage.warning('商品成本价为空,请完善商品成本价')
...@@ -1015,15 +1016,15 @@ const getTreeNum = async () => { ...@@ -1015,15 +1016,15 @@ const getTreeNum = async () => {
} }
} }
const showPrintDialog = ref(false) const showPrintDialog = ref(false)
const printProductTag = async () => { // const printProductTag = async () => {
if (!selections.value.length) { // if (!selections.value.length) {
return ElMessage.warning('请选择要删除的数据') // return ElMessage.warning('请选择要操作的数据')
} // }
showPrintDialog.value = true // showPrintDialog.value = true
// selections.value.forEach((el:InterWarehousePage) => { // selections.value.forEach((el:InterWarehousePage) => {
// el.number = '' // el.number = ''
// }) // })
} // }
async function handlePrintProductTag() { async function handlePrintProductTag() {
// const flag = selections.value.every((el:InterWarehousePage) => el.number && el.number != '0') // const flag = selections.value.every((el:InterWarehousePage) => el.number && el.number != '0')
// if (!flag) { // if (!flag) {
...@@ -1088,11 +1089,9 @@ const exportForm = ref({ ...@@ -1088,11 +1089,9 @@ const exportForm = ref({
delivery: false, delivery: false,
resource: '', resource: '',
}) })
const handleExport = () => { // const handleExport = () => {
exportVisible.value = true // exportVisible.value = true
// exportForm.value.delivery = false // }
// exportForm.value.resource = ''
}
const submitExportForm = () => { const submitExportForm = () => {
// if (exportForm.value.resource === '') { // if (exportForm.value.resource === '') {
// return ElMessage.error('请选择导出类型') // return ElMessage.error('请选择导出类型')
...@@ -1270,7 +1269,8 @@ const tabsClick = async () => { ...@@ -1270,7 +1269,8 @@ const tabsClick = async () => {
} }
const [editForm, resetEditForm] = useValue<InterWarehouseDetail>({ const [editForm, resetEditForm] = useValue<InterWarehouseDetail>({
inNo: '', inNo: '',
warehouseId: '', warehouseId: null,
warehouseName: '',
remark: '', remark: '',
factoryCode: '', factoryCode: '',
factoryId: 0, factoryId: 0,
...@@ -1310,7 +1310,7 @@ const addDialog = async (i: number, v: InterWarehousePage | null) => { ...@@ -1310,7 +1310,7 @@ const addDialog = async (i: number, v: InterWarehousePage | null) => {
const getProduct = async (id: number | undefined) => { const getProduct = async (id: number | undefined) => {
try { try {
const res = await getWarehouseInRecordDetailApi(id) const res = await getWarehouseInRecordDetailApi(id)
editForm2.value = res.data editForm.value = JSON.parse(JSON.stringify(res.data))
otherPurchaseData.value = res.data?.productList || [] otherPurchaseData.value = res.data?.productList || []
} catch (e) { } catch (e) {
console.error(e) console.error(e)
...@@ -1349,7 +1349,7 @@ const auditOrder = (key: string) => { ...@@ -1349,7 +1349,7 @@ const auditOrder = (key: string) => {
} }
const confimText = const confimText =
key === 'audit' key === 'audit'
? '确定进行审核?点“确定”将会直接更改库存数量,请在审核前确认数量是否正确。' ? '确定进行审核?点"确定"将会直接更改库存数量,请在审核前确认数量是否正确。'
: `确定对选中的信息进行${text}?` : `确定对选中的信息进行${text}?`
ElMessageBox.confirm(confimText, '重要提示', { ElMessageBox.confirm(confimText, '重要提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -1413,7 +1413,7 @@ watch( ...@@ -1413,7 +1413,7 @@ watch(
watch( watch(
() => editForm.value.warehouseId, () => editForm.value.warehouseId,
(newVal: number | string | undefined) => { (newVal: number | null | undefined) => {
if (newVal) { if (newVal) {
fetchLocationList('') fetchLocationList('')
} }
...@@ -1512,13 +1512,17 @@ const addSection = async () => { ...@@ -1512,13 +1512,17 @@ const addSection = async () => {
} }
const upSection = async () => { const upSection = async () => {
const params = { ...editForm.value } const params = { ...editForm.value }
params.productList = otherPurchaseData.value // params.productList = otherPurchaseData.value
// const result = checkUpdateParams(params, editForm2.value, '', { const result = checkUpdateParams(
// productList: 'value', { ...params, productList: otherPurchaseData.value },
// }) editForm.value as unknown as AnyObject,
// console.log(result, params, editForm2.value) 'id',
{
productList: 'warehouseSku',
},
)
try { try {
await updateInRecordApi(params) await updateInRecordApi(result)
newDialogVisible.value = false newDialogVisible.value = false
ElMessage.success('修改成功') ElMessage.success('修改成功')
search() search()
...@@ -1592,6 +1596,7 @@ const fetchLocationList = async (query: string) => { ...@@ -1592,6 +1596,7 @@ const fetchLocationList = async (query: string) => {
// locationList.value = [] // locationList.value = []
// return // return
// } // }
if (!editForm.value.warehouseId) return
locationLoading.value = true locationLoading.value = true
try { try {
const res = await getByWareHouseIdAndCodeApi( const res = await getByWareHouseIdAndCodeApi(
...@@ -1619,6 +1624,12 @@ const handleLocationChange = (val: number, row: InterProductList) => { ...@@ -1619,6 +1624,12 @@ const handleLocationChange = (val: number, row: InterProductList) => {
) )
row.locationCode = found ? found.locationCode : '' row.locationCode = found ? found.locationCode : ''
} }
const handleWarehouseChange = (val: number | null | undefined) => {
const found = warehouseList.value.find(
(item: InterWarehouseList) => item.id === val,
)
editForm.value.warehouseName = found ? found.name : ''
}
onMounted(() => { onMounted(() => {
getTreeNum() getTreeNum()
getWarehouseList() getWarehouseList()
......
...@@ -4,9 +4,10 @@ import { ...@@ -4,9 +4,10 @@ import {
factoryWarehouseInfo, factoryWarehouseInfo,
warehouseInfo, warehouseInfo,
createWarehouseApi, createWarehouseApi,
updateWarehouseApi, deleteWarehouseApi, updateWarehouseApi, deleteWarehouseApi, logisticsAddressGetAllList, Address,
} from '@/api/warehouse.ts' } from '@/api/warehouse.ts'
import { nextTick, ref } from 'vue' import { nextTick, ref } from 'vue'
// import { add } from 'lodash-es'
const selections = ref<warehouseInfo[]>([]) const selections = ref<warehouseInfo[]>([])
const formRef = ref() const formRef = ref()
...@@ -17,6 +18,7 @@ const createData = ref({ ...@@ -17,6 +18,7 @@ const createData = ref({
form: { form: {
name: '', name: '',
code: '', code: '',
addressId: '',
sort: '', sort: '',
defaulted: 0, defaulted: 0,
remarks: '', remarks: '',
...@@ -32,6 +34,9 @@ const rules = { ...@@ -32,6 +34,9 @@ const rules = {
defaulted: [ defaulted: [
{ required: true, message: '请选择是否默认仓库', trigger: 'change' }, { required: true, message: '请选择是否默认仓库', trigger: 'change' },
], ],
addressId: [
{ required: true, message: '请选择地址', trigger: 'change' },
],
} }
const leftData = ref<warehouseInfo[]>([]) const leftData = ref<warehouseInfo[]>([])
const pagination = ref<factoryWarehouseInfo>({ const pagination = ref<factoryWarehouseInfo>({
...@@ -39,6 +44,7 @@ const pagination = ref<factoryWarehouseInfo>({ ...@@ -39,6 +44,7 @@ const pagination = ref<factoryWarehouseInfo>({
currentPage: 1, currentPage: 1,
total: 0, total: 0,
}) })
const addressList = ref<Address[]>([])
async function getData() { async function getData() {
const res = await getFactoryWarehouseInfo({ const res = await getFactoryWarehouseInfo({
...@@ -96,6 +102,7 @@ const createWarehouse = () => { ...@@ -96,6 +102,7 @@ const createWarehouse = () => {
createData.value.form = { createData.value.form = {
name: '', name: '',
code: '', code: '',
addressId: '',
sort: '', sort: '',
defaulted: 0, defaulted: 0,
remarks: '', remarks: '',
...@@ -120,7 +127,23 @@ const updateWarehouse = (item: warehouseInfo) => { ...@@ -120,7 +127,23 @@ const updateWarehouse = (item: warehouseInfo) => {
formRef.value?.clearValidate() formRef.value?.clearValidate()
}) })
} }
const getAddress = (id:number) => {
if(!id) return ''
const item = addressList.value.find((el) => el.id === id)
if(!item) return ''
return [item.countryName,
item.stateProvince,
item.city,
item.addressLine1,
item.addressLine2 ,
item.addressLine3 ,].filter(el => el).join(' ')
}
const getAddressList = async () => {
const data = await logisticsAddressGetAllList()
addressList.value = data.data
}
getData() getData()
getAddressList()
</script> </script>
<template> <template>
...@@ -138,9 +161,14 @@ getData() ...@@ -138,9 +161,14 @@ getData()
<el-table-column type="index" label="序号" width="60" /> <el-table-column type="index" label="序号" width="60" />
<el-table-column label="仓库名称" prop="name" align="center" /> <el-table-column label="仓库名称" prop="name" align="center" />
<el-table-column label="仓库编码" prop="code" align="center" /> <el-table-column label="仓库编码" prop="code" align="center" />
<el-table-column label="仓库序号" prop="sort" align="center" /> <el-table-column show-overflow-tooltip label="地址" prop="addressId" align="center">
<template #default="{row}">
{{getAddress(row.addressId)}}
</template>
</el-table-column>
<el-table-column width="90" label="仓库序号" prop="sort" align="center" />
<el-table-column label="备注" prop="remarks" align="center" /> <el-table-column label="备注" prop="remarks" align="center" />
<el-table-column label="默认仓库" prop="defaulted" align="center"> <el-table-column width="90" label="默认仓库" prop="defaulted" align="center">
<template #default="{row}"> <template #default="{row}">
<el-switch <el-switch
v-model="row.defaulted" :active-value="1" :inactive-value="0" v-model="row.defaulted" :active-value="1" :inactive-value="0"
...@@ -176,6 +204,19 @@ getData() ...@@ -176,6 +204,19 @@ getData()
<el-form-item label="仓库编码" prop="code"> <el-form-item label="仓库编码" prop="code">
<el-input v-model="createData.form.code" clearable placeholder="请输入仓库编码"></el-input> <el-input v-model="createData.form.code" clearable placeholder="请输入仓库编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="地址" prop="addressId">
<el-select v-model="createData.form.addressId" clearable filterable>
<el-option
v-for="it in addressList" :key="it.id" :value="it.id" :label="[
it.countryName,
it.stateProvince,
it.city,
it.addressLine1,
it.addressLine2 ,
it.addressLine3 ,
].filter(el=>el).join(' ')"></el-option>
</el-select>
</el-form-item>
<el-form-item label="仓库序号" prop="sort"> <el-form-item label="仓库序号" prop="sort">
<el-input-number v-model="createData.form.sort"></el-input-number> <el-input-number v-model="createData.form.sort"></el-input-number>
</el-form-item> </el-form-item>
......
...@@ -125,10 +125,10 @@ ...@@ -125,10 +125,10 @@
> >
删除 删除
</el-button> </el-button>
<el-button type="success" @click="handleExport"> 导出 </el-button> <!-- <el-button type="success" @click="handleExport"> 导出 </el-button>
<el-button type="primary" @click="printProductTag"> <el-button type="primary" @click="printProductTag">
打印商品SKU标签 打印商品SKU标签
</el-button> </el-button> -->
<el-button <el-button
v-if="nodeCode === 'PENDING_AUDIT'" v-if="nodeCode === 'PENDING_AUDIT'"
type="warning" type="warning"
...@@ -481,6 +481,7 @@ ...@@ -481,6 +481,7 @@
clearable clearable
placeholder="请选择仓库" placeholder="请选择仓库"
style="width: 160px" style="width: 160px"
@change="handleWarehouseChange(editForm.warehouseId)"
> >
<ElOption <ElOption
v-for="item in warehouseList" v-for="item in warehouseList"
...@@ -565,8 +566,7 @@ ...@@ -565,8 +566,7 @@
<!-- +后有就正常展示,没有则通过搜索接口自己添加 --> <!-- +后有就正常展示,没有则通过搜索接口自己添加 -->
<!-- remote <!-- remote
:remote-method="(query) => handleLocationSearch(query, row)" :remote-method="(query) => handleLocationSearch(query, row)"
:loading="locationLoading" :loading="locationLoading"-->
@change="(val) => handleLocationChange(val, row)" -->
<span v-if="row.loacationCode">{{ row.loacationCode }}</span> <span v-if="row.loacationCode">{{ row.loacationCode }}</span>
<ElSelect <ElSelect
v-else v-else
...@@ -797,7 +797,7 @@ import { CirclePlusFilled } from '@element-plus/icons-vue' ...@@ -797,7 +797,7 @@ import { CirclePlusFilled } from '@element-plus/icons-vue'
import splitDiv from '@/components/splitDiv/splitDiv.vue' import splitDiv from '@/components/splitDiv/splitDiv.vue'
import { ElTable } from 'element-plus' import { ElTable } from 'element-plus'
import usePageList from '@/utils/hooks/usePageList' import usePageList from '@/utils/hooks/usePageList'
// import { checkUpdateParams } from '@/utils/hooks/commonUtil' import { checkUpdateParams, AnyObject } from '@/utils/hooks/commonUtil'
import { useValue } from '@/utils/hooks/useValue' import { useValue } from '@/utils/hooks/useValue'
import { import {
getInRecordStatusTree, getInRecordStatusTree,
...@@ -990,6 +990,7 @@ const { ...@@ -990,6 +990,7 @@ const {
pageSize, pageSize,
).then((res) => res.data) as never, ).then((res) => res.data) as never,
}) })
const setCostPrice = (item: InterProductList) => { const setCostPrice = (item: InterProductList) => {
if (!item.costPrice) { if (!item.costPrice) {
ElMessage.warning('商品成本价为空,请完善商品成本价') ElMessage.warning('商品成本价为空,请完善商品成本价')
...@@ -1015,15 +1016,15 @@ const getTreeNum = async () => { ...@@ -1015,15 +1016,15 @@ const getTreeNum = async () => {
} }
} }
const showPrintDialog = ref(false) const showPrintDialog = ref(false)
const printProductTag = async () => { // const printProductTag = async () => {
if (!selections.value.length) { // if (!selections.value.length) {
return ElMessage.warning('请选择要删除的数据') // return ElMessage.warning('请选择要操作的数据')
} // }
showPrintDialog.value = true // showPrintDialog.value = true
// selections.value.forEach((el:InterWarehousePage) => { // selections.value.forEach((el:InterWarehousePage) => {
// el.number = '' // el.number = ''
// }) // })
} // }
async function handlePrintProductTag() { async function handlePrintProductTag() {
// const flag = selections.value.every((el:InterWarehousePage) => el.number && el.number != '0') // const flag = selections.value.every((el:InterWarehousePage) => el.number && el.number != '0')
// if (!flag) { // if (!flag) {
...@@ -1088,11 +1089,9 @@ const exportForm = ref({ ...@@ -1088,11 +1089,9 @@ const exportForm = ref({
delivery: false, delivery: false,
resource: '', resource: '',
}) })
const handleExport = () => { // const handleExport = () => {
exportVisible.value = true // exportVisible.value = true
// exportForm.value.delivery = false // }
// exportForm.value.resource = ''
}
const submitExportForm = () => { const submitExportForm = () => {
// if (exportForm.value.resource === '') { // if (exportForm.value.resource === '') {
// return ElMessage.error('请选择导出类型') // return ElMessage.error('请选择导出类型')
...@@ -1270,7 +1269,8 @@ const tabsClick = async () => { ...@@ -1270,7 +1269,8 @@ const tabsClick = async () => {
} }
const [editForm, resetEditForm] = useValue<InterWarehouseDetail>({ const [editForm, resetEditForm] = useValue<InterWarehouseDetail>({
inNo: '', inNo: '',
warehouseId: '', warehouseId: null,
warehouseName: '',
remark: '', remark: '',
factoryCode: '', factoryCode: '',
factoryId: 0, factoryId: 0,
...@@ -1310,7 +1310,7 @@ const addDialog = async (i: number, v: InterWarehousePage | null) => { ...@@ -1310,7 +1310,7 @@ const addDialog = async (i: number, v: InterWarehousePage | null) => {
const getProduct = async (id: number | undefined) => { const getProduct = async (id: number | undefined) => {
try { try {
const res = await getWarehouseInRecordDetailApi(id) const res = await getWarehouseInRecordDetailApi(id)
editForm2.value = res.data editForm.value = JSON.parse(JSON.stringify(res.data))
otherPurchaseData.value = res.data?.productList || [] otherPurchaseData.value = res.data?.productList || []
} catch (e) { } catch (e) {
console.error(e) console.error(e)
...@@ -1349,7 +1349,7 @@ const auditOrder = (key: string) => { ...@@ -1349,7 +1349,7 @@ const auditOrder = (key: string) => {
} }
const confimText = const confimText =
key === 'audit' key === 'audit'
? '确定进行审核?点“确定”将会直接更改库存数量,请在审核前确认数量是否正确。' ? '确定进行审核?点"确定"将会直接更改库存数量,请在审核前确认数量是否正确。'
: `确定对选中的信息进行${text}?` : `确定对选中的信息进行${text}?`
ElMessageBox.confirm(confimText, '重要提示', { ElMessageBox.confirm(confimText, '重要提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -1413,7 +1413,7 @@ watch( ...@@ -1413,7 +1413,7 @@ watch(
watch( watch(
() => editForm.value.warehouseId, () => editForm.value.warehouseId,
(newVal: number | string | undefined) => { (newVal: number | null | undefined) => {
if (newVal) { if (newVal) {
fetchLocationList('') fetchLocationList('')
} }
...@@ -1512,13 +1512,17 @@ const addSection = async () => { ...@@ -1512,13 +1512,17 @@ const addSection = async () => {
} }
const upSection = async () => { const upSection = async () => {
const params = { ...editForm.value } const params = { ...editForm.value }
params.productList = otherPurchaseData.value // params.productList = otherPurchaseData.value
// const result = checkUpdateParams(params, editForm2.value, '', { const result = checkUpdateParams(
// productList: 'value', { ...params, productList: otherPurchaseData.value },
// }) editForm.value as unknown as AnyObject,
// console.log(result, params, editForm2.value) 'id',
{
productList: 'warehouseSku',
},
)
try { try {
await updateInRecordApi(params) await updateInRecordApi(result)
newDialogVisible.value = false newDialogVisible.value = false
ElMessage.success('修改成功') ElMessage.success('修改成功')
search() search()
...@@ -1592,6 +1596,7 @@ const fetchLocationList = async (query: string) => { ...@@ -1592,6 +1596,7 @@ const fetchLocationList = async (query: string) => {
// locationList.value = [] // locationList.value = []
// return // return
// } // }
if (!editForm.value.warehouseId) return
locationLoading.value = true locationLoading.value = true
try { try {
const res = await getByWareHouseIdAndCodeApi( const res = await getByWareHouseIdAndCodeApi(
...@@ -1619,6 +1624,12 @@ const handleLocationChange = (val: number, row: InterProductList) => { ...@@ -1619,6 +1624,12 @@ const handleLocationChange = (val: number, row: InterProductList) => {
) )
row.locationCode = found ? found.locationCode : '' row.locationCode = found ? found.locationCode : ''
} }
const handleWarehouseChange = (val: number | null | undefined) => {
const found = warehouseList.value.find(
(item: InterWarehouseList) => item.id === val,
)
editForm.value.warehouseName = found ? found.name : ''
}
onMounted(() => { onMounted(() => {
getTreeNum() getTreeNum()
getWarehouseList() getWarehouseList()
......
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