Browse Source

制品报废记录页面修改修改

master
zhaoxuebing 11 months ago
parent
commit
29740e16ea
  1. 5
      src/api/wms/bomDismantle/index.ts
  2. 110
      src/views/wms/productionManage/productscrap/productscrapRecordMain/index.vue
  3. 226
      src/views/wms/productionManage/productscrap/productscrapRecordMain/productscrapRecordMain.data.ts

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

@ -14,3 +14,8 @@ export const getBomDismantleRecordPage = async (params) => {
export const getProductscrapBomDismantlePage = async (params) => { export const getProductscrapBomDismantlePage = async (params) => {
return await request.get({ url: `/wms/productscrap-request-main/bomPage`, params }) return await request.get({ url: `/wms/productscrap-request-main/bomPage`, params })
} }
// 查询制品报废申请子列表
export const getProductscrapBomDismantleRecordPage = async (params) => {
return await request.get({ url: `/wms/productscrap-record-main/bomPage`, params })
}

110
src/views/wms/productionManage/productscrap/productscrapRecordMain/index.vue

@ -47,6 +47,7 @@
:tableAllSchemas="ProductscrapRecordDetail.allSchemas" :tableAllSchemas="ProductscrapRecordDetail.allSchemas"
:tableFormRules="ProductscrapRecordDetailRules" :tableFormRules="ProductscrapRecordDetailRules"
:isBusiness="true" :isBusiness="true"
@buttonOperationClick="buttonOperationClick"
/> />
<!-- 详情 --> <!-- 详情 -->
@ -57,15 +58,41 @@
:detailAllSchemas="ProductscrapRecordDetail.allSchemas" :detailAllSchemas="ProductscrapRecordDetail.allSchemas"
:detailAllSchemasRules="ProductscrapRecordDetailRules" :detailAllSchemasRules="ProductscrapRecordDetailRules"
:apiPage="ProductscrapRecordDetailApi.getProductscrapRecordDetailPage" :apiPage="ProductscrapRecordDetailApi.getProductscrapRecordDetailPage"
: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="ProdcutscrapRecordBomDismantle.allSchemas.tableColumns"
:tableData="detatableDataBom.tableList"
:isShowButton="false"
:isShowReduceButton="false"
/>
<template #footer>
<ButtonBase :Butttondata="ButttondataBom" @button-base-click="buttonBaseClickBom" />
</template>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { ProductscrapRecordMain,ProductscrapRecordMainRules,ProductscrapRecordDetail,ProductscrapRecordDetailRules } from './productscrapRecordMain.data' import { ProductscrapRecordMain,ProductscrapRecordMainRules,ProductscrapRecordDetail,ProductscrapRecordDetailRules,ProdcutscrapRecordBomDismantle } from './productscrapRecordMain.data'
import * as ProductscrapRecordMainApi from '@/api/wms/productscrapRecordMain' import * as ProductscrapRecordMainApi from '@/api/wms/productscrapRecordMain'
import * as ProductscrapRecordDetailApi from '@/api/wms/productscrapRecordDetail' import * as ProductscrapRecordDetailApi from '@/api/wms/productscrapRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as BomDismantleApi from "@/api/wms/bomDismantle";
import {getProductscrapBomDismantleRecordPage} from "@/api/wms/bomDismantle";
// //
defineOptions({ name: 'ProductscrapRecordMain' }) defineOptions({ name: 'ProductscrapRecordMain' })
@ -78,6 +105,87 @@ const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(ProductscrapRecordMain.allSchemas.tableColumns) const tableColumns = ref(ProductscrapRecordMain.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.getProductscrapBomDismantleRecordPage
})
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) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val

226
src/views/wms/productionManage/productscrap/productscrapRecordMain/productscrapRecordMain.data.ts

@ -660,3 +660,229 @@ export const ProductscrapRecordDetailRules = reactive({
{ required: true, message: '请输入创建者', trigger: 'blur' } { required: true, message: '请输入创建者', trigger: 'blur' }
], ],
}) })
/**
* @returns {Array} bom record记录页面
*/
export const ProdcutscrapRecordBomDismantle = 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: {
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
}
}
]))

Loading…
Cancel
Save