材料站领料bug修复

This commit is contained in:
hongchao 2025-07-14 17:25:31 +08:00
parent c494514932
commit d635eaa592
2 changed files with 17 additions and 13 deletions

View File

@ -2,16 +2,16 @@
<!-- 新增工机具 --> <!-- 新增工机具 -->
<div> <div>
<el-form :model="maForm" ref="maForm" size="small" :rules="rules" :inline="true" label-width="120px"> <el-form :model="maForm" ref="maForm" size="small" :rules="rules" :inline="true" label-width="120px">
<el-form-item label="租赁工程" prop="projectId"> <el-form-item label="租赁工程" prop="proId">
<el-select <el-select
v-if="!isEdit || !maForm.teamId" v-if="!isEdit || !maForm.teamId"
v-model="maForm.projectId" v-model="maForm.proId"
placeholder="请选择租赁工程" placeholder="请选择租赁工程"
filterable filterable
style="width: 240px" style="width: 240px"
@change="changePro" @change="changePro"
> >
<el-option v-for="(item, index) in projectList" :key="index" :label="item.proName" :value="item.projectId" /> <el-option v-for="(item, index) in projectList" :key="index" :label="item.proName" :value="item.proId" />
</el-select> </el-select>
<el-input v-else v-model="maForm.projectName" disabled maxlength="50" style="width: 240px" /> <el-input v-else v-model="maForm.projectName" disabled maxlength="50" style="width: 240px" />
</el-form-item> </el-form-item>
@ -296,7 +296,7 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
], ],
projectId: [ proId: [
{ {
required: true, required: true,
message: '请选择租赁工程', message: '请选择租赁工程',
@ -362,7 +362,7 @@ export default {
watch: { watch: {
maForm: { maForm: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
if (newVal.teamId && newVal.projectId) { if (newVal.teamId && newVal.proId) {
this.getAgreementId() this.getAgreementId()
} else { } else {
this.equipmentTypeList = [] this.equipmentTypeList = []
@ -386,7 +386,7 @@ export default {
}, },
// id // id
getAgreementId() { getAgreementId() {
if (!this.maForm.teamId || !this.maForm.projectId) return if (!this.maForm.teamId || !this.maForm.proId) return
getAgreement({ getAgreement({
teamId: this.maForm.teamId, teamId: this.maForm.teamId,
// projectId: this.maForm.projectId, // projectId: this.maForm.projectId,
@ -453,7 +453,8 @@ export default {
}, },
changePro(e) { changePro(e) {
console.log('🚀 ~ changePro ~ e:', e) console.log('🚀 ~ changePro ~ e:', e)
this.maForm.proId = this.projectList.find(item => item.projectId === e)?.proId this.maForm.proId = e
this.maForm.projectId = this.projectList.find(item => item.proId === e)?.projectId
this.getBmTeam() this.getBmTeam()
}, },
changeTeam(e) { changeTeam(e) {
@ -584,6 +585,7 @@ export default {
await getApplyInfo(this.id).then(response => { await getApplyInfo(this.id).then(response => {
Object.assign(this.maForm, response.data.leaseApplyInfo) Object.assign(this.maForm, response.data.leaseApplyInfo)
this.maForm.projectId = response.data.leaseApplyInfo.proId this.maForm.projectId = response.data.leaseApplyInfo.proId
this.maForm.proId = response.data.leaseApplyInfo.proId
this.equipmentList = response.data.leaseApplyDetailsList || [] this.equipmentList = response.data.leaseApplyDetailsList || []
// bmFileInfos // bmFileInfos
if (this.maForm.bmFileInfos.length > 0) { if (this.maForm.bmFileInfos.length > 0) {

View File

@ -2,17 +2,17 @@
<!-- 新增工机具 --> <!-- 新增工机具 -->
<div> <div>
<el-form :model="maForm" ref="maForm" size="small" :rules="rules" :inline="true" label-width="120px"> <el-form :model="maForm" ref="maForm" size="small" :rules="rules" :inline="true" label-width="120px">
<el-form-item label="租赁工程" prop="projectId"> <el-form-item label="租赁工程" prop="proId">
<el-select <el-select
v-if="!isEdit" v-if="!isEdit"
v-model="maForm.projectId" v-model="maForm.proId"
:disabled="isEdit" :disabled="isEdit"
placeholder="请选择租赁工程" placeholder="请选择租赁工程"
filterable filterable
style="width: 240px" style="width: 240px"
@change="changePro" @change="changePro"
> >
<el-option v-for="(item, index) in projectList" :key="index" :label="item.proName" :value="item.projectId" /> <el-option v-for="(item, index) in projectList" :key="index" :label="item.proName" :value="item.proId" />
</el-select> </el-select>
<el-input v-else v-model="maForm.projectName" disabled maxlength="50" style="width: 240px" /> <el-input v-else v-model="maForm.projectName" disabled maxlength="50" style="width: 240px" />
</el-form-item> </el-form-item>
@ -306,7 +306,7 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
], ],
projectId: [ proId: [
{ {
required: true, required: true,
message: '请选择租赁工程', message: '请选择租赁工程',
@ -381,7 +381,7 @@ export default {
watch: { watch: {
maForm: { maForm: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
if (newVal.teamId && newVal.projectId) { if (newVal.teamId && newVal.proId) {
this.getAgreementId() this.getAgreementId()
} else { } else {
this.equipmentTypeList = [] this.equipmentTypeList = []
@ -450,7 +450,8 @@ export default {
}, },
changePro(e) { changePro(e) {
console.log('🚀 ~ changePro ~ e:', e) console.log('🚀 ~ changePro ~ e:', e)
this.maForm.proId = this.projectList.find(item => item.projectId === e)?.proId this.maForm.proId = e
this.maForm.projectId = this.projectList.find(item => item.proId === e)?.projectId
this.getBmTeam() this.getBmTeam()
}, },
changeTeam(e) { changeTeam(e) {
@ -596,6 +597,7 @@ export default {
} }
Object.assign(this.maForm, response.data.leaseApplyInfo) Object.assign(this.maForm, response.data.leaseApplyInfo)
this.maForm.projectId = response.data.leaseApplyInfo.proId this.maForm.projectId = response.data.leaseApplyInfo.proId
this.maForm.proId = response.data.leaseApplyInfo.proId
this.equipmentList = response.data.leaseApplyDetailsList || [] this.equipmentList = response.data.leaseApplyDetailsList || []
if (this.equipmentList.length > 0) { if (this.equipmentList.length > 0) {
this.equipmentList.forEach(item => { this.equipmentList.forEach(item => {