领退管理-优化
This commit is contained in:
parent
b279180b62
commit
cafcef6f2e
|
|
@ -373,6 +373,16 @@ export function getMaTypeDataById(data) {
|
||||||
data,
|
data,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function getFourMaTypeList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/material/select/getFourMaTypeList',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
repeatSubmit: false,
|
||||||
|
},
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 获取预退数量
|
// 获取预退数量
|
||||||
export function getPreAuditNum(params) {
|
export function getPreAuditNum(params) {
|
||||||
|
|
|
||||||
|
|
@ -57,17 +57,20 @@
|
||||||
<el-form-item label="协议号" prop="agreementCode">
|
<el-form-item label="协议号" prop="agreementCode">
|
||||||
<el-input maxlength="50" v-model="queryParams.agreementCode" disabled style="width: 240px"></el-input>
|
<el-input maxlength="50" v-model="queryParams.agreementCode" disabled style="width: 240px"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="成套设备" prop="agreementCode">
|
<el-form-item label="成套设备" prop="agreementCode">
|
||||||
<el-select
|
<el-select
|
||||||
clearable
|
clearable
|
||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
placeholder="请选择成套设备"
|
placeholder="请选择成套设备"
|
||||||
@change="onChangeWholeTypeName"
|
@change="onChangeWholeTypeName"
|
||||||
v-model="queryParams.wholeName"
|
@remove-tag="onRemoveTag"
|
||||||
|
v-model="queryParams.wholeTypeName"
|
||||||
|
multiple
|
||||||
|
:disabled="isEdit"
|
||||||
>
|
>
|
||||||
<el-option v-for="item in holdingPoleSelList" :key="item.id" :label="item.wholeName" :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="status">
|
<el-form-item label="类型名称" prop="status">
|
||||||
<el-cascader
|
<el-cascader
|
||||||
filterable
|
filterable
|
||||||
|
|
@ -79,7 +82,7 @@
|
||||||
ref="deviceTypeCascader"
|
ref="deviceTypeCascader"
|
||||||
:options="deviceTypeTree"
|
:options="deviceTypeTree"
|
||||||
@change="deviceTypeChange"
|
@change="deviceTypeChange"
|
||||||
placeholder="请输入规格型号"
|
placeholder="请输入类型名称"
|
||||||
popper-class="popper-select"
|
popper-class="popper-select"
|
||||||
:props="deviceTypeTreeProps"
|
:props="deviceTypeTreeProps"
|
||||||
:disabled="(isEdit && !isView) || isCost || wholeTypeNameList.length > 0"
|
:disabled="(isEdit && !isView) || isCost || wholeTypeNameList.length > 0"
|
||||||
|
|
@ -162,14 +165,14 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<!-- <el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-download"
|
icon="el-icon-download"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col> -->
|
</el-col> -->
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-show="wholeTypeNameList.length > 0" :data="wholeTypeNameList">
|
<el-table v-show="wholeTypeNameList.length > 0" :data="wholeTypeNameList">
|
||||||
|
|
@ -177,16 +180,22 @@
|
||||||
<el-table-column type="expand">
|
<el-table-column type="expand">
|
||||||
<template slot-scope="props">
|
<template slot-scope="props">
|
||||||
<el-table :data="props.row.childrenList">
|
<el-table :data="props.row.childrenList">
|
||||||
<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="deviceNum" align="center" />
|
||||||
<el-table-column align="center" label="库存数量" prop="num" />
|
<el-table-column align="center" label="库存数量" prop="num" />
|
||||||
|
<el-table-column align="center" label="是否管理库存">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<el-tag size="mini" type="primary" v-if="row.isStorage == 1">是</el-tag>
|
||||||
|
<el-tag size="mini" type="warning" v-if="row.isStorage == 0">否</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="wholeName" align="center" label="抱杆设备名称" />
|
<el-table-column prop="wholeTypeName" align="center" label="成套设备名称" />
|
||||||
<el-table-column align="center" label="抱杆设备数量" width="260">
|
<el-table-column align="center" label="成套设备数量" width="260">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
:min="1"
|
:min="1"
|
||||||
|
|
@ -196,19 +205,14 @@
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="操作" width="180">
|
<el-table-column align="center" label="操作" width="180" v-if="!isEdit">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="danger" @click="onHandelDelete(scope.$index)">删除</el-button>
|
<el-button size="mini" type="danger" @click="onHandelDelete(scope.$index)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<el-table
|
<el-table v-loading="loading" :data="leaseApplyDetails" @selection-change="handleSelectionChange">
|
||||||
v-loading="loading"
|
|
||||||
:data="leaseApplyDetails"
|
|
||||||
v-show="wholeTypeNameList.length === 0"
|
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
>
|
|
||||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||||
<el-table-column label="序号" type="index" width="80" />
|
<el-table-column label="序号" type="index" width="80" />
|
||||||
<el-table-column label="机具名称" prop="typeCn" :show-overflow-tooltip="true" />
|
<el-table-column label="机具名称" prop="typeCn" :show-overflow-tooltip="true" />
|
||||||
|
|
@ -253,6 +257,13 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width" v-if="isView">
|
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width" v-if="isView">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<!-- <el-button-->
|
||||||
|
<!-- size="mini"-->
|
||||||
|
<!-- type="text"-->
|
||||||
|
<!-- icon="el-icon-edit"-->
|
||||||
|
<!-- @click="handleBack(scope.row)"-->
|
||||||
|
<!-- v-hasPermi="['system:role:edit']"-->
|
||||||
|
<!-- >修改</el-button>-->
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
|
|
@ -411,14 +422,14 @@ export default {
|
||||||
},
|
},
|
||||||
//领料详情集合
|
//领料详情集合
|
||||||
leaseApplyDetails: [],
|
leaseApplyDetails: [],
|
||||||
wholeName: '',
|
wholeTypeName: '',
|
||||||
},
|
},
|
||||||
typeListDev: [], // 规格型号
|
|
||||||
selectParams: {},
|
|
||||||
typeList: [
|
typeList: [
|
||||||
{ id: '0', name: '工程租赁' },
|
{ id: '0', name: '工程租赁' },
|
||||||
{ id: '1', name: '长期领用' },
|
{ id: '1', name: '长期领用' },
|
||||||
], //集合
|
], //集合
|
||||||
|
typeListDev: [], // 规格型号
|
||||||
|
selectParams: {},
|
||||||
leaseApplyDetails: [],
|
leaseApplyDetails: [],
|
||||||
leaseApplyInfoList: [],
|
leaseApplyInfoList: [],
|
||||||
//领料详情单条模板
|
//领料详情单条模板
|
||||||
|
|
@ -538,14 +549,38 @@ export default {
|
||||||
this.getCostBearingFun()
|
this.getCostBearingFun()
|
||||||
|
|
||||||
this.getHoldingPoleSelListData()
|
this.getHoldingPoleSelListData()
|
||||||
|
|
||||||
|
// this.GetDeviceTypeTree()
|
||||||
|
// this.getList();
|
||||||
|
if (this.$route.query.taskId && !this.$route.query.isBack) {
|
||||||
|
console.log('查看')
|
||||||
|
this.GetTaskDetail(this.$route.query.taskId)
|
||||||
|
}
|
||||||
|
if (this.$route.query.taskId && this.$route.query.isBack) {
|
||||||
|
console.log('驳回提交查看')
|
||||||
|
this.GetTaskDetail2(this.$route.query.taskId)
|
||||||
|
}
|
||||||
|
// this.taskId = this.$route.query.taskId
|
||||||
|
// this.isEdit = this.$route.query.isEdit
|
||||||
this.taskId = this.viewTaskId
|
this.taskId = this.viewTaskId
|
||||||
|
|
||||||
if (this.taskId) {
|
if (this.taskId) {
|
||||||
this.GetTaskDetail(this.taskId)
|
Promise.all([this.GetTaskDetail(this.taskId), this.GetDeviceTypeTree()]).then(() => {
|
||||||
this.GetDeviceTypeTree()
|
let selectList = []
|
||||||
|
this.leaseApplyDetails.forEach((e) => {
|
||||||
|
selectList.push(this.getParentsById(this.deviceTypeTree, e.typeId))
|
||||||
|
})
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.deviceType = selectList
|
||||||
|
this.propsKey++
|
||||||
|
})
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.GetDeviceTypeTree()
|
this.GetDeviceTypeTree()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// console.log(typeof(this.isEdit))
|
||||||
|
// this.$set('isEdit',this.$route.query.isEdit)
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -639,6 +674,12 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.queryParams.agreementId = res.data.agreementId
|
this.queryParams.agreementId = res.data.agreementId
|
||||||
this.queryParams.agreementCode = res.data.agreementCode
|
this.queryParams.agreementCode = res.data.agreementCode
|
||||||
|
|
||||||
|
// // 1. 判断当前协议对应的工程是否结算
|
||||||
|
|
||||||
|
// getAgreementInfoByIdApi({
|
||||||
|
// agreementId: res.data.agreementId,
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -648,6 +689,11 @@ export default {
|
||||||
const res = await getLeaseApplyListAll({ taskId })
|
const res = await getLeaseApplyListAll({ taskId })
|
||||||
|
|
||||||
const data = res.rows[0]
|
const data = res.rows[0]
|
||||||
|
|
||||||
|
// unitId:null,
|
||||||
|
// proId:null,
|
||||||
|
// agreementId:null, //协议id
|
||||||
|
// agreementCode: null,
|
||||||
if (data.taskStatus == 100) {
|
if (data.taskStatus == 100) {
|
||||||
this.queryParams.taskStatus = 32
|
this.queryParams.taskStatus = 32
|
||||||
this.queryParams.examineStatusId = '32'
|
this.queryParams.examineStatusId = '32'
|
||||||
|
|
@ -655,21 +701,26 @@ export default {
|
||||||
this.queryParams.unitId = data.unitId
|
this.queryParams.unitId = data.unitId
|
||||||
this.queryParams.costBearingParty = data.costBearingParty
|
this.queryParams.costBearingParty = data.costBearingParty
|
||||||
this.queryParams.proId = data.proId
|
this.queryParams.proId = data.proId
|
||||||
this.queryParams.leaseApplyInfo.phone = data.leaseApplyInfoList[0].phone
|
this.queryParams.leaseApplyInfo.phone = data.leaseApplyInfoList[0]?.phone
|
||||||
this.queryParams.leaseApplyInfo.leasePerson = data.leaseApplyInfoList[0].leasePerson
|
this.queryParams.leaseApplyInfo.leasePerson = data.leaseApplyInfoList[0]?.leasePerson
|
||||||
this.queryParams.agreementCode = data.agreementCode
|
this.queryParams.agreementCode = data.agreementCode
|
||||||
this.queryParams.agreementId = data.agreementId
|
this.queryParams.agreementId = data.agreementId
|
||||||
this.queryParams.estimateLeaseTime = data.estimateLeaseTime
|
this.queryParams.estimateLeaseTime = data.estimateLeaseTime
|
||||||
|
this.queryParams.wholeTypeName = data.wholeTypeName
|
||||||
|
|
||||||
// this.queryParams.leaseType = data.leaseType
|
// this.queryParams.leaseType = data.leaseType
|
||||||
this.$set(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.leaseApplyInfoList = data.leaseApplyInfoList
|
||||||
this.leaseApplyDetails = data.leaseApplyDetails.map((item) => {
|
this.leaseApplyDetails = data.leaseApplyDetails?.map((item) => {
|
||||||
return this.handelEchoData(item)
|
return this.handelEchoData(item)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (data.ctLeaseApplyDetails) {
|
||||||
|
this.getCtFileList(data.ctLeaseApplyDetails)
|
||||||
|
}
|
||||||
let selectList = []
|
let selectList = []
|
||||||
this.leaseApplyDetails.forEach((item) => {
|
this.leaseApplyDetails?.forEach((item) => {
|
||||||
try {
|
try {
|
||||||
selectList.push(this.getParentsById(this.deviceTypeTree, item.typeId))
|
selectList.push(this.getParentsById(this.deviceTypeTree, item.typeId))
|
||||||
console.log('🚀 ~ 以大代小 ~ item:')
|
console.log('🚀 ~ 以大代小 ~ item:')
|
||||||
|
|
@ -689,7 +740,6 @@ export default {
|
||||||
this.deviceType = selectList
|
this.deviceType = selectList
|
||||||
this.propsKey++
|
this.propsKey++
|
||||||
})
|
})
|
||||||
console.log('🚀 ~ this.leaseApplyDetails:', this.leaseApplyDetails)
|
|
||||||
},
|
},
|
||||||
// 驳回提交 任务详情数据
|
// 驳回提交 任务详情数据
|
||||||
async GetTaskDetail2(taskId) {
|
async GetTaskDetail2(taskId) {
|
||||||
|
|
@ -713,6 +763,7 @@ export default {
|
||||||
this.queryParams.agreementCode = data.agreementCode
|
this.queryParams.agreementCode = data.agreementCode
|
||||||
this.queryParams.agreementId = data.agreementId
|
this.queryParams.agreementId = data.agreementId
|
||||||
this.queryParams.estimateLeaseTime = data.estimateLeaseTime
|
this.queryParams.estimateLeaseTime = data.estimateLeaseTime
|
||||||
|
this.queryParams.wholeTypeName = data.wholeTypeName
|
||||||
// this.queryParams.leaseType = data.leaseType
|
// this.queryParams.leaseType = data.leaseType
|
||||||
this.$set(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
|
||||||
|
|
@ -720,6 +771,39 @@ export default {
|
||||||
this.leaseApplyDetails = data.leaseApplyDetails.map((item) => {
|
this.leaseApplyDetails = data.leaseApplyDetails.map((item) => {
|
||||||
return this.handelEchoData(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) {
|
handelEchoData(item) {
|
||||||
|
|
@ -814,8 +898,8 @@ export default {
|
||||||
try {
|
try {
|
||||||
this.queryParams.leaseApplyDetails.forEach((item) => {
|
this.queryParams.leaseApplyDetails.forEach((item) => {
|
||||||
// if (item.num == 0) {
|
// if (item.num == 0) {
|
||||||
// this.$message.error('机具类型库存量为零无法领料')
|
// this.$message.error('机具类型库存量为零无法领料')
|
||||||
// throw new Error()
|
// throw new Error()
|
||||||
// }
|
// }
|
||||||
if (item.preNum == '') {
|
if (item.preNum == '') {
|
||||||
this.$message.error('请填写预领数量')
|
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) {
|
if (this.wholeTypeNameList.length > 0) {
|
||||||
const wholeTypeList = []
|
const wholeTypeList = []
|
||||||
this.wholeTypeNameList.forEach((i) => {
|
this.wholeTypeNameList.forEach((i) => {
|
||||||
|
|
@ -837,14 +929,18 @@ export default {
|
||||||
preNum: e.deviceNum,
|
preNum: e.deviceNum,
|
||||||
typeCn: e.typeName,
|
typeCn: e.typeName,
|
||||||
typeId: e.deviceTypeId,
|
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) {
|
if (!canSave) {
|
||||||
|
|
@ -868,16 +964,43 @@ export default {
|
||||||
if (this.rejectTaskStatus == 100) {
|
if (this.rejectTaskStatus == 100) {
|
||||||
this.queryParams.souceByRefuse = 1
|
this.queryParams.souceByRefuse = 1
|
||||||
}
|
}
|
||||||
const params = {
|
|
||||||
...this.queryParams,
|
const params = JSON.parse(JSON.stringify(this.queryParams))
|
||||||
taskId: this.taskId,
|
params.taskId = this.taskId
|
||||||
leaseApplyInfoList: this.leaseApplyInfoList,
|
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)
|
res = await editLeaseApply(params)
|
||||||
} else {
|
} else {
|
||||||
// console.log(this.queryParams)
|
// console.log(this.queryParams)
|
||||||
res = await submitLeaseApply(this.queryParams)
|
|
||||||
|
console.log('submitQueryParams', submitQueryParams)
|
||||||
|
res = await submitLeaseApply(submitQueryParams)
|
||||||
}
|
}
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
|
@ -900,6 +1023,7 @@ export default {
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
|
console.log('🚀 ~ handleDelete ~ row:', row)
|
||||||
// this.deviceType.forEach((e, index) => {
|
// this.deviceType.forEach((e, index) => {
|
||||||
// if (e[3] === row.typeId) {
|
// if (e[3] === row.typeId) {
|
||||||
// this.deviceType.splice(index, 1)
|
// this.deviceType.splice(index, 1)
|
||||||
|
|
@ -925,10 +1049,13 @@ export default {
|
||||||
},
|
},
|
||||||
/////// 设备类型树 切换
|
/////// 设备类型树 切换
|
||||||
deviceTypeChange(val) {
|
deviceTypeChange(val) {
|
||||||
|
console.log('🚀 ~ deviceTypeChange ~ val:', val)
|
||||||
this.queryParams.typeId = ''
|
this.queryParams.typeId = ''
|
||||||
this.typeListDev = []
|
this.typeListDev = []
|
||||||
|
// console.log('🚀 ~ deviceTypeChange ~ val:', val)
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const deviceTypeList = this.$refs.deviceTypeCascader.getCheckedNodes()
|
const deviceTypeList = this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||||
|
console.log('🚀 ~ deviceTypeChange ~ deviceTypeList:', deviceTypeList[0])
|
||||||
this.selectParams = {
|
this.selectParams = {
|
||||||
createBy: this.user.name,
|
createBy: this.user.name,
|
||||||
companyId: deviceTypeList[0].data.companyId,
|
companyId: deviceTypeList[0].data.companyId,
|
||||||
|
|
@ -937,94 +1064,37 @@ export default {
|
||||||
typeModelName: deviceTypeList[0].data.label,
|
typeModelName: deviceTypeList[0].data.label,
|
||||||
maTypeId: deviceTypeList[0].data.id,
|
maTypeId: deviceTypeList[0].data.id,
|
||||||
}
|
}
|
||||||
|
console.log('🚀 ~ deviceTypeChange ~ this.selectParams:', this.selectParams)
|
||||||
this.getMaTypeDataByIdFun(val[val.length - 1])
|
this.getMaTypeDataByIdFun(val[val.length - 1])
|
||||||
})
|
})
|
||||||
|
|
||||||
// let tempList = []
|
|
||||||
// if (val.length > 0) {
|
// if (val.length > 0) {
|
||||||
// const items = val.map((e) => {
|
// const items = val.map((e) => {
|
||||||
// return e[3]
|
// 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)
|
|
||||||
// }
|
|
||||||
// })
|
// })
|
||||||
// })
|
// for (let i in items) {
|
||||||
// this.leaseApplyDetails = newArray_array
|
// for (let z in deviceTypeList) {
|
||||||
// // this.leaseApplyDetails.forEach(async (item) => {
|
// if (deviceTypeList[z].data.id === items[i]) {
|
||||||
// // console.log('🚀 ~ this.leaseApplyDetails.forEach ~ item:', item)
|
// let { num, companyId, id, unitName } = deviceTypeList[z].data
|
||||||
// // 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)
|
|
||||||
// // }
|
|
||||||
// // })
|
|
||||||
|
|
||||||
// const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
|
// const isRepeat = this.leaseApplyDetails.some((e) => e.typeId === id)
|
||||||
|
// if (!isRepeat) {
|
||||||
// const promises = this.leaseApplyDetails.map(async (item, index) => {
|
// this.leaseApplyDetails.push({
|
||||||
// console.log('🚀 ~ this.leaseApplyDetails.forEach ~ item:', item)
|
// createBy: this.user.name,
|
||||||
// if (item.isReplaceOpt) {
|
// typeId: id,
|
||||||
// return item
|
// num,
|
||||||
|
// companyId,
|
||||||
|
// unitCn: unitName,
|
||||||
|
// typeCn: deviceTypeList[z].pathLabels[2],
|
||||||
|
// guigeCn: deviceTypeList[z].pathLabels[3],
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
// }
|
// }
|
||||||
// try {
|
// console.log('🚀 ~ deviceTypeChange ~ this.leaseApplyDetails:', this.leaseApplyDetails)
|
||||||
// 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')
|
|
||||||
// })
|
|
||||||
// } else {
|
// } else {
|
||||||
// this.leaseApplyDetails = []
|
// this.leaseApplyDetails = []
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
// 获取规格型号
|
// 获取规格型号
|
||||||
|
|
@ -1132,28 +1202,35 @@ export default {
|
||||||
this.holdingPoleSelList = res
|
this.holdingPoleSelList = res
|
||||||
},
|
},
|
||||||
/* 抱杆成套设备change事件 */
|
/* 抱杆成套设备change事件 */
|
||||||
onChangeWholeTypeName(val) {
|
async onChangeWholeTypeName(val) {
|
||||||
const selLable = this.holdingPoleSelList.find((e) => e.id === val)
|
val.forEach((e) => {
|
||||||
const wholeTypeNameData = {
|
const selLable = this.holdingPoleSelList.find((j) => j.id === e)
|
||||||
id: val,
|
const isPush = this.wholeTypeNameList.some((z) => z.id == e)
|
||||||
wholeName: selLable.wholeName,
|
|
||||||
wholeTypeNum: 1,
|
if (!isPush) {
|
||||||
childrenList: [],
|
const wholeTypeNameData = {
|
||||||
}
|
id: e,
|
||||||
queryCompleteSetToolsApi(wholeTypeNameData).then((res) => {
|
wholeTypeName: selLable.wholeTypeName,
|
||||||
wholeTypeNameData.childrenList = res.data
|
wholeTypeNum: 1,
|
||||||
wholeTypeNameData.childrenList.forEach((e) => (e.initNum = e.deviceNum))
|
childrenList: [],
|
||||||
const isREpeat = this.wholeTypeNameList.find((e) => e.id === val)
|
}
|
||||||
if (!isREpeat) {
|
|
||||||
this.wholeTypeNameList.push(wholeTypeNameData)
|
queryCompleteSetToolsApi(wholeTypeNameData).then((res) => {
|
||||||
} else {
|
wholeTypeNameData.childrenList = res.data.map((e) => {
|
||||||
this.$modal.msgError('当前抱杆成套设备已添加,不可重复添加!')
|
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) {
|
onChangeInput(val, v) {
|
||||||
this.wholeTypeNameList[v].childrenList.forEach((e) => (e.deviceNum = e.initNum * val))
|
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) {
|
handleReplaceType(e, row) {
|
||||||
console.log('🚀 ~ handleReplaceType ~ e:', e)
|
console.log('🚀 ~ handleReplaceType ~ e:', e)
|
||||||
|
|
|
||||||
|
|
@ -294,7 +294,7 @@ import {
|
||||||
getUseNumByTypeId,
|
getUseNumByTypeId,
|
||||||
getTaskDetail,
|
getTaskDetail,
|
||||||
submitUpdateBackApply,
|
submitUpdateBackApply,
|
||||||
getMaTypeDataById,
|
getFourMaTypeList,
|
||||||
getPreAuditNum,
|
getPreAuditNum,
|
||||||
} from '@/api/claimAndRefund/receive'
|
} from '@/api/claimAndRefund/receive'
|
||||||
import { submitBackApplyApi } from '@/api/claimAndRefund/return'
|
import { submitBackApplyApi } from '@/api/claimAndRefund/return'
|
||||||
|
|
@ -1079,7 +1079,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 获取规格型号
|
// 获取规格型号
|
||||||
async getMaTypeDataByIdFun(val) {
|
async getMaTypeDataByIdFun(val) {
|
||||||
const res = await getMaTypeDataById({ id: val })
|
const res = await getFourMaTypeList({ id: val, agreementId: this.queryParams.agreementId })
|
||||||
this.typeListDev = res.data
|
this.typeListDev = res.data
|
||||||
console.log('🚀 ~ getMaTypeDataByIdFun ~ res:', res)
|
console.log('🚀 ~ getMaTypeDataByIdFun ~ res:', res)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -140,12 +140,14 @@
|
||||||
align="center"
|
align="center"
|
||||||
prop="typeName"
|
prop="typeName"
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
|
width="200"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="规格型号"
|
label="规格型号"
|
||||||
align="center"
|
align="center"
|
||||||
prop="typeModelName"
|
prop="typeModelName"
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
|
width="200"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="单位"
|
label="单位"
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@
|
||||||
width="50"
|
width="50"
|
||||||
align="center"
|
align="center"
|
||||||
/> -->
|
/> -->
|
||||||
<el-table-column label="名称" align="center" key="typeName" prop="typeName" show-overflow-tooltip />
|
<el-table-column label="名称" align="center" key="typeName" prop="typeName" show-overflow-tooltip width="200" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="计量单位"
|
label="计量单位"
|
||||||
align="center"
|
align="center"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue