退料编辑编码反显问题修改

This commit is contained in:
zzyuan 2025-01-23 16:12:07 +08:00
parent 3c7a0cc56e
commit d9b83b8412
1 changed files with 96 additions and 130 deletions

View File

@ -1,14 +1,6 @@
<template> <template>
<div> <div>
<el-form <el-form :model="queryParams" ref="queryForm" size="small" :rules="queryRules" :inline="true" v-show="showSearch" label-width="100px">
:model="queryParams"
ref="queryForm"
size="small"
:rules="queryRules"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-row> <el-row>
<el-form-item label="退料单位" prop="unitId"> <el-form-item label="退料单位" prop="unitId">
<treeselect <treeselect
@ -68,7 +60,6 @@
style="width: 240px" style="width: 240px"
></el-input> ></el-input>
</el-form-item> --> </el-form-item> -->
<el-form-item label="退料人" prop="backPerson"> <el-form-item label="退料人" prop="backPerson">
<el-input <el-input
v-model="queryParams.backPerson" v-model="queryParams.backPerson"
@ -86,63 +77,61 @@
:maxlength="11" :maxlength="11"
/> />
</el-form-item> </el-form-item>
</el-row> </el-row>
<!-- <el-form-item label="物品类型" prop="deviceType"> -->
<el-row :gutter="24" style="display: flex;align-items: center;"> <el-row :gutter="24" style="display: flex;align-items: center;">
<el-col :span="1.5" style="text-align: center;margin-left: 20px;"> <el-col :span="1.5" style="text-align: center;margin-left: 20px;">
<span style="color: red;">*</span> <span style="color: red;">*</span>
<span style="font-size: 14px;font-weight: 600;color: #606266;">物品类型</span> <span style="font-size: 14px;font-weight: 600;color: #606266;">物品类型</span>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-select <el-select
ref="typeSelect" ref="typeSelect"
v-model="tempDeviceType" v-model="tempDeviceType"
multiple multiple
filterable filterable
placeholder="请输入物品类型" placeholder="请输入物品类型"
style="width: 400px" style="width: 400px"
@change="handleTypeChange" @change="handleTypeChange"
clearable clearable
collapse-tags collapse-tags
:filter-method="handleSearchImpl" :filter-method="handleSearchImpl"
:popper-class="'type-select-dropdown'" :popper-class="'type-select-dropdown'"
:popper-append-to-body="false" :popper-append-to-body="false"
@visible-change="handleVisibleChange" @visible-change="handleVisibleChange"
>
<el-option
v-for="item in filteredOptions"
:key="item.typeId"
:label="item.fullPath"
:value="item.typeId"
:data-key="item.typeId"
> >
<el-option <span v-html="highlightText(item.fullPath, searchKeyword)"></span>
v-for="item in filteredOptions" <span style="float: right; color: #8492a6; font-size: 13px">
:key="item.typeId" 出库:{{ item.num }}
:label="item.fullPath" </span>
:value="item.typeId" </el-option>
:data-key="item.typeId" </el-select>
> </el-col>
<span v-html="highlightText(item.fullPath, searchKeyword)"></span> <el-col :span="5">
<span style="float: right; color: #8492a6; font-size: 13px"> <el-input
出库:{{ item.num }} ref="searchInput"
</span> v-model="searchKeyword"
</el-option> placeholder="输入物品类型高亮搜索"
</el-select> prefix-icon="el-icon-search"
</el-col> clearable
<el-col :span="5"> style="width: 300px"
<el-input @input="handleHighlightSearch"
ref="searchInput" @focus="handleSearchFocus"
v-model="searchKeyword" @click.native="handleSearchClick"
placeholder="输入物品类型高亮搜索" >
prefix-icon="el-icon-search" <template slot="append">
clearable <span v-if="matchedOptions.length" style="margin: 0 5px">
style="width: 300px" {{ currentMatchIndex + 1 }}/{{ matchedOptions.length }}
@input="handleHighlightSearch" </span>
@focus="handleSearchFocus" </template>
@click.native="handleSearchClick" </el-input>
> </el-col>
<template slot="append">
<span v-if="matchedOptions.length" style="margin: 0 5px">
{{ currentMatchIndex + 1 }}/{{ matchedOptions.length }}
</span>
</template>
</el-input>
</el-col>
<!-- <el-cascader <!-- <el-cascader
:key="propsKey" :key="propsKey"
v-model="deviceType" v-model="deviceType"
@ -157,8 +146,7 @@
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="roleName"> <el-form-item label="备注" prop="roleName">
<el-input <el-input
v-model="queryParams.remark" v-model="queryParams.remark"
@ -198,6 +186,7 @@
>导出</el-button> --> >导出</el-button> -->
</el-col> </el-col>
</el-row> </el-row>
<el-table v-loading="loading" :data="equipmentList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="equipmentList" @selection-change="handleSelectionChange">
<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" align="center" min-width="80" /> <el-table-column label="序号" type="index" align="center" min-width="80" />
@ -214,11 +203,9 @@
</el-table-column> </el-table-column>
<el-table-column label="退料数量" align="center" prop="preNum" min-width="100"> <el-table-column label="退料数量" align="center" prop="preNum" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<div <div style="color: rgb(2, 167, 240)"
style="color: rgb(2, 167, 240)"
@click="openAddCode(scope.row)" @click="openAddCode(scope.row)"
v-if="scope.row.manageType == 0" v-if="scope.row.manageType == 0">
>
添加编码 添加编码
</div> </div>
<el-input <el-input
@ -244,8 +231,7 @@
style="width: 100%" style="width: 100%"
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark" min-width="120"> <el-table-column label="备注" align="center" prop="remark" min-width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
@ -283,7 +269,6 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="100px"> <el-table-column label="操作" align="center" width="100px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="danger" @click="handleDelete(scope.row, scope.$index)">删除</el-button> <el-button size="mini" type="danger" @click="handleDelete(scope.row, scope.$index)">删除</el-button>
@ -309,46 +294,18 @@
<el-button type="primary" size="mini" @click="handleAddCode">添加编码</el-button> <el-button type="primary" size="mini" @click="handleAddCode">添加编码</el-button>
</el-col> </el-col>
</el-row> --> </el-row> -->
<el-table <el-table :data="machineList" width="100%" ref="codeTableList" height="450px" row-key="maId" @selection-change="codeSelectionChange">
:data="machineList"
width="100%"
ref="codeTableList"
height="450px"
row-key="maId"
@selection-change="codeSelectionChange"
>
<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="55" align="center" /> <el-table-column label="序号" type="index" width="55" align="center" />
<el-table-column <el-table-column label="类型名称" prop="typeName" align="center" :show-overflow-tooltip="true"></el-table-column>
label="类型名称" <el-table-column label="规格型号" prop="materialName" align="center" :show-overflow-tooltip="true"></el-table-column>
prop="typeName" <el-table-column label="设备编码" prop="maCode" align="center" :show-overflow-tooltip="true"></el-table-column>
align="center"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
label="规格型号"
prop="materialName"
align="center"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column
label="设备编码"
prop="maCode"
align="center"
:show-overflow-tooltip="true"
></el-table-column>
<el-table-column label="设备状态" prop="maStatus" align="center" :show-overflow-tooltip="true"> <el-table-column label="设备状态" prop="maStatus" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.ma_machine_status" :value="scope.row.maStatus" /> <dict-tag :options="dict.type.ma_machine_status" :value="scope.row.maStatus" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="外观判定" prop="apDetection" align="center" width="150" :show-overflow-tooltip="true">
label="外观判定"
prop="apDetection"
align="center"
width="150"
:show-overflow-tooltip="true"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
v-model.number="scope.row.apDetection" v-model.number="scope.row.apDetection"
@ -459,6 +416,7 @@ export default {
maId: '', maId: '',
maData: {}, maData: {},
maCodeList: [], // maCodeList: [], //
tempMaCodeList: [], //
machineList: [], // machineList: [], //
// //
dialogImageUrl: '', dialogImageUrl: '',
@ -599,11 +557,8 @@ export default {
}, },
mounted() { mounted() {
this.GetUnitData() this.GetUnitData()
this.GetProData() this.GetProData()
if (this.backId) { //
if (this.backId) {
//
console.log(this.backId)
this.rowId = this.backId this.rowId = this.backId
this.GetViewByApply() this.GetViewByApply()
} }
@ -821,7 +776,7 @@ export default {
async GetViewByApply(params) { async GetViewByApply(params) {
const res = await getBackApplyInfo(this.rowId) const res = await getBackApplyInfo(this.rowId)
console.log(res) console.log(res)
const data = res.data const data = res.data;
this.queryParams.unitId = data.backApplyInfo.unitId this.queryParams.unitId = data.backApplyInfo.unitId
// this.unitId = this.treeParentsById(this.unitList, this.queryParams.unitId) // this.unitId = this.treeParentsById(this.unitList, this.queryParams.unitId)
this.GetProData() this.GetProData()
@ -829,12 +784,12 @@ export default {
this.queryParams.proId = data.backApplyInfo.proId this.queryParams.proId = data.backApplyInfo.proId
}, 500) }, 500)
// this.projectId = this.treeParentsById(this.proList, this.queryParams.proId) // this.projectId = this.treeParentsById(this.proList, this.queryParams.proId)
this.queryParams.phone = data.backApplyInfo.phone this.queryParams.phone = data.backApplyInfo.phone
this.queryParams.backPerson = data.backApplyInfo.backPerson this.queryParams.backPerson = data.backApplyInfo.backPerson
this.queryParams.agreementId = data.backApplyInfo.agreementId this.queryParams.agreementId = data.backApplyInfo.agreementId
this.queryParams.remark = data.backApplyInfo.remark this.queryParams.remark = data.backApplyInfo.remark
this.equipmentList = data.backApplyDetailsList this.equipmentList = data.backApplyDetailsList;
this.equipmentList.forEach(item=>{item.tempMaCodeList=item.maCodeList})
this.GetDeviceTypeTreeFn(data.backApplyInfo.agreementId) this.GetDeviceTypeTreeFn(data.backApplyInfo.agreementId)
}, },
// //
@ -1040,13 +995,13 @@ export default {
template.num = node.data.num template.num = node.data.num
template.useNum = node.data.useNum template.useNum = node.data.useNum
return template return template
}, },
// changeMachine(val){ // changeMachine(val){
// console.log(val) // console.log(val)
// this.maData = this.machineList.find(option => option.maId == val); // this.maData = this.machineList.find(option => option.maId == val);
// // = this.machineList[index] // // = this.machineList[index]
// }, // },
// //
async getMachineById(typeId) { async getMachineById(typeId) {
let param = { let param = {
@ -1064,21 +1019,33 @@ export default {
}, },
//- //-
async openAddCode(row) { async openAddCode(row) {
this.rowData = row this.rowData = row;
await this.getMachineById(row.typeId) await this.getMachineById(row.typeId)
// this.maId="" // this.maId=""
if (this.rowData.maCodeList && this.rowData.maCodeList.length > 0) { if (this.rowData.maCodeList && this.rowData.maCodeList.length > 0) {
this.maCodeList = this.rowData.maCodeList console.log(this.maCodeList)
// console.log(this.maCodeList) console.log(this.machineList)
// console.log(this.machineList)
if (this.rowId != '') { if (this.rowId != '') {
// // //
this.maCodeList.forEach(item => { this.rowData.tempMaCodeList.forEach(item => {
this.machineList.unshift(item) // this.machineList.unshift(item) //
this.$nextTick(() => { // this.$nextTick(() => {
this.$refs.codeTableList.toggleRowSelection(item, true) // this.$refs.codeTableList.toggleRowSelection(item, true)
// })
})
this.maCodeList = this.rowData.maCodeList;
this.machineList.forEach(item => {
this.maCodeList.forEach(sub => {
if (sub.maId == item.maId) {
this.$nextTick(() => {
setTimeout(() => {
this.$refs.codeTableList.toggleRowSelection(item, true)
}, 500)
})
}
}) })
}) })
} else { } else {
// //
// console.log("") // console.log("")
@ -1101,8 +1068,7 @@ export default {
}, },
codeSelectionChange(selection) { codeSelectionChange(selection) {
this.maCodeList = selection this.maCodeList = selection
// console.log(selection) // console.log(selection)
// this.queryParams.equipmentList = selection // this.queryParams.equipmentList = selection
}, },
// //
@ -1140,8 +1106,8 @@ export default {
saveDevCode() { saveDevCode() {
console.log(this.rowData) console.log(this.rowData)
console.log(this.maCodeList) console.log(this.maCodeList)
this.rowData.maCodeList = this.maCodeList this.rowData.maCodeList = this.maCodeList;
this.rowData.preNum = this.maCodeList.length this.rowData.preNum = this.maCodeList.length;
this.open = false this.open = false
console.log(this.equipmentList) console.log(this.equipmentList)
}, },