领料申请优化

This commit is contained in:
BianLzhaoMin 2024-08-23 13:09:01 +08:00
parent bbd3ecf8b6
commit a4a446d4b1
2 changed files with 33 additions and 2 deletions

View File

@ -307,6 +307,14 @@ export function getCostBearingApi() {
method: 'get', method: 'get',
}) })
} }
// 判断工程是否结算
export function getAgreementInfoByIdApi(data) {
return request({
url: '/material/select/getAgreementInfoById',
method: 'post',
data
})
}

View File

@ -82,7 +82,7 @@
ref="deviceTypeCascader" ref="deviceTypeCascader"
filterable filterable
style="width: 240px" style="width: 240px"
:disabled="isEdit && !isView" :disabled="(isEdit && !isView) || isCost"
></el-cascader> ></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="预计领料时间" prop="estimateLeaseTime"> <el-form-item label="预计领料时间" prop="estimateLeaseTime">
@ -271,6 +271,7 @@ import {
getLeaseApplyListAll, getLeaseApplyListAll,
getLeaseApplyAuditListAll, getLeaseApplyAuditListAll,
getCostBearingApi, getCostBearingApi,
getAgreementInfoByIdApi,
} from '@/api/claimAndRefund/receive' } from '@/api/claimAndRefund/receive'
import { getInfo } from '@/api/login' import { getInfo } from '@/api/login'
export default { export default {
@ -493,6 +494,7 @@ export default {
], ],
}, },
costBearingList: [], costBearingList: [],
isCost: false,
} }
}, },
mounted() { mounted() {
@ -569,6 +571,21 @@ export default {
projectId: this.queryParams.proId, projectId: this.queryParams.proId,
} }
const res = await getAgreementInfoById(params) const res = await getAgreementInfoById(params)
console.log(res, '根据工程和单位获取协议id')
if (res.data.isSlt == 1) {
this.$message.error(
'当前协议下对应的工程已完成结算,不可重复领料!',
)
this.isCost = true
if (this.leaseApplyDetails.length > 0) {
this.leaseApplyDetails = []
}
} else {
this.isCost = false
}
if (!(res.data && res.data.agreementId)) { if (!(res.data && res.data.agreementId)) {
this.$message.error('当前单位和工程未上传') this.$message.error('当前单位和工程未上传')
@ -579,6 +596,12 @@ export default {
} else { } else {
this.queryParams.agreementId = res.data.agreementId this.queryParams.agreementId = res.data.agreementId
this.queryParams.agreementCode = res.data.agreementCode this.queryParams.agreementCode = res.data.agreementCode
// // 1.
// getAgreementInfoByIdApi({
// agreementId: res.data.agreementId,
// })
} }
} }
}, },
@ -729,7 +752,7 @@ export default {
} else { } else {
this.queryParams.leaseApplyDetails = this.leaseApplyDetails this.queryParams.leaseApplyDetails = this.leaseApplyDetails
if (this.queryParams.leaseApplyDetails.length == 0) { if (this.queryParams.leaseApplyDetails.length == 0) {
this.$message.error('请添加数据') this.$message.error('请添加机具类型')
return return
} }
let canSave = true let canSave = true