Browse Source

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

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

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

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

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

@ -80,8 +80,8 @@
:apiDelete="PurchaseClaimRequestDetailApi.deletePurchaseClaimRequestDetail" :apiDelete="PurchaseClaimRequestDetailApi.deletePurchaseClaimRequestDetail"
:detailButtonIsShowDelete="false" :detailButtonIsShowDelete="false"
:detailButtonIsShowAdd="false" :detailButtonIsShowAdd="false"
:detailButtonIsShowAddStatusArray="['1','2']" :detailButtonIsShowAddStatusArray="['1', '2']"
:isChangeDetailDrawer="['2']" :isChangeDetailDrawer="['2']"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
@detailOpenForm="detailOpenForm" @detailOpenForm="detailOpenForm"
/> />
@ -96,14 +96,14 @@
:mode="2" :mode="2"
:extend="businessType" :extend="businessType"
/> />
<BasicForm <BasicForm
ref="detailFormRef" ref="detailFormRef"
:isOpenSearchTable="true" :isOpenSearchTable="true"
fieldTableColumn="itemCode" fieldTableColumn="itemCode"
:rules="PurchaseClaimRequestMainRules" :rules="PurchaseClaimRequestMainRules"
:formAllSchemas="PurchaseClaimRequestAmount.allSchemas" :formAllSchemas="PurchaseClaimRequestAmount.allSchemas"
:isBusiness="false" :isBusiness="false"
@success="submitFormDetail" @success="submitFormDetail"
/> />
</template> </template>
@ -154,28 +154,34 @@ const updataTableColumns = (val) => {
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => { nextTick(async () => {
if (type == 'tableForm') { if (type == 'tableForm') {
if(formField == 'itemCode'){ if (formField == 'itemCode') {
let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) let itemCodes = val.filter((item) =>
if(itemCodes.length>0){ tableData.value.find((item1) => item1['itemCode'] == item['itemCode'])
itemCodes = itemCodes.map(item=>(item['itemCode'])) )
if (itemCodes.length > 0) {
itemCodes = itemCodes.map((item) => item['itemCode'])
message.warning(`物料${itemCodes.join(',')}已经存在`) message.warning(`物料${itemCodes.join(',')}已经存在`)
} }
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) val = val.filter(
if(val.length==0){ (item) => !tableData.value.find((item1) => item1['itemCode'] == item['itemCode'])
)
if (val.length == 0) {
return return
} }
let newVal = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) let newVal = val.filter(
newVal.forEach(item=>{ (item) => !tableData.value.find((item1) => item1['itemCode'] == item['itemCode'])
)
newVal.forEach((item) => {
let tfk = JSON.parse(JSON.stringify(tableFormKeys)) let tfk = JSON.parse(JSON.stringify(tableFormKeys))
tfk['itemCode'] = item['itemCode'] tfk['itemCode'] = item['itemCode']
tfk['itemName'] = item['itemName'] tfk['itemName'] = item['itemName']
tfk['uom'] = item['supplierUom'] tfk['uom'] = item['supplierUom']
tableData.value.push(tfk) tableData.value.push(tfk)
}) })
} }
} }
const setV = {} const setV = {}
if(formField === 'supplierCode'){ if (formField === 'supplierCode') {
setV['supplierCode'] = val[0]['code'] setV['supplierCode'] = val[0]['code']
setV['supplierName'] = val[0]['name'] setV['supplierName'] = val[0]['name']
tableData.value = [] tableData.value = []
@ -192,9 +198,8 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
setV['remark'] = val[0]['remark'] setV['remark'] = val[0]['remark']
setV['uom'] = val[0]['customerUom'] setV['uom'] = val[0]['customerUom']
if (formField == 'itemCode') { if (formField == 'itemCode') {
setV['itemName'] = val[0]['itemName'] setV['itemName'] = val[0]['itemName']
setV['uom'] = val[0]['supplierUom'] setV['uom'] = val[0]['supplierUom']
} }
formRef.setValues(setV) formRef.setValues(setV)
}) })
@ -277,9 +282,14 @@ const butttondata = (row, $index) => {
hide: isShowMainButton(row, ['1']), hide: isShowMainButton(row, ['1']),
hasPermi: 'wms:purchaseClaimRequest:update' hasPermi: 'wms:purchaseClaimRequest:update'
}), // }), //
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3']),hasPermi:'wms:purchaseClaimRequest:close'}), // defaultButtons.mainListCloseBtn({
hide: isShowMainButton(row, ['1', '2', '3']),
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:purchaseClaimRequest:reAdd'}), // hasPermi: 'wms:purchaseClaimRequest:close'
}), //
defaultButtons.mainListReAddBtn({
hide: isShowMainButton(row, ['4', '5']),
hasPermi: 'wms:purchaseClaimRequest:reAdd'
}) //
] ]
} }
@ -291,44 +301,46 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'mainPlanSub') { } else if (val == 'mainPlanSub') {
// //
handleSub(row.masterId) handleSub(row.masterId)
} } else if (val == 'mainPlanApp') {
else if (val == 'mainPlanApp') {
// //
handleAgree(row.masterId) handleAgree(row.masterId)
} } else if (val == 'mainPlanTur') {
else if (val == 'mainPlanTur') {
// //
handleReject(row.masterId) handleReject(row.masterId)
} } else if (val == 'delete') {
else if (val == 'delete') {
// //
handleDelete(row.masterId) handleDelete(row.masterId)
}else if (val == 'mainClose') { // } else if (val == 'mainClose') {
//
await message.confirm('确认要关闭吗?') await message.confirm('确认要关闭吗?')
tableObject.loading = true tableObject.loading = true
PurchaseClaimRequestMainApi.closePurchaseClaimRequestMain(row.masterId).then(() => { PurchaseClaimRequestMainApi.closePurchaseClaimRequestMain(row.masterId)
message.success(t('common.updateSuccess')) .then(() => {
tableObject.loading = false message.success(t('common.updateSuccess'))
buttonBaseClick('refresh',null) tableObject.loading = false
}).catch(err => { buttonBaseClick('refresh', null)
tableObject.loading = false })
console.log(err) .catch((err) => {
}) tableObject.loading = false
} else if (val == 'mainReAdd') { // console.log(err)
    await message.confirm('确认要重新添加吗?') })
    tableObject.loading = true } else if (val == 'mainReAdd') {
    PurchaseClaimRequestMainApi.reAddPurchaseClaimRequestMain(row.masterId).then(() => { //
      message.success(t('common.updateSuccess')) await message.confirm('确认要重新添加吗?')
      tableObject.loading = false tableObject.loading = true
      buttonBaseClick('refresh',null) PurchaseClaimRequestMainApi.reAddPurchaseClaimRequestMain(row.masterId)
    }).catch(err => { .then(() => {
      tableObject.loading = false message.success(t('common.updateSuccess'))
      console.log(err) tableObject.loading = false
    }) buttonBaseClick('refresh', null)
  } })
.catch((err) => {
tableObject.loading = false
console.log(err)
})
}
} }
/** 提交审批按钮操作 */ /** 提交审批按钮操作 */
const handleSub = async (masterId: number) => { const handleSub = async (masterId: number) => {
try { try {
@ -383,20 +395,19 @@ const handleReject = async (masterId: number) => {
} }
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = async (type: string, row?: any) => { const openForm = async (type: string, row?: any) => {
tableData.value = [] // tableData.value = [] //
if (row?.id) { if (row?.id) {
PurchaseClaimRequestMain.allSchemas.formSchema.forEach(item => { PurchaseClaimRequestMain.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') { if (item.field == 'supplierCode') {
item.componentProps.isSearchList = false item.componentProps.isSearchList = false
item.componentProps.disabled = true item.componentProps.disabled = true
} }
}) })
} else { } else {
PurchaseClaimRequestMain.allSchemas.formSchema.forEach(item => { PurchaseClaimRequestMain.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') { if (item.field == 'supplierCode') {
item.componentProps.isSearchList = true item.componentProps.isSearchList = true
item.componentProps.disabled = false item.componentProps.disabled = false
@ -561,7 +572,7 @@ const detailOpenForm = (type, row, masterParmas) => {
} }
} }
// //
const submitFormDetail =async (formType,data) => { const submitFormDetail = async (formType, data) => {
detailFormRef.value.formLoading = true detailFormRef.value.formLoading = true
try { try {
if (formType === 'create') { if (formType === 'create') {
@ -577,7 +588,6 @@ const submitFormDetail =async (formType,data) => {
} catch { } catch {
detailFormRef.value.formLoading = false detailFormRef.value.formLoading = false
} }
} }
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {

Loading…
Cancel
Save