Browse Source

MES——> 叫料补料 主子明细提交

master_hella_20240701
gaojs 6 months ago
parent
commit
a34797cdcf
  1. 56
      src/api/mes/itemRequestDetail/index.ts
  2. 9
      src/views/mes/components/Detail.vue
  3. 29
      src/views/mes/itemRequestMain/index.vue
  4. 181
      src/views/mes/itemRequestMain/itemRequestMain.data.ts
  5. 2
      src/views/mes/qualityform/index.vue

56
src/api/mes/itemRequestDetail/index.ts

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface ItemRequestDetailVO {
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
requestBillNo: string
itemBasicCode: string
itemCounts: number
itemUom: string
siteId: number
}
// 查询叫料申请明细列表
export const getItemRequestDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/item-request-detail/senior', data })
} else {
return await request.get({ url: `/mes/item-request-detail/page`, params })
}
}
// 查询叫料申请明细详情
export const getItemRequestDetail = async (id: number) => {
return await request.get({ url: `/mes/item-request-detail/get?id=` + id })
}
// 新增叫料申请明细
export const createItemRequestDetail = async (data: ItemRequestDetailVO) => {
return await request.post({ url: `/mes/item-request-detail/create`, data })
}
// 修改叫料申请明细
export const updateItemRequestDetail = async (data: ItemRequestDetailVO) => {
return await request.put({ url: `/mes/item-request-detail/update`, data })
}
// 删除叫料申请明细
export const deleteItemRequestDetail = async (id: number) => {
return await request.delete({ url: `/mes/item-request-detail/delete?id=` + id })
}
// 导出叫料申请明细 Excel
export const exportItemRequestDetail = async (params) => {
return await request.download({ url: `/mes/item-request-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/item-request-detail/get-import-template' })
}

9
src/views/mes/components/Detail.vue

@ -533,7 +533,8 @@ const change = (item, index) => {
const masterParmas = ref({
masterId: '', //id
number: '', //
status: '' //
status: '', //
requestBillNo:'' //
})
//
@ -578,13 +579,15 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
}
count.value++
//
if (!props.isBasic) {
if (!props.isBasic && !props.isBasicMes) {
// id
masterParmas.value.masterId = row.masterId||row.id
masterParmas.value.number = row.number
masterParmas.value.status = row.status
masterParmas.value.requestBillNo = row.requestBillNo
tableObjectRef.value.params = {
masterId: row.masterId||row.id
masterId: row.masterId||row.id,
requestBillNo:row.requestBillNo
}
await getList()
}

29
src/views/mes/itemRequestMain/index.vue

@ -27,9 +27,9 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
<template #requestBillNo="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.requestBillNo)">
<span>{{ row.requestBillNo }}</span>
</el-button>
</template>
<template #action="{ row }">
@ -51,7 +51,23 @@
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ItemRequestMain.allSchemas" />
<Detail ref="detailRef"
:isBasic="false"
:isBasicMes="false"
:allSchemas="ItemRequestMain.allSchemas"
:detailAllSchemas="ItemRequestDetail.allSchemas"
:detailAllSchemasRules="ItemRequestMainRules"
:apiPage="ItemRequestDetailApi.getItemRequestDetailPage"
:apiCreate="ItemRequestDetailApi.createItemRequestDetail"
:apiUpdate="ItemRequestDetailApi.updateItemRequestDetail"
:apiDelete="ItemRequestDetailApi.deleteItemRequestDetail"
:detailButtonIsShowAdd="true"
:detailButtonIsShowEdit="true"
:detailButtonIsShowDelete="true"
@handleMainFefresh="handleMainFefresh"
@searchTableSuccessDetail="searchTableSuccessDetail"
:key="count"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/item-request-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
@ -59,12 +75,13 @@
<script setup lang="ts">
import download from '@/utils/download'
import { ItemRequestMain,ItemRequestMainRules } from './itemRequestMain.data'
import { ItemRequestMain,ItemRequestMainRules,ItemRequestDetail,ItemRequestDetailRules } from './itemRequestMain.data'
import * as ItemRequestMainApi from '@/api/mes/itemRequestMain'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as ItemRequestDetailApi from '@/api/mes/itemRequestDetail'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import Detail from '../components/Detail.vue'
defineOptions({ name: 'MesItemRequestMain' })

181
src/views/mes/itemRequestMain/itemRequestMain.data.ts

@ -32,6 +32,12 @@ export const ItemRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
}
},
},
{
label: '申请单号',
field: 'requestBillNo',
sort: 'custom',
isSearch: true,
},
{
label: '主键',
field: 'id',
@ -45,7 +51,10 @@ export const ItemRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'Radio'
},
@ -64,11 +73,73 @@ export const ItemRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
},
},
{
label: '备注',
field: 'remark',
label: '删除用户名',
field: 'deleter',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '位置ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '计划编码',
field: 'planDayCode',
sort: 'custom',
isSearch: true,
},
{
label: '工单编码',
field: 'workBillNo',
sort: 'custom',
isSearch: true,
},
{
label: '批次编码',
field: 'batchCode',
sort: 'custom',
isSearch: true,
},
{
label: '工位编码',
field: 'workstationCode',
sort: 'custom',
isSearch: true,
},
{
label: '产品编码',
field: 'productCode',
sort: 'custom',
isSearch: true,
},
{
label: '工序编码',
field: 'processCode',
sort: 'custom',
isSearch: true,
},
{
label: '类型(1:叫料、2:补料)',
field: 'requestType',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '创建时间',
field: 'createTime',
@ -86,8 +157,32 @@ export const ItemRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
isForm: false,
},
{
label: '删除用户名',
field: 'deleter',
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
export const ItemRequestDetailRules = reactive({
concurrencyStamp: [required],
})
export const ItemRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '主键',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
@ -95,8 +190,20 @@ export const ItemRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
isDetail:false,
},
{
label: '位置ID',
field: 'siteId',
label: '状态',
field: 'status',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'Radio'
},
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
@ -107,56 +214,74 @@ export const ItemRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
value: 0
},
},
{
label: '计划编码',
field: 'planDayCode',
label: '删除用户名',
field: 'deleter',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '工单编码',
field: 'workBillNo',
label: '申请单号',
field: 'requestBillNo',
sort: 'custom',
isSearch: true,
},
{
label: '批次编码',
field: 'batchCode',
label: '物料编码',
field: 'itemBasicCode',
sort: 'custom',
isSearch: true,
},
{
label: '申请单号',
field: 'requestBillNo',
label: '物料数量',
field: 'itemCounts',
sort: 'custom',
isSearch: true,
},
{
label: '工位编码',
field: 'workstationCode',
label: '物料单位',
field: 'itemUom',
sort: 'custom',
isSearch: true,
},
{
label: '产品编码',
field: 'productCode',
label: '位置ID',
field: 'siteId',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '工序编码',
field: 'processCode',
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '类型(1:叫料、2:补料)',
field: 'requestType',
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '操作',

2
src/views/mes/qualityform/index.vue

@ -53,7 +53,7 @@
<!-- 详情 -->
<Detail ref="detailRef"
:isBasic="false"
:isBasicMes="true"
:isBasicMes="false"
:allSchemas="Qualityform.allSchemas"
:detailAllSchemas="QualityformDetail.allSchemas"
:detailAllSchemasRules="QualityformDetailRules"

Loading…
Cancel
Save