Commit 455434be by linjinhong

Merge remote-tracking branch 'origin/master' into linjinhong

parents d614938c 03336ad7
......@@ -3,8 +3,54 @@
"version": "0.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@ampproject/remapping": {
"packages": {
"": {
"name": "factory_front",
"version": "0.0.0",
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^5.1.12",
"axios": "^1.6.7",
"bignumber.js": "^9.3.0",
"dayjs": "^1.11.13",
"element-plus": "^2.6.0",
"lodash-es": "^4.17.21",
"pinia": "^2.1.7",
"splitpanes": "^3.1.5",
"vue": "^3.4.19",
"vue-dompurify-html": "^5.1.0",
"vue-router": "^4.3.0",
"vue-tsc": "^2.1.10"
},
"devDependencies": {
"@types/splitpanes": "^2.2.6",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"@vitejs/plugin-vue": "^5.0.4",
"@vitejs/plugin-vue-jsx": "^4.1.0",
"@vue/eslint-config-typescript": "^12.0.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-vue": "^9.22.0",
"sass": "^1.71.1",
"typescript": "^5.2.2",
"unplugin-auto-import": "^0.17.5",
"unplugin-icons": "^0.18.5",
"unplugin-vue-components": "^0.26.0",
"vite": "^5.1.4"
}
},
"node_modules/@aashutoshrathi/word-wrap": {
"version": "1.2.6",
"resolved": "https://registry.npmmirror.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz",
"integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/@ampproject/remapping": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/@ampproject/remapping/-/remapping-2.3.0.tgz",
"integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==",
......@@ -1801,7 +1847,15 @@
"resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
},
"binary-extensions": {
"node_modules/bignumber.js": {
"version": "9.3.0",
"resolved": "https://registry.npmmirror.com/bignumber.js/-/bignumber.js-9.3.0.tgz",
"integrity": "sha512-EM7aMFTXbptt/wZdMlBv2t8IViwQL+h6SLHosp8Yf0dqJMTnY6iL32opnAB6kAdL0SZPuvcAzFr31o0c/R3/RA==",
"engines": {
"node": "*"
}
},
"node_modules/binary-extensions": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/binary-extensions/-/binary-extensions-2.3.0.tgz",
"integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==",
......
......@@ -14,6 +14,7 @@
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^5.1.12",
"axios": "^1.6.7",
"bignumber.js": "^9.3.0",
"dayjs": "^1.11.13",
"element-plus": "^2.6.0",
"lodash-es": "^4.17.21",
......
......@@ -4,11 +4,16 @@
</el-config-provider>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import { ref, computed, onMounted } from 'vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn.mjs'
import en from 'element-plus/es/locale/lang/en.mjs'
const language = ref('zh-cn')
const locale = computed(() => (language.value === 'zh-cn' ? zhCn : en))
// 在组件挂载时清空 localStorage
onMounted(() => {
localStorage.removeItem('socket_connect')
})
</script>
<style lang="scss">
body {
......
......@@ -60,7 +60,13 @@ export function getFilePath() {
import.meta.env.VITE_API_BASE_URL + import.meta.env.VITE_API_BASE_UPLOAD_URL
)
}
export function getWsUrl() {
if (location.protocol === 'https:') {
return 'wss://' + location.host
} else {
return 'ws://' + location.host
}
}
export const filePath = getFilePath()
export default axios
import { BasePaginationData, BaseRespData } from '@/types/api'
import { BasePaginationData, BaseRespData, RejectParams } from '@/types/api'
import axios from './axios'
import { PaymentForm } from '@/types/api/index.ts'
import {
LogListData,
OrderData,
......@@ -12,11 +13,15 @@ import {
InspectionData,
} from '@/types/api/order'
import {
apiSubmitPodOrderForm,
DeliveryNoteData,
DeliveryNoteSearchForm,
DetailForm,
LogListsData,
ProductionOrder,
ShipmentOrderDetailData,
updatePriceForm,
IUpdatePrice,
} from '@/types/api/deliveryNote'
import {
AccountStatementNote,
......@@ -78,7 +83,16 @@ export function reCreateScriptUrlApi(id: number) {
},
)
}
export function apiGetCraftGroup(id?: number | string) {
return axios.get<never, BaseRespData<never>>(
'pod/podReconciliation/getCraftGroup',
{
params: {
id,
},
},
)
}
// 打印生产单
export function printOrder(ids: number[]) {
return axios.post<never, BaseRespData<never>>(
......@@ -129,7 +143,27 @@ export function qaFinishedApi(data: InspectionData[]) {
data,
)
}
export function apiSetCraftData({
id,
craftTotalPrice,
recNumber,
craftPriceList,
}: {
id: number | undefined
craftTotalPrice: number | undefined
recNumber:string|undefined
craftPriceList: IUpdatePrice[]
}) {
return axios.post<never, BaseRespData<never>>(
'pod/podReconciliation/setCraftData',
{
id,
recNumber,
craftTotalPrice,
craftPriceList,
},
)
}
// 发货保存
export function saveOrder(
sumbitSendOutList: ShipmentOrderRes[],
......@@ -251,6 +285,21 @@ export function customJomallReconciliation(
)
}
export function podReconciliationList(
data: AccountStatementNoteSearchForm,
currentPage: number,
pageSize: number,
) {
return axios.post<never, BasePaginationData<AccountStatementNote>>(
'pod/podReconciliation/list',
{
...data,
currentPage,
pageSize,
},
)
}
export function printDeliveryNote(data: string[], userMark?: string) {
return axios.post<never, BaseRespData<never>>(
'factory/customJomallShipment/printInvoiceStatistics',
......@@ -302,6 +351,17 @@ export function getReconciliationAmount(id?: number) {
)
}
export function podReconciliation(id?: number) {
return axios.get<never, BaseRespData<CountStatus[]>>(
'pod/podReconciliation/groupCount',
{
params: {
id,
},
},
)
}
export function getCustomJomallReconciliationById(id?: number) {
return axios.get<never, BaseRespData<OrderData>>(
'factory/customJomallReconciliation/getById',
......@@ -337,17 +397,97 @@ export function exportExcelApi(ids: string) {
},
})
}
export function exportPodExcelApi(ids: string) {
return axios.get<never, BaseRespData<never>>(
'pod/podReconciliation/exportExcel',
{
params: {
ids,
},
},
)
}
export function getShipmentDetailsById(data: DetailForm) {
return axios.post<never, BasePaginationData<BillOrderDetailData>>(
'reconciliation/getItemList',
data,
)
}
export function apiupdateByPodExcel(formData: never) {
return axios.post('pod/podReconciliation/updateByExcel', formData, {
headers: {
'Content-Type': 'multipart/form-data',
},
})
}
export function apiRejectedPodReconciliation(params?: RejectParams) {
return axios.post<never, BaseRespData<never>>(
'pod/podReconciliation/rejectedLocal',
params,
)
}
export function getPodShipmentDetailsById(data: DetailForm) {
return axios.post<never, BasePaginationData<BillOrderDetailData>>(
'pod/podReconciliation/getItemList',
data,
)
}
export function apiLogList(id?: number) {
return axios.get<never, BaseRespData<LogListsData[]>>(
'pod/podReconciliation/getLog',
{ params: { id } },
)
}
export function apiItemLogList(id?: number) {
return axios.get<never, BaseRespData<LogListsData[]>>(
'pod/podReconciliation/getItemLog',
{ params: { id } },
)
}
export function apiSubmitPodOrder(params: apiSubmitPodOrderForm) {
return axios.get<never, BaseRespData<ShipmentOrderDetailData>>(
'pod/podReconciliation/create',
{ params },
)
}
export function apiPodBillSubmit(ids: number[]) {
return axios.post<never, BaseRespData<ShipmentOrderDetailData>>(
'pod/podReconciliation/submission',
{ ids },
)
}
export function apiPodUpdatePrice(data: updatePriceForm) {
return axios.get<never, BaseRespData<never>>(
'pod/podReconciliation/updatePrice',
{ params: data },
)
}
export function updateRecPrice(data: updatePriceForm) {
return axios.get<never, BaseRespData<never>>(
'pod/podReconciliation/updateRecPrice',
{ params: data },
)
}
export function getLogListApi(id?: number) {
return axios.get<never, BaseRespData<LogList[]>>('reconciliation/getLog', {
params: { id },
})
}
export function getPodLogListApi(id?: number) {
return axios.get<never, BaseRespData<LogList[]>>(
'pod/podReconciliation/getLog',
{
params: { id },
},
)
}
export function auditOrderApi(url: string, data: string) {
return axios.get(url, {
params: {
......@@ -369,6 +509,37 @@ export function getShipmentOrderDetailById(id?: number | string) {
export function confirmOrderApi(data: ConfirmOrderForm) {
return axios.post<never, BaseRespData<never>>('reconciliation/confirm', data)
}
export function confirmPodOrderApi(data: ConfirmOrderForm) {
return axios.post<never, BaseRespData<never>>(
'pod/podReconciliation/confirm',
data,
)
}
export function apiRejectionOfReview({
ids,
description,
recNumbers,
}: {
ids: string
recNumbers: string
description: string
}) {
return axios.post<never, BaseRespData<never>>(
'pod/podReconciliation/rejectionOfReview',
{
ids,
description,
recNumbers,
},
)
}
export function apiBillPodPayment(data: PaymentForm) {
return axios.post<never, BaseRespData<never>>(
'pod/podReconciliation/payment',
data,
)
}
export function rejectOrderApi({
ids,
description,
......
import { BasePaginationData, BaseRespData } from '@/types/api'
import {
ProductList,
PodUsOrderListData,
SearchForm,
Tab,
LogListData,
} from '@/types/api/podUsOrder'
import axios from './axios'
import { PodMakeOrderData } from '@/types/api/podMakeOrder'
export function getOrderTabData() {
return axios.get<never, BaseRespData<Tab[]>>(
'/factory/podJomallOrderUs/findStateGroupList',
)
}
export function getOrderList(
params: SearchForm,
currentPage: number,
pageSize: number,
) {
return axios.post<never, BasePaginationData<PodUsOrderListData[]>>(
'/factory/podJomallOrderUs/list_page',
{
...params,
currentPage,
pageSize,
},
)
}
export function getCardOrderList(
params: SearchForm,
currentPage: number,
pageSize: number,
) {
return axios.post<never, BasePaginationData<ProductList[]>>(
'/factory/podJomallOrderProductUs/list_page',
{
...params,
currentPage,
pageSize,
},
)
}
export function confirmOrderApi(data: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/confirmOrders',
data,
)
}
export function updateExceptionOrderApi(data: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/updateExceptionOrders',
{
orderIds: data,
},
)
}
export function changeExceptionOrderApi(ids: number[], value: string) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/exceptionOrders',
{
orderIds: ids,
exceptionReason: value,
},
)
}
export function cancelOrderApi(ids: number[], value: string) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/cancelOrders',
{
orderIds: ids,
cancelReason: value,
},
)
}
export function getOperationLogApi(id: number) {
return axios.get<never, BaseRespData<LogListData[]>>(
`factory/podJomallOrderUsLog/getPodJomallOrderUsLog?id=${id}`,
)
}
export function getSubOrderBySubOrderNumber(factorySubOrderNumber: string) {
return axios.get<never, BaseRespData<ProductList>>(
'factory/podJomallOrderProductUs/getProductUsByFactorySubOrderNumber',
{
params: {
factorySubOrderNumber,
},
},
)
}
export function downloadMaterialApi(id: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderProductUs/downloadDesignImages',
id,
)
}
export function productionQueryApi(id: number, podJomallOrderUsId: number) {
return axios.post<never, BasePaginationData<never>>(
'factory/podJomallOrderProductUs/completeDelivery',
{
id,
podJomallOrderUsId,
},
)
}
export function printProductionOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderUs/printProducePdf',
orderIds,
)
}
export function getOrderDetailById(id: number) {
return axios.get<never, BaseRespData<ProductList>>(
`factory/podJomallOrderProductUs/getProductUsById?id=${id}`,
)
}
export function getPackingDataApi(
code: string,
factoryNo: number,
box: number | null,
) {
return axios.get<never, BaseRespData<PodMakeOrderData>>(
'/factory/podJomallOrderUs/getPodBoxDetailsBySkuOrNo',
{
params: {
podJomallUsNo: code,
box,
factoryNo,
},
},
)
}
export function getPodBoxListApi(factoryNo: number | string) {
return axios.get<never, BaseRespData<PodMakeOrderData[]>>(
'factory/podJomallOrderUs/getPodBoxOrderDetails',
{
params: { factoryNo },
},
)
}
export function submitInspectionApi(
data: { id: number; version?: number }[],
boxIndex: number | null,
) {
return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderUs/podPrintOrderComplete?box=${boxIndex}`,
{
orderParamList: data,
},
)
}
export function clearBoxApi(factoryNo: number, box: number | null) {
return axios.get<never, BaseRespData<never>>(
'factory/podJomallOrderUs/delPodBoxOrderDetailsByBox',
{
params: { factoryNo, box },
},
)
}
export function clearAllBoxApi() {
return axios.get<never, BaseRespData<never>>(
'factory/podJomallOrderUs/delPodBoxOrderDetails',
)
}
export function updateRemarkApi(id: number, content: string) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/addRemark',
{ id, content },
)
}
......@@ -13,6 +13,7 @@
v-if="selectionable"
type="selection"
width="50"
fixed="left"
header-align="center"
align="center"
></ElTableColumn>
......@@ -20,7 +21,8 @@
v-if="serialNumberable"
label="序号"
type="index"
width="50"
width="60"
fixed="left"
header-align="center"
align="center"
></ElTableColumn>
......
......@@ -16,9 +16,11 @@ import { getToken } from '@/api/axios'
import UserPage from '@/views/UserPage.vue'
import DeliveryNotePage from '@/views/DeliveryNotePage.vue'
import AccountStatementNote from '@/views/AccountStatementNote.vue'
import PodBillOrder from '@/views/podBillOrder/index.vue'
import TypeseetingManagement from '@/views/typesetting/TypesettingManagement.vue'
import PodOrderList from '@/views/order/pod/index.vue'
import PodDeliveryNoteList from '@/views/order/pod/deliveryOrderList.vue'
import PodUsOrderList from '@/views/order/podUs/index.vue'
const router = createRouter({
history: createWebHistory(),
......@@ -50,6 +52,13 @@ const router = createRouter({
component: PodOrderList,
},
{
path: '/pod-us-order/list',
meta: {
title: 'POD订单(US)',
},
component: PodUsOrderList,
},
{
path: '/pod-delivery-note/list',
meta: {
title: 'POD发货单',
......@@ -80,9 +89,15 @@ const router = createRouter({
{
path: '/account/statement-note',
meta: {
title: '对账单',
title: '定制对账单',
},
component: AccountStatementNote,
},{
path: '/account/pod-bill-order',
meta: {
title: 'POD对账单',
},
component: PodBillOrder,
},
{
path: '/typesetting-management/list',
......
......@@ -26,13 +26,30 @@ const menu: MenuItem[] = [
id: 7,
label: 'POD订单',
},
{
index: '/pod-us-order/list',
id: 8,
label: 'POD订单(US)',
},
],
},
{
index: '/account/statement-note',
index: '11',
id: 3,
label: '对账单',
children: [
{
index: '/account/statement-note',
id: 1,
label: '定制对账单',
},
{
index: '/account/pod-bill-order',
id: 2,
label: 'POD对账单',
},
],
},
{
index: '2',
......
import { defineStore } from 'pinia'
import {
OrderData,
PodMakeOrderData,
ProductList,
} from '@/types/api/podMakeOrder'
import { getPodBoxListApi } from '@/api/podUsOrder'
export interface OrderStoreState {
podBoxList?: PodMakeOrderData[]
podBoxIndex?: number | null
socketConnect?: string
}
const useOrderStore = defineStore('order', {
state: () => {
return {
podBoxList: [],
podBoxIndex: null,
socketConnect: '',
} as OrderStoreState
},
actions: {
async setPodBoxList(content: {
boxList: PodMakeOrderData[] | OrderData | null
factoryNo: number | string
box?: number
data?: OrderData
}) {
const { factoryNo, boxList, box, data } = content
if (Array.isArray(boxList)) {
this.podBoxList = boxList
} else {
const index = this.podBoxList?.findIndex((item) => item.box === box)
if (index === -1) {
try {
const res = await getPodBoxListApi(factoryNo)
const boxList = res.data.map((item) => {
if (res.data) {
const productList = item?.data?.productList || []
const pickingNumber = productList.reduce(
(prev: number, item1: ProductList) => {
if (item1.count) {
return prev + item1.count
}
return prev
},
0,
)
if (item.data) {
item.data.pickingNumber = pickingNumber
}
}
return item
})
this.podBoxList = boxList
this.podBoxIndex = box
} catch (error) {
console.error(error)
}
} else if (box !== 0 && box !== undefined) {
const arr = this.podBoxList
if (arr) {
arr[box - 1] = {
box,
data: data || boxList || null,
}
}
console.log('222arr1111', arr)
this.podBoxList = arr
this.podBoxIndex = box
}
}
},
// 清空所有箱子
clearPodBoxList() {
this.podBoxList = []
},
// 设置当前箱子
setPodBox(box: number) {
this.podBoxIndex = box
},
// 清空当前箱子
clearPodBox() {
this.podBoxIndex = null
},
setSocketConnect(connect: string) {
this.socketConnect = connect
},
},
})
export default useOrderStore
......@@ -114,3 +114,6 @@ img {
.mt-10 {
margin-top: 10px;
}
.mb-10 {
margin-bottom: 10px;
}
......@@ -10,17 +10,26 @@ export interface AccountStatementNoteSearchForm {
status?: number | string | null
dateRange?: string[]
billNumber?: string
subOrderNumber?: string
shipmentNumber?: string
recNumber?: string
orderNumber?: string
factory_status?: string
erp_status?: string
startTime?: string
start_time?: string
endTime?: string
end_time?: string
orderNumber?: string
}
export interface AccountStatementNote {
create_time?: string
product_total_amount?: number
craft_total_amount?: number
pass_num?: number
factory_code?: string
total_amount?: string | number
actual_amount?: string | number
num?: number
end_time?: string
rec_number?: string
......@@ -35,6 +44,9 @@ export interface AccountStatementNote {
id?: number
erp_total_amount?: number
dataVersion: ''
water_list?: {
url: string | undefined
}[]
}
export interface BillOrderDetailData {
create_time?: string
......@@ -59,11 +71,13 @@ export interface BillOrderDetailData {
export interface LogList {
create_time?: string
employee_id?: number
info_id?: number
description?: string
id: string
diy_id: number
employee_account?: string
employee_name?: string
employee_id?: string
description?: string
}
export interface ItemList {
......@@ -85,5 +99,5 @@ export interface ItemList {
export interface ConfirmOrderForm {
pass?: number | null
description?: string
ids?:string
ids?: string
}
......@@ -12,6 +12,11 @@ export interface DeliveryNoteSearchForm {
status?: number | null
}
export interface IUpdatePrice {
process: string
base_price: string | number
add_price: string | number
}
export interface DeliveryNoteData {
id: number
billNumber?: string
......@@ -182,11 +187,49 @@ export interface DbFactory {
authorize_number?: number
status?: number
}
export interface LogListsData {
id: number
diy_id: number
employee_account?: string
employee_name?: string
employee_id?: string
description?: string
create_time?: string
}
export interface LogListData {
id?: string | number | null
infoId?: number
employeeId?: number
employeeAccount?: string
description?: string
createTime?: string
}
export interface DetailForm {
billNumber?: string
orderNumber?:string
orderNumber?: string
baseSku?: string
shipmentNumber?: string
process?: string
supplierItemNo?: string
dateRange?: string[]
endTime?: string
startTime?: string
subOrderNumber?: string
rows?: number
page?: number
pageSize?: number
infoId?: number
}
export interface BillForm {
timeRange: [string, string] | []
}
export interface apiSubmitPodOrderForm {
startDate?: string
endDate?: string
}
export interface updatePriceForm {
ids?: string
infoId?: number
price?: string
}
export interface BaseRespData<D> {
code: number
message?: string
......@@ -7,12 +6,14 @@ export interface BaseRespData<D> {
export interface PaginationData<D> {
page?: PaginationData<D>
craftPrice?: string
costPrice?: string
total: number
size: number
current: number
records: D[]
}
export interface Statistics<D> {
export interface Statistics<D> {
sumNotPassNum: number
sumPassNum: number
sumShipmentNum: number
......@@ -28,3 +29,21 @@ export interface Statistics<D> {
export type BasePaginationData<D> = BaseRespData<PaginationData<D>>
export type StatisticsData<D> = BaseRespData<Statistics<D>>
export interface baseRes {
code: number
msg: string
}
export interface PaymentForm {
waterList: string
id?: number | string
actualAmount?: number | string
payableAmount?: number | string
recNumber?: number | string
}
export interface RejectParams {
id: number
description?: string
ids?: string
pass?: number
}
......@@ -81,6 +81,7 @@ export interface ProductList {
subOrderNumber?: string
shopNumber?: string
material?: string
materialPrice?: number|null
count?: number
baseSku?: string
erpSubOrderNumber?: string
......
export interface PodMakeOrderData {
data: OrderData | null
warehouseId?: number
box?: number
addDate?: string
}
export interface OrderData {
shipmentsNote?: string
filePath?: string
fileData?: string
logisticsWayName?: string
orderStatus?: number
salesPlatform?: string
logisticsCompanyId?: number
blocked?: boolean
logisticsCompanyName?: string
logisticsWayNameId?: number
shopNumber?: string
id?: number
shopId?: number
systemWeight?: number
trackingNumber?: string
productList?: ProductList[]
purchaseNumber?: number
pickingNumber?: number
printResult?: string
remark?: string
version?: number
}
export interface ProductList {
warehouseSkuImage: string
warehouseSku: string
orderItemId: string
warehouseSkuName: string
productMark: string
podJomallNo: string
id: number
mainSku: string
imageAry: string
purchaseNumber: number
count?: number
power?: boolean
variantImage?: string
}
export interface Tab {
status?: string
statusName?: string
quantity?: number
}
export interface SearchForm {
timeType: number | null
shopNumber: string
userMark: string
logisticsTracking: string
baseSku: string
factoryOrderNumber: string
sku: string
factorySubOrderNumber: string
status: string
customizedQuantity: string
startTime: string | null
endTime: string | null
}
export interface PodUsOrderListData {
id: number
thirdOrderNumber?: string
factoryOrderNumber?: string
shopNumber?: string
factoryOnlineId?: number | null
factoryNo?: number | null
factoryCode?: string | null
status?: string
weight?: number | null
totalProductAmount?: number | null
productAmount?: number
carriageAmount?: number | null
totalAmount?: number | null
productNum?: number | null
trackStatus?: string | null
receiverName?: string
receiverPhone?: string
receiverCountry?: string
receiverProvince?: string
receiverCity?: string
receiverDistrict?: string
receiverAddress1?: string
receiverAddress2?: string
receiverPostCode?: string
paymentType?: string
paymentTime?: string
startStockingTime?: string
finishTime?: string
shipmentType?: string
expressSheet?: string
trackingNumber?: string
processNumber?: string
createTime?: string
updateTime?: string
remark?: string | null
userMark?: string
version?: number
productList?: ProductList[]
orderNumber?: string
}
export interface ProductList {
id: number
podJomallOrderUsId: number
thirdSubOrderNumber?: string
factorySubOrderNumber?: string
factoryCode?: string
productName?: string
baseSku?: string
variantSku?: string
productPrice?: number
templatePrice?: number
variantImage?: string
craftPrice?: number
imageAry?: string
designImages?: string
categoryId?: number
categoryName?: string
num?: number
passNum?: number
notPassNum?: number
payAmount?: number
weight?: number | null
diyId?: string
endProductId?: string
customizedQuantity?: number
tagIds?: string
isProduction?: boolean
createTime?: string
updateTime?: string
remark?: string | null
version?: number
subOrderNumber?: string
craftName?: string | null
lanshouAddress?: string | null
shopNumber?: string | null
factoryOrderNumber?: string | null
}
export interface cardImages {
title: string
url: string
sort: number
id?: number
}
export interface LogListData {
id: number
bizId: number
userId: number
employeeName: string
description: string
deleteContent: string
createTime: string
}
export interface PodOrderRes extends ProductList {
expectDeliveryTime?: string | null
thirdOrderNumber?: string | null
startStockingTime?: string | null
factoryOrderNumber?: string | null
userMark?: string | null
craftName?: string | null
craftId?: string | null
shopNumber?: string | null
color?: string | null
size?: string | null
note?: Array<{ prop: string | number; value: string | number }>
imgList: cardImages[]
}
......@@ -101,6 +101,7 @@ export interface LogList {
employeeId: number
description: string
createdTime: string
createTime?: string
}
export interface ImageListData {
......
import { onMounted } from 'vue'
export interface LODOPObject extends HTMLObjectElement {
VERSION: string;
CVERSION: string;
SET_LICENSES: (companyName: string, licenseA: string, licenseB: string, licenseC: string) => void;
GET_PRINTER_COUNT: () => number;
GET_PRINTER_NAME: (index: number) => string;
PRINT_INIT: (printName: string) => void;
SET_PRINTER_INDEX: (printerName: string) => void | string | number | boolean;
SET_PRINT_MODE: (mode: string, value: boolean) => void;
On_Return: (id: string, value: string) => void;
On_Return_Remain: boolean;
SEND_PRINT_RAWDATA: (data: string) => void;
ADD_PRINT_PDF: (x: number, y: number, width: string, height: string, url: string) => void;
GET_VALUE: (valueType: string, valueIndex: string | unknown) => string;
PRINT: () => string;
PRINTA: () => string;
}
export interface CLodopObject {
CVERSION: string;
GET_STATUS: () => number;
GET_VALUE: (valueType: string, valueIndex: string | unknown) => string;
}
declare global {
interface Window {
LODOP: new () => LODOPObject;
CLODOP: CLodopObject;
getCLodop: () => LODOPObject;
}
}
export default function useLodop() {
let CLodopJsState: 'loading' | 'complete' | null = null
let CLodopIsLocal = false
let CreatedOKLodopObject: LODOPObject | null = null
// 检查是否需要使用 CLODOP
const checkNeedCLodop = (): boolean => {
try {
const ua = navigator.userAgent
if (ua.match(/Windows\sPhone/i)) return true
if (ua.match(/iPhone|iPod|iPad/i)) return true
if (ua.match(/Android/i)) return true
if (ua.match(/Edge\D?\d+/i)) return true
const verTrident = ua.match(/Trident\D?\d+/i)
const verIE = ua.match(/MSIE\D?\d+/i)
let verOPR = ua.match(/OPR\D?\d+/i)
let verFF = ua.match(/Firefox\D?\d+/i)
const x64 = ua.match(/x64/i)
if (!verTrident && !verIE && x64) return true
else if (verFF) {
verFF = verFF[0].match(/\d+/)
if ((verFF && parseInt(verFF[0]) >= 41) || x64) return true
} else if (verOPR) {
verOPR = verOPR[0].match(/\d+/)
if (verOPR && parseInt(verOPR[0]) >= 32) return true
} else if (!verTrident && !verIE) {
let verChrome = ua.match(/Chrome\D?\d+/i)
if (verChrome) {
verChrome = verChrome[0].match(/\d+/)
if (verChrome && parseInt(verChrome[0]) >= 41) return true
}
}
return false
} catch (err) {
return true
}
}
const needCLodop = checkNeedCLodop()
const showMsg = (msg: string) => {
ElMessageBox.alert(msg, '提示', {
dangerouslyUseHTMLString: true,
closeOnClickModal: false,
center: true,
})
}
// 初始化 LODOP
const initLodop = () => {
if (CLodopJsState == 'loading' || CLodopJsState == 'complete') return
CLodopJsState = 'loading'
const head =
document.head ||
document.getElementsByTagName('head')[0] ||
document.documentElement
const JS1 = document.createElement('script')
const JS2 = document.createElement('script')
if (window.location.protocol == 'https:') {
JS1.src = 'https://localhost.lodop.net:8443/CLodopfuncs.js'
JS2.src = 'https://localhost.lodop.net:8444/CLodopfuncs.js'
} else {
JS1.src = 'http://localhost:8000/CLodopfuncs.js'
JS2.src = 'http://localhost:18000/CLodopfuncs.js'
}
JS1.onload = JS2.onload = function () {
CLodopJsState = 'complete'
}
JS1.onerror = JS2.onerror = function () {
CLodopJsState = 'complete'
}
head.insertBefore(JS1, head.firstChild)
head.insertBefore(JS2, head.firstChild)
CLodopIsLocal = !!(JS1.src + JS2.src).match(/\/\/localho|\/\/127.0.0./i)
}
const getCLodop = (oOBJECT: LODOPObject | null, oEMBED: LODOPObject | null): LODOPObject | null => {
const strFontTag = '<font _#_>打印控件'
const strLodopInstall =
strFontTag +
'未安装!点击这里<a href=http://www.c-lodop.com/download/CLodop_Setup_for_Win64NT_6.623EN.zip target=_self>执行安装</a>'
const strLodopUpdate =
strFontTag +
'需要升级!点击这里<a href=install_lodop32.exe target=_self>执行升级</a>'
const strLodop64Install =
strFontTag +
'未安装!点击这里<a href=install_lodop64.exe target=_self>执行安装</a>'
const strLodop64Update =
strFontTag +
'需要升级!点击这里<a href=install_lodop64.exe target=_self>执行升级</a>'
const strCLodopInstallA =
'<font >Web打印服务CLodop未安装启动,点击下列按钮执行安装<br><a href=http://www.c-lodop.com/download/lodop6.226_Clodop6.623.zip target=_self>安装32位</a> <a href=http://www.c-lodop.com/download/CLodop_Setup_for_Win64NT_6.623EN.zip target=_blank>安装64位</a><br>'
const strCLodopInstallB =
'(若此前已安装过,可点这里直接<a href=CLodop.protocol:setup target=_self>再次启动</a>)'
const strCLodopUpdate =
'<font >Web打印服务CLodop需升级!点击这里<a href=CLodop_Setup_for_Win32NT.exe target=_self>执行升级</a>'
const strLodop7FontTag = '<font >Web打印服务Lodop7'
const strLodop7HrefX86 =
'点击这里<a href=https://www.c-lodop.com/download/Lodop7.105_Linux_X86_64_CN.deb.zip target=_self>下载安装</a>(下载后解压,点击lodop文件开始执行)'
const strLodop7HrefARM =
'点击这里<a href=https://www.c-lodop.com/download/Lodop7.105_Linux_ARM64_CN.deb.zip target=_self>下载安装</a>(下载后解压,点击lodop文件开始执行)'
const strLodop7Install_X86 =
strLodop7FontTag + '未安装启动,' + strLodop7HrefX86
const strLodop7Install_ARM =
strLodop7FontTag + '未安装启动,' + strLodop7HrefARM
const strLodop7Update_X86 = strLodop7FontTag + '需升级,' + strLodop7HrefX86
const strLodop7Update_ARM = strLodop7FontTag + '需升级,' + strLodop7HrefARM
const strInstallOK = ',成功后请刷新本页面或重启浏览器。</font>'
let LODOP: LODOPObject | null = null
try {
const isWinIE =
/MSIE/i.test(navigator.userAgent) ||
/Trident/i.test(navigator.userAgent)
const isWinIE64 = isWinIE && /x64/i.test(navigator.userAgent)
const isLinuxX86 =
/Linux/i.test(navigator.userAgent) && /x86_64/i.test(navigator.userAgent)
const isLinuxARM =
/Linux/i.test(navigator.userAgent) && /aarch64/i.test(navigator.userAgent)
if (needCLodop || isLinuxX86 || isLinuxARM) {
try {
LODOP = window.getCLodop()
} catch (err) {
console.error(err)
}
if (!LODOP && CLodopJsState !== 'complete') {
if (CLodopJsState == 'loading')
alert('网页还没下载完毕,请稍等一下再操作.')
else alert('未曾加载Lodop主JS文件,请先调用loadCLodop过程.')
return null
}
let strAlertMessage
if (!LODOP) {
if (isLinuxX86) strAlertMessage = strLodop7Install_X86
else if (isLinuxARM) strAlertMessage = strLodop7Install_ARM
else
strAlertMessage =
strCLodopInstallA + (CLodopIsLocal ? strCLodopInstallB : '')
showMsg(strAlertMessage + strInstallOK)
return null
} else {
if (isLinuxX86 && LODOP.CVERSION < '7.0.4.3')
strAlertMessage = strLodop7Update_X86
else if (isLinuxARM && LODOP.CVERSION < '7.0.4.3')
strAlertMessage = strLodop7Update_ARM
else if (window.CLODOP.CVERSION < '4.1.6.1')
strAlertMessage = strCLodopUpdate
if (strAlertMessage) showMsg(strAlertMessage + strInstallOK)
}
} else {
//==如果页面有Lodop插件就直接使用,否则新建:==
if (oOBJECT || oEMBED) {
if (isWinIE) LODOP = oOBJECT
else LODOP = oEMBED
} else if (!CreatedOKLodopObject) {
LODOP = document.createElement('object') as unknown as LODOPObject
LODOP.setAttribute('width', '0')
LODOP.setAttribute('height', '0')
LODOP.setAttribute(
'style',
'position:absolute;left:0px;top:-100px;width:0px;height:0px;',
)
if (isWinIE)
LODOP.setAttribute(
'classid',
'clsid:2105C259-1E0C-4534-8141-A753534CB4CA',
)
else LODOP.setAttribute('type', 'application/x-print-lodop')
document.documentElement.appendChild(LODOP)
CreatedOKLodopObject = LODOP
} else LODOP = CreatedOKLodopObject
//==Lodop插件未安装时提示下载地址:==
if (!LODOP || !LODOP.VERSION) {
showMsg(
(isWinIE64 ? strLodop64Install : strLodopInstall) + strInstallOK,
)
return null
}
if (LODOP.VERSION < '6.2.2.6') {
showMsg(
(isWinIE64 ? strLodop64Update : strLodopUpdate) + strInstallOK,
)
}
}
if (location.host.indexOf('jomalls.com') !== -1) {
LODOP.SET_LICENSES('', '90D9E6991E35971D8FC86B525F637C8A9F9', '', '')
} else {
LODOP.SET_LICENSES('', 'A9F23BF819622E36A8775E717685989E9FC', '', '')
}
return LODOP
} catch (err) {
alert('getLodop出错:' + err)
}
return null
}
onMounted(() => {
initLodop()
})
return {
getCLodop,
}
}
......@@ -57,7 +57,11 @@ export default function usePageList<T>(options: UsePageListOptions<T>) {
loadData()
}
const refresh = () => {
const refresh = (reset?: boolean) => {
if (reset) {
data.value = []
total.value = 0
}
currentPage.value = 1
loadData()
}
......
import { getWsUrl } from '../api/axios'
import useOrderStore from '../store/order'
interface NotificationOptions {
body: string
icon: string
data: string
requireInteraction: boolean
}
export interface WebSocketMessage {
code?: string
content?: string
type?: string
data?: unknown
[key: string]: string | unknown | undefined
}
interface InitOptions {
account: string
factoryNo: string
}
type MessageCallback = (
data: WebSocketMessage,
sendSystemMessage: (msg: string) => void,
) => void
type OpenCallback = () => void
function sendSystemMessage(msg: string): void {
if (window.Notification && Notification.permission === 'granted') {
const notificationOptions: NotificationOptions = {
body: msg,
icon: './favicon.ico',
data: 'I like peas.',
requireInteraction: true,
}
const n = new Notification('消息通知', notificationOptions)
n.onclick = (event: Event) => {
event.preventDefault()
window.open('/home', '_blank')
}
setTimeout(() => {
n.close()
}, 10000)
}
}
const showReconnectingMsg = (): void => {
ElMessageBox.alert('消息服务已断开,正在重新连接,请稍候', {
showClose: true,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
}
class Im {
private socket: WebSocket | null = null
private _wsUrl: string = ''
// private userId: string = ''
private _onMessageCallback?: MessageCallback
private _onOpenCallback?: OpenCallback
private _heartbeatTimer: number | null = null
private _heartbeatTimeoutTimer: number | null = null
private _reconnectingTimer: number | null = null
private num: number = 0
constructor() {
this._onWsOpen = this._onWsOpen.bind(this)
this._onWsMessage = this._onWsMessage.bind(this)
this._onWsClose = this._onWsClose.bind(this)
this._onWsError = this._onWsError.bind(this)
}
private _onWsOpen(): void {
console.log('服务器连接成功')
localStorage.setItem('socket_connect', 'online')
this._onOpenCallback?.()
this._startHeartbeat()
}
private _onWsMessage(event: MessageEvent): void {
let data: WebSocketMessage = {}
if (typeof event.data === 'string') {
try {
data = JSON.parse(event.data)
} catch (error) {
data = {}
}
}
this._onHeartbeatMessage()
this._onMessageCallback?.(data, sendSystemMessage)
}
private _onWsClose(): void {
console.log('服务器关闭')
this._destroyWebSocket(true)
}
private _onWsError(): void {
console.log('连接出错')
this._destroyWebSocket(true)
}
private _sendHeartbeat(): void {
if (!this.socket) return
this.send({ code: 'HEALTH' })
if (this._heartbeatTimeoutTimer) {
window.clearTimeout(this._heartbeatTimeoutTimer)
}
this._heartbeatTimeoutTimer = window.setTimeout(() => {
this._destroyWebSocket(true)
}, 5 * 1000)
}
private _onHeartbeatMessage(): void {
console.log('心跳')
useOrderStore().setSocketConnect('online')
if (this._heartbeatTimeoutTimer) {
window.clearTimeout(this._heartbeatTimeoutTimer)
}
}
private _startHeartbeat(): void {
this._stopHeartbeat()
this._sendHeartbeat()
this._heartbeatTimer = window.setInterval(
() => this._sendHeartbeat(),
10 * 1000,
)
}
private _stopHeartbeat(): void {
if (this._heartbeatTimer) {
window.clearInterval(this._heartbeatTimer)
}
if (this._heartbeatTimeoutTimer) {
window.clearTimeout(this._heartbeatTimeoutTimer)
}
}
private _scheduleReconnect(): void {
if (!this.num) this.num = 0
this.num++
if (this.num > 5) {
ElMessageBox.alert('尝试重连消息服务失败,请刷新重试')
return
}
showReconnectingMsg()
this._reconnectingTimer = window.setTimeout(() => {
this._createWebSocket()
}, 2000)
}
private _destroyWebSocket(reconnect?: boolean): void {
if (!this.socket) return
this._stopHeartbeat()
if (this._reconnectingTimer) {
window.clearTimeout(this._reconnectingTimer)
}
this.socket.removeEventListener('open', this._onWsOpen)
this.socket.removeEventListener('message', this._onWsMessage)
this.socket.removeEventListener('close', this._onWsClose)
this.socket.removeEventListener('error', this._onWsError)
this.socket.close(1000)
this.socket = null
localStorage.removeItem('socket_connect')
useOrderStore().setSocketConnect('offline')
if (reconnect) this._scheduleReconnect()
}
private _createWebSocket(): void {
if (!this._wsUrl) return
const socket = new WebSocket(this._wsUrl)
socket.addEventListener('open', this._onWsOpen)
socket.addEventListener('message', this._onWsMessage)
socket.addEventListener('close', this._onWsClose)
socket.addEventListener('error', this._onWsError)
this.socket = socket
}
init(
options: InitOptions,
msgfunc?: MessageCallback,
openfunc?: OpenCallback,
): Promise<void> {
return new Promise((resolve, reject) => {
const { account, factoryNo } = options
const socket_connect = localStorage.getItem('socket_connect')
if (socket_connect === 'online') {
resolve()
return
}
if (!window.WebSocket) {
reject(new Error('WebSocket is not supported'))
return
}
this._onMessageCallback = msgfunc
this._onOpenCallback = () => {
openfunc?.()
resolve()
}
this._destroyWebSocket()
this._wsUrl = `${getWsUrl()}/ws/websocket/${factoryNo}/${account}`
this._createWebSocket()
})
}
send(options: WebSocketMessage): void {
this.socket?.send(JSON.stringify(options))
}
close(): void {
this._destroyWebSocket()
}
}
export default new Im()
......@@ -163,6 +163,15 @@
item.price || '--'
}}</span>
</div>
<div
v-if="item.materialPrice && item.materialPrice > 0"
class="order-list-expand_item_info_title"
>
<span class="order-list-expand_item_label">材质价格:</span>
<span class="order-list-expand_item_value">{{
item.materialPrice
}}</span>
</div>
<div class="order-list-expand_item_info_title font-bold">
<span class="order-list-expand_item_label">购买数:</span>
<span class="order-list-expand_item_value">{{ item.num || 0 }}</span>
......
......@@ -97,10 +97,10 @@
{{ detail?.factorySubOrderNumber }}
</p>
</div>
<div :title="detail?.thirdOrderNumber || ''" class="div-item">
<div :title="detail?.thirdSubOrderNumber || ''" class="div-item">
<span>第三方生产单号</span>
<p>
{{ detail?.thirdOrderNumber }}
{{ detail?.thirdSubOrderNumber }}
</p>
</div>
<div :title="String(detail?.process)" class="div-item">
......@@ -466,7 +466,7 @@ const changeStatus = async () => {
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
setData(TrackingNumber.value)
setData(detail.value.factorySubOrderNumber || '')
})
}
const setData = async (orderNumber: string) => {
......
......@@ -1084,7 +1084,7 @@ import {
OrderData,
ShipmentForm,
} from '@/types/api/order'
import fastProduction from '../fastProduction.vue'
import fastProduction from './fastProduction.vue'
// import CardWrapper from '@/components/CardPods.vue'
import { useValue } from '@/utils/hooks/useValue'
import {
......
......@@ -239,7 +239,7 @@
<div v-for="(item, index) in logList" :key="index" class="log-item">
<div class="icon-left">
<Icon name="a-2labadianji3x" />
<span class="time">{{ item.createdTime }}</span
<span class="time">{{ item.createTime }}</span
>&emsp;
</div>
<span class="description" :title="item.description">
......@@ -385,7 +385,7 @@ const operationLog = async (data: TypesettingListData) => {
try {
const res = await getTypesettingLogByIdApi(data.id)
res.data.forEach((item) => {
item.createdTime = dayjs(item.createdTime).format('YYYY-MM-DD HH:mm:ss')
item.createTime = dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss')
})
logList.value = res.data
logVisible.value = true
......
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