物料流程整合
This commit is contained in:
@@ -9,6 +9,7 @@ export interface WeighManageResp {
|
|||||||
materialSpec: string
|
materialSpec: string
|
||||||
unitWeight: number
|
unitWeight: number
|
||||||
photoUrl: string
|
photoUrl: string
|
||||||
|
materialProcess: string
|
||||||
matchResult: string
|
matchResult: string
|
||||||
downFloatRatio: string
|
downFloatRatio: string
|
||||||
upFloatRatio: string
|
upFloatRatio: string
|
||||||
@@ -29,6 +30,6 @@ export function validateWeighing(data: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @desc 校验物料是否一致 */
|
/** @desc 校验物料是否一致 */
|
||||||
export function vmSend(code: string) {
|
export function vmSend(materialProcess: string) {
|
||||||
return http.post<string>(`/vm/send`, { msg: code })
|
return http.post<string>(`/vm/send`, { materialProcess })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ const title = computed(() => (isUpdate.value ? '修改物料管理' : '新增物
|
|||||||
const formRef = ref<InstanceType<typeof GiForm>>()
|
const formRef = ref<InstanceType<typeof GiForm>>()
|
||||||
|
|
||||||
const { materialTypeList, getMaterialTypeSelect } = materialType()
|
const { materialTypeList, getMaterialTypeSelect } = materialType()
|
||||||
const { materialProcessList, getMaterialProcessSelect } = materialProcess()
|
|
||||||
const { light_level } = useDict('light_level')
|
const { light_level } = useDict('light_level')
|
||||||
|
|
||||||
|
|
||||||
@@ -91,15 +90,10 @@ const columns: ColumnItem[] = reactive([
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '物料流程编码',
|
label: '物料流程编码',
|
||||||
field: 'materialProcessId',
|
field: 'materialProcess',
|
||||||
type: 'select',
|
type: 'input',
|
||||||
span: 24,
|
span: 24,
|
||||||
required: true,
|
required: true,
|
||||||
props: {
|
|
||||||
options: materialProcessList,
|
|
||||||
allowClear: true,
|
|
||||||
allowSearch: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '物料规格',
|
label: '物料规格',
|
||||||
@@ -149,9 +143,6 @@ const onAdd = async () => {
|
|||||||
if (!materialTypeList.value.length) {
|
if (!materialTypeList.value.length) {
|
||||||
await getMaterialTypeSelect()
|
await getMaterialTypeSelect()
|
||||||
}
|
}
|
||||||
if (!materialProcessList.value.length) {
|
|
||||||
await getMaterialProcessSelect();
|
|
||||||
}
|
|
||||||
visible.value = true
|
visible.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,9 +154,6 @@ const onUpdate = async (id: string) => {
|
|||||||
if (!materialTypeList.value.length) {
|
if (!materialTypeList.value.length) {
|
||||||
await getMaterialTypeSelect()
|
await getMaterialTypeSelect()
|
||||||
}
|
}
|
||||||
if (!materialProcessList.value.length) {
|
|
||||||
await getMaterialProcessSelect();
|
|
||||||
}
|
|
||||||
Object.assign(form, data)
|
Object.assign(form, data)
|
||||||
form.lightLevel = data.lightLevel ? JSON.stringify(data.lightLevel) : ''
|
form.lightLevel = data.lightLevel ? JSON.stringify(data.lightLevel) : ''
|
||||||
visible.value = true
|
visible.value = true
|
||||||
|
|||||||
@@ -81,7 +81,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// ... 保持原有的 import 不变
|
|
||||||
import MaterialInfoAddModal from './MaterialInfoAddModal.vue'
|
import MaterialInfoAddModal from './MaterialInfoAddModal.vue'
|
||||||
import MaterialInfoImportDrawer from './MaterialInfoImportDrawer.vue'
|
import MaterialInfoImportDrawer from './MaterialInfoImportDrawer.vue'
|
||||||
import PhotosImport from '@/views/material/PhotosImport.vue';
|
import PhotosImport from '@/views/material/PhotosImport.vue';
|
||||||
@@ -124,6 +123,7 @@ const columns = ref<TableInstanceColumns[]>([
|
|||||||
{ title: '物料单位重量(g)', dataIndex: 'unitWeight', slotName: 'unitWeight' },
|
{ title: '物料单位重量(g)', dataIndex: 'unitWeight', slotName: 'unitWeight' },
|
||||||
{ title: '物料品类', dataIndex: 'typeName' },
|
{ title: '物料品类', dataIndex: 'typeName' },
|
||||||
{ title: '物料规格', dataIndex: 'materialSpec', slotName: 'materialSpec' },
|
{ title: '物料规格', dataIndex: 'materialSpec', slotName: 'materialSpec' },
|
||||||
|
{ title: '物料流程', dataIndex: 'materialProcess', slotName: 'materialProcess' },
|
||||||
{ title: '灯光等级', dataIndex: 'lightLevel', slotName: 'lightLevel' },
|
{ title: '灯光等级', dataIndex: 'lightLevel', slotName: 'lightLevel' },
|
||||||
{ title: '物料照片', dataIndex: 'photoUrl', slotName: 'photoUrl', width: 120, align: 'center' },
|
{ title: '物料照片', dataIndex: 'photoUrl', slotName: 'photoUrl', width: 120, align: 'center' },
|
||||||
{ title: '创建人', dataIndex: 'createUserString', slotName: 'createUser' },
|
{ title: '创建人', dataIndex: 'createUserString', slotName: 'createUser' },
|
||||||
|
|||||||
@@ -285,6 +285,7 @@ const formData = reactive({
|
|||||||
encoding: '', // 物料编码
|
encoding: '', // 物料编码
|
||||||
materialName: '', // 物料名称
|
materialName: '', // 物料名称
|
||||||
materialSpec: '', // 物料规格
|
materialSpec: '', // 物料规格
|
||||||
|
materialProcess: '', // 物料流程
|
||||||
unitWeight: 0, // 重量
|
unitWeight: 0, // 重量
|
||||||
photoUrl: '', // 样图URL
|
photoUrl: '', // 样图URL
|
||||||
weightRange: '', // 物料重量范围
|
weightRange: '', // 物料重量范围
|
||||||
@@ -579,6 +580,7 @@ const fetchMaterialData = async (code: string) => {
|
|||||||
formData.encoding = res.data?.encoding || ''
|
formData.encoding = res.data?.encoding || ''
|
||||||
formData.materialName = res.data?.materialName || ''
|
formData.materialName = res.data?.materialName || ''
|
||||||
formData.materialSpec = res.data?.materialSpec || ''
|
formData.materialSpec = res.data?.materialSpec || ''
|
||||||
|
formData.materialProcess = res.data?.materialProcess || ''
|
||||||
formData.unitWeight = res.data?.unitWeight || 0
|
formData.unitWeight = res.data?.unitWeight || 0
|
||||||
formData.photoUrl = res.data?.photoUrl || ''
|
formData.photoUrl = res.data?.photoUrl || ''
|
||||||
formData.weightRange = (res.data?.downFloatRatio || '-') + '% ~ ' + (res.data?.upFloatRatio || '-') + '%'
|
formData.weightRange = (res.data?.downFloatRatio || '-') + '% ~ ' + (res.data?.upFloatRatio || '-') + '%'
|
||||||
@@ -634,16 +636,19 @@ const handleNext = async () => {
|
|||||||
} else if (activeStep.value === 1 && compareMatchResult.value !== 'success') {
|
} else if (activeStep.value === 1 && compareMatchResult.value !== 'success') {
|
||||||
// 当在扫码核验页面点击开始比对时,调用后端接口获取比对结果
|
// 当在扫码核验页面点击开始比对时,调用后端接口获取比对结果
|
||||||
try {
|
try {
|
||||||
// 这里应该调用后端的比对接口,暂时使用fetchMaterialData模拟
|
|
||||||
// 实际项目中应该替换为专门的比对接口
|
|
||||||
const materialCode = formData.inputMaterialCode?.trim()
|
const materialCode = formData.inputMaterialCode?.trim()
|
||||||
if (!materialCode) {
|
if (!materialCode) {
|
||||||
Message.error('请先扫描物料编码')
|
Message.error('请先扫描物料编码')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.materialProcess || formData.materialProcess === '') {
|
||||||
|
Message.error('未找到物料流程,无法对比')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 调用后端接口获取比对结果 // todo
|
// 调用后端接口获取比对结果 // todo
|
||||||
const res = await vmSend(materialCode);
|
const res = await vmSend(formData.materialProcess);
|
||||||
if (res.data && res.data == materialCode) {
|
if (res.data && res.data == materialCode) {
|
||||||
compareMatchResult.value === 'success';
|
compareMatchResult.value === 'success';
|
||||||
Message.success('比对成功')
|
Message.success('比对成功')
|
||||||
|
|||||||
Reference in New Issue
Block a user