Browse Source

1、订单月计划,入库仓库代码使用参照弹窗获取

master_hella_20240701
bjang03 8 months ago
parent
commit
ce7333bd6b
  1. 2
      src/api/mes/ordermonthplan/index.ts
  2. 52
      src/views/mes/ordermonthplan/index.vue
  3. 61
      src/views/mes/ordermonthplan/mesOrderMonthSub.data.ts

2
src/api/mes/ordermonthplan/index.ts

@ -63,7 +63,9 @@ export interface MesOrderMonthSubVO {
status: string
remark: string
productCode: string
productName: string
bomCode: string
bomVersion: string
inStoreCode: string
planBegin: Date
planEnd: Date

52
src/views/mes/ordermonthplan/index.vue

@ -57,13 +57,14 @@
:detailAllSchemas="detailAllSchemas"
:detailAllSchemasRules="MesOrderMonthSubRules"
:apiPage="MesOrderMonthApi.getMesOrderMonthSubPage"
:apiCreate="MesOrderMonthApi.createMesOrderMonthSub"
:apiUpdate="MesOrderMonthApi.updateMesOrderMonthSub"
:apiCreate="createMesOrderMonthSub"
:apiUpdate="updateMesOrderMonthSub"
:apiDelete="MesOrderMonthApi.deleteMesOrderMonthSub"
:tabs="TabsList"
:detailButtonIsShowDelete="true"
:detailButtonIsShowEdit="true"
:detailButtonIsShowAdd="true"
@searchTableSuccessDetail="searchTableSuccess"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/plan/mes-order-month-main/import"
@ -81,6 +82,8 @@ import {
MesOrderMonthSub,
MesOrderMonthSubRules
} from "@/views/mes/ordermonthplan/mesOrderMonthSub.data";
import * as OrderDayApi from "@/api/mes/orderDay";
import {MesOrderMonthSubVO} from "@/api/mes/ordermonthplan";
defineOptions({ name: 'MesOrderMonthMain' })
@ -91,14 +94,6 @@ const routeName = ref()
routeName.value = route.name
const tableColumns = ref(MesOrderMonthMain.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
@ -111,6 +106,7 @@ const { tableObject, tableMethods } = useTable({
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi: 'mes:ordermonthplan:create'}), //
@ -255,4 +251,40 @@ onMounted(async () => {
importTemplateData.templateUrl = await MesOrderMonthApi.importTemplate()
})
const detailAllSchemas = ref(MesOrderMonthSub.allSchemas)
//
let productName
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
if(formField=='productCode'){
//formRef.setValues({standardBom:'bomddd'})
// getProcessroutes(val[0][searchField])
productName = val[0].name
getBoms(val[0][searchField])
}
// if(formField=='workroomCode'){
// getProductlines(val[0][searchField])
// }
})
}
const bomOptions=ref([])
const getBoms = async (code: String) => {
bomOptions.value = await OrderDayApi.getBoms(code)
MesOrderMonthSub.allSchemas.formSchema.forEach(item => {
if (item.field == 'bomCode') {
item.componentProps.options = bomOptions.value
}
})
}
const createMesOrderMonthSub = async (data: MesOrderMonthSubVO) => {
data.productName = productName
return await MesOrderMonthApi.createMesOrderMonthSub(data)
}
const updateMesOrderMonthSub = async (data: MesOrderMonthSubVO) => {
data.productName = productName
return await MesOrderMonthApi.updateMesOrderMonthSub(data)
}
</script>

61
src/views/mes/ordermonthplan/mesOrderMonthSub.data.ts

@ -1,6 +1,9 @@
import type {CrudSchema} from '@/hooks/web/useCrudSchemas'
import {dateFormatter} from '@/utils/formatTime'
import {Itembasic} from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data";
import * as ItembasicApi from "@/api/wms/itembasic";
import {Warehouse} from "@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data";
import * as WorehouseApi from "@/api/wms/warehouse";
// 表单校验
export const MesOrderMonthSubRules = reactive({
productCode: [required],
@ -19,7 +22,33 @@ export const MesOrderMonthSub = useCrudSchemas(reactive<CrudSchema[]>([
field: 'productCode',
sort: 'custom',
isTable: false,
isSearch: true
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '产品编码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '产品信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
isHideFilterButton:true,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'type',
action: 'in', // 查询拼接条件
isSearch: true, // 使用自定义拼接条件
value: 'CCP,BCP',//,SEMI]
isMainValue: false
},
]
}
}
},
{
label: '产品名称',
@ -33,13 +62,37 @@ export const MesOrderMonthSub = useCrudSchemas(reactive<CrudSchema[]>([
field: 'bomCode',
sort: 'custom',
isTable: false,
isSearch: true
isSearch: true,
form: {
component:'Select',
componentProps: {
options: [{lablel:'bom',value:'bom'}]
}
}
},
{
label: '入库仓库编码',
field: 'inStoreCode',
sort: 'custom',
isSearch: true
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '仓库编码', // 查询弹窗标题
searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类
searchPage: WorehouseApi.getWarehousePage, // 查询弹窗所需分页方法
isHideFilterButton:true,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
}
},
{
label: '计划数量',

Loading…
Cancel
Save