bug修复

This commit is contained in:
hongchao 2025-04-18 17:35:26 +08:00
parent 96d8b38824
commit bab70ad628
4 changed files with 204 additions and 134 deletions

View File

@ -405,6 +405,17 @@ export function getFourMaTypeList(data) {
}) })
} }
export function getFourMaTypeListTwo(data) {
return request({
url: '/material/select/getFourMaTypeListTwo',
method: 'post',
headers: {
repeatSubmit: false,
},
data,
})
}
// 获取预退数量 // 获取预退数量
export function getPreAuditNum(params) { export function getPreAuditNum(params) {
return request({ return request({

View File

@ -116,15 +116,6 @@
<el-option v-for="item in holdingPoleSelList" :key="item.id" :label="item.wholeTypeName" :value="item.id" /> <el-option v-for="item in holdingPoleSelList" :key="item.id" :label="item.wholeTypeName" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="预计领料时间" prop="estimateLeaseTime">
<el-date-picker
v-model="queryParams.estimateLeaseTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="预计领料时间"
></el-date-picker>
</el-form-item>
<el-form-item label="领料人" prop="leasePerson"> <el-form-item label="领料人" prop="leasePerson">
<el-input <el-input
maxlength="50" maxlength="50"
@ -161,7 +152,16 @@
<el-option v-for="(item, index) in costBearingList" :key="index" :label="item" :value="item"></el-option> <el-option v-for="(item, index) in costBearingList" :key="index" :label="item" :value="item"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="roleName"> <el-form-item label="预计领料时间" prop="estimateLeaseTime" label-width="110px">
<el-date-picker
v-model="queryParams.estimateLeaseTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="预计领料时间"
></el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="roleName" label-width="90px">
<el-input <el-input
maxlength="100" maxlength="100"
v-model="queryParams.leaseApplyInfo.remark" v-model="queryParams.leaseApplyInfo.remark"
@ -511,6 +511,13 @@ export default {
trigger: 'change', trigger: 'change',
}, },
], ],
estimateLeaseTime: [
{
required: true,
message: '请选择预计领料时间',
trigger: 'change',
},
],
// leasePerson: [ // leasePerson: [
// { // {
// required: true, message: '', trigger: 'blur', // required: true, message: '', trigger: 'blur',

View File

@ -280,7 +280,7 @@
<!-- 编码出库 --> <!-- 编码出库 -->
<el-dialog :title="title" :visible.sync="openCode" width="1200px" append-to-body> <el-dialog :title="title" :visible.sync="openCode" width="1200px" append-to-body>
<el-form :model="codeOutForm" ref="codeOutForm" size="small" :inline="true" label-width="100px"> <el-form :model="codeOutForm" ref="codeOutForm" size="small" :inline="true" label-width="120px" :rules="queryRules">
<span style="margin-right: 50px">待出库数量{{ outNum }}</span> <span style="margin-right: 50px">待出库数量{{ outNum }}</span>
<br /> <br />
<br /> <br />
@ -305,7 +305,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-form :model="outQuery" ref="outQuery" size="small" :inline="true" label-width="100px"> <el-form :model="outQuery" ref="outQuery" size="small" :inline="true" label-width="120px">
<el-form-item label="设备编码" prop="maCode"> <el-form-item label="设备编码" prop="maCode">
<el-input v-model="outQuery.maCode" maxlength="20" /> <el-input v-model="outQuery.maCode" maxlength="20" />
</el-form-item> </el-form-item>
@ -362,7 +362,7 @@
<!-- 数量出库 --> <!-- 数量出库 -->
<el-dialog :title="title" :visible.sync="openNum" width="1200px" append-to-body> <el-dialog :title="title" :visible.sync="openNum" width="1200px" append-to-body>
<el-form :model="numOutForm" ref="numOutForm" size="small" :inline="true" label-width="100px"> <el-form :model="numOutForm" ref="numOutForm" size="small" :inline="true" label-width="120px" :rules="queryRulesNum">
<!-- <span style="margin-right: 50px;"> <!-- <span style="margin-right: 50px;">
待出库数量{{outNum}} 待出库数量{{outNum}}
</span>--> </span>-->
@ -644,6 +644,24 @@ export default {
}, },
showSelect: true, showSelect: true,
rowTemp: {}, // rowTemp: {}, //
queryRules: {
createTime: [
{
required: true,
message: '请选择出库时间',
trigger: 'change',
},
],
},
queryRulesNum: {
createTime: [
{
required: true,
message: '请选择出库时间',
trigger: 'change',
},
],
}
} }
}, },
created() { created() {
@ -822,6 +840,10 @@ export default {
}, },
// //
saveCodeOut() { saveCodeOut() {
this.$refs.codeOutForm.validate(async (valid) => {
if (!valid) {
return false
} else {
if (this.maCodeList.length <= this.outObj.outNum) { if (this.maCodeList.length <= this.outObj.outNum) {
let params = this.maCodeList.map((item) => { let params = this.maCodeList.map((item) => {
let obj = { let obj = {
@ -854,9 +876,15 @@ export default {
} else { } else {
this.$modal.msgError('所选机具编码已超出出库数量!') this.$modal.msgError('所选机具编码已超出出库数量!')
} }
}
})
}, },
// //
saveNumOut() { saveNumOut() {
this.$refs.numOutForm.validate(async (valid) => {
if (!valid) {
return false
} else{
this.outNumList[0].carCode = this.numOutForm.carCode this.outNumList[0].carCode = this.numOutForm.carCode
this.outNumList[0].remark = this.numOutForm.remark this.outNumList[0].remark = this.numOutForm.remark
this.outNumList[0].createTime = this.numOutForm.createTime this.outNumList[0].createTime = this.numOutForm.createTime
@ -869,6 +897,9 @@ export default {
this.handleDialogQuery() this.handleDialogQuery()
this.handleQuery() this.handleQuery()
}) })
}
})
}, },
// //

View File

@ -42,7 +42,7 @@
<el-form-item label="协议号" prop="agreementCode"> <el-form-item label="协议号" prop="agreementCode">
<el-input v-model="queryParams.agreementCode" disabled style="width: 240px"></el-input> <el-input v-model="queryParams.agreementCode" disabled style="width: 240px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="类型名称" prop="status"> <!-- <el-form-item label="类型名称" prop="status">
<el-cascader <el-cascader
:key="propsKey" :key="propsKey"
v-model="deviceType" v-model="deviceType"
@ -57,8 +57,8 @@
popper-class="popper-select" popper-class="popper-select"
@change="deviceTypeChange" @change="deviceTypeChange"
></el-cascader> ></el-cascader>
</el-form-item> </el-form-item> -->
<el-form-item label="规格型号" prop="typeId"> <!-- <el-form-item label="规格型号" prop="typeId">
<el-select <el-select
v-model="queryParams.typeId" v-model="queryParams.typeId"
filterable filterable
@ -74,6 +74,22 @@
:value="item.id" :value="item.id"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> -->
<el-form-item label="规格型号" prop="equipmentId">
<el-cascader
:key="propsKey"
v-model="deviceType"
:show-all-levels="true"
:options="deviceTypeTree"
:props="deviceTypeTreeProps"
filterable
collapse-tags
style="width: 240px"
placeholder="请选择规格型号"
ref="deviceTypeCascader"
popper-class="popper-select"
@change="deviceTypeChange"
></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="退料人" prop="backPerson"> <el-form-item label="退料人" prop="backPerson">
<el-input <el-input
@ -136,33 +152,33 @@
>导出</el-button> --> >导出</el-button> -->
</el-col> </el-col>
</el-row> </el-row>
<el-table v-loading="loading" :data="leaseApplyDetails" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="leaseApplyDetails" @selection-change="handleSelectionChange" border>
<el-table-column type="selection" min-width="55" align="center" :selectable="selectable" /> <el-table-column type="selection" min-width="55" align="center" :selectable="selectable" />
<el-table-column label="序号" type="index" min-width="120" /> <el-table-column label="序号" type="index" min-width="120" />
<el-table-column <el-table-column
label="机具名称" label="机具名称"
prop="typeName" prop="typeName"
min-width="200" min-width="150"
align="center" align="center"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column
label="规格型号" label="规格型号"
prop="typeCode" prop="typeCode"
min-width="200" min-width="150"
align="center" align="center"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column label="计量单位" prop="unitNames" min-width="100" align="center" /> <el-table-column label="计量单位" prop="unitNames" min-width="100" align="center" />
<el-table-column label="当前在用量" align="center" prop="useNum" min-width="180"> </el-table-column> <el-table-column label="当前在用量" align="center" prop="useNum" min-width="130"> </el-table-column>
<!-- <el-table-column label="预退数量" align="center" prop="outNum" min-width="180"> </el-table-column> --> <!-- <el-table-column label="预退数量" align="center" prop="outNum" min-width="180"> </el-table-column> -->
<el-table-column label="退料方式" align="center" prop="manageType" min-width="180"> <el-table-column label="退料方式" align="center" prop="manageType" min-width="130">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<span>{{ row.manageType == '0' ? '编码退料' : '数量退料' }}</span> <span>{{ row.manageType == '0' ? '编码退料' : '数量退料' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="退料数量" align="center" prop="num" min-width="180"> <el-table-column label="退料数量" align="center" prop="num" min-width="130">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<span v-if="row.manageType == 1">{{ <span v-if="row.manageType == 1">{{
Number(row.maintenanceNum || 0) + Number(row.passNum || 0) Number(row.maintenanceNum || 0) + Number(row.passNum || 0)
@ -208,7 +224,7 @@
<span v-else>{{ calculateDifference(row) }}</span> <span v-else>{{ calculateDifference(row) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark" min-width="180"> <el-table-column label="备注" align="center" prop="remark" min-width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
v-model="scope.row.remark" v-model="scope.row.remark"
@ -335,7 +351,7 @@ import {
getUseNumByTypeId, getUseNumByTypeId,
getTaskDetail, getTaskDetail,
submitUpdateBackApply, submitUpdateBackApply,
getFourMaTypeList, getFourMaTypeListTwo,
getPreAuditNum, getPreAuditNum,
} from '@/api/claimAndRefund/receive' } from '@/api/claimAndRefund/receive'
import { submitBackApplyApi, getMachineById } from '@/api/claimAndRefund/return' import { submitBackApplyApi, getMachineById } from '@/api/claimAndRefund/return'
@ -532,7 +548,7 @@ export default {
deviceTypeTreeProps: { deviceTypeTreeProps: {
children: 'children', children: 'children',
label: 'typeName', label: 'typeName',
// multiple: false, multiple: false,
value: 'typeId', value: 'typeId',
// multiple: true, // multiple: true,
}, },
@ -665,14 +681,14 @@ export default {
this.deviceTypeTree = res.data this.deviceTypeTree = res.data
// console.log('🚀 ~ getUseTypeTreee ~ this.deviceTypeTree:', this.deviceTypeTree) // console.log('🚀 ~ getUseTypeTreee ~ this.deviceTypeTree:', this.deviceTypeTree)
// 3 // 4
const recursion = (data, level = 1) => { const recursion = (data, level = 1) => {
if (data) { if (data) {
data.forEach((item) => { data.forEach((item) => {
if (item.children) { if (item.children) {
recursion(item.children, level + 1) recursion(item.children, level + 1)
} }
if (level == 3) { if (level == 4) {
delete item.children delete item.children
} }
}) })
@ -1104,8 +1120,8 @@ export default {
/////// ///////
async deviceTypeChange(val) { async deviceTypeChange(val) {
this.queryParams.typeId = '' this.queryParams.typeId = ''
this.typeListDev = [] // this.typeListDev = []
// console.log('🚀 ~ deviceTypeChange ~ val:', val) console.log('🚀 ~ deviceTypeChange ~ valtttttttttttt:', val)
this.$nextTick(() => { this.$nextTick(() => {
const deviceTypeList = this.$refs.deviceTypeCascader.getCheckedNodes() const deviceTypeList = this.$refs.deviceTypeCascader.getCheckedNodes()
console.log('🚀 ~ deviceTypeChange ~ deviceTypeList:', deviceTypeList[0]) console.log('🚀 ~ deviceTypeChange ~ deviceTypeList:', deviceTypeList[0])
@ -1117,6 +1133,26 @@ export default {
// useNum: deviceTypeList[0].data.num, // useNum: deviceTypeList[0].data.num,
typeName: deviceTypeList[0].data.typeName, typeName: deviceTypeList[0].data.typeName,
} }
// if (val.length > 0) {
// const items = val.map((e) => {
// return e[3]
// })
// console.log("tttttttttttttt",items)
// for (let i in items) {
// for (let z in deviceTypeList) {
// if (deviceTypeList[z].data.typeId == items[i]) {
// let { id,} = deviceTypeList[z].data
// const isRepeat = this.leaseApplyDetails.some((e) => e.typeId === id)
// if (!isRepeat) {
// this.getMaTypeDataByIdFun(deviceTypeList[z].data)
// }
// }
// }
// }
// }
// console.log('🚀 ~ deviceTypeChange ~ this.selectParams:', this.selectParams) // console.log('🚀 ~ deviceTypeChange ~ this.selectParams:', this.selectParams)
this.getMaTypeDataByIdFun(val[val.length-1]) this.getMaTypeDataByIdFun(val[val.length-1])
}) })
@ -1129,65 +1165,21 @@ export default {
// if (val.length > 0) { // if (val.length > 0) {
// const items = val.map((e) => { // const items = val.map((e) => {
// return e[3] // return e[3]
// })x // })
// for (let i in items) { // for (let i in items) {
// for (let z in deviceTypeList) { // for (let z in deviceTypeList) {
// if (deviceTypeList[z].data.typeId == items[i]) { // if (deviceTypeList[z].data.typeId == items[i]) {
// let { num, companyId, typeId, unitNames } = // this.getMaTypeDataByIdFun(val[val.length-1])
// deviceTypeList[z].data
// tempList.push({
// createBy: this.createBy,
// typeId,
// preNum: num,
// num,
// companyId,
// unitNames,
// useNum: num,
// typeName: deviceTypeList[z].pathLabels[2],
// typeCode: deviceTypeList[z].pathLabels[3],
// })
// break
// } // }
// } // }
// } // }
// const newDataList = [...this.leaseApplyDetails, ...tempList]
// const map = new Map()
// for (let item of newDataList) {
// if (!map.has(item.typeId * 1)) {
// map.set(item.typeId * 1, item)
// }
// }
// const newArray = [...map.values()]
// console.log(newArray, 'newArray', items, 'items')
// let newArray_array = []
// items.forEach((e) => {
// newArray.forEach((j) => {
// if (e == j.typeId) {
// newArray_array.push(j)
// }
// })
// })
// this.leaseApplyDetails = newArray_array
// } else {
// this.leaseApplyDetails = []
// } // }
}, },
// //
async getMaTypeDataByIdFun(val) { async getMaTypeDataByIdFun(val) {
const res = await getFourMaTypeList({ id: val, agreementId: this.queryParams.agreementId }) console.log("yyyyyyyyyyy",val)
this.typeListDev = res.data const res = await getFourMaTypeListTwo({ id: val, agreementId: this.queryParams.agreementId })
console.log('🚀 ~ getMaTypeDataByIdFun ~ res:', res) const selectType = res.data
},
//
async changeType(e) {
console.log('🚀 ~ changeType ~ e:', e)
if (!e) return
//
const selectType = this.typeListDev.find((item) => item.id == e)
console.log('🚀 ~ changeType ~ selectType:', selectType)
this.selectParams.typeId = selectType.id this.selectParams.typeId = selectType.id
this.selectParams.typeCode = selectType.name this.selectParams.typeCode = selectType.name
this.selectParams.unitNames = selectType.unit this.selectParams.unitNames = selectType.unit
@ -1207,15 +1199,44 @@ export default {
this.$message.error('当前设备已添加,不可重复添加!') this.$message.error('当前设备已添加,不可重复添加!')
return return
} }
// const { data: outNum } = await getPreAuditNum({
// typeId: selectType.id, this.leaseApplyDetails.unshift({ ...this.selectParams })
// agreementId: this.queryParams.agreementId,
// })
// console.log('🚀 ~ deviceTypeChange ~ outNum:', outNum)
// this.selectParams.outNum = outNum
this.leaseApplyDetails.push({ ...this.selectParams })
console.log('🚀 ~ changeType ~ this.leaseApplyDetails:', this.leaseApplyDetails)
}, },
// //
// async changeType(e) {
// console.log('🚀 ~ changeType ~ e:', e)
// if (!e) return
// //
// const selectType = this.typeListDev.find((item) => item.id == e)
// console.log('🚀 ~ changeType ~ selectType:', selectType)
// this.selectParams.typeId = selectType.id
// this.selectParams.typeCode = selectType.name
// this.selectParams.unitNames = selectType.unit
// this.selectParams.num = selectType.num
// this.selectParams.preNum = selectType.num
// this.selectParams.useNum = selectType.num
// this.selectParams.numList = []
// this.selectParams.numIds = []
// this.selectParams.standardIds = []
// this.selectParams.passMaCodeDtoList = []
// this.selectParams.manageType = selectType.manageType
// console.log('🚀 ~ changeType ~ this.selectParams:', this.selectParams)
// //
// const isRepeat = this.leaseApplyDetails.find((item) => item.typeId == selectType.id)
// // console.log('🚀 ~ changeType ~ isRepeat:', isRepeat)
// if (isRepeat) {
// this.$message.error('')
// return
// }
// // const { data: outNum } = await getPreAuditNum({
// // typeId: selectType.id,
// // agreementId: this.queryParams.agreementId,
// // })
// // console.log('🚀 ~ deviceTypeChange ~ outNum:', outNum)
// // this.selectParams.outNum = outNum
// this.leaseApplyDetails.push({ ...this.selectParams })
// console.log('🚀 ~ changeType ~ this.leaseApplyDetails:', this.leaseApplyDetails)
// },
//// ////
handelTableItemData(node) { handelTableItemData(node) {
const template = JSON.parse(JSON.stringify(this.leaseApplyDetailsItem)) const template = JSON.parse(JSON.stringify(this.leaseApplyDetailsItem))