材料站领料退料
This commit is contained in:
parent
cabf9f8c28
commit
67ec45b7ea
|
|
@ -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数量 -->
|
||||
|
|
|
|||
|
|
@ -645,7 +645,7 @@ export default {
|
|||
},
|
||||
|
||||
async handleDepartChange() {
|
||||
this.queryParams.proName = null // 清空工程已选
|
||||
this.queryParams.projectName = null // 清空工程已选
|
||||
this.proOptions = [] // 清空原有下拉
|
||||
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -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 => ({
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)">
|
||||
领料单
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue