Browse Source

备件入库详情新增修改,详情组件新增修改删除按钮按照主页面传入的状态值变化

master_hella_20240701
zhang_li 5 months ago
parent
commit
5565b493f5
  1. 12
      src/components/Detail/src/Detail.vue
  2. 41
      src/views/eam/sparepartsinlocation/index.vue
  3. 5
      src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts

12
src/components/Detail/src/Detail.vue

@ -359,6 +359,12 @@ const props = defineProps({
type: Boolean, type: Boolean,
required: false, required: false,
default: true default: true
},
//
detailButtonIsShowAddStatusArray:{
type: Array,
required: false,
default: () => ['1']
}, },
// //
detailButtonIsShowEdit:{ detailButtonIsShowEdit:{
@ -627,7 +633,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
// //
detailButtonAdd = [ detailButtonAdd = [
defaultButtons.defaultAddBtn({ defaultButtons.defaultAddBtn({
hide: isShowMainButton(row, ['1']) hide: isShowMainButton(row, props.detailButtonIsShowAddStatusArray)
}) })
] ]
} }
@ -646,7 +652,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
// //
detailButtonEdit = [ detailButtonEdit = [
defaultButtons.mainListEditBtn({ defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['1']) hide: isShowMainButton(row,props.detailButtonIsShowAddStatusArray)
}) })
] ]
} }
@ -654,7 +660,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
// //
detailButtonDelete = [ detailButtonDelete = [
defaultButtons.mainListDeleteBtn({ defaultButtons.mainListDeleteBtn({
hide: isShowMainButton(row, ['1']) hide: isShowMainButton(row,props.detailButtonIsShowAddStatusArray)
}) })
] ]
} }

41
src/views/eam/sparepartsinlocation/index.vue

@ -77,6 +77,7 @@
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="true" :isShowAddBtn="true"
:detailButtonIsShowAdd="true" :detailButtonIsShowAdd="true"
:detailButtonIsShowAddStatusArray="['0']"
/> />
<!-- 导入 --> <!-- 导入 -->
@ -124,16 +125,16 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
nextTick(() => { nextTick(() => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
if(type == 'tableForm'){ if (type == 'tableForm') {
if (formField == 'sparePartsCode') { if (formField == 'sparePartsCode') {
row['sparePartsCode'] = val[0].itemNumber row['sparePartsCode'] = val[0].itemNumber
row['currentQty'] = val[0].qty row['currentQty'] = val[0].qty
} }
}else{ } else {
if (formField == 'locationCode') { if (formField == 'locationCode') {
setV['locationCode'] = val[0].code setV['locationCode'] = val[0].code
setV['areaCode'] = val[0].areaCode setV['areaCode'] = val[0].areaCode
} }
} }
formRef.setValues(setV) formRef.setValues(setV)
@ -144,14 +145,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => { nextTick(async () => {
const setV = {} const setV = {}
// if(formField == 'itemCode'){ if (formField == 'sparePartsCode') {
// await ItembasicApi.getItembasicPage({ setV['sparePartsCode'] = val[0].itemNumber
// code: setV['itemCode'] setV['currentQty'] = val[0].qty
// }).then(res => { }
// setV['uom'] = res.list[0].uom
// setV[formField] = val[0][searchField]
// })
// }
formRef.setValues(setV) formRef.setValues(setV)
}) })
} }
@ -217,8 +214,8 @@ const isShowMainButton = (row, val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({ hasPermi: 'wms:sparePartsInLocationMain:update' }), // defaultButtons.mainListEditBtn({ hasPermi: 'wms:sparePartsInLocationMain:update' }) //
defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:sparePartsInLocationMain:delete' }) // // defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:sparePartsInLocationMain:delete' }) //
] ]
} }
@ -299,7 +296,9 @@ const handleExport = async () => {
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const data = await SparePartsInLocationMainApi.exportSparePartsInLocationMain(tableObject.params) const data = await SparePartsInLocationMainApi.exportSparePartsInLocationMain(
tableObject.params
)
download.excel(data, '备件申领记录主.xlsx') download.excel(data, '备件申领记录主.xlsx')
} catch { } catch {
} finally { } finally {
@ -328,7 +327,7 @@ const handleDeleteTable = (item, index) => {
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
data.subList = tableData.value // data.subList = tableData.value //
console.log( formRef.value) console.log(formRef.value)
formRef.value.formLoading = true formRef.value.formLoading = true
try { try {
if (formType === 'create') { if (formType === 'create') {

5
src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts

@ -276,6 +276,11 @@ export const SparePartsInLocationDetail = useCrudSchemas(reactive<CrudSchema[]>(
tableForm: { tableForm: {
disabled: true disabled: true
}, },
form:{
componentProps:{
disabled: true
}
},
isDetail:false, isDetail:false,
isTable:false isTable:false
}, },

Loading…
Cancel
Save