Browse Source

采购索赔申请审批驳回和关闭后缺少重新添加功能 YT-1095

intex
YEJIAXING-PC\lenovo 2 days ago
parent
commit
b5999acf89
  1. 21
      src/views/wms/inventoryManage/balance/index.vue
  2. 80
      src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue

21
src/views/wms/inventoryManage/balance/index.vue

@ -41,7 +41,7 @@
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" />
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event, row)" />
</template>
</Table>
</ContentWrap>
@ -266,8 +266,20 @@ const handleSelectionPoint = async () => {
})
// window.open(srcPoint.value+'&relateNumber='+rows.join(','))
}
const isShowPointBtn = (row) =>{
 if(row.qty>0){
   return false
 }else{
   return true
 }
}
// -
const butttondata = [
const butttondata = (row) => {
  return [
// {
// label: '',
// name: 'bqxx',
@ -279,10 +291,11 @@ const butttondata = [
// float: 'right',
// hasPermi: ''
// },
defaultButtons.mainListPointBtn(null) //
defaultButtons.mainListPointBtn({hide: isShowPointBtn(row)} ) //
// defaultButtons.mainListEditBtn({hasPermi:'wms:balance:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:balance:delete'}), //
]
  ]
}
// -
const buttonTableClick = async (val, row) => {

80
src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue

@ -155,17 +155,23 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
nextTick(async () => {
if (type == 'tableForm') {
if (formField == 'itemCode') {
let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
let itemCodes = val.filter((item) =>
tableData.value.find((item1) => item1['itemCode'] == item['itemCode'])
)
if (itemCodes.length > 0) {
itemCodes = itemCodes.map(item=>(item['itemCode']))
itemCodes = itemCodes.map((item) => item['itemCode'])
message.warning(`物料${itemCodes.join(',')}已经存在`)
}
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
val = val.filter(
(item) => !tableData.value.find((item1) => item1['itemCode'] == item['itemCode'])
)
if (val.length == 0) {
return
}
let newVal = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
newVal.forEach(item=>{
let newVal = val.filter(
(item) => !tableData.value.find((item1) => item1['itemCode'] == item['itemCode'])
)
newVal.forEach((item) => {
let tfk = JSON.parse(JSON.stringify(tableFormKeys))
tfk['itemCode'] = item['itemCode']
tfk['itemName'] = item['itemName']
@ -194,7 +200,6 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
if (formField == 'itemCode') {
setV['itemName'] = val[0]['itemName']
setV['uom'] = val[0]['supplierUom']
}
formRef.setValues(setV)
})
@ -277,9 +282,14 @@ const butttondata = (row, $index) => {
hide: isShowMainButton(row, ['1']),
hasPermi: 'wms:purchaseClaimRequest:update'
}), //
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3']),hasPermi:'wms:purchaseClaimRequest:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:purchaseClaimRequest:reAdd'}), //
defaultButtons.mainListCloseBtn({
hide: isShowMainButton(row, ['1', '2', '3']),
hasPermi: 'wms:purchaseClaimRequest:close'
}), //
defaultButtons.mainListReAddBtn({
hide: isShowMainButton(row, ['4', '5']),
hasPermi: 'wms:purchaseClaimRequest:reAdd'
}) //
]
}
@ -291,43 +301,45 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'mainPlanSub') {
//
handleSub(row.masterId)
}
else if (val == 'mainPlanApp') {
} else if (val == 'mainPlanApp') {
//
handleAgree(row.masterId)
}
else if (val == 'mainPlanTur') {
} else if (val == 'mainPlanTur') {
//
handleReject(row.masterId)
}
else if (val == 'delete') {
} else if (val == 'delete') {
//
handleDelete(row.masterId)
}else if (val == 'mainClose') { //
} else if (val == 'mainClose') {
//
await message.confirm('确认要关闭吗?')
tableObject.loading = true
PurchaseClaimRequestMainApi.closePurchaseClaimRequestMain(row.masterId).then(() => {
PurchaseClaimRequestMainApi.closePurchaseClaimRequestMain(row.masterId)
.then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh', null)
}).catch(err => {
})
.catch((err) => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainReAdd') {
//
await message.confirm('确认要重新添加吗?')
tableObject.loading = true
PurchaseClaimRequestMainApi.reAddPurchaseClaimRequestMain(row.masterId)
.then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh', null)
})
.catch((err) => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainReAdd') { //
    await message.confirm('确认要重新添加吗?')
    tableObject.loading = true
    PurchaseClaimRequestMainApi.reAddPurchaseClaimRequestMain(row.masterId).then(() => {
      message.success(t('common.updateSuccess'))
      tableObject.loading = false
      buttonBaseClick('refresh',null)
    }).catch(err => {
      tableObject.loading = false
      console.log(err)
    })
  }
}
}
/** 提交审批按钮操作 */
const handleSub = async (masterId: number) => {
@ -383,20 +395,19 @@ const handleReject = async (masterId: number) => {
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type: string, row?: any) => {
tableData.value = [] //
if (row?.id) {
PurchaseClaimRequestMain.allSchemas.formSchema.forEach(item => {
PurchaseClaimRequestMain.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') {
item.componentProps.isSearchList = false
item.componentProps.disabled = true
}
})
} else {
PurchaseClaimRequestMain.allSchemas.formSchema.forEach(item => {
PurchaseClaimRequestMain.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') {
item.componentProps.isSearchList = true
item.componentProps.disabled = false
@ -577,7 +588,6 @@ const submitFormDetail =async (formType,data) => {
} catch {
detailFormRef.value.formLoading = false
}
}
/** 初始化 **/
onMounted(async () => {

Loading…
Cancel
Save