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