Commit 58bf51b8 by linjinhong

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

parents ecb8d615 106dbe29
......@@ -51,6 +51,7 @@ declare module 'vue' {
ElTag: typeof import('element-plus/es')['ElTag']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree']
ElUpload: typeof import('element-plus/es')['ElUpload']
Icon: typeof import('./src/components/Icon.vue')['default']
ImageView: typeof import('./src/components/ImageView.vue')['default']
LogList: typeof import('./src/components/LogList.vue')['default']
......
......@@ -950,6 +950,7 @@ import useLodop, { LODOPObject } from '@/utils/hooks/useLodop'
import dayjs from 'dayjs'
import rightMenu from '../pod/rightMenu.vue'
import ResultInfo from './components/ResultInfo.vue'
import { isArray, isString } from '@/utils/validate'
declare global {
interface Window {
ActiveXObject: {
......@@ -1257,6 +1258,10 @@ const handleUpdateRemark = async (item: ProductList) => {
inputPattern: /^.{1,2000}$/,
inputErrorMessage: '请输入备注',
}).then(async ({ value }) => {
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
})
try {
const res = await updateRemarkApi(item.id, value)
if (res.code !== 200) return
......@@ -1264,6 +1269,8 @@ const handleUpdateRemark = async (item: ProductList) => {
search()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
})
}
......@@ -1288,6 +1295,10 @@ const loadProductionClient = async () => {
}
const submitConfirm = async () => {
const ids = selection.value.map((item) => item.id)
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
})
try {
const res = await confirmOrderApi(
ids,
......@@ -1301,6 +1312,8 @@ const submitConfirm = async () => {
loadTabData()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
const updateOrder = async () => {
......@@ -1317,6 +1330,10 @@ const updateOrder = async () => {
return
}
const ids = selection.value.map((item) => item.id)
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
})
try {
const res = await updateExceptionOrderApi(ids)
if (res.code !== 200) return
......@@ -1325,6 +1342,8 @@ const updateOrder = async () => {
loadTabData()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
const printProductionOrder = async () => {
......@@ -1332,6 +1351,10 @@ const printProductionOrder = async () => {
return ElMessage.warning('请选择数据')
}
const orderIds = selection.value.map((item) => item.id)
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
})
try {
const res = await printProductionOrderApi(orderIds)
if (res.code !== 200) return
......@@ -1339,6 +1362,8 @@ const printProductionOrder = async () => {
window.open(filePath + res.message)
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
const printPickingOrder = async () => {
......@@ -1346,6 +1371,10 @@ const printPickingOrder = async () => {
return ElMessage.warning('请选择数据')
}
const orderIds = selection.value.map((item) => item.id)
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
})
try {
const res = await printPrintOrderApi(orderIds)
if (res.code !== 200) return
......@@ -1353,6 +1382,8 @@ const printPickingOrder = async () => {
window.open(filePath + res.message)
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
const pickingComplete = async () => {
......@@ -1369,6 +1400,10 @@ const pickingComplete = async () => {
return
}
const orderIds = selection.value.map((item) => item.id)
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
})
try {
const res = await printPickingOrderApi(orderIds)
if (res.code !== 200) return
......@@ -1377,6 +1412,8 @@ const pickingComplete = async () => {
loadTabData()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
......@@ -1391,6 +1428,10 @@ const changeExceptionOrder = async () => {
inputPattern: /^.{1,2000}$/,
inputErrorMessage: '请输入异常原因',
}).then(async ({ value }) => {
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
})
try {
const res = await changeExceptionOrderApi(orderIds, value)
if (res.code !== 200) return
......@@ -1399,6 +1440,8 @@ const changeExceptionOrder = async () => {
loadTabData()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
})
}
......@@ -1413,6 +1456,10 @@ const cancelOrder = async () => {
inputPattern: /^.{1,2000}$/,
inputErrorMessage: '请输入取消原因',
}).then(async ({ value }) => {
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
})
try {
const res = await cancelOrderApi(orderIds, value)
if (res.code !== 200) return
......@@ -1421,6 +1468,8 @@ const cancelOrder = async () => {
loadTabData()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
})
}
......@@ -1489,6 +1538,10 @@ const downloadMaterial = async () => {
offset: window.innerHeight / 2,
})
}
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
})
try {
const res = await downloadMaterialApi(selectedIds)
if (res.code !== 200) return
......@@ -1496,6 +1549,8 @@ const downloadMaterial = async () => {
} catch (e) {
// showError(e)
console.error(e)
} finally {
loading.close()
}
}
const logList = ref<LogListData[]>([])
......@@ -1557,17 +1612,26 @@ const getOrderByIdApi = async (type: string) => {
type: 'warning',
})
const ids = selection.value.map((el) => el.id)
// console.log(Fn)
if (Fn) {
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
})
const res = await Fn(ids)
console.log(res)
if (res.code === 200) {
if (isArray(res.data)) {
resultInfo.value = res.data
resultRefs.value?.showDialog(type)
} else if (res.code === 205) {
window.open(filePath + res.message)
} else if (isString(res.data)) {
window.open(filePath + res.data)
}
} else {
ElMessage.error(res.message)
}
loading.close()
}
} catch {
return
......@@ -1584,7 +1648,10 @@ const stockOutCheck = async () => {
if (selection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
})
try {
const selectedIds = selection.value.map((item) => item.id)
const res = await stockOutCheckApi(selectedIds)
......@@ -1627,6 +1694,8 @@ const stockOutCheck = async () => {
})
} catch (error) {
console.error('补货校验失败:', error)
} finally {
loading.close()
}
}
const toBePicking = async () => {
......@@ -1642,6 +1711,10 @@ const toBePicking = async () => {
} catch (e) {
return
}
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
})
try {
const res = await toBePickingApi(selection.value.map((item) => item.id))
if (res.code !== 200) return
......@@ -1650,6 +1723,8 @@ const toBePicking = async () => {
loadTabData()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
const sheetPrinter = ref('')
......@@ -1818,6 +1893,10 @@ const downloadPDF = (url: string) => {
return strData
}
const openDetail = async (id: number) => {
const loading = ElLoading.service({
fullscreen: true,
text: '加载中...',
})
try {
const res = await getOrderDetailById(id)
if (res.code == 200) {
......@@ -1830,6 +1909,8 @@ const openDetail = async (id: number) => {
}
} catch (e) {
//showError(e)
} finally {
loading.close()
}
}
const onFastRefresh = () => {
......@@ -1862,6 +1943,10 @@ const refreshMaterial = async () => {
if (selection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
const loading = ElLoading.service({
fullscreen: true,
text: '刷新中...',
})
try {
const res = await refreshMaterialApi(
selection.value.map((item) => item.id).join(','),
......@@ -1871,6 +1956,8 @@ const refreshMaterial = async () => {
search()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
onMounted(() => {
......
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