diff --git a/src/api/claimAndRefund/receive.js b/src/api/claimAndRefund/receive.js
index cfa3d34..aaf90e5 100644
--- a/src/api/claimAndRefund/receive.js
+++ b/src/api/claimAndRefund/receive.js
@@ -373,6 +373,16 @@ export function getMaTypeDataById(data) {
data,
})
}
+export function getFourMaTypeList(data) {
+ return request({
+ url: '/material/select/getFourMaTypeList',
+ method: 'post',
+ headers: {
+ repeatSubmit: false,
+ },
+ data,
+ })
+}
// 获取预退数量
export function getPreAuditNum(params) {
diff --git a/src/views/claimAndreturn/picking/auditing/component/EditPicking.vue b/src/views/claimAndreturn/picking/auditing/component/EditPicking.vue
index efc5e89..b9129bf 100644
--- a/src/views/claimAndreturn/picking/auditing/component/EditPicking.vue
+++ b/src/views/claimAndreturn/picking/auditing/component/EditPicking.vue
@@ -57,17 +57,20 @@
-
+
+ 导出
+ -->
@@ -177,16 +180,22 @@
-
+
+
+
+ 是
+ 否
+
+
-
-
+
+
-
+
删除
-
+
@@ -253,6 +257,13 @@
+
+
+
+
+
+
+
{
+ let selectList = []
+ this.leaseApplyDetails.forEach((e) => {
+ selectList.push(this.getParentsById(this.deviceTypeTree, e.typeId))
+ })
+ this.$nextTick(() => {
+ this.deviceType = selectList
+ this.propsKey++
+ })
+ })
} else {
this.GetDeviceTypeTree()
}
+
+ // console.log(typeof(this.isEdit))
+ // this.$set('isEdit',this.$route.query.isEdit)
},
methods: {
@@ -639,6 +674,12 @@ export default {
} else {
this.queryParams.agreementId = res.data.agreementId
this.queryParams.agreementCode = res.data.agreementCode
+
+ // // 1. 判断当前协议对应的工程是否结算
+
+ // getAgreementInfoByIdApi({
+ // agreementId: res.data.agreementId,
+ // })
}
}
},
@@ -648,6 +689,11 @@ export default {
const res = await getLeaseApplyListAll({ taskId })
const data = res.rows[0]
+
+ // unitId:null,
+ // proId:null,
+ // agreementId:null, //协议id
+ // agreementCode: null,
if (data.taskStatus == 100) {
this.queryParams.taskStatus = 32
this.queryParams.examineStatusId = '32'
@@ -655,21 +701,26 @@ export default {
this.queryParams.unitId = data.unitId
this.queryParams.costBearingParty = data.costBearingParty
this.queryParams.proId = data.proId
- this.queryParams.leaseApplyInfo.phone = data.leaseApplyInfoList[0].phone
- this.queryParams.leaseApplyInfo.leasePerson = data.leaseApplyInfoList[0].leasePerson
+ this.queryParams.leaseApplyInfo.phone = data.leaseApplyInfoList[0]?.phone
+ this.queryParams.leaseApplyInfo.leasePerson = data.leaseApplyInfoList[0]?.leasePerson
this.queryParams.agreementCode = data.agreementCode
this.queryParams.agreementId = data.agreementId
this.queryParams.estimateLeaseTime = data.estimateLeaseTime
+ this.queryParams.wholeTypeName = data.wholeTypeName
// this.queryParams.leaseType = data.leaseType
this.$set(this.queryParams, 'leaseType', data.leaseType)
- this.queryParams.leaseApplyInfo.remark = data.leaseApplyInfoList[0].remark
+ this.queryParams.leaseApplyInfo.remark = data.leaseApplyInfoList[0]?.remark
this.leaseApplyInfoList = data.leaseApplyInfoList
- this.leaseApplyDetails = data.leaseApplyDetails.map((item) => {
+ this.leaseApplyDetails = data.leaseApplyDetails?.map((item) => {
return this.handelEchoData(item)
})
+
+ if (data.ctLeaseApplyDetails) {
+ this.getCtFileList(data.ctLeaseApplyDetails)
+ }
let selectList = []
- this.leaseApplyDetails.forEach((item) => {
+ this.leaseApplyDetails?.forEach((item) => {
try {
selectList.push(this.getParentsById(this.deviceTypeTree, item.typeId))
console.log('🚀 ~ 以大代小 ~ item:')
@@ -689,7 +740,6 @@ export default {
this.deviceType = selectList
this.propsKey++
})
- console.log('🚀 ~ this.leaseApplyDetails:', this.leaseApplyDetails)
},
// 驳回提交 任务详情数据
async GetTaskDetail2(taskId) {
@@ -713,6 +763,7 @@ export default {
this.queryParams.agreementCode = data.agreementCode
this.queryParams.agreementId = data.agreementId
this.queryParams.estimateLeaseTime = data.estimateLeaseTime
+ this.queryParams.wholeTypeName = data.wholeTypeName
// this.queryParams.leaseType = data.leaseType
this.$set(this.queryParams, 'leaseType', data.leaseType)
this.queryParams.leaseApplyInfo.remark = data.leaseApplyInfoList[0].remark
@@ -720,6 +771,39 @@ export default {
this.leaseApplyDetails = data.leaseApplyDetails.map((item) => {
return this.handelEchoData(item)
})
+
+ if (data.ctLeaseApplyDetails) {
+ this.getCtFileList(data.ctLeaseApplyDetails)
+ }
+ },
+
+ // 生成成套附属设备
+ getCtFileList(ctData) {
+ const ctList = []
+ for (const key in ctData) {
+ ctList.push({
+ wholeTypeName: key,
+ wholeTypeNum: ctData[key][0].setsNum,
+ childrenList: [],
+ id: ctData[key][0].ctParentId,
+ })
+ }
+
+ ctList.forEach((e) => {
+ queryCompleteSetToolsApi(e).then((res) => {
+ e.childrenList = res.data.map((j) => {
+ return {
+ ...j,
+ initNum: j.deviceNum,
+ }
+ })
+
+ e.childrenList.forEach((i) => {
+ i.deviceNum = i.initNum * e.wholeTypeNum
+ })
+ this.wholeTypeNameList.push(e)
+ })
+ })
},
//生成回显数据
handelEchoData(item) {
@@ -814,8 +898,8 @@ export default {
try {
this.queryParams.leaseApplyDetails.forEach((item) => {
// if (item.num == 0) {
- // this.$message.error('机具类型库存量为零无法领料')
- // throw new Error()
+ // this.$message.error('机具类型库存量为零无法领料')
+ // throw new Error()
// }
if (item.preNum == '') {
this.$message.error('请填写预领数量')
@@ -827,6 +911,14 @@ export default {
}
}
+ const submitQueryParams = JSON.parse(JSON.stringify(this.queryParams))
+
+ if (submitQueryParams.leaseApplyDetails.length > 0) {
+ submitQueryParams.leaseApplyDetails.forEach((e) => {
+ e.isCt = 1
+ })
+ }
+
if (this.wholeTypeNameList.length > 0) {
const wholeTypeList = []
this.wholeTypeNameList.forEach((i) => {
@@ -837,14 +929,18 @@ export default {
preNum: e.deviceNum,
typeCn: e.typeName,
typeId: e.deviceTypeId,
- wholeName: i.wholeName,
+ wholeTypeName: i.wholeTypeName,
+ isCt: 0,
+ ctParentId: i.id,
+ setsNum: i.wholeTypeNum,
}
- wholeTypeList.push(items)
+ // wholeTypeList.push(items)
+ submitQueryParams.leaseApplyDetails.push(items)
})
})
- this.queryParams.leaseApplyDetails = wholeTypeList
+ // this.queryParams.leaseApplyDetails = wholeTypeList
}
if (!canSave) {
@@ -868,16 +964,43 @@ export default {
if (this.rejectTaskStatus == 100) {
this.queryParams.souceByRefuse = 1
}
- const params = {
- ...this.queryParams,
- taskId: this.taskId,
- leaseApplyInfoList: this.leaseApplyInfoList,
+
+ const params = JSON.parse(JSON.stringify(this.queryParams))
+ params.taskId = this.taskId
+ params.leaseApplyInfoList = this.leaseApplyInfoList
+ params.leaseApplyDetails.forEach((e) => {
+ e.isCt = 1
+ })
+ if (this.wholeTypeNameList.length > 0) {
+ const wholeTypeList = []
+ this.wholeTypeNameList.forEach((i) => {
+ i.childrenList.forEach((e) => {
+ const items = {
+ companyId: '101',
+ guigeCn: e.deviceType,
+ preNum: e.deviceNum,
+ typeCn: e.typeName,
+ typeId: e.deviceTypeId,
+ wholeTypeName: i.wholeTypeName,
+ isCt: 0,
+ ctParentId: i.id,
+ setsNum: i.wholeTypeNum,
+ }
+
+ // wholeTypeList.push(items)
+ params.leaseApplyDetails.push(items)
+ })
+ })
+
+ // this.queryParams.leaseApplyDetails = wholeTypeList
}
res = await editLeaseApply(params)
} else {
// console.log(this.queryParams)
- res = await submitLeaseApply(this.queryParams)
+
+ console.log('submitQueryParams', submitQueryParams)
+ res = await submitLeaseApply(submitQueryParams)
}
if (res.code == 200) {
this.$message({
@@ -900,6 +1023,7 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
+ console.log('🚀 ~ handleDelete ~ row:', row)
// this.deviceType.forEach((e, index) => {
// if (e[3] === row.typeId) {
// this.deviceType.splice(index, 1)
@@ -925,10 +1049,13 @@ export default {
},
/////// 设备类型树 切换
deviceTypeChange(val) {
+ console.log('🚀 ~ deviceTypeChange ~ val:', val)
this.queryParams.typeId = ''
this.typeListDev = []
+ // console.log('🚀 ~ deviceTypeChange ~ val:', val)
this.$nextTick(() => {
const deviceTypeList = this.$refs.deviceTypeCascader.getCheckedNodes()
+ console.log('🚀 ~ deviceTypeChange ~ deviceTypeList:', deviceTypeList[0])
this.selectParams = {
createBy: this.user.name,
companyId: deviceTypeList[0].data.companyId,
@@ -937,94 +1064,37 @@ export default {
typeModelName: deviceTypeList[0].data.label,
maTypeId: deviceTypeList[0].data.id,
}
-
+ console.log('🚀 ~ deviceTypeChange ~ this.selectParams:', this.selectParams)
this.getMaTypeDataByIdFun(val[val.length - 1])
})
- // let tempList = []
// if (val.length > 0) {
- // const items = val.map((e) => {
- // return e[3]
- // })
-
- // const itemsMap = new Map(items.map((item) => [item, true]))
-
- // deviceTypeList.forEach((device) => {
- // console.log('🚀 ~ deviceTypeList.forEach ~ device:', device)
- // if (itemsMap.has(device.data.id)) {
- // const { num, companyId, id, unitName } = device.data
- // tempList.push({
- // createBy: this.user.name,
- // typeId: id,
- // num,
- // companyId,
- // unitCn: unitName,
- // typeCn: device.pathLabels[2],
- // guigeCn: device.pathLabels[3],
- // // 第三级id
- // maTypeId: device.path[2],
- // // 是否以大代小
- // isReplaceId: device.data.isReplaceId,
- // })
- // }
- // })
-
- // const newDataList = [...this.leaseApplyDetails, ...tempList]
- // const map = new Map()
- // for (let item of newDataList) {
- // if (!map.has(item.typeId)) {
- // map.set(item.typeId, item)
- // }
- // }
- // const newArray = [...map.values()]
-
- // let newArray_array = []
- // items.forEach((e) => {
- // newArray.forEach((j) => {
- // if (e == j.typeId) {
- // newArray_array.push(j)
- // }
+ // const items = val.map((e) => {
+ // return e[3]
// })
- // })
- // this.leaseApplyDetails = newArray_array
- // // this.leaseApplyDetails.forEach(async (item) => {
- // // console.log('🚀 ~ this.leaseApplyDetails.forEach ~ item:', item)
- // // try {
- // // if (item.isReplaceOpt) {
- // // return
- // // }
- // // const res = await getMaTypeDataById({ id: item.maTypeId })
- // // this.$set(item, 'isReplaceOpt', res.data)
- // // console.log('🚀 ~ ~ item.isReplaceOpt:', item.isReplaceOpt)
- // // } catch (error) {
- // // console.log('🚀 ~ this.leaseApplyDetails.forEach ~ error:', error)
- // // }
- // // })
+ // for (let i in items) {
+ // for (let z in deviceTypeList) {
+ // if (deviceTypeList[z].data.id === items[i]) {
+ // let { num, companyId, id, unitName } = deviceTypeList[z].data
- // const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
-
- // const promises = this.leaseApplyDetails.map(async (item, index) => {
- // console.log('🚀 ~ this.leaseApplyDetails.forEach ~ item:', item)
- // if (item.isReplaceOpt) {
- // return item
+ // const isRepeat = this.leaseApplyDetails.some((e) => e.typeId === id)
+ // if (!isRepeat) {
+ // this.leaseApplyDetails.push({
+ // createBy: this.user.name,
+ // typeId: id,
+ // num,
+ // companyId,
+ // unitCn: unitName,
+ // typeCn: deviceTypeList[z].pathLabels[2],
+ // guigeCn: deviceTypeList[z].pathLabels[3],
+ // })
+ // }
+ // }
+ // }
// }
- // try {
- // await delay(index * 100) // 每次请求之间延迟100毫秒
- // const res = await getMaTypeDataById({ id: item.maTypeId })
- // this.$set(item, 'isReplaceOpt', res.data)
- // console.log('🚀 ~ ~ item.isReplaceOpt:', item.isReplaceOpt)
- // } catch (error) {
- // console.log('🚀 ~ this.leaseApplyDetails.forEach ~ error:', error)
- // }
- // return item
- // })
-
- // Promise.all(promises).then((results) => {
- // this.leaseApplyDetails = results
- // console.log('All requests completed')
- // })
+ // console.log('🚀 ~ deviceTypeChange ~ this.leaseApplyDetails:', this.leaseApplyDetails)
// } else {
- // this.leaseApplyDetails = []
+ // this.leaseApplyDetails = []
// }
},
// 获取规格型号
@@ -1132,28 +1202,35 @@ export default {
this.holdingPoleSelList = res
},
/* 抱杆成套设备change事件 */
- onChangeWholeTypeName(val) {
- const selLable = this.holdingPoleSelList.find((e) => e.id === val)
- const wholeTypeNameData = {
- id: val,
- wholeName: selLable.wholeName,
- wholeTypeNum: 1,
- childrenList: [],
- }
- queryCompleteSetToolsApi(wholeTypeNameData).then((res) => {
- wholeTypeNameData.childrenList = res.data
- wholeTypeNameData.childrenList.forEach((e) => (e.initNum = e.deviceNum))
- const isREpeat = this.wholeTypeNameList.find((e) => e.id === val)
- if (!isREpeat) {
- this.wholeTypeNameList.push(wholeTypeNameData)
- } else {
- this.$modal.msgError('当前抱杆成套设备已添加,不可重复添加!')
+ async onChangeWholeTypeName(val) {
+ val.forEach((e) => {
+ const selLable = this.holdingPoleSelList.find((j) => j.id === e)
+ const isPush = this.wholeTypeNameList.some((z) => z.id == e)
+
+ if (!isPush) {
+ const wholeTypeNameData = {
+ id: e,
+ wholeTypeName: selLable.wholeTypeName,
+ wholeTypeNum: 1,
+ childrenList: [],
+ }
+
+ queryCompleteSetToolsApi(wholeTypeNameData).then((res) => {
+ wholeTypeNameData.childrenList = res.data.map((e) => {
+ return {
+ ...e,
+ initNum: e.deviceNum,
+ }
+ })
+ this.wholeTypeNameList.push(wholeTypeNameData)
+ })
}
-
- console.log(this.wholeTypeNameList, '处理后的数据---')
})
+ },
- this.queryParams.wholeName = ''
+ // 移除时触发
+ onRemoveTag(val) {
+ this.wholeTypeNameList = this.wholeTypeNameList.filter((e) => e.id != val)
},
/* 删除 */
@@ -1165,6 +1242,34 @@ export default {
onChangeInput(val, v) {
this.wholeTypeNameList[v].childrenList.forEach((e) => (e.deviceNum = e.initNum * val))
},
+ // 获取规格型号
+ async getMaTypeDataByIdFun(val) {
+ const res = await getMaTypeDataById({ id: val })
+ this.typeListDev = res.data.filter((e) => e.isStorage == 1)
+ console.log('🚀 ~ getMaTypeDataByIdFun ~ res:', res)
+ },
+ // 选择规格型号
+ 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.guigeCn = selectType.name
+ this.selectParams.unitCn = selectType.unit
+ this.selectParams.num = selectType.num
+ 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
+ }
+ this.leaseApplyDetails.push({ ...this.selectParams })
+ console.log('🚀 ~ changeType ~ this.leaseApplyDetails:', this.leaseApplyDetails)
+ },
// 以大代小
handleReplaceType(e, row) {
console.log('🚀 ~ handleReplaceType ~ e:', e)
diff --git a/src/views/claimAndreturn/return/receive/component/addReturn1.vue b/src/views/claimAndreturn/return/receive/component/addReturn1.vue
index 586bd00..97a11a6 100644
--- a/src/views/claimAndreturn/return/receive/component/addReturn1.vue
+++ b/src/views/claimAndreturn/return/receive/component/addReturn1.vue
@@ -294,7 +294,7 @@ import {
getUseNumByTypeId,
getTaskDetail,
submitUpdateBackApply,
- getMaTypeDataById,
+ getFourMaTypeList,
getPreAuditNum,
} from '@/api/claimAndRefund/receive'
import { submitBackApplyApi } from '@/api/claimAndRefund/return'
@@ -1079,7 +1079,7 @@ export default {
},
// 获取规格型号
async getMaTypeDataByIdFun(val) {
- const res = await getMaTypeDataById({ id: val })
+ const res = await getFourMaTypeList({ id: val, agreementId: this.queryParams.agreementId })
this.typeListDev = res.data
console.log('🚀 ~ getMaTypeDataByIdFun ~ res:', res)
},
diff --git a/src/views/stquery/deviceStatusRecord.vue b/src/views/stquery/deviceStatusRecord.vue
index 6f4b514..c26e1d5 100644
--- a/src/views/stquery/deviceStatusRecord.vue
+++ b/src/views/stquery/deviceStatusRecord.vue
@@ -140,12 +140,14 @@
align="center"
prop="typeName"
:show-overflow-tooltip="true"
+ width="200"
/>
-->
-
+