bug修复
This commit is contained in:
parent
96d8b38824
commit
bab70ad628
|
|
@ -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) {
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -116,15 +116,6 @@
|
|||
<el-option v-for="item in holdingPoleSelList" :key="item.id" :label="item.wholeTypeName" :value="item.id" />
|
||||
</el-select>
|
||||
</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-input
|
||||
maxlength="50"
|
||||
|
|
@ -161,7 +152,16 @@
|
|||
<el-option v-for="(item, index) in costBearingList" :key="index" :label="item" :value="item"></el-option>
|
||||
</el-select>
|
||||
</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
|
||||
maxlength="100"
|
||||
v-model="queryParams.leaseApplyInfo.remark"
|
||||
|
|
@ -511,6 +511,13 @@ export default {
|
|||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
estimateLeaseTime: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择预计领料时间',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
// leasePerson: [
|
||||
// {
|
||||
// required: true, message: '请输入领料人', trigger: 'blur',
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@
|
|||
|
||||
<!-- 编码出库 -->
|
||||
<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>
|
||||
<br />
|
||||
<br />
|
||||
|
|
@ -305,7 +305,7 @@
|
|||
</el-form-item>
|
||||
</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-input v-model="outQuery.maCode" maxlength="20" />
|
||||
</el-form-item>
|
||||
|
|
@ -362,7 +362,7 @@
|
|||
|
||||
<!-- 数量出库 -->
|
||||
<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;">
|
||||
待出库数量:{{outNum}}
|
||||
</span>-->
|
||||
|
|
@ -644,6 +644,24 @@ export default {
|
|||
},
|
||||
showSelect: true,
|
||||
rowTemp: {}, // 临时存储行数据
|
||||
queryRules: {
|
||||
createTime: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择出库时间',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
},
|
||||
queryRulesNum: {
|
||||
createTime: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择出库时间',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
@ -822,53 +840,66 @@ export default {
|
|||
},
|
||||
//编码出库保存
|
||||
saveCodeOut() {
|
||||
if (this.maCodeList.length <= this.outObj.outNum) {
|
||||
let params = this.maCodeList.map((item) => {
|
||||
let obj = {
|
||||
id: this.outObj.id,
|
||||
maId: item,
|
||||
manageType: 0,
|
||||
carCode: this.codeOutForm.carCode,
|
||||
remark: this.codeOutForm.remark,
|
||||
typeId: this.outObj.typeId,
|
||||
parentId: this.outObj.parentId,
|
||||
outNum: 1,
|
||||
taskId: this.outObj.taskId,
|
||||
leaseType: this.leaseType,
|
||||
maModel: this.outObj.maModel,
|
||||
maName: this.outObj.maName,
|
||||
createTime: this.codeOutForm.createTime,
|
||||
// remark: this.outCodeList.find((v) => v.maId == item).remark,
|
||||
}
|
||||
return obj
|
||||
})
|
||||
this.$refs.codeOutForm.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
} else {
|
||||
if (this.maCodeList.length <= this.outObj.outNum) {
|
||||
let params = this.maCodeList.map((item) => {
|
||||
let obj = {
|
||||
id: this.outObj.id,
|
||||
maId: item,
|
||||
manageType: 0,
|
||||
carCode: this.codeOutForm.carCode,
|
||||
remark: this.codeOutForm.remark,
|
||||
typeId: this.outObj.typeId,
|
||||
parentId: this.outObj.parentId,
|
||||
outNum: 1,
|
||||
taskId: this.outObj.taskId,
|
||||
leaseType: this.leaseType,
|
||||
maModel: this.outObj.maModel,
|
||||
maName: this.outObj.maName,
|
||||
createTime: this.codeOutForm.createTime,
|
||||
// remark: this.outCodeList.find((v) => v.maId == item).remark,
|
||||
}
|
||||
return obj
|
||||
})
|
||||
|
||||
console.log(params, '编码出库时参数')
|
||||
// console.log(params)
|
||||
submitOut(params).then((response) => {
|
||||
this.$modal.msgSuccess('出库成功')
|
||||
this.openCode = false
|
||||
this.handleDialogQuery()
|
||||
this.handleQuery()
|
||||
})
|
||||
} else {
|
||||
this.$modal.msgError('所选机具编码已超出出库数量!')
|
||||
}
|
||||
console.log(params, '编码出库时参数')
|
||||
// console.log(params)
|
||||
submitOut(params).then((response) => {
|
||||
this.$modal.msgSuccess('出库成功')
|
||||
this.openCode = false
|
||||
this.handleDialogQuery()
|
||||
this.handleQuery()
|
||||
})
|
||||
} else {
|
||||
this.$modal.msgError('所选机具编码已超出出库数量!')
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//数量出库保存
|
||||
saveNumOut() {
|
||||
this.outNumList[0].carCode = this.numOutForm.carCode
|
||||
this.outNumList[0].remark = this.numOutForm.remark
|
||||
this.outNumList[0].createTime = this.numOutForm.createTime
|
||||
this.outNumList[0].leaseType = this.leaseType
|
||||
let param = this.outNumList
|
||||
// console.log(param, '数量出库时参数')
|
||||
submitNumOut(param).then((response) => {
|
||||
this.$modal.msgSuccess('出库成功')
|
||||
this.openNum = false
|
||||
this.handleDialogQuery()
|
||||
this.handleQuery()
|
||||
this.$refs.numOutForm.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
} else{
|
||||
this.outNumList[0].carCode = this.numOutForm.carCode
|
||||
this.outNumList[0].remark = this.numOutForm.remark
|
||||
this.outNumList[0].createTime = this.numOutForm.createTime
|
||||
this.outNumList[0].leaseType = this.leaseType
|
||||
let param = this.outNumList
|
||||
// console.log(param, '数量出库时参数')
|
||||
submitNumOut(param).then((response) => {
|
||||
this.$modal.msgSuccess('出库成功')
|
||||
this.openNum = false
|
||||
this.handleDialogQuery()
|
||||
this.handleQuery()
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
//输入出库数量
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
<el-form-item label="协议号" prop="agreementCode">
|
||||
<el-input v-model="queryParams.agreementCode" disabled style="width: 240px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型名称" prop="status">
|
||||
<!-- <el-form-item label="类型名称" prop="status">
|
||||
<el-cascader
|
||||
:key="propsKey"
|
||||
v-model="deviceType"
|
||||
|
|
@ -57,8 +57,8 @@
|
|||
popper-class="popper-select"
|
||||
@change="deviceTypeChange"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="typeId">
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="规格型号" prop="typeId">
|
||||
<el-select
|
||||
v-model="queryParams.typeId"
|
||||
filterable
|
||||
|
|
@ -74,6 +74,22 @@
|
|||
:value="item.id"
|
||||
></el-option>
|
||||
</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 label="退料人" prop="backPerson">
|
||||
<el-input
|
||||
|
|
@ -136,33 +152,33 @@
|
|||
>导出</el-button> -->
|
||||
</el-col>
|
||||
</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 label="序号" type="index" min-width="120" />
|
||||
<el-table-column
|
||||
label="机具名称"
|
||||
prop="typeName"
|
||||
min-width="200"
|
||||
min-width="150"
|
||||
align="center"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="规格型号"
|
||||
prop="typeCode"
|
||||
min-width="200"
|
||||
min-width="150"
|
||||
align="center"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<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="manageType" min-width="180">
|
||||
<el-table-column label="退料方式" align="center" prop="manageType" min-width="130">
|
||||
<template slot-scope="{ row }">
|
||||
<span>{{ row.manageType == '0' ? '编码退料' : '数量退料' }}</span>
|
||||
</template>
|
||||
</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 }">
|
||||
<span v-if="row.manageType == 1">{{
|
||||
Number(row.maintenanceNum || 0) + Number(row.passNum || 0)
|
||||
|
|
@ -208,7 +224,7 @@
|
|||
<span v-else>{{ calculateDifference(row) }}</span>
|
||||
</template>
|
||||
</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">
|
||||
<el-input
|
||||
v-model="scope.row.remark"
|
||||
|
|
@ -335,7 +351,7 @@ import {
|
|||
getUseNumByTypeId,
|
||||
getTaskDetail,
|
||||
submitUpdateBackApply,
|
||||
getFourMaTypeList,
|
||||
getFourMaTypeListTwo,
|
||||
getPreAuditNum,
|
||||
} from '@/api/claimAndRefund/receive'
|
||||
import { submitBackApplyApi, getMachineById } from '@/api/claimAndRefund/return'
|
||||
|
|
@ -532,7 +548,7 @@ export default {
|
|||
deviceTypeTreeProps: {
|
||||
children: 'children',
|
||||
label: 'typeName',
|
||||
// multiple: false,
|
||||
multiple: false,
|
||||
value: 'typeId',
|
||||
// multiple: true,
|
||||
},
|
||||
|
|
@ -665,14 +681,14 @@ export default {
|
|||
this.deviceTypeTree = res.data
|
||||
// console.log('🚀 ~ getUseTypeTreee ~ this.deviceTypeTree:', this.deviceTypeTree)
|
||||
|
||||
// 递归循环 只要前3级
|
||||
// 递归循环 只要前4级
|
||||
const recursion = (data, level = 1) => {
|
||||
if (data) {
|
||||
data.forEach((item) => {
|
||||
if (item.children) {
|
||||
recursion(item.children, level + 1)
|
||||
}
|
||||
if (level == 3) {
|
||||
if (level == 4) {
|
||||
delete item.children
|
||||
}
|
||||
})
|
||||
|
|
@ -1104,8 +1120,8 @@ export default {
|
|||
/////// 设备类型树 切换
|
||||
async deviceTypeChange(val) {
|
||||
this.queryParams.typeId = ''
|
||||
this.typeListDev = []
|
||||
// console.log('🚀 ~ deviceTypeChange ~ val:', val)
|
||||
// this.typeListDev = []
|
||||
console.log('🚀 ~ deviceTypeChange ~ valtttttttttttt:', val)
|
||||
this.$nextTick(() => {
|
||||
const deviceTypeList = this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
console.log('🚀 ~ deviceTypeChange ~ deviceTypeList:', deviceTypeList[0])
|
||||
|
|
@ -1117,8 +1133,28 @@ export default {
|
|||
// useNum: deviceTypeList[0].data.num,
|
||||
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)
|
||||
this.getMaTypeDataByIdFun(val[val.length - 1])
|
||||
this.getMaTypeDataByIdFun(val[val.length-1])
|
||||
})
|
||||
// console.log(val, '*******************')
|
||||
|
||||
|
|
@ -1129,65 +1165,21 @@ export default {
|
|||
// if (val.length > 0) {
|
||||
// const items = val.map((e) => {
|
||||
// return e[3]
|
||||
// })x
|
||||
// })
|
||||
// for (let i in items) {
|
||||
// for (let z in deviceTypeList) {
|
||||
// if (deviceTypeList[z].data.typeId == items[i]) {
|
||||
// let { num, companyId, typeId, unitNames } =
|
||||
// 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
|
||||
// this.getMaTypeDataByIdFun(val[val.length-1])
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// 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) {
|
||||
const res = await getFourMaTypeList({ id: val, agreementId: this.queryParams.agreementId })
|
||||
this.typeListDev = res.data
|
||||
console.log('🚀 ~ getMaTypeDataByIdFun ~ res:', res)
|
||||
},
|
||||
// 选择规格型号
|
||||
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)
|
||||
console.log("yyyyyyyyyyy",val)
|
||||
const res = await getFourMaTypeListTwo({ id: val, agreementId: this.queryParams.agreementId })
|
||||
const selectType = res.data
|
||||
this.selectParams.typeId = selectType.id
|
||||
this.selectParams.typeCode = selectType.name
|
||||
this.selectParams.unitNames = selectType.unit
|
||||
|
|
@ -1207,15 +1199,44 @@ export default {
|
|||
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)
|
||||
|
||||
this.leaseApplyDetails.unshift({ ...this.selectParams })
|
||||
},
|
||||
// // 选择规格型号
|
||||
// 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) {
|
||||
const template = JSON.parse(JSON.stringify(this.leaseApplyDetailsItem))
|
||||
|
|
@ -1402,11 +1423,11 @@ export default {
|
|||
<style lang="scss">
|
||||
.popper-select {
|
||||
.el-cascader-panel .el-scrollbar .el-checkbox {
|
||||
display: none;
|
||||
}
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-cascader-panel .el-scrollbar:nth-child(4) .el-checkbox {
|
||||
display: block !important;
|
||||
}
|
||||
.el-cascader-panel .el-scrollbar:nth-child(4) .el-checkbox {
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue