Browse Source

制品返修开发完成代码提交

master
zhaoxuebing 11 months ago
parent
commit
0b5354d3ae
  1. 7
      src/api/wms/bomDismantle/index.ts
  2. 32
      src/api/wms/productrepairRequestMain/index.ts
  3. 111
      src/views/wms/productionManage/productrepair/productrepairRecordMain/index.vue
  4. 245
      src/views/wms/productionManage/productrepair/productrepairRecordMain/productrepairRecordMain.data.ts
  5. 102
      src/views/wms/productionManage/productrepair/productrepairRequestMain/index.vue
  6. 215
      src/views/wms/productionManage/productrepair/productrepairRequestMain/productrepairRequestMain.data.ts

7
src/api/wms/bomDismantle/index.ts

@ -3,4 +3,9 @@ import request from '@/config/axios'
// 查询制品返修申请子列表
export const getBomDismantlePage = async (params) => {
return await request.get({ url: `/wms/productrepair-request-main/bomPage`, params })
}
}
// 查询制品返修记录子列表
export const getBomDismantleRecordPage = async (params) => {
return await request.get({ url: `/wms/productrepair-record-main/bomPage`, params })
}

32
src/api/wms/productrepairRequestMain/index.ts

@ -63,4 +63,34 @@ export const exportProductrepairRequestMain = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/productrepair-request-main/get-import-template' })
}
}
// 关闭-制品返修申请
export const closeProductrepairRequestMain = async (id) => {
return await request.put({ url: `/wms/productrepair-request-main/close?id=` + id })
}
// 重新添加-制品返修申请
export const reAddProductrepairRequestMain = async (id) => {
return await request.put({ url: `/wms/productrepair-request-main/reAdd?id=` + id })
}
// 提交审批-制品返修申请
export const submitProductrepairRequestMain = async (id) => {
return await request.put({ url: `/wms/productrepair-request-main/submit?id=` + id })
}
// 审批驳回-制品返修申请
export const refusedProductrepairRequestMain = async (id) => {
return await request.put({ url: `/wms/productrepair-request-main/refused?id=` + id })
}
// 审批通过-制品返修申请
export const agreeProductrepairRequestMain = async (id) => {
return await request.put({ url: `/wms/productrepair-request-main/agree?id=` + id })
}
// 处理-制品返修申请
export const handleProductrepairRequestMain = async (id) => {
return await request.put({ url: `/wms/productrepair-request-main/handle?id=` + id })
}

111
src/views/wms/productionManage/productrepair/productrepairRecordMain/index.vue

@ -47,6 +47,7 @@
:tableAllSchemas="ProductrepairRecordDetail.allSchemas"
:tableFormRules="ProductrepairRecordDetailRules"
:isBusiness="true"
@buttonOperationClick="buttonOperationClick"
/>
<!-- 详情 -->
@ -57,15 +58,42 @@
:detailAllSchemas="ProductrepairRecordDetail.allSchemas"
:detailAllSchemasRules="ProductrepairRecordDetailRules"
:apiPage="ProductrepairRecordDetailApi.getProductrepairRecordDetailPage"
:buttondataTable="buttondataTable"
@tableFormButton="tableFormButton"
/>
<!-- bom列表 -->
<Dialog
:title="DialogTitle"
v-model="bomModelVisible"
width="80%"
:scroll="true"
max-height="450px"
>
<TableForm
ref="tableFormRef"
class="w-[100%]"
:tableFields="BomDismantle.allSchemas.tableColumns"
:tableData="detatableDataBom.tableList"
:isShowButton="false"
:isShowReduceButton="false"
/>
<template #footer>
<ButtonBase :Butttondata="ButttondataBom" @button-base-click="buttonBaseClickBom" />
</template>
</Dialog>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ProductrepairRecordMain,ProductrepairRecordMainRules,ProductrepairRecordDetail,ProductrepairRecordDetailRules } from './productrepairRecordMain.data'
import { ProductrepairRecordMain,ProductrepairRecordMainRules,ProductrepairRecordDetail,ProductrepairRecordDetailRules, BomDismantle } from './productrepairRecordMain.data'
import * as ProductrepairRecordMainApi from '@/api/wms/productrepairRecordMain'
import * as ProductrepairRecordDetailApi from '@/api/wms/productrepairRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as BomDismantleApi from "@/api/wms/bomDismantle";
import {getBomDismantleRecordPage} from "@/api/wms/bomDismantle";
//
defineOptions({ name: 'ProductrepairRecordMain' })
@ -78,6 +106,87 @@ const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ProductrepairRecordMain.allSchemas.tableColumns)
// table
const buttondataTable = ref([{
label: 'Bom',
name: 'bom',
hide: false,
type: 'primary',
icon: '',
color: '',
hasPermi: '',
link: true, //
}])
// Bom
const DialogTitle = ref('Bom信息')
const bomModelVisible = ref(false)
const tableListBom = ref()
const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({
getListApi: BomDismantleApi.getBomDismantleRecordPage
})
const { getList:getDetailListBom } = detatableMethodsBom
// tableform
const buttonOperationClick = async (row, label, index)=> {
if (row.itemCode == '') {
message.warning('请选择物品代码!')
return
}
detatableDataBom.params.itemCode = row.itemCode
DialogTitle.value = '物品代码:【' + row.itemCode + '】 Bom 信息'
bomModelVisible.value = true
await getDetailListBom()
detatableDataBom.tableList.map(item => {
item.rowId = index
if(tableData.value[index].childList) {
tableData.value[index].childList.forEach(itemChild => {
if (itemChild.itemCode == item.itemCode) {
item.qty = itemChild.qty
}
})
}
})
}
/** bom 列表 表单 按钮 */
const ButttondataBom = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) //
]
// bom
const buttonBaseClickBom = (val) => {
//
if (val == 'save') {
//
tableListBom.value = detatableDataBom.tableList.filter(item => (item.qty!=0))
tableData.value.forEach((item, index) => {
if(tableListBom.value[0].rowId == index) {
item.childList = tableListBom.value
}
})
console.log(157, tableData.value)
bomModelVisible.value = false
}
//
else if (val == 'close') {
bomModelVisible.value = false
}
}
// Bom
const tableFormButton = async (val , row) => {
if (val == 'bom') { // bom
bomModelVisible.value = true
DialogTitle.value = '物品代码【' + row.itemCode + '】——Bom信息'
detatableDataBom.params = {
masterId: row.id
}
await getDetailListBom()
}
}
//
const updataTableColumns = (val) => {
tableColumns.value = val

245
src/views/wms/productionManage/productrepair/productrepairRecordMain/productrepairRecordMain.data.ts

@ -581,6 +581,22 @@ export const ProductrepairRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 150,
fixed: 'right'
},
isTableForm: true,
tableForm: {
type: 'action',
buttonText: 'Bom',
buttonName: 'Bom'
}
},
]))
//表单校验
@ -624,4 +640,231 @@ export const ProductrepairRecordDetailRules = reactive({
creator: [
{ required: true, message: '请输入创建者', trigger: 'blur' }
],
})
})
/**
* @returns {Array} bom
*/
export const BomDismantle = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '行标记',
field: 'rowId',
isTableForm: false,
isForm: false,
tableForm:{
disabled: true
},
table: {
show: false
}
},
{
label: '物品代码',
field: 'itemCode',
tableForm:{
disabled: true
}
},
{
label: '数量',
field: 'qty',
tableForm: {
disabled: true,
type: 'InputNumber',
min: 0,
precision: 6
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
tableForm:{
type: 'Select',
disabled: true
}
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
tableForm:{
disabled: true
}
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
tableForm:{
disabled: true
}
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
}
]))

102
src/views/wms/productionManage/productrepair/productrepairRequestMain/index.vue

@ -69,6 +69,8 @@
:apiPage="ProductrepairRequestDetailApi.getProductrepairRequestDetailaPage"
:apiDelete="ProductrepairRequestDetailApi.deleteProductrepairRequestDetaila"
@searchTableSuccessDetail="searchTableSuccessDetail"
:buttondataTable="buttondataTable"
@tableFormButton="tableFormButton"
/>
<!-- bom列表 -->
@ -117,6 +119,18 @@ const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ProductrepairRequestMain.allSchemas.tableColumns)
// table
const buttondataTable = ref([{
label: 'Bom',
name: 'bom',
hide: false,
type: 'primary',
icon: '',
color: '',
hasPermi: '',
link: true, //
}])
// Bom
const DialogTitle = ref('Bom信息')
const bomModelVisible = ref(false)
@ -171,7 +185,6 @@ const buttonOperationClick = async (row, label, index)=> {
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
@ -190,6 +203,12 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
row['uom'] = val[0]['uom']
row['inventoryStatus'] = val[0]['inventoryStatus']
row['fromLocationCode'] = val[0]['locationCode']
} else if(formField == 'productionLineCode'){
row['productionLineCode'] = val[0]['code']
} else if(formField == 'workStationCode'){
row['workStationCode'] = val[0]['code']
} else if(formField == 'formField'){
row['workStationCode'] = val[0]['code']
} else {
row[formField] = val[0][searchField]
}
@ -284,14 +303,22 @@ const butttondata = (row) => {
const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { //
console.log('列表-操作按钮事件-关闭')
handleClose(row.id)
} else if (val == 'mainReAdd') { //
console.log('列表-操作按钮事件-重新添加')
handleReAdd(row.id)
} else if (val == 'mainSubmit') { //
console.log('列表-操作按钮事件-提交审批')
handleSubmit(row.id)
} else if (val == 'mainTurnDown') { //
console.log('列表-操作按钮事件-驳回')
handleRefused(row.id)
} else if (val == 'mainApprove') { //
console.log('列表-操作按钮事件-审批通过')
handleAgree(row.id)
} else if (val == 'mainHandle') { //
console.log('列表-操作按钮事件-处理')
handleHandle(row.id)
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
@ -299,6 +326,66 @@ const buttonTableClick = async (val, row) => {
}
}
/** 关闭按钮操作 */
const handleClose = async (id: number) => {
try {
await message.confirm(t('common.confirmColse'))
await ProductrepairRequestMainApi.closeProductrepairRequestMain(id)
message.success(t('common.closeSuccess'))
await getList()
} catch {}
}
/** 重新添加按钮操作 */
const handleReAdd = async (id: number) => {
try {
await message.confirm(t('common.confirmReAdd'))
await ProductrepairRequestMainApi.reAddProductrepairRequestMain(id)
message.success(t('common.reAddSuccess'))
await getList()
} catch {}
}
/** 提交按钮操作 */
const handleSubmit = async (id: number) => {
try {
await message.confirm(t('common.confirmSubmit'))
await ProductrepairRequestMainApi.submitProductrepairRequestMain(id)
message.success(t('common.submitSuccess'))
await getList()
} catch {}
}
/** 审批驳回按钮操作 */
const handleRefused = async (id: number) => {
try {
await message.confirm(t('common.confirmRefused'))
await ProductrepairRequestMainApi.refusedProductrepairRequestMain(id)
message.success(t('common.refusedSuccess'))
await getList()
} catch {}
}
/** 审批通过按钮操作 */
const handleAgree = async (id: number) => {
try {
await message.confirm(t('common.confirmAgree'))
await ProductrepairRequestMainApi.agreeProductrepairRequestMain(id)
message.success(t('common.agreeSuccess'))
await getList()
} catch {}
}
/** 处理按钮操作 */
const handleHandle = async (id: number) => {
try {
await message.confirm(t('common.confirmHandle'))
await ProductrepairRequestMainApi.handleProductrepairRequestMain(id)
message.success(t('common.handleSuccess'))
await getList()
} catch {}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: number) => {
@ -404,7 +491,18 @@ const searchFormClick = (searchData) => {
getList() //
}
// Bom
const tableFormButton = async (val , row) => {
if (val == 'bom') { // bom
bomModelVisible.value = true
DialogTitle.value = '物品代码【' + row.itemCode + '】——Bom信息'
detatableDataBom.params = {
itemCode: row.itemCode,
masterId: row.id
}
await getDetailListBom()
}
}
/** 初始化 **/
onMounted(async () => {

215
src/views/wms/productionManage/productrepair/productrepairRequestMain/productrepairRequestMain.data.ts

@ -1056,34 +1056,6 @@ export const ConsumereRequestDetailb = useCrudSchemas(reactive<CrudSchema[]>([
}
]))
//表单校验
export const ConsumereRequestDetailbRules = reactive({
inventoryStatus: [
{ required: true, message: '请选择库存状态', trigger: 'change' }
],
packingNumber: [
{ required: true, message: '请选择包装号', trigger: 'change' }
],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
fromLocationCode: [
{ required: true, message: '请选择从库位代码', trigger: 'change' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
itemCode: [
{ required: true, message: '请选择物品代码', trigger: 'change' }
],
createTime: [
{ required: true, message: '请输入创建时间', trigger: 'blur' }
],
creator: [
{ required: true, message: '请输入创建者', trigger: 'blur' }
],
})
/**
* @returns {Array} bom
@ -1096,6 +1068,9 @@ export const BomDismantle = useCrudSchemas(reactive<CrudSchema[]>([
isForm: false,
tableForm:{
disabled: true
},
table: {
show: false
}
},
{
@ -1124,4 +1099,186 @@ export const BomDismantle = useCrudSchemas(reactive<CrudSchema[]>([
disabled: true
}
},
]))
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
tableForm:{
disabled: true
}
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
tableForm:{
disabled: true
}
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
}
}
]))

Loading…
Cancel
Save