功能优化

This commit is contained in:
hongchao 2025-04-01 18:57:34 +08:00
parent 16a6e7897b
commit 4dd2027580
4 changed files with 101 additions and 18 deletions

View File

@ -373,6 +373,18 @@ export function getMaTypeDataById(data) {
data, data,
}) })
} }
// 根据二级id 查4级规格类型
export function getMaTypeDataByIdTwo(data) {
return request({
url: '/material/select/getMaTypeDataByIdTwo',
method: 'post',
headers: {
repeatSubmit: false,
},
data,
})
}
export function getFourMaTypeList(data) { export function getFourMaTypeList(data) {
return request({ return request({
url: '/material/select/getFourMaTypeList', url: '/material/select/getFourMaTypeList',

View File

@ -62,7 +62,7 @@
<el-cascader <el-cascader
:key="propsKey" :key="propsKey"
v-model="deviceType" v-model="deviceType"
:show-all-levels="false" :show-all-levels="true"
:options="deviceTypeTree" :options="deviceTypeTree"
:props="deviceTypeTreeProps" :props="deviceTypeTreeProps"
filterable filterable
@ -199,7 +199,20 @@
<el-table-column align="center" prop="typeName" label="机具名称" /> <el-table-column align="center" prop="typeName" label="机具名称" />
<el-table-column align="center" label="规格型号" prop="deviceType" /> <el-table-column align="center" label="规格型号" prop="deviceType" />
<el-table-column align="center" label="设备所属" prop="deviceAscription" /> <el-table-column align="center" label="设备所属" prop="deviceAscription" />
<el-table-column label="预领数量" prop="deviceNum" align="center" /> <el-table-column label="预领数量" prop="preNum" align="center" >
<template slot-scope="scope">
<el-input
v-if="isView"
v-model.number="scope.row.preNum"
placeholder="请输入预领数量"
type="number"
min="1"
clearable
style="width: 100%"
/>
<span v-else>{{ scope.row.preNum }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="库存数量" prop="num" /> <el-table-column align="center" label="库存数量" prop="num" />
<el-table-column align="center" label="是否管理库存"> <el-table-column align="center" label="是否管理库存">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
@ -564,11 +577,11 @@ export default {
// this.getList(); // this.getList();
if (this.$route.query.taskId && !this.$route.query.isBack) { if (this.$route.query.taskId && !this.$route.query.isBack) {
console.log('查看') console.log('查看')
this.GetTaskDetail(this.$route.query.taskId) await this.GetTaskDetail(this.$route.query.taskId)
} }
if (this.$route.query.taskId && this.$route.query.isBack) { if (this.$route.query.taskId && this.$route.query.isBack) {
console.log('驳回提交查看') console.log('驳回提交查看')
this.GetTaskDetail2(this.$route.query.taskId) await this.GetTaskDetail2(this.$route.query.taskId)
} }
// this.taskId = this.$route.query.taskId // this.taskId = this.$route.query.taskId
// this.isEdit = this.$route.query.isEdit // this.isEdit = this.$route.query.isEdit
@ -594,7 +607,7 @@ export default {
}) })
} else { } else {
this.GetDeviceTypeTree() await this.GetDeviceTypeTree()
} }
// console.log(typeof(this.isEdit)) // console.log(typeof(this.isEdit))
@ -739,6 +752,7 @@ export default {
}) })
this.deviceType = selectList this.deviceType = selectList
this.propsKey++ this.propsKey++
await this.$nextTick();
if (data.ctLeaseApplyDetails) { if (data.ctLeaseApplyDetails) {
this.getCtFileList(data.ctLeaseApplyDetails) this.getCtFileList(data.ctLeaseApplyDetails)
@ -775,7 +789,16 @@ export default {
return this.handelEchoData(item) return this.handelEchoData(item)
}) })
let selectList = []
this.leaseApplyDetails.forEach((e) => {
selectList.push(this.getParentsById(this.deviceTypeTree, e.typeId))
})
this.deviceType = selectList
this.propsKey++
await this.$nextTick();
if (data.ctLeaseApplyDetails) { if (data.ctLeaseApplyDetails) {
this.
this.getCtFileList(data.ctLeaseApplyDetails) this.getCtFileList(data.ctLeaseApplyDetails)
} }
}, },
@ -793,19 +816,34 @@ export default {
} }
ctList.forEach((e) => { ctList.forEach((e) => {
queryCompleteSetToolsApi(e).then((res) => { // queryCompleteSetToolsApi(e).then((res) => {
e.childrenList = res.data.map((j) => { // e.childrenList = res.data.map((j) => {
return { // return {
...j, // ...j,
initNum: j.deviceNum, // initNum: j.deviceNum,
} // preNum: j.preNum,
}) // }
// })
e.childrenList.forEach((i) => { // e.childrenList.forEach((i) => {
i.deviceNum = i.initNum * e.wholeTypeNum // i.deviceNum = i.initNum * e.wholeTypeNum
}) // })
this.wholeTypeNameList.push(e) // this.wholeTypeNameList.push(e)
// })
e.childrenList = ctData[e.wholeTypeName].map((j) => {
console.log("pppppppp",j)
return {
...j,
initNum: j.deviceNum,
preNum: j.preNum,
}
}) })
e.childrenList.forEach((i) => {
i.deviceNum = i.initNum * e.wholeTypeNum
i.preNum = Number(i.preNum )
})
this.wholeTypeNameList.push(e)
console.log("hhhhhhhhhhhh",this.wholeTypeNameList)
}) })
}, },
// //
@ -1184,6 +1222,7 @@ export default {
wholeTypeNameData.childrenList = res.data.map((e) => { wholeTypeNameData.childrenList = res.data.map((e) => {
return { return {
...e, ...e,
preNum: e.deviceNum,
initNum: e.deviceNum, initNum: e.deviceNum,
} }
}) })
@ -1205,7 +1244,10 @@ export default {
/* 更改数量 */ /* 更改数量 */
onChangeInput(val, v) { onChangeInput(val, v) {
this.wholeTypeNameList[v].childrenList.forEach((e) => (e.deviceNum = e.initNum * val)) console.log("sssssssssss",this.wholeTypeNameList),
this.wholeTypeNameList[v].childrenList.forEach((e) => (
console.log("uuuuuuuuuu",e),
e.deviceNum = e.deviceNum * val,e.preNum = e.preNum * val))
}, },
// //
async getMaTypeDataByIdFun(val) { async getMaTypeDataByIdFun(val) {

View File

@ -305,6 +305,7 @@ import {
getHoldingPoleSelListApi, getHoldingPoleSelListApi,
getLevelTwoUnitCbx, getLevelTwoUnitCbx,
getMaTypeDataById, getMaTypeDataById,
getMaTypeDataByIdTwo,
} from '@/api/claimAndRefund/receive' } from '@/api/claimAndRefund/receive'
import { getInfo } from '@/api/login' import { getInfo } from '@/api/login'
export default { export default {
@ -726,7 +727,8 @@ export default {
console.log('🚀 ~ 以大代小 ~ item:') console.log('🚀 ~ 以大代小 ~ item:')
// //
if (item.isReplace == 1) { if (item.isReplace == 1) {
getMaTypeDataById({ id: item.maTypeId }).then((res) => { console.log("xxxxxxxxxxxx",item)
getMaTypeDataByIdTwo({ id: item.levelTwoId }).then((res) => {
console.log('🚀 ~ this.leaseApplyDetails.forEach ~ res:', res) console.log('🚀 ~ this.leaseApplyDetails.forEach ~ res:', res)
this.$set(item, 'isReplaceOpt', res.data) this.$set(item, 'isReplaceOpt', res.data)
}) })
@ -826,6 +828,7 @@ export default {
template.maTypeId = item.maTypeId template.maTypeId = item.maTypeId
template.replaceTypeId = item.replaceTypeId template.replaceTypeId = item.replaceTypeId
template.maModel = item.maModel template.maModel = item.maModel
template.levelTwoId = item.levelTwoId
return template return template
}, },

View File

@ -289,6 +289,20 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="12">
<el-form-item label="查看全量数据" prop="isView">
<el-radio-group v-model="form.isView">
<el-radio
v-for="dict in viewStatus"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}</el-radio
>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -485,6 +499,13 @@ export default {
trigger: 'blur', trigger: 'blur',
}, },
], ],
isView: [
{
required: true,
message: '是否可查看全量数据为必填项',
trigger: ['change'],
},
],
}, },
// //
addCompanyVisible: false, addCompanyVisible: false,
@ -496,6 +517,10 @@ export default {
enterpriseOwnershipCode: '', enterpriseOwnershipCode: '',
}, },
], ],
viewStatus: [
{ label: '是', value: '0' },
{ label: '否', value: '1' },
],
userId: sessionStorage.getItem('userId'), userId: sessionStorage.getItem('userId'),
ENV: process.env.VUE_APP_ENV, // 线 ENV: process.env.VUE_APP_ENV, // 线
@ -577,6 +602,7 @@ export default {
phone: undefined, phone: undefined,
email: undefined, email: undefined,
status: '0', status: '0',
isView: '0',
} }
this.resetForm('form') this.resetForm('form')
}, },