Compare commits

...

2 Commits

7 changed files with 594 additions and 434 deletions

46
src/api/repair/repair.js Normal file
View File

@ -0,0 +1,46 @@
import request from '@/utils/request'
// 查询维修任务一级列表
export function getRepairTaskList(query) {
return request({
url: '/material/repair/getRepairTaskList',
method: 'get',
params: query
})
}
// 查询维修任务机具列表二级列表
export function getAppRepairMaTypeList(query) {
return request({
url: '/material/repair/getAppRepairMaTypeList',
method: 'get',
params: query
})
}
//获取配件类型树
export function partTypeTreeList(query) {
return request({
url: '/material/ma_part_type/list',
method: 'get',
params: query,
})
}
// //维修驳回至退料
// export function rejectRepair(data) {
// return request({
// url: '/material/repair/rejectRepair',
// method: 'post',
// data: data,
// })
// }
// 维修驳回至退料
export function rejectRepair(taskIds) {
return request({
url: '/material/repair/' + taskIds,
method: 'delete'
})
}

View File

@ -11,7 +11,17 @@
>
<el-row>
<el-form-item label="退料单位" prop="unitId">
<el-select
<el-cascader v-model="unitId"
:show-all-levels="false"
:options="unitList"
:props="selectTreeProps"
filterable
clearable
collapse-tags
@change="unitChange"
placeholder="请选择退料单位"
></el-cascader>
<!-- <el-select
v-model="queryParams.unitId"
clearable
filterable
@ -26,10 +36,19 @@
:value="item.unitId"
>
</el-option>
</el-select>
</el-select> -->
</el-form-item>
<el-form-item label="退料工程" prop="proId">
<el-select
<el-cascader v-model="projectId"
:show-all-levels="false"
:options="proList"
:props="selectTreeProps"
filterable clearable
collapse-tags
@change="proChange"
placeholder="请选择退料工程"
></el-cascader>
<!-- <el-select
v-model="queryParams.proId"
clearable
filterable
@ -44,7 +63,7 @@
:value="item.proId"
>
</el-option>
</el-select>
</el-select> -->
</el-form-item>
<!-- <el-form-item label="协议号" prop="agreementCode">
<el-input
@ -404,8 +423,19 @@ export default {
//
url: process.env.VUE_APP_BASE_API + '/file/upload'
},
selectTreeProps: {
children: 'children',
label: 'name',
// multiple: false,
value: 'id',
// multiple: true,
},
unitList: [], //
proList: [], //
unitId: null,
lastUnitId: null,
projectId: null,
lastProjectId: null,
//
queryParams: {
unitId: null,
@ -481,8 +511,7 @@ export default {
},
],
},
unitList: [], //
proList: [], //
deviceTypeTree: [], //
//
@ -524,67 +553,108 @@ export default {
},
methods: {
//
async GetUnitData(val) {
// if(this.equipmentList.length>0){
// this.$modal.confirm('退').then(() => {
// this.$message.success('!')
// }).catch(() => {
// console.log(this.unitId)
// setTimeout(()=>{
// this.$set(this.queryParams,"unitId",this.unitId)
// console.log(this.queryParams.unitId)
// this.$forceUpdate()
// },500)
// })
// }else{
// this.unitId=val
async GetUnitData() {
const params = {
projectId: this.queryParams.proId /* */,
}
const res = await getUnitList(params)
this.unitList = res.data
this.GetAgreementInfoById()
this.GetAgreementInfoById()
},
unitChange(val){
// if(this.equipmentList.length>0){
// this.$modal.confirm('退').then(() => {
// this.unitId=val
// this.lastUnitId=val
// if(val&&val.length>0){
// this.queryParams.unitId=this.unitId[this.unitId.length - 1]
// }else if(val&&val.length==0){
// this.queryParams.unitId=""
// }
// this.GetProData()
// this.deviceType=[]
// this.equipmentList=[]
// this.$message.success('!')
// }).catch(() => {
// console.log(val)
// console.log(this.unitId)
// console.log(this.lastUnitId)
// // this.unitId=this.lastUnitId
// // this.$message.success('!')
// })
// }else{
// this.unitId=val
// this.lastUnitId=val
if(val&&val.length>0){
this.queryParams.unitId=this.unitId[this.unitId.length - 1]
}else if(val&&val.length==0){
this.queryParams.unitId=""
}
this.GetProData()
// }
},
//
async GetProData(val) {
// if(this.equipmentList.length>0){
// this.$modal.confirm('退').then(() => {
// this.$message.success('!')
// }).catch(() => {
// // this.queryParams.proId=this.projectId
// console.log(this.projectId)
// setTimeout(()=>{
// this.$set(this.queryParams,"proId",this.projectId)
// console.log(this.queryParams.proId)
// this.$forceUpdate()
// },500)
// })
// }else{
// this.projectId=val
async GetProData() {
const params = {
unitId: this.queryParams.unitId,
}
const res = await getProjectList(params)
this.proList = res.data
this.GetAgreementInfoById()
// }
this.GetAgreementInfoById()
},
proChange(val){
console.log(this.projectId)
console.log(val)
// if(this.equipmentList.length>0){
// this.$modal.confirm('退').then(() => {
// console.log(val)
// console.log(this.projectId)
// console.log(this.lastProjectId)
// this.projectId=val
// this.lastProjectId=val
// if(val&&val.length>0){
// this.queryParams.proId=this.projectId[this.projectId.length - 1]
// }else if(val&&val.length==0){
// this.queryParams.proId=""
// }
// this.GetUnitData()
// this.deviceType=[]
// this.equipmentList=[]
// this.$message.success('!')
// }).catch(() => {
// console.log(val)
// console.log(this.projectId)
// console.log(this.lastProjectId)
// // this.$nextTick(()=>{
// // setTimeout(()=>{
// // val = this.lastProjectId
// // this.projectId = this.lastProjectId
// // this.$forceUpdate()
// // },1000)
// // })
// // this.projectId=this.lastProjectId
// })
// }else{
// console.log(val)
// console.log(this.projectId)
// console.log(this.lastProjectId)
// this.projectId=val
// this.lastProjectId=val
if(val&&val.length>0){
this.queryParams.proId=this.projectId[this.projectId.length - 1]
}else if(val&&val.length==0){
this.queryParams.proId=""
}
this.GetUnitData()
// }
},
//
async GetDeviceTypeTreeFn(agreementId) {
const params = {
agreementId: agreementId,
}
// equipmentTypeTree().then((response) => {
// this.deviceTypeTree = response.data
// })
//
const res = await getDeviceTreeByAgreementId(params)
console.log('resgetUseTypeTreee==========', res)
this.deviceTypeTree = res.data;
@ -638,31 +708,40 @@ export default {
}
}
},
//
async GetViewByApply(params) {
const res = await getBackApplyInfo(this.rowId)
console.log(res)
const data = res.data
console.log(data)
this.queryParams.unitId = data.backApplyInfo.unitId
const data = res.data
this.queryParams.unitId = data.backApplyInfo.unitId
this.unitId = this.treeParentsById(this.unitList, this.queryParams.unitId)
this.queryParams.proId = data.backApplyInfo.proId
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.GetDeviceTypeTreeFn(data.backApplyInfo.agreementId)
// this.$set(this.queryParams, 'phone', data.phone)
// this.queryParams.backPerson = data.backPerson
// this.queryParams.backTime = data.backTime
// this.queryParams.agreementCode = data.agreementCode
// this.queryParams.agreementId = data.agreementId
// this.queryParams.remark = data.remark
// this.equipmentList = res.data
//
},
//
treeParentsById(list, id) {
for (let i in list) {
if (list[i].id == id) {
//value
return [list[i].id]
}
if (list[i].children) {
let node = this.treeParentsById(list[i].children, id)
if (node !== undefined) {
//
node.unshift(list[i].id)
return node
}
}
}
},
//
selectable(row) {
console.log(row)
@ -964,12 +1043,19 @@ export default {
},
}
</script>
<style lang="scss">
<style lang="scss">
.form-select {
.el-cascader-panel .el-scrollbar .el-checkbox {
display: none;
}
.el-cascader-panel .el-scrollbar:nth-child(3) .el-checkbox {
display: block !important;
}
}
.popper-select {
.el-cascader-panel .el-scrollbar .el-checkbox {
display: none;
}
.el-cascader-panel .el-scrollbar:nth-child(4) .el-checkbox {
display: block !important;
}

View File

@ -52,7 +52,17 @@
</el-form-item>
<br>
<el-form-item label="退料单位" prop="unitId">
<el-select
<el-cascader v-model="unitId"
:show-all-levels="false"
:options="unitList"
:props="selectTreeProps"
filterable
clearable
collapse-tags
@change="unitChange"
placeholder="请选择退料单位"
></el-cascader>
<!-- <el-select
v-model="queryParams.unitId"
clearable
filterable
@ -66,10 +76,19 @@
:label="item.unitName"
:value="item.unitId"
></el-option>
</el-select>
</el-select> -->
</el-form-item>
<el-form-item label="工程名称" prop="proId">
<el-select
<el-cascader v-model="projectId"
:show-all-levels="false"
:options="proList"
:props="selectTreeProps"
filterable clearable
collapse-tags
@change="proChange"
placeholder="请选择退料工程"
></el-cascader>
<!-- <el-select
v-model="queryParams.proId"
clearable
filterable
@ -82,7 +101,7 @@
:label="item.proName"
:value="item.proId"
></el-option>
</el-select>
</el-select> -->
</el-form-item>
<el-form-item>
<el-button
@ -418,6 +437,15 @@ export default {
endTime: '',
proId: '',
},
selectTreeProps: {
children: 'children',
label: 'name',
// multiple: false,
value: 'id',
// multiple: true,
},
unitId: null,
projectId: null,
dialogQueryParams: {
pageNum: 1,
pageSize: 10,
@ -484,18 +512,38 @@ export default {
},
//
async GetUnitData() {
const params = {}
const res = await getUnitList(params)
this.unitList = res.data
const params = {
projectId: this.queryParams.proId /* */,
}
const res = await getUnitList(params)
this.unitList = res.data
},
unitChange(val){
if(val&&val.length>0){
this.queryParams.unitId=this.unitId[this.unitId.length - 1]
}else if(val&&val.length==0){
this.queryParams.unitId=""
}
this.GetProData()
},
//
async GetProData() {
const params = {
unitId: this.queryParams.unitId,
const params = {
unitId: this.queryParams.unitId,
}
const res = await getProjectList(params)
this.proList = res.data
},
proChange(val){
if(val&&val.length>0){
this.queryParams.proId=this.projectId[this.projectId.length - 1]
}else if(val&&val.length==0){
this.queryParams.proId=""
}
const res = await getProjectList(params)
this.proList = res.data
},
this.GetUnitData()
},
/** 查询列表 startTime,结束日期endTime */
async getList() {
this.loading = true
@ -523,6 +571,10 @@ export default {
resetQuery() {
this.queryParams.time = []
// this.resetForm("queryForm");
this.unitId=null;
this.projectId=null;
this.queryParams.unitId = ""
this.queryParams.proId = ""
this.$refs.queryForm.resetFields()
this.initSelectData()
this.handleQuery()

View File

@ -10,43 +10,23 @@
label-width="100px"
>
<el-row>
<el-form-item label="退料单位" prop="unitId">
<el-select
v-model="queryParams.unitId"
clearable
filterable
@change="GetProData"
<el-form-item label="退料单位" prop="proName">
<el-input
v-model="queryParams.proName"
placeholder="退料单位"
clearable
style="width: 240px"
placeholder="请选择"
:disabled="isView"
>
<el-option
v-for="item in unitList"
:key="item.unitId"
:label="item.unitName"
:value="item.unitId"
>
</el-option>
</el-select>
/>
</el-form-item>
<el-form-item label="退料工程" prop="proId">
<el-select
v-model="queryParams.proId"
clearable
filterable
@change="GetUnitData"
<el-form-item label="退料工程" prop="unitName">
<el-input
v-model="queryParams.unitName"
placeholder="退料工程"
clearable
style="width: 240px"
placeholder="请选择"
:disabled="isView"
>
<el-option
v-for="item in proList"
:key="item.proId"
:label="item.proName"
:value="item.proId"
>
</el-option>
</el-select>
/>
</el-form-item>
<!-- <el-form-item label="协议号" prop="agreementCode">
<el-input
@ -193,7 +173,7 @@
min-width="100"
>
<template slot-scope="scope">
<div style="color: rgb(2, 167, 240);" @click="openAddCode(scope.row)" v-if="scope.row.manageType==0">添加编码</div>
<div style="color: rgb(2, 167, 240);" @click="openAddCode(scope.row)" v-if="scope.row.manageType==0">查看编码</div>
<el-input
v-if="scope.row.manageType==1"
v-model.number="scope.row.preNum"
@ -589,10 +569,6 @@ export default {
const params = {
agreementId: agreementId,
}
// equipmentTypeTree().then((response) => {
// this.deviceTypeTree = response.data
// })
//
const res = await getDeviceTreeByAgreementId(params)
console.log('resgetUseTypeTreee==========', res)
this.deviceTypeTree = res.data;
@ -655,6 +631,8 @@ export default {
console.log(data)
this.queryParams.unitId = data.backApplyInfo.unitId
this.queryParams.proId = data.backApplyInfo.proId
this.queryParams.unitName = data.backApplyInfo.unitName
this.queryParams.proName = data.backApplyInfo.proName
this.queryParams.phone = data.backApplyInfo.phone
this.queryParams.backPerson = data.backApplyInfo.backPerson
this.queryParams.agreementId = data.backApplyInfo.agreementId

View File

@ -2,11 +2,11 @@
<div>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-row>
<el-form-item label="退料单位" prop="unitName">
<el-input v-model="queryParams.unitName" placeholder="退料单位" clearable style="width: 240px" disabled/>
<el-form-item label="退料单位" prop="backUnit">
<el-input v-model="queryParams.backUnit" placeholder="退料单位" clearable style="width: 240px" disabled/>
</el-form-item>
<el-form-item label="退料工程" prop="proName">
<el-input v-model="queryParams.proName" placeholder="退料工程" clearable style="width: 240px" disabled/>
<el-form-item label="退料工程" prop="backPro">
<el-input v-model="queryParams.backPro" placeholder="退料工程" clearable style="width: 240px" disabled/>
</el-form-item>
<el-form-item label="维修单号" prop="repairCode">
<el-input v-model="queryParams.repairCode" placeholder="维修单号" clearable style="width: 240px" disabled/>
@ -17,7 +17,7 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-back" size="mini">维修管理</el-button>
<el-button type="primary" plain icon="el-icon-back" size="mini" @click="goBack ">维修管理</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-plus" size="mini" @click="handleAdd">合格</el-button>
@ -27,11 +27,11 @@
<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="类型名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
<el-table-column label="规格型号" align="center" prop="typeModel" :show-overflow-tooltip="true"/>
<el-table-column label="规格型号" align="center" prop="type" :show-overflow-tooltip="true"/>
<el-table-column label="计量单位" align="center" prop="unitName" />
<el-table-column label="退料数量" align="center" prop="preNum" ></el-table-column>
<el-table-column label="已修数量" align="center" prop="num1" ></el-table-column>
<el-table-column label="待修数量" align="center" prop="num2" ></el-table-column>
<el-table-column label="退料数量" align="center" prop="repairNum" ></el-table-column>
<el-table-column label="已修数量" align="center" prop="repairedNum" ></el-table-column>
<el-table-column label="待修数量" align="center" prop="disrepairNum" ></el-table-column>
<el-table-column label="管理模式" align="center" prop="manageType">
<template slot-scope="scope">
<!-- 0编码1数量 -->
@ -47,23 +47,23 @@
</el-table-column>
</el-table>
<!-- 编码维修 -->
<el-dialog title="编码维修" :visible.sync="open" width="1200px" append-to-body>
<el-dialog title="编码维修" :visible.sync="openCode" width="1200px" append-to-body>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" size="mini">合格</el-button>
</el-col>
</el-row>
<el-table :data="maCodeList" width="100%" height="450px">
<el-table :data="repairDeviceList" width="100%" height="450px">
<el-table-column label="序号" type="index" width="55" align="center"/>
<el-table-column label="类型名称" prop="materialName" 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="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="typeName" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="规格型号" prop="type" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="设备编码" prop="code" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="维修状态" prop="status" 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>
<el-table-column label="配件信息" prop="partInfo" align="center" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="附件" align="center" width="100">
<template slot-scope="scope">
<div style="display: flex;align-items: center;justify-content: center;">
@ -84,13 +84,13 @@
<template slot-scope="scope">
<el-button size="mini" type="warning" @click="openInnerDialog(scope.row)">内部维修</el-button>
<el-button size="mini" type="warning" @click="openBackDialog(scope.row)">返场维修</el-button>
<el-button size="mini" type="danger">待报废</el-button>
<el-button size="mini" type="danger" @click="openScrapDialog(scope.row)">待报废</el-button>
</template>
</el-table-column>
</el-table>
<div style="width: 100%;height: 50px;display: flex;justify-content: flex-end;align-items: center;">
<el-button type="primary" size="mini" @click="saveCodeDialog">保存</el-button>
<el-button type="normal" size="mini" @click="open=false">取消</el-button>
<el-button type="normal" size="mini" @click="openCode=false">取消</el-button>
</div>
</el-dialog>
<!-- 内部维修 -->
@ -122,8 +122,29 @@
<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="typeCode" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="是否收费" prop="isCharge" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="配件数量" prop="partNum" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="是否收费" prop="isCharge" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-select
v-model="scope.row.isCharge"
placeholder="是否收费"
filterable
clearable
>
<el-option label="是" value="1"></el-option>
<el-option label="否" value="0"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="配件数量" prop="partNum" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input
v-model.number="scope.row.partNum"
placeholder="配件数量"
type="number" min="1"
clearable style="width: 100%"
/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="120px">
<template slot-scope="scope">
<el-button size="mini" type="danger" @click="handleDeletePart({ ...scope.row, index: scope.$index })">删除</el-button>
@ -216,7 +237,59 @@
<el-button type="normal" size="mini" @click="openBack=false">取消</el-button>
</div>
</el-dialog>
<!-- 待报废 -->
<el-dialog title="待报废" :visible.sync="openScrap" width="900px" append-to-body>
<div style="height: 300px;width: 100%;">
<el-form :model="scrapForm" ref="scrapForm" size="small" :rules="scrapRules" :inline="true" label-width="100px">
<el-form-item label="报废原因" prop="scrapReason">
<el-select
v-model="scrapForm.scrapReason"
placeholder="损坏原因"
clearable filterable style="width: 250px">
<el-option
v-for="item in damageReasonList"
:key="item.id"
:label="item.label"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="损坏原因" prop="damageReason">
<el-select
v-model="scrapForm.damageReason"
placeholder="损坏原因"
clearable filterable style="width: 250px">
<el-option
v-for="item in damageReasonList"
:key="item.id"
:label="item.label"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="其他原因" prop="remark">
<el-input
v-model="scrapForm.otherReason"
placeholder="请输入其他原因"
clearable maxlength="150" type="textarea"
style="width: 250px" rows="4"/>
</el-form-item>
<el-form-item label="照片" prop="picture">
<el-upload ref="upload" :limit="1" :headers="upload.headers" drag
:action="upload.url" :show-file-list="false" accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"
:on-success="handleFileSuccess3" :auto-upload="true">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<!-- <div class="el-upload__tip" slot="tip">只能上传jpg/png文件且不超过500kb</div> -->
</el-upload>
</el-form-item>
</el-form>
</div>
<div style="width: 100%;height: 50px;display: flex;justify-content: flex-end;align-items: center;">
<el-button type="primary" size="mini">保存</el-button>
<el-button type="normal" size="mini" @click="openScrap=false">取消</el-button>
</div>
</el-dialog>
<!-- 图片查看弹窗 -->
<el-dialog :visible.sync="dialogVisible" width="500px" height="500px" >
@ -228,9 +301,12 @@
<script>
import { getListFacturer } from '@/api/ma/supplier';
import {
equipmentTypeTree,
} from '@/api/purchase/goodsArrived';
import {
getAppRepairMaTypeList,
partTypeTreeList
} from '@/api/repair/repair.js'
import {
getProjectList,
getUnitList,
@ -248,8 +324,8 @@ export default {
name: '',
dicts: ['ma_machine_status'],
props: {
Id: {
type: [String, Number],
repairRow: {
type: [Object],
}
},
data() {
@ -269,19 +345,18 @@ export default {
//
title: '',
//
queryParams: {
unitId:"111",
unitName:"安徽润森电力工程有限公司",
proId:"222",
proName:"安徽滁州天长-开元110",
repairCode:"X20240725-391",
queryParams: {
backUnit:"",
backPro:"",
repairCode:"",
equipmentList: [],
},
equipmentList: [],
//
open: false,
openCode: false,
repairRowData:{},
maCodeList: [],//
repairDeviceList: [],//
//
dialogImageUrl: '',
dialogVisible: false,
@ -293,6 +368,7 @@ export default {
//
url: process.env.VUE_APP_BASE_API + '/file/upload'
},
//
openInner: false,
innerRowData:{},
@ -305,9 +381,9 @@ export default {
//
partTypeTreeProps: {
children: 'children',
label: 'typeName',
label: 'label',
// multiple: false,
value: 'typeId',
value: 'id',
multiple: true,
},
propsKey: 1000,
@ -342,29 +418,39 @@ export default {
//
supplierList:[],
//
openScrap: false,
scrapRowData:{},
scrapForm:{
scrapReason:"",
damageReason:"",
otherReason:"",
fileName:"",
fileUrl:"",
},
damageReasonList:[{label:"自然损坏",id:"自然损坏"},{label:"人为损坏",id:"人为损坏"}],//
scrapRules:{
},
//
deviceTypeTree: [], //
//
deviceTypeTreeProps: {
children: 'children',
label: 'typeName',
label: 'label',
// multiple: false,
value: 'typeId',
value: 'id',
multiple: true,
},
//
deviceType: null,
createBy: '',
rowId: '',
companyId: '',
createBy: '',
}
},
mounted() {
console.log(this.repairRow)
this.GetViewByApply()
if (this.Id) {//
console.log(this.Id)
this.rowId = this.Id;
this.GetViewByApply()
}
this.supplierInfoList()
// getInfo().then((res) => {
// this.companyId = res.user.companyId
@ -374,136 +460,47 @@ export default {
computed: {
...mapState(['user']),
},
methods: {
//
async GetDeviceTypeTreeFn() {
const params = {
// agreementId: agreementId,
}
// equipmentTypeTree().then((response) => {
// this.deviceTypeTree = response.data
// })
//
const res = await equipmentTypeTree(params)
console.log('resgetUseTypeTreee==========', res)
this.deviceTypeTree = res.data;
//
let selectList = []
this.equipmentList.forEach((e) => {
selectList.push(
this.getParentsById(this.deviceTypeTree, e.typeId),
)
})
this.deviceType = selectList
this.$forceUpdate()
methods: {
goBack(){
this.$emit('goBackPage')
},
//
getParentsById(list, id) {
for (let i in list) {
if (list[i].typeId == id) {
//value
return [list[i].typeId]
}
if (list[i].children) {
let node = this.getParentsById(list[i].children, id)
if (node !== undefined) {
//
node.unshift(list[i].typeId)
return node
}
}
}
},
//
async deviceTypeChange(val) {
const deviceTypeList =
this.$refs.deviceTypeCascader.getCheckedNodes()
console.log(deviceTypeList)
let tempList = []
if (val.length > 0) {
const items = val.map((e) => {
return e[3]
})
for (let i of items) {
for (let z of deviceTypeList) {
if (z.data.typeId === i) {
const obj = JSON.parse(JSON.stringify(z.data))
console.log(obj)
obj.typeModel = obj.typeName
obj.typeName = deviceTypeList[2].data.typeName
// obj.preNum = 0
// obj.apDetection = ''
obj.maCodeList=[]
obj.bmFileInfos=[]
tempList.push(obj)
break
}
}
}
const newDataListNew = [...this.equipmentList, ...tempList]
const map = new Map()
for (let item of newDataListNew) {
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)
}
})
})
this.equipmentList = newArray_array
} else {
this.equipmentList = []
}
},
//
async GetViewByApply(params) {
// const res = await getBackApplyInfo(this.rowId)
// console.log(res)
// const data = res.data
let data = {
backApplyInfo:{
unitId:"111",
unitName:"安徽润森电力工程有限公司",
proId:"222",
proName:"安徽滁州天长-开元110",
repairCode:"X20240725-391"
}
async GetViewByApply() {
console.log(this.repairRow)
this.queryParams.backUnit = this.repairRow.backUnit
this.queryParams.backPro = this.repairRow.backPro
this.queryParams.repairCode = this.repairRow.repairCode
let param = {
taskId:this.repairRow.taskId,
keyword:""
}
console.log(data)
this.queryParams.unitId = data.backApplyInfo.unitId
this.queryParams.unitName = data.backApplyInfo.unitName
this.queryParams.proId = data.backApplyInfo.proId
this.queryParams.proName = data.backApplyInfo.proName
this.queryParams.repairCode = data.backApplyInfo.repairCode
// this.equipmentList = data.backApplyDetailsList
this.equipmentList = [
{
typeName:"牵引机",
typeModel:"90kN",
unitName:"台",
preNum:"10",
num1:"0",
num2:"10",
manageType:"0"
},
{
typeName:"单轮滑车",
typeModel:"φ508",
unitName:"台",
preNum:"100",
num1:"0",
num2:"100",
manageType:"1"
},
]
console.log(param)
const res = await getAppRepairMaTypeList(param)
console.log(res)
this.equipmentList = res.data
this.equipmentList.forEach((e) => {
e.disrepairNum=Number(e.repairNum)-Number(e.repairedNum)
})
// this.equipmentList = [
// {
// typeName:"",
// typeModel:"90kN",
// unitName:"",
// preNum:"10",
// num1:"0",
// num2:"10",
// manageType:"0"
// },
// {
// typeName:"",
// typeModel:"φ508",
// unitName:"",
// preNum:"100",
// num1:"0",
// num2:"100",
// manageType:"1"
// },
// ]
// this.GetDeviceTypeTreeFn(data.backApplyInfo.agreementId)
},
@ -517,19 +514,13 @@ export default {
this.$message.error('请先勾选数据')
return
}
console.log(this.queryParams)
// this.queryParams.createBy = this.user.name
// this.queryParams.companyId = this.companyId
// this.queryParams.backApplyInfo = {
// repairCode: this.queryParams.repairCode,
console.log(this.queryParams)
// this.queryParams.backApplyInfo = {
// remark: this.queryParams.remark,
// agreementId: this.queryParams.agreementId,
// backTime: this.queryParams.backTime,
// createBy: this.queryParams.createBy,
// companyId: this.queryParams.companyId,
// backTime: this.queryParams.backTime,
// }
// let params = {
// id:this.rowId,
// let params = {
// backApplyInfo: this.queryParams.backApplyInfo,
// backApplyDetailsList:
// this.queryParams.equipmentList,
@ -582,84 +573,71 @@ export default {
//-
/** 维修按钮操作 */
/** 编码维修按钮操作 */
handleRepair(row){
this.repairRowData=row;
this.maCodeList=[]
this.repairRowData.maCodeList=[
{
materialName:"速差自控器",
typeName:"G-J-10",
maId:"1",
maCode:"W202407-00001",
maStatus:"待修",
apDetection:"",
partTableList:[],
backTableList:[],
bmFileInfos:[]
},
{
materialName:"速差自控器",
typeName:"G-J-10",
maId:"2",
maCode:"W202407-00002",
maStatus:"待修",
apDetection:"",
partTableList:[],
backTableList:[],
bmFileInfos:[]
},
{
materialName:"速差自控器",
typeName:"G-J-10",
maId:"3",
maCode:"W202407-00003",
maStatus:"待修",
apDetection:"",
partTableList:[],
backTableList:[],
bmFileInfos:[]
},
]
if(this.repairRowData.maCodeList&&this.repairRowData.maCodeList.length>0){
this.maCodeList = this.repairRowData.maCodeList
this.repairDeviceList=[]
// this.repairRowData.repairDeviceList=[
// {
// materialName:"",
// typeName:"G-J-10",
// maId:"1",
// maCode:"W202407-00001",
// maStatus:"",
// apDetection:"",
// partTableList:[],
// backTableList:[],
// bmFileInfos:[]
// },
// {
// materialName:"",
// typeName:"G-J-10",
// maId:"2",
// maCode:"W202407-00002",
// maStatus:"",
// apDetection:"",
// partTableList:[],
// backTableList:[],
// bmFileInfos:[]
// },
// {
// materialName:"",
// typeName:"G-J-10",
// maId:"3",
// maCode:"W202407-00003",
// maStatus:"",
// apDetection:"",
// partTableList:[],
// backTableList:[],
// bmFileInfos:[]
// },
// ]
if(this.repairRowData.repairDeviceList&&this.repairRowData.repairDeviceList.length>0){
this.repairDeviceList = this.repairRowData.repairDeviceList
}
this.open=true;
this.openCode=true;
},
//
//
saveCodeDialog(){
console.log(this.repairRowData)
console.log(this.maCodeList)
this.repairRowData.maCodeList = this.maCodeList;
this.open=false
console.log(this.repairDeviceList)
this.repairRowData.repairDeviceList = this.repairDeviceList;
this.openCode=false
// console.log(this.equipmentList)
},
//
//
beforeFileUpload(row){
this.fileData = row
},
// -退
handleFileSuccess(response, file, fileList) {
if(response.code==200){
let obj = {
"name": response.data.name,
"url": response.data.url,
}
let index = this.equipmentList.findIndex(v=>v.typeId==this.fileData.typeId)
this.equipmentList[index].bmFileInfos=[obj]
}
},
// -
},
// -
handleFileSuccess2(response, file, fileList) {
if(response.code==200){
let obj = {
"name": response.data.name,
"url": response.data.url,
}
let index = this.maCodeList.findIndex(v=>v.maCode==this.fileData.maCode)
this.maCodeList[index].bmFileInfos=[obj]
let index = this.repairDeviceList.findIndex(v=>v.maCode==this.fileData.maCode)
this.repairDeviceList[index].bmFileInfos=[obj]
}
},
//
@ -692,15 +670,14 @@ export default {
},
//-
async getPartTypeTreeData() {
const params = {
}
const res = await equipmentTypeTree(params)
const params = {}
const res = await partTypeTreeList(params)
console.log('treeData==========', res)
this.partTypeTree = res.data;
//
let selectList = []
this.partTableList.forEach((e) => {
selectList.push(this.getSelectId(this.partTypeTree, e.typeId))
selectList.push(this.getSelectId(this.partTypeTree, e.id))
})
this.partType = selectList
this.$forceUpdate()
@ -708,15 +685,15 @@ export default {
//-
getSelectId(list, id) {
for (let i in list) {
if (list[i].typeId == id) {
if (list[i].id == id) {
//value
return [list[i].typeId]
return [list[i].id]
}
if (list[i].children) {
let node = this.getSelectId(list[i].children, id)
if (node !== undefined) {
//
node.unshift(list[i].typeId)
node.unshift(list[i].id)
return node
}
}
@ -726,24 +703,23 @@ export default {
async partTypeChange(val) {
const partTypeList =
this.$refs.partTypeCascader.getCheckedNodes()
// console.log(partTypeList)
console.log(partTypeList)
let tempList = []
if (val.length > 0) {
const items = val.map((e) => {
return e[3]
})
return e[2]
})
for (let i of items) {
for (let z of partTypeList) {
if (z.data.typeId === i) {
if (z.data.id === i) {
const parent = z.parent
console.log(parent)
const obj = JSON.parse(JSON.stringify(z.data))
console.log(obj)
//typeName typeCode isCharge partNum
obj.typeCode = obj.typeName
obj.typeCode = obj.label
obj.typeName = parent.label
obj.isCharge = "0"
obj.partNum = 0
obj.partNum = 1
console.log(obj)
tempList.push(obj)
break
@ -753,15 +729,15 @@ export default {
const newDataListNew = [...this.partTableList, ...tempList]
const map = new Map()
for (let item of newDataListNew) {
if (!map.has(item.typeId)) {
map.set(item.typeId, item)
if (!map.has(item.id)) {
map.set(item.id, item)
}
}
const newArray = [...map.values()]
let newArray_array = []
items.forEach((e) => {
newArray.forEach((j) => {
if (e == j.typeId) {
if (e == j.id) {
newArray_array.push(j)
}
})
@ -779,13 +755,13 @@ export default {
//-
handleDeletePart(row){
this.partType.forEach((e, index) => {
if (e[3] === row.typeId) {
if (e[2] === row.id) {
this.partType.splice(index, 1)
this.propsKey++
}
})
this.partTableList.forEach((item, index) => {
if (item.typeId == row.typeId) {
if (item.id == row.id) {
this.partTableList.splice(index, 1)
}
})
@ -794,6 +770,11 @@ export default {
saveInnerDialog(){
console.log(this.innerRowData)
console.log(this.partTableList)
const isNum = this.partTableList.some((item) => item.partNum == 0 || item.partNum == undefined,)
if (isNum) {
this.$message.error('配件数量不能为0')
return
}
this.innerRowData.partTableList = this.partTableList;
this.openInner=false
// console.log(this.equipmentList)
@ -815,7 +796,7 @@ export default {
let obj={
partName:"",
isCharge:"0",
partNum:0,
partNum:1,
backCost:0,
}
this.backTableList.push(obj)
@ -878,6 +859,26 @@ export default {
})
},
// -
openScrapDialog(row){
this.scrapRowData = row;
// if(this.scrapRowData.backTableList&&this.scrapRowData.backTableList.length>0){
// this.scrapForm = this.scrapRowData.scrapForm;
// }else{
this.scrapForm={}
// }
this.openScrap=true;
},
// -
handleFileSuccess3(response, file, fileList) {
if(response.code==200){
let obj = {
"name": response.data.name,
"url": response.data.url,
}
// this.scrapForm={}
}
},
},
}
@ -888,7 +889,7 @@ export default {
display: none;
}
.el-cascader-panel .el-scrollbar:nth-child(4) .el-checkbox {
.el-cascader-panel .el-scrollbar:nth-child(3) .el-checkbox {
display: block !important;
}
}

View File

@ -56,12 +56,15 @@
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button type="primary" plain size="mini" @click="handleAdd">新增</el-button>
</el-col>
</el-col> -->
<el-col :span="1.5">
<el-button type="warning" plain size="mini">提交</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain size="mini" @click="handleReject">退回</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
</el-col>
@ -69,33 +72,33 @@
</el-row>
<el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<!-- <el-table-column label="序号" align="center" width="80" type="index>
<template scope="scope">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{(queryParams.pageNum - 1) * 10 + scope.$index + 1}}</span>
</template>
</el-table-column> -->
<el-table-column align="center" label="序号" type="index"/>
<el-table-column label="退料单位" align="center" prop="unitName" :show-overflow-tooltip="true"/>
<el-table-column label="退料工程" align="center" prop="proName" :show-overflow-tooltip="true"/>
<el-table-column label="维修单号" align="center" prop="code" :show-overflow-tooltip="true"/>
<el-table-column label="物资类型" align="center" prop="typeName" :show-overflow-tooltip="true"/>
<el-table-column label="退料单号" align="center" prop="code" :show-overflow-tooltip="true"/>
<el-table-column label="维修班组" align="center" prop="backPerson" :show-overflow-tooltip="true"/>
</el-table-column>
<!-- <el-table-column align="center" label="序号" type="index"/> -->
<el-table-column label="退料单位" align="center" prop="backUnit" :show-overflow-tooltip="true"/>
<el-table-column label="退料工程" align="center" prop="backPro" :show-overflow-tooltip="true"/>
<el-table-column label="维修单号" align="center" prop="repairCode" :show-overflow-tooltip="true"/>
<el-table-column label="物资类型" align="center" prop="type" :show-overflow-tooltip="true"/>
<el-table-column label="退料单号" align="center" prop="backCode" :show-overflow-tooltip="true"/>
<el-table-column label="维修班组" align="center" prop="repairer" :show-overflow-tooltip="true"/>
<!-- <el-table-column label="退料人电话" align="center" prop="phone" :show-overflow-tooltip="true"/> -->
<el-table-column label="创建人" align="center" prop="createBy" :show-overflow-tooltip="true"/>
<el-table-column label="创建人" align="center" prop="createName" :show-overflow-tooltip="true"/>
<el-table-column label="创建时间" align="center" prop="createTime" :show-overflow-tooltip="true"/>
<el-table-column label="状态" align="center" :show-overflow-tooltip="true" prop="taskStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.back_task_status" :value="scope.row.taskStatus"/>
</template>
<el-table-column label="状态" align="center" :show-overflow-tooltip="true" prop="repairStatusCode">
<!-- <template slot-scope="scope">
<dict-tag :options="dict.type.back_task_status" :value="scope.row.repairStatusCode"/>
</template> -->
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
<template slot-scope="scope">
<el-button size="mini" plain icon="el-icon-zoom-in" @click="handleSee(scope.row)" >查看</el-button>
<el-button size="mini" type="warning" plain icon="el-icon-edit" @click="handleUpdate(scope.row)">编辑</el-button>
<el-button size="mini" type="danger" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
<el-button size="mini" type="primary" plain icon="el-icon-edit" @click="handleUpdate(scope.row)">维修</el-button>
<el-button size="mini" type="danger" icon="el-icon-delete" @click="handleReject(scope.row)">驳回</el-button>
</template>
</el-table-column>
</el-table>
@ -110,13 +113,12 @@
</template>
<script>
import {
getBackApplyList,
getProjectList,
getUnitList,
backApplyRemove
} from '@/api/back/index.js'
getRepairTaskList,
rejectRepair
} from '@/api/repair/repair.js'
import { getInfo, h } from '@/api/login'
export default {
name: '',
@ -188,7 +190,7 @@ export default {
companyId: this.companyId,
...this.queryParams,
}
const res = await getBackApplyList(params)
const res = await getRepairTaskList(params)
this.tableList = res.rows
this.total = res.total
this.loading = false
@ -208,7 +210,7 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.dictId)
this.ids = selection.map((item) => item.taskId)
this.single = selection.length != 1
this.multiple = !selection.length
},
@ -218,37 +220,33 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$emit("handelEdit",row.id);
this.$emit("handelEdit",row);
},
/** 查看按钮操作 */
handleSee(row) {
this.$emit("handelView",row.id);
},
this.$emit("handelView",row);
},
/** 删除按钮操作 */
handleDelete(row) {
// let param = {
// id:row.id+ '',
// }
this.$modal
.confirm('是否确认删除所选择的数据项?')
.then(() => {
return backApplyRemove(row.id)
})
.then(() => {
this.getList()
this.$message.success('操作成功!')
})
.catch(() => {
})
handleReject(row) {
const taskIds = row.taskId || this.ids;
this.$modal.confirm('是否确认驳回该退料?').then(function() {
return rejectRepair(taskIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
'material/backApply/export',
'material/repair/export',
{
...this.queryParams
...this.queryParams,
startTime:this.queryParams.time[0],
endTime:this.queryParams.time[1]
},
`退料申请单_${new Date().getTime()}.xlsx`,
`维修任务单_${new Date().getTime()}.xlsx`,
)
},
},

View File

@ -8,7 +8,7 @@
/>
<component
:is="isShowComponent"
:Id="Id"
:repairRow="repairRow"
:isView="isView"
@handelAdd="handelAdd"
@handelEdit="handelEdit"
@ -34,24 +34,23 @@ export default {
return {
isShowComponent: 'Home',
pageContent: '',
Id: '',
repairRow: {},
isView: false,
}
},
methods: {
handelAdd() {
this.Id = ''
handelAdd() {
this.pageContent = '新建任务'
this.isShowComponent = 'EditPage'
},
handelEdit(id) {
this.Id = id
handelEdit(row) {
this.repairRow = row
this.pageContent = '编辑任务'
this.isShowComponent = 'EditPage'
},
handelView(id) {
handelView(row) {
this.isView = true
this.Id = id
this.repairRow = row
this.pageContent = '查看任务'
this.isShowComponent = 'viewPage'
},