Browse Source

报废拆解明细模块

master_hella_20240701
gaojs 8 months ago
parent
commit
8757d10800
  1. 56
      src/api/mes/dismantlingDetail/index.ts
  2. 4
      src/utils/dict.ts
  3. 181
      src/views/mes/dismantlingMain/dismantlingMain.data.ts
  4. 30
      src/views/mes/dismantlingMain/index.vue

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

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface DismantlingDetailVO {
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
siteId: number
mainBiilno: string
materialCode: string
materialStauts: string
materialProcessstauts: string
}
// 查询报废拆解明细列表
export const getDismantlingDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/dismantling-detail/senior', data })
} else {
return await request.get({ url: `/mes/dismantling-detail/page`, params })
}
}
// 查询报废拆解明细详情
export const getDismantlingDetail = async (id: number) => {
return await request.get({ url: `/mes/dismantling-detail/get?id=` + id })
}
// 新增报废拆解明细
export const createDismantlingDetail = async (data: DismantlingDetailVO) => {
return await request.post({ url: `/mes/dismantling-detail/create`, data })
}
// 修改报废拆解明细
export const updateDismantlingDetail = async (data: DismantlingDetailVO) => {
return await request.put({ url: `/mes/dismantling-detail/update`, data })
}
// 删除报废拆解明细
export const deleteDismantlingDetail = async (id: number) => {
return await request.delete({ url: `/mes/dismantling-detail/delete?id=` + id })
}
// 导出报废拆解明细 Excel
export const exportDismantlingDetail = async (params) => {
return await request.download({ url: `/mes/dismantling-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/dismantling-detail/get-import-template' })
}

4
src/utils/dict.ts

@ -312,6 +312,10 @@ export enum DICT_TYPE {
REWORK_STATUS='rework_status',//返工返修状态:待返修,返修中,返修完成
REWORK_REPLACE_FLAG = 'rework_replace_flag',//是否有替换件
DISMANTLING_BILL_TYPE = 'dismantling_bill_type',//工单类型
DISMANTLING_MATERIAL_STATUS = 'dismantling_material_status',//报废拆解物料状态
DISMANTLING_MATERIAL_HANDLE_STATUS = 'dismantling_material_handle_status',//报废拆解处理状态
SUPPLIERINVOICE_REQUEST_STATUS = 'supplierinvoice_request_status', //发票申请状态
SUPPLIERINVOICE_STATUS = 'supplierinvoice_status', //待开票审核状态
}

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

@ -3,7 +3,7 @@ import { dateFormatter } from '@/utils/formatTime'
import {Itembasic} from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data";
import * as ItembasicApi from "@/api/wms/itembasic";
// 表单校验
// 表单校验
export const DismantlingMainRules = reactive({
productionCode: [required],
workbillType: [required],
@ -175,3 +175,182 @@ export const DismantlingMain = useCrudSchemas(reactive<CrudSchema[]>([
}
}
]))
export const DismantlingDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '删除时间',
field: 'deleteTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '主键',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
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,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
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')]
}
},
},
{
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: 'mainBiilno',
sort: 'custom',
isSearch: true,
isForm: false,
isTable: false,
table: {
width: 150,
fixed: 'right'
}
},
{
label: '物料编码',
field: 'materialCode',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchTitle: '物料编码', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchField: 'code', // 查询弹窗赋值字段
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'type',
action: 'in', // 查询拼接条件
isSearch: true, // 使用自定义拼接条件
value: 'BCP,CCP',//,SEMI]
isMainValue: false
}]
}
}
},
{
label: '物料状态',
field: 'materialStauts',
sort: 'custom',
dictType: DICT_TYPE.DISMANTLING_MATERIAL_STATUS,
dictClass: 'string',
isSearch: true,
},
{
label: '处理状态',
field: 'materialProcessstauts',
dictType: DICT_TYPE.DISMANTLING_MATERIAL_HANDLE_STATUS,
dictClass: 'string',
sort: 'custom',
isSearch: true,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 子表单校验
export const DismantlingDetailRules = reactive({
materialCode: [required],
materialStauts: [required],
materialProcessstauts: [required],
})

30
src/views/mes/dismantlingMain/index.vue

@ -28,7 +28,7 @@
v-model:sort="tableObject.sort"
>
<template #dismantlingBillno="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.dismantlingBillno)">
<el-button type="primary" link @click="openDetail(row, '单据编号', row.dismantlingBillno)">
<span>{{ row.dismantlingBillno }}</span>
</el-button>
</template>
@ -51,7 +51,21 @@
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DismantlingMain.allSchemas" />
<Detail ref="detailRef"
:isBasic="false"
:allSchemas="DismantlingMain.allSchemas"
:detailAllSchemas="DismantlingDetail.allSchemas"
:detailAllSchemasRules="DismantlingDetailRules"
:apiPage="DismantlingDetailApi.getDismantlingDetailPage"
:apiCreate="DismantlingDetailApi.createDismantlingDetail"
:apiUpdate="DismantlingDetailApi.updateDismantlingDetail"
:apiDelete="DismantlingDetailApi.deleteDismantlingDetail"
:detailButtonIsShowAdd="true"
:detailButtonIsShowEdit="true"
:detailButtonIsShowDelete="true"
@searchTableSuccessDetail="searchTableSuccessDetail"
:key="count"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/dismantling-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
@ -59,8 +73,9 @@
<script setup lang="ts">
import download from '@/utils/download'
import { DismantlingMain,DismantlingMainRules } from './dismantlingMain.data'
import { DismantlingMain,DismantlingMainRules,DismantlingDetail,DismantlingDetailRules } from './dismantlingMain.data'
import * as DismantlingMainApi from '@/api/mes/dismantlingMain'
import * as DismantlingDetailApi from '@/api/mes/dismantlingDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
@ -85,6 +100,15 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val

Loading…
Cancel
Save