材料站领料退料

This commit is contained in:
hongchao 2025-09-22 20:08:38 +08:00
parent cabf9f8c28
commit 67ec45b7ea
10 changed files with 107 additions and 80 deletions

View File

@ -200,7 +200,7 @@
<el-table-column label="类型名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="typeModel" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="unitName" />
<!-- <el-table-column label="当前在用量" align="center" prop="num"></el-table-column> -->
<el-table-column label="当前在用量" align="center" prop="num"></el-table-column>
<el-table-column label="管理模式" align="center" prop="manageType">
<template slot-scope="scope">
<!-- 0编码1数量 -->

View File

@ -645,7 +645,7 @@ export default {
},
async handleDepartChange() {
this.queryParams.proName = null //
this.queryParams.projectName = null //
this.proOptions = [] //
try {

View File

@ -20,9 +20,9 @@
</el-select>
</el-form-item>
<el-form-item label="领料工程" prop="proName">
<el-form-item label="领料工程" prop="leaseProject">
<el-select
v-model="queryParams.proName"
v-model="queryParams.leaseProject"
placeholder="请选择领料工程"
clearable
filterable
@ -465,7 +465,7 @@ export default {
startTime: '', //
endTime: '', //
impUnitName: '', //
proName: '', //
leaseProject: '', //
maTypeNames: '', //
leasePerson: '', //
code: '', //
@ -577,14 +577,14 @@ export default {
},
async handleDepartChange() {
this.queryParams.proName = null //
this.queryParams.leaseProject = null //
this.proOptions = [] //
try {
//
const params = {
impUnitName: this.queryParams.impUnitName, //
proName: this.queryParams.proName,
proName: this.queryParams.leaseProject,
}
const res = await getProListByDepartApi(params)
this.proOptions = res.data.map(item => ({

View File

@ -251,7 +251,8 @@ export default {
dialogForm: {
pageNum: 1,
pageSize: 10,
keyWord: '' //
keyWord: '', //
parentId: null, // id
},
dialogColumns: [
{ label: '类型名称', prop: 'typeCode' },
@ -407,7 +408,7 @@ export default {
this.dialogTitle = '查看'
this.dialogVisible = true
setTimeout(() => {
this.dialogForm.code = row.code
this.dialogForm.parentId = row.id
this.getDetailsList()
}, 100)
},

View File

@ -336,6 +336,7 @@ export default {
teamId: null,
proId: null,
agreementId: null, //id
agreementIds:[],
agreementCode: null, //code
// companyId: '', //
// createBy: '', //
@ -467,9 +468,9 @@ export default {
// this.GetAgreementInfoById()
},
//
async GetDeviceTypeTreeFn(agreementId) {
async GetDeviceTypeTreeFn(agreementIds) {
const params = {
agreementId: agreementId
agreementIds: agreementIds
}
const res = await getDeviceTreeByAgreementId(params)
console.log('resgetUseTypeTreee==========', res)
@ -600,7 +601,7 @@ export default {
}
const res = await getAgreementInfoByIdBackApi(params)
console.log(res)
if (!(res.data && res.data.agreementId)) {
if (!(res.data && res.data.length > 0)) {
// this.$message.error('')
this.queryParams.teamId = null
this.queryParams.proId = null
@ -608,10 +609,10 @@ export default {
this.GetUnitData()
this.GetProData()
} else {
this.queryParams.agreementId = res.data.agreementId
this.queryParams.agreementCode = res.data.agreementCode
this.queryParams.agreementIds = res.data.map(item => item.agreementId)
// this.queryParams.agreementCode = res.data.agreementCode
this.equipmentList = []
this.GetDeviceTypeTreeFn(res.data.agreementId)
this.GetDeviceTypeTreeFn(this.queryParams.agreementIds)
}
}
},
@ -631,7 +632,7 @@ export default {
item.tempMaCodeList = item.maCodeList || item.maCodeVoList || []
item.maTypeName = item.materialName
})
this.GetDeviceTypeTreeFn(data.backApplyInfo.agreementId)
this.GetDeviceTypeTreeFn(data.backApplyInfo.agreementIds)
},
//
selectable(row) {
@ -672,7 +673,7 @@ export default {
backPerson: this.queryParams.backPerson,
phone: this.queryParams.phone,
remark: this.queryParams.remark,
agreementId: this.queryParams.agreementId,
agreementIds: this.queryParams.agreementIds,
isBack,
taskId: this.queryParams.taskId,
createBy: sessionStorage.getItem('userName')

View File

@ -4,7 +4,6 @@
<el-form :model="maForm" ref="maForm" size="small" :rules="rules" :inline="true" label-width="120px">
<el-form-item label="租赁工程" prop="proId">
<el-select
v-if="!isEdit || !maForm.teamId"
v-model="maForm.proId"
placeholder="请选择租赁工程"
filterable
@ -13,11 +12,9 @@
>
<el-option v-for="(item, index) in projectList" :key="index" :label="item.proName" :value="item.proId" />
</el-select>
<el-input v-else v-model="maForm.projectName" disabled maxlength="50" style="width: 240px" />
</el-form-item>
<el-form-item label="领用班组" prop="teamId">
<el-select
v-if="!isEdit"
v-model="maForm.teamId"
placeholder="请选择班组"
filterable
@ -32,7 +29,6 @@
:data-key="item.id"
/>
</el-select>
<el-input v-else v-model="maForm.teamName" disabled maxlength="50" style="width: 240px" />
</el-form-item>
<el-form-item label="班组长" prop="leasePerson">
<el-input
@ -239,6 +235,12 @@ export default {
return false
}
},
isView: {
type: Boolean,
default: () => {
return false
}
},
editTaskId: {
type: [String, Number],
default: () => {
@ -356,31 +358,32 @@ export default {
},
async mounted() {
this.getStandardConfigListApi() //
if (this.isEdit) {
if (this.isEdit && this.isView == false) {
console.log('isEdit', this.isEdit)
this.taskId = this.editTaskId
this.id = this.editId
this.getTaskInfo()
} else {
// this.getBmTeam()
this.projectInfoList().then(() => {
this.getTaskInfo()
})
} else if(this.isEdit && this.isView){
this.projectInfoList()
}
setTimeout(() => {
this.fitNum = this.maForm.fitNum
}, 500)
},
watch: {
maForm: {
handler(newVal, oldVal) {
if (newVal.teamId && newVal.proId) {
this.getAgreementId()
} else {
this.equipmentTypeList = []
}
},
deep: true
}
},
// watch: {
// maForm: {
// handler(newVal, oldVal) {
// if (newVal.teamId && newVal.proId) {
// this.getAgreementId()
// } else {
// this.equipmentTypeList = []
// }
// },
// deep: true
// }
// },
methods: {
fitNumChange() {
const newVal = Math.min(5, Math.max(1, parseInt(this.maForm.fitNum) || 1))
@ -395,7 +398,7 @@ export default {
this.maForm.fitNum = newVal
},
// id
getAgreementId() {
async getAgreementId() {
if (!this.maForm.teamId || !this.maForm.proId) return
getAgreement({
teamId: this.maForm.teamId,
@ -463,11 +466,15 @@ export default {
console.log('🚀 ~ projectInfoList ~ error:', error)
}
},
changePro(e) {
async changePro(e) {
console.log('🚀 ~ changePro ~ e:', e)
this.maForm.proId = e
this.maForm.projectId = this.projectList.find(item => item.proId === e)?.projectId
this.getBmTeam()
await this.getBmTeam()
if(this.maForm.proId){
this.equipmentList = []
await this.getAgreementId()
}
},
changeTeam(e) {
console.log('🚀 ~ changeTeam ~ e:', e)
@ -597,15 +604,17 @@ export default {
// this.loading = true;
await getApplyInfo(this.id).then(response => {
Object.assign(this.maForm, response.data.leaseApplyInfo)
this.maForm.projectId = response.data.leaseApplyInfo.proId
this.maForm.proId = response.data.leaseApplyInfo.proId
this.maForm.projectId = this.projectList.find(item => item.proId === response.data.leaseApplyInfo.proId)?.projectId
this.maForm.relPhone = response.data.leaseApplyInfo.phone || response.data.leaseApplyInfo.relPhone || ''
this.getBmTeam()
this.equipmentList = response.data.leaseApplyDetailsList || []
this.getAgreementId()
// bmFileInfos
if (this.maForm.bmFileInfos.length > 0) {
this.isFileFbs = true
}
// this.loading = false;
this.getAgreementId()
})
},
//
@ -679,8 +688,8 @@ export default {
.confirm('是否确认保存当前页面')
.then(function () {})
.then(() => {
if (this.isEdit) {
this.maForm.leaseProjectId = this.maForm.projectId
if (this.isEdit && this.isView == false) {
this.maForm.leaseProjectId = this.maForm.proId
console.log('编辑')
this.loading = true
updateApplyInfo({
@ -697,7 +706,7 @@ export default {
.catch(() => {
this.loading = false
})
} else if (!this.isEdit) {
} else if (this.isEdit && this.isView ) {
console.log('新增')
// console.log(this.equipmentList)
this.loading = true

View File

@ -48,7 +48,8 @@ export default {
methods: {
/* 新增工机具 */
addTools() {
this.isEdit = false
this.isEdit = true
this.isView = true
this.editTaskId = ''
this.queryTaskId = ''
this.pageContent = '领料申请'
@ -61,6 +62,7 @@ export default {
/* 编辑工机具 */
editTools(taskId, id) {
this.isEdit = true
this.isView = false
this.pageContent = '领料编辑'
this.editTaskId = taskId
this.editId = id

View File

@ -4,9 +4,7 @@
<el-form :model="maForm" ref="maForm" size="small" :rules="rules" :inline="true" label-width="120px">
<el-form-item label="租赁工程" prop="proId">
<el-select
v-if="!isEdit"
v-model="maForm.proId"
:disabled="isEdit"
placeholder="请选择租赁工程"
filterable
style="width: 240px"
@ -14,11 +12,9 @@
>
<el-option v-for="(item, index) in projectList" :key="index" :label="item.proName" :value="item.proId" />
</el-select>
<el-input v-else v-model="maForm.projectName" disabled maxlength="50" style="width: 240px" />
</el-form-item>
<el-form-item label="领用班组" prop="teamId">
<el-select
v-if="!isEdit"
v-model="maForm.teamId"
placeholder="请选择班组"
filterable
@ -34,7 +30,6 @@
@change="changeTeam"
/>
</el-select>
<el-input v-else v-model="maForm.teamName" disabled maxlength="50" style="width: 240px" />
</el-form-item>
<el-form-item label="班组长" prop="leasePerson">
<el-input
@ -230,6 +225,12 @@ export default {
return false
}
},
isView: {
type: Boolean,
default: () => {
return false
}
},
editTaskId: {
type: [String, Number],
default: () => {
@ -380,34 +381,38 @@ export default {
},
mounted() {
this.getStandardConfigListApi() //
if (this.isEdit) {
if (this.isEdit && this.isView == false) {
console.log('isEdit', this.isEdit)
this.taskId = this.editTaskId
this.id = this.editId
this.getTaskInfo()
} else {
this.projectInfoList().then(() => {
this.getTaskInfo()
})
} else if(this.isEdit && this.isView){
this.projectInfoList()
}
},
watch: {
'maForm.teamId'(newVal) {
if (newVal && this.maForm.proId) {
this.getAgreementId()
} else {
this.equipmentTypeList = []
}
},
'maForm.proId'(newVal) {
if (newVal && this.maForm.teamId) {
this.getAgreementId()
} else {
this.equipmentTypeList = []
}
}
},
// watch: {
// 'maForm.teamId'(newVal) {
// console.log("kkkkkkkkkkkkkkkkkkkk",newVal)
// if (newVal && this.maForm.proId) {
// this.getAgreementId()
// } else {
// this.equipmentTypeList = []
// }
// },
// 'maForm.proId'(newVal) {
// console.log("ppppppppppppppppppppppp",newVal)
// if (newVal && this.maForm.teamId) {
// this.getAgreementId()
// } else {
// this.equipmentTypeList = []
// }
// }
// },
methods: {
// id
getAgreementId() {
async getAgreementId() {
getAgreement({
teamId: this.maForm.teamId,
// projectId: this.maForm.projectId,
@ -437,6 +442,7 @@ export default {
//
async getBmTeam() {
try {
console.log("xxxxxxxxxxxxxxxxxx", this.maForm.projectId)
const idCard = sessionStorage.getItem('idCard')
const res = await getBmTeamApi({ isAll: 0, idCard, projectId: this.maForm.projectId })
// console.log('🚀 ~ getBmTeam ~ res:', res)
@ -466,11 +472,16 @@ export default {
console.log('🚀 ~ getBmTeam ~ error:', error)
}
},
changePro(e) {
async changePro(e) {
console.log('🚀 ~ changePro ~ e:', e)
this.maForm.proId = e
this.maForm.projectId = this.projectList.find(item => item.proId === e)?.projectId
this.getBmTeam()
await this.getBmTeam()
if(this.maForm.proId){
console.log("xxxxxxxyyyyyyyyyyy", this.maForm.proId)
this.equipmentList = []
await this.getAgreementId()
}
},
changeTeam(e) {
@ -622,10 +633,10 @@ export default {
this.$message.warning(response.msg)
}
Object.assign(this.maForm, response.data.leaseApplyInfo)
this.maForm.projectId = response.data.leaseApplyInfo.proId
this.maForm.proId = response.data.leaseApplyInfo.proId
this.maForm.projectId = this.projectList.find(item => item.proId === response.data.leaseApplyInfo.proId)?.projectId
this.maForm.relPhone = response.data.leaseApplyInfo.phone || response.data.leaseApplyInfo.relPhone || ''
// this.getBmTeam()
this.getBmTeam()
this.equipmentList = response.data.leaseApplyDetailsList || []
if (this.equipmentList.length > 0) {
this.equipmentList.forEach(item => {
@ -636,6 +647,7 @@ export default {
this.parentId = this.equipmentList[0].parentId
console.log('🚀 ~ awaitgetApplyInfo ~ this.parentId:', this.parentId)
}
this.getAgreementId()
// bmFileInfos
if (this.maForm.bmFileInfos.length > 0) {
this.isFileFbs = true
@ -732,8 +744,8 @@ export default {
this.loading = true
this.maForm.isOut = isOut
this.maForm.createBy = sessionStorage.getItem('userName')
if (this.isEdit) {
this.maForm.leaseProjectId = this.maForm.projectId
if (this.isEdit && this.isView == false) {
this.maForm.leaseProjectId = this.maForm.proId
console.log('编辑')
updateApplyInfo({
leaseApplyDetailsList: this.equipmentList,
@ -749,7 +761,7 @@ export default {
.catch(() => {
this.loading = false
})
} else if (!this.isEdit) {
} else if (this.isEdit && this.isView ) {
console.log('新增')
addApplyInfo({
leaseApplyDetailsList: this.equipmentList,

View File

@ -199,7 +199,7 @@
@click="handleUpdate(scope.row)"
v-if="scope.row.taskStatus == 1"
>
出库
编辑
</el-button>
<el-button size="mini" type="warning" v-if="scope.row.taskStatus != 1" @click="handleLld(scope.row)">
领料单

View File

@ -48,7 +48,8 @@ export default {
methods: {
/* 新增工机具 */
addTools() {
this.isEdit = false
this.isEdit = true
this.isView = true
this.editTaskId = ''
this.queryTaskId = ''
this.pageContent = '领料申请'
@ -61,6 +62,7 @@ export default {
/* 编辑工机具 */
editTools(taskId, id) {
this.isEdit = true
this.isView = false
this.pageContent = '领料出库'
this.editTaskId = taskId
this.editId = id