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