diff --git a/src/views/orderPurchaseManagement/orderPurchase/index.vue b/src/views/orderPurchaseManagement/orderPurchase/index.vue index f21e22a..52ecd74 100644 --- a/src/views/orderPurchaseManagement/orderPurchase/index.vue +++ b/src/views/orderPurchaseManagement/orderPurchase/index.vue @@ -59,8 +59,9 @@ - + + - - + + @@ -391,6 +397,7 @@ import { WorkOrderLog, printByBarTender } from '@/api/productManagement/proworkorder.js' +import { getMaterialOption } from '@/api/materialManagement/productionMaterial/mminventory.js' import { getOneDict } from '@/utils/dict.js' import { downFile } from '@/utils/request.js' @@ -410,6 +417,7 @@ const queryParams = reactive({ groupCode: '', workorderDate: [proxy.dayjs(), proxy.dayjs()], status: -1, + materialCode: '', sort: 'sort', sortType: 'asc' }) @@ -464,6 +472,28 @@ function getAllGroupSelectOptions() { getAllGroupSelectOptions() // ================================== +// =========== 获取所有物料 ========== +const allMaterialOptions = ref([]) +function getMaterialCodeList() { + try { + getMaterialOption('materialCode').then((res) => { + const { code, data } = res + if (code == 200) { + allMaterialOptions.value = data.map((item) => { + return { + id: item.id, + label: `${item.type || ''} ${item.materialCode} ${item.materialName} [${item.supplierName || ''}]`, + value: item.materialCode + } + }) + } + }) + } catch (error) { + proxy.$modal.msgError(error.message) + } +} +// ================================== + // 校验搜索 function handleCheck() { loading.value = true @@ -533,7 +563,7 @@ function sortChange(column) { } function tableCellClassName({ row, column, rowIndex, columnIndex }) { - if (row.isMatch_material_name === null && column.label === '产品名称') { + if (row.isMatch_material_name === null && column.label === '主体品名') { return 'danger-cell-1' } if (row.isMatch_material_code === null && column.label === '物料编号') { @@ -561,7 +591,7 @@ const state = reactive({ multiple: true, form: {}, rules: { - productionName: [{ required: true, message: '产品名称不能为空', trigger: 'blur' }], + productionName: [{ required: true, message: '主体品名不能为空', trigger: 'blur' }], productionCode: [{ required: true, message: '物料编号不能为空', trigger: 'blur' }], deliveryNum: [{ required: true, message: '交互数量不能为空', trigger: 'blur' }], groupCode: [{ required: true, message: '组别不能为空', trigger: 'blur' }], @@ -1021,6 +1051,7 @@ function handleShipmentSubmit(data) { } // initDict() +getMaterialCodeList() handleQuery()