优化宇视图片地址
This commit is contained in:
@@ -13,8 +13,8 @@ export function getLeaveWeighPage() {
|
||||
}
|
||||
|
||||
/** @desc 抓拍图片 */
|
||||
export function getCaptureImage(imgName: string) {
|
||||
return http.get<any>(`${BASE_URL}/capture-image?imgName=${imgName}`)
|
||||
export function getCaptureImage(data: any) {
|
||||
return http.get<any>(`${BASE_URL}/capture-image`, data)
|
||||
}
|
||||
|
||||
/** @desc 检查称重状态 */
|
||||
|
||||
@@ -96,7 +96,10 @@ const save = async () => {
|
||||
if (isInvalid) return
|
||||
try {
|
||||
//手动抓图
|
||||
const response = await getCaptureImage('fullOrder');
|
||||
const data = {
|
||||
type: 2,
|
||||
}
|
||||
const response = await getCaptureImage(data);
|
||||
if (response) {
|
||||
form.imgUrl = response.data;
|
||||
} else {
|
||||
|
||||
@@ -91,24 +91,7 @@ const {
|
||||
} = useTable((page) => listMaterialType({ ...queryForm, ...page }), { immediate: true })
|
||||
const columns = ref<TableInstanceColumns[]>([
|
||||
{ title: '品类名称', dataIndex: 'typeName', slotName: 'typeName' },
|
||||
{
|
||||
title: h('span', null, [
|
||||
'品类上下浮动范围(%)',
|
||||
h('a-tooltip', {
|
||||
title: '领取物料重量不得超出此百分比范围'
|
||||
}, [
|
||||
h('span', {
|
||||
style: {
|
||||
marginLeft: '4px',
|
||||
cursor: 'help',
|
||||
color: '#1890ff'
|
||||
}
|
||||
}, '?')
|
||||
])
|
||||
]),
|
||||
dataIndex: 'upFloatRatio',
|
||||
slotName: 'floatRatio'
|
||||
},
|
||||
{ title: '品类上下浮动范围(%)', dataIndex: 'upFloatRatio', slotName: 'floatRatio' },
|
||||
{ title: '创建时间', dataIndex: 'createTime', slotName: 'createTime' },
|
||||
{ title: '更新时间', dataIndex: 'updateTime', slotName: 'updateTime', show: false },
|
||||
{ title: '创建人', dataIndex: 'createUserString', slotName: 'createUser' },
|
||||
|
||||
@@ -331,9 +331,9 @@ const leaveWeighPage = async () => {
|
||||
}
|
||||
|
||||
// 手动抓图
|
||||
const captureImage = async (imgName) => {
|
||||
const captureImage = async (data: any) => {
|
||||
try {
|
||||
const response = await getCaptureImage(imgName);
|
||||
const response = await getCaptureImage(data);
|
||||
if (response.code === '0') {
|
||||
return response.data
|
||||
}
|
||||
@@ -1019,7 +1019,12 @@ const handleConfirm = async () => {
|
||||
weighingCount.value = weighingList.value.length + 1
|
||||
|
||||
// 调用手动抓图接口
|
||||
const imageUrl = await captureImage(newItem.key + '_' + newItem.materialId);
|
||||
const data2 = {
|
||||
batch: formData.batch,
|
||||
encoding: formData.encoding,
|
||||
type: 1,
|
||||
}
|
||||
const imageUrl = await captureImage(data2)
|
||||
const addedItem = weighingList.value.find((item) => item.key === newItem.key)
|
||||
if (addedItem) {
|
||||
addedItem.imgUrl = imageUrl || '抓图失败'
|
||||
|
||||
Reference in New Issue
Block a user