Merge branch 'material-ui' of http://192.168.0.56:3000/bonus/bonus-ui into material-ui

This commit is contained in:
jjLv 2024-11-22 10:18:45 +08:00
commit e8d1aa05e0
4 changed files with 112 additions and 74 deletions

View File

@ -54,10 +54,11 @@ export function addBackApply(data) {
} }
// 退料--删除 // 退料--删除
export function backApplyRemove(ids) { export function backApplyRemove(data) {
return request({ return request({
url: '/material/back_apply_info/' + ids, url: '/material/back_apply_info/deleteById',
method: 'delete', method: 'post',
data: data
}) })
} }

View File

@ -286,8 +286,8 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-dialog title="编码退料" :visible.sync="open" width="1000px" append-to-body> <el-dialog title="编码退料" :visible.sync="open" width="1200px" append-to-body>
<el-row :gutter="10" class="mb8"> <!-- <el-row :gutter="10" class="mb8">
<el-col :span="6"> <el-col :span="6">
<div style="width: 100%;height: 100%;display: flex;align-items: center;"> <div style="width: 100%;height: 100%;display: flex;align-items: center;">
<span style="width: 80px;">编码</span> <span style="width: 80px;">编码</span>
@ -303,12 +303,13 @@
<el-col :span="1.5"> <el-col :span="1.5">
<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 :data="maCodeList" width="100%" height="450px"> <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="序号" type="index" width="55" align="center"/>
<el-table-column label="类型名称" prop="materialName" align="center" :show-overflow-tooltip="true"> <el-table-column label="类型名称" prop="typeName" align="center" :show-overflow-tooltip="true">
</el-table-column> </el-table-column>
<el-table-column label="规格型号" prop="typeName" align="center" :show-overflow-tooltip="true"> <el-table-column label="规格型号" prop="materialName" align="center" :show-overflow-tooltip="true">
</el-table-column> </el-table-column>
<el-table-column label="设备编码" prop="maCode" align="center" :show-overflow-tooltip="true"> <el-table-column label="设备编码" prop="maCode" align="center" :show-overflow-tooltip="true">
</el-table-column> </el-table-column>
@ -343,12 +344,12 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="120px"> <!-- <el-table-column label="操作" align="center" width="120px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="danger" <el-button size="mini" type="danger"
@click="handleDeleteCode({ ...scope.row, index: scope.$index })">删除</el-button> @click="handleDeleteCode({ ...scope.row, index: scope.$index })">删除</el-button>
</template> </template>
</el-table-column> </el-table-column> -->
</el-table> </el-table>
<div style="width: 100%;height: 50px;display: flex;justify-content: flex-end;align-items: center;"> <div style="width: 100%;height: 50px;display: flex;justify-content: flex-end;align-items: center;">
<el-button type="primary" size="mini" @click="saveDevCode">保存</el-button> <el-button type="primary" size="mini" @click="saveDevCode">保存</el-button>
@ -782,6 +783,7 @@ export default {
// this.queryParams.createBy = this.user.name // this.queryParams.createBy = this.user.name
// this.queryParams.companyId = this.companyId // this.queryParams.companyId = this.companyId
this.queryParams.backApplyInfo = { this.queryParams.backApplyInfo = {
id:this.rowId,
backPerson: this.queryParams.backPerson, backPerson: this.queryParams.backPerson,
phone: this.queryParams.phone, phone: this.queryParams.phone,
remark: this.queryParams.remark, remark: this.queryParams.remark,
@ -792,7 +794,6 @@ export default {
} }
if (this.rowId != '') { if (this.rowId != '') {
let params = { let params = {
id:this.rowId,
backApplyInfo: this.queryParams.backApplyInfo, backApplyInfo: this.queryParams.backApplyInfo,
backApplyDetailsList: backApplyDetailsList:
this.queryParams.equipmentList, this.queryParams.equipmentList,
@ -878,7 +879,7 @@ export default {
const obj = JSON.parse(JSON.stringify(z.data)) const obj = JSON.parse(JSON.stringify(z.data))
console.log(obj) console.log(obj)
obj.typeModel = obj.typeName obj.typeModel = obj.typeName
obj.typeName = deviceTypeList[2].data.typeName obj.typeName = obj.materialName
obj.preNum = 0 obj.preNum = 0
obj.apDetection = '' obj.apDetection = ''
obj.remark = '' obj.remark = ''
@ -927,71 +928,107 @@ export default {
template.useNum = node.data.useNum template.useNum = node.data.useNum
return template return template
}, },
//
getMachineById(typeId){ // changeMachine(val){
// console.log(val)
// this.maData = this.machineList.find(option => option.maId == val);
// // = this.machineList[index]
// },
//
async getMachineById(typeId){
let param = { let param = {
unitId:this.queryParams.unitId, unitId:this.queryParams.unitId,
proId:this.queryParams.proId, proId:this.queryParams.proId,
typeId:typeId typeId:typeId
} }
getMachineById(param).then((res) => { await getMachineById(param).then((res) => {
this.machineList=res.data this.machineList=res.data
this.machineList.forEach((item)=>{
item.bmFileInfos=[];
item.apDetection=""
})
}) })
}, },
changeMachine(val){
console.log(val)
this.maData = this.machineList.find(option => option.maId == val);
// = this.machineList[index]
},
//- //-
openAddCode(row){ async openAddCode(row){
this.rowData=row; this.rowData=row;
this.getMachineById(row.typeId) await this.getMachineById(row.typeId)
this.maId="" // this.maId=""
this.maCodeList=[]
if(this.rowData.maCodeList&&this.rowData.maCodeList.length>0){ if(this.rowData.maCodeList&&this.rowData.maCodeList.length>0){
this.maCodeList = this.rowData.maCodeList this.maCodeList = this.rowData.maCodeList;
// console.log(this.maCodeList)
// console.log(this.machineList)
if (this.rowId != '') {//
this.maCodeList.forEach((item)=>{
this.machineList.unshift(item)//
this.$nextTick(() => {
this.$refs.codeTableList.toggleRowSelection(item,true);
})
})
}else{//
// console.log("")
this.machineList.forEach((item)=>{
this.maCodeList.forEach((sub)=>{
if(sub.maId==item.maId){
this.$nextTick(() => {
setTimeout(()=>{
this.$refs.codeTableList.toggleRowSelection(item,true);
},500)
})
}
})
})
}
}else{
this.maCodeList=[]
} }
this.open=true; this.open=true;
}, },
codeSelectionChange(selection) {
this.maCodeList=selection
// console.log(selection)
// this.queryParams.equipmentList = selection
},
// //
handleAddCode(){ handleAddCode(){
console.log(this.rowData)
console.log(this.maId)
console.log(this.maData)
if(this.maId!=""){
let obj = {
materialName:this.maData.materialName,
typeId:this.maData.typeId,
typeName:this.maData.typeName,
maId:this.maData.maId,
maCode:this.maData.maCode,
maStatus:this.maData.maStatus,
bmFileInfos:[],
apDetection:"",
}
let index = this.maCodeList.findIndex(v=>v.maId==this.maId)
if(index>-1){
this.$message.error('设备编码已存在!')
}else{
this.maCodeList.push(obj)
}
}else{
this.$message.error('请先填写设备编码!')
}
},
/** 删除按钮操作 */
handleDeleteCode(row) {
this.maCodeList.splice(row.index, 1)
},
//
saveDevCode(){
// console.log(this.rowData) // console.log(this.rowData)
// console.log(this.maCodeList) // console.log(this.maCodeList)
// console.log(this.maId)
// console.log(this.maData)
// if(this.maId!=""){
// let obj = {
// materialName:this.maData.materialName,
// typeId:this.maData.typeId,
// typeName:this.maData.typeName,
// maId:this.maData.maId,
// maCode:this.maData.maCode,
// maStatus:this.maData.maStatus,
// bmFileInfos:[],
// apDetection:"",
// }
// let index = this.maCodeList.findIndex(v=>v.maId==this.maId)
// if(index>-1){
// this.$message.error('')
// }else{
// this.maCodeList.push(obj)
// }
// }else{
// this.$message.error('')
// }
},
// /** */
// handleDeleteCode(row) {
// this.maCodeList.splice(row.index, 1)
// },
//
saveDevCode(){
console.log(this.rowData)
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)
}, },
// //
beforeFileUpload(row){ beforeFileUpload(row){
@ -1006,19 +1043,19 @@ export default {
} }
let index = this.equipmentList.findIndex(v=>v.typeId==this.fileData.typeId) let index = this.equipmentList.findIndex(v=>v.typeId==this.fileData.typeId)
this.equipmentList[index].bmFileInfos=[obj] this.equipmentList[index].bmFileInfos=[obj]
} }
}, },
// - // -
handleFileSuccess2(response, file, fileList) { handleFileSuccess2(response, file, fileList) {
console.log(1111)
if(response.code==200){ if(response.code==200){
let obj = { let obj = {
"name": response.data.name, "name": response.data.name,
"url": response.data.url, "url": response.data.url,
} }
let index = this.maCodeList.findIndex(v=>v.maCode==this.fileData.maCode) let index = this.machineList.findIndex(v=>v.maCode==this.fileData.maCode)
this.maCodeList[index].bmFileInfos=[obj] this.machineList[index].bmFileInfos=[obj]
console.log(this.machineList)
} }
}, },
// //

View File

@ -28,9 +28,9 @@
style="width: 240px" style="width: 240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="退料状态" prop="taskStatus"> <el-form-item label="退料状态" prop="status">
<el-select <el-select
v-model="queryParams.taskStatus" v-model="queryParams.status"
clearable clearable
filterable filterable
style="width: 240px" style="width: 240px"
@ -424,7 +424,7 @@ export default {
keyWord: '', // keyWord: '', //
unitId: '', //id unitId: '', //id
lotId: '', //id lotId: '', //id
taskStatus: '', // status: '', //
typeId: '', // typeId: '', //
time: '', time: '',
agreementCode: '', // agreementCode: '', //
@ -630,7 +630,7 @@ export default {
this.$modal this.$modal
.confirm('是否确认删除所选择的退料任务?') .confirm('是否确认删除所选择的退料任务?')
.then(() => { .then(() => {
return backApplyRemove(row.id) return backApplyRemove({id:row.id})
}) })
.then(() => { .then(() => {
this.getList() this.getList()

View File

@ -81,7 +81,7 @@
<dict-tag :options="dict.type.purchase_task_status" :value="scope.row.taskStatus"/> <dict-tag :options="dict.type.purchase_task_status" :value="scope.row.taskStatus"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" width="250"> <el-table-column label="操作" align="center" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button