修试入库驳回原因

This commit is contained in:
zzyuan 2024-12-13 17:09:28 +08:00
parent 2367f8676b
commit 082f72f965
1 changed files with 139 additions and 101 deletions

View File

@ -14,32 +14,7 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- <el-row :gutter="10" class="mb8"> <el-table v-loading="loading" :data="equipmentList" row-key="id">
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-check"
size="mini"
:disabled="multiple"
@click="handlePassAll"
>入库</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-close"
size="mini"
:disabled="multiple"
@click="handleFailAll"
>驳回</el-button
>
</el-col>
</el-row> -->
<el-table v-loading="loading" :data="equipmentList" row-key="id" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" :selectable="selectable"/> -->
<el-table-column label="序号" align="center" type="index" /> <el-table-column label="序号" align="center" type="index" />
<el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true"/> <el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
<el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true"/> <el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true"/>
@ -50,7 +25,6 @@
<el-table-column label="被驳回数量" align="center" prop="rejectNum" :show-overflow-tooltip="true" /> <el-table-column label="被驳回数量" align="center" prop="rejectNum" :show-overflow-tooltip="true" />
<el-table-column label="管理模式" align="center" prop="manageType" :show-overflow-tooltip="true"> <el-table-column label="管理模式" align="center" prop="manageType" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 0编码1数量 -->
<div v-if="scope.row.manageType==0">编码管理</div> <div v-if="scope.row.manageType==0">编码管理</div>
<div v-if="scope.row.manageType==1">数量管理</div> <div v-if="scope.row.manageType==1">数量管理</div>
</template> </template>
@ -83,14 +57,14 @@
</el-dialog> </el-dialog>
<!-- 数量入库驳回框 --> <!-- 数量入库驳回框 -->
<el-dialog title="数量入库" :visible.sync="numOpen2" width="600px" append-to-body> <el-dialog title="数量入库" :visible.sync="numOpen2" width="600px" append-to-body>
<div style="width: 100%;height: 100%;display: flex;align-items: center;"> <div style="width: 100%;height: 100%;display: flex;align-items: center;margin-bottom: 10px;">
<span style="width: 100px;">驳回数量</span> <span style="width: 100px;">驳回数量</span>
<el-input v-model="numInput2" type="number" min="0" @input="(v)=>(rowData.unitValue==1?numInput2=Number(v.replace(/[^\d.]/g,'')) : numInput2=Number(v.replace(/[^\d]/g,'')))" <el-input v-model="numInput2" type="number" min="0" @input="(v)=>(rowData.unitValue==1?numInput2=Number(v.replace(/[^\d.]/g,'')) : numInput2=Number(v.replace(/[^\d]/g,'')))"
placeholder="请输入驳回数量:" clearable maxlength="20" style="width: 400px"/> placeholder="请输入驳回数量:" clearable maxlength="20" style="width: 400px"/>
</div> </div>
<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: 100px;">驳回原因</span> <span style="width: 100px;">驳回原因</span>
<el-input v-model="rejectReason" type="text" <el-input v-model="rejectReason" type="textarea"
placeholder="请输入驳回原因:" clearable maxlength="50" style="width: 400px"/> placeholder="请输入驳回原因:" clearable maxlength="50" style="width: 400px"/>
</div> </div>
<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;">
@ -118,8 +92,32 @@
<el-button size="mini" @click="resetCodeQuery">重置</el-button> <el-button size="mini" @click="resetCodeQuery">重置</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-table :data="maCodeList" width="100%" ref="codeTableList" height="450px" row-key="maId"> <el-row :gutter="10" class="mb8">
<!-- <el-table-column type="selection" width="55" align="center" /> --> <el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-check"
size="mini"
:disabled="multiple"
@click="handlePassAll"
>入库</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-close"
size="mini"
:disabled="multiple"
@click="handleFailAll"
>驳回</el-button
>
</el-col>
</el-row>
<el-table :data="maCodeList" width="100%" ref="codeTableList" height="450px" row-key="maId" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" :selectable="selectable"/>
<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="typeName" align="center" :show-overflow-tooltip="true"/> <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 label="规格型号" prop="materialName" align="center" :show-overflow-tooltip="true"/>
@ -129,6 +127,7 @@
<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 label="驳回原因" prop="rejectReason" align="center" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" size="mini" @click="codeWarehouse(scope.row)" v-if="!isReject&&scope.row.maStatus=='5'">入库</el-button> <el-button type="primary" size="mini" @click="codeWarehouse(scope.row)" v-if="!isReject&&scope.row.maStatus=='5'">入库</el-button>
@ -142,6 +141,22 @@
</div> --> </div> -->
</el-dialog> </el-dialog>
<!-- 编码入库驳回框 -->
<el-dialog :visible.sync="codeOpen" width="500px" append-to-body :show-close="false">
<div style="width: 100%;height: 100%;display: flex;align-items: center;margin-bottom: 20px;">
<span style="width: 100%;font-size: 16px;">是否确认驳回所选择的设备编码</span>
</div>
<div style="width: 100%;height: 100%;display: flex;align-items: center;">
<span style="width: 100px;">驳回原因</span>
<el-input v-model="rejectReason" type="textarea"
placeholder="请输入驳回原因:" clearable maxlength="100" style="width: 400px"/>
</div>
<div style="width: 100%;height: 50px;display: flex;justify-content: flex-end;align-items: center;">
<el-button type="primary" size="mini" @click="confirmRejectCode">确定</el-button>
<el-button type="normal" size="mini" @click="codeOpen=false">取消</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -211,6 +226,8 @@ export default {
isReject: false, isReject: false,
keyWord:"", keyWord:"",
maCodeList: [], maCodeList: [],
codeOpen: false,
codeRow:{}
}; };
}, },
computed: {}, computed: {},
@ -237,7 +254,6 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
// //
handlePass(row) { handlePass(row) {
console.log(row) console.log(row)
@ -280,7 +296,7 @@ export default {
}); });
} }
}, },
// //-
handleFail(row) { handleFail(row) {
console.log(row) console.log(row)
console.log(row.manageType) console.log(row.manageType)
@ -297,7 +313,7 @@ export default {
this.open=true; this.open=true;
} }
}, },
// //--
rejectNumInput(){ rejectNumInput(){
console.log(this.rowData) console.log(this.rowData)
console.log(this.numInput2) console.log(this.numInput2)
@ -313,6 +329,7 @@ export default {
agreementId:this.rowData.agreementId, agreementId:this.rowData.agreementId,
taskId:this.rowData.taskId, taskId:this.rowData.taskId,
typeId:this.rowData.typeId, typeId:this.rowData.typeId,
rejectReason:this.rejectReason,
pendingInputNum:this.rowData.pendingInputNum, pendingInputNum:this.rowData.pendingInputNum,
rejectNum:this.numInput2 rejectNum:this.numInput2
} }
@ -325,7 +342,7 @@ export default {
}); });
} }
}, },
// //-
handleViewCode(row){ handleViewCode(row){
this.rowData=row; this.rowData=row;
this.isReject=true; this.isReject=true;
@ -348,7 +365,7 @@ export default {
} }
}); });
}, },
// //-
resetCodeQuery(){ resetCodeQuery(){
this.keyWord="" this.keyWord=""
this.queryCodeList() this.queryCodeList()
@ -374,15 +391,97 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
//- //--
rejectCodeWarehouse(codeRow){ rejectCodeWarehouse(codeRow){
console.log(this.rowData) console.log(this.rowData)
console.log(codeRow) console.log(codeRow)
this.rejectReason="";
this.codeOpen=true;
this.codeRow=codeRow
// let param = {
// agreementId:this.rowData.agreementId,
// taskId:this.rowData.taskId,
// typeId:this.rowData.typeId,
// maCodeList:[{maId:codeRow.maId}]
// }
// this.$modal.confirm("")
// .then(function () {
// return rejectWarehouseApi(param);
// }).then((response) => {
// if(response.code==200){
// this.$modal.msgSuccess("");
// this.queryCodeList();
// this.getTaskInfo();
// }
// })
// .catch(() => {});
},
//---
confirmRejectCode(){
let param = { let param = {
agreementId:this.rowData.agreementId, agreementId:this.rowData.agreementId,
taskId:this.rowData.taskId, taskId:this.rowData.taskId,
typeId:this.rowData.typeId, typeId:this.rowData.typeId,
maCodeList:[{maId:codeRow.maId}] rejectReason:this.rejectReason,
maCodeList:[{maId:this.codeRow.maId}]
}
rejectWarehouseApi(param).then((response) => {
if(response.code==200){
this.$modal.msgSuccess("驳回成功");
this.codeOpen=false;
this.queryCodeList();
this.getTaskInfo();
}
})
},
//
selectable(row) {
if (row.maStatus == "5") {
return true;
} else {
return false;
}
},
//
handleSelectionChange(selection) {
this.passTemp = [];
this.failTemp = [];
this.ids = selection.map((item) => item.id);
selection.forEach((item) => {
this.passTemp.push({maId:item.maId});
});
selection.forEach((item) => {
this.failTemp.push({maId:item.maId});
});
this.single = selection.length != 1;
this.multiple = !selection.length;
},
//-
handlePassAll() {
let param = {
taskId:this.rowData.taskId,
typeId:this.rowData.typeId,
maCodeList:this.passTemp
}
this.$modal.confirm("是否确认入库所选择的设备编码?")
.then(function () {
return repairInputWarehouseApi(param);
}).then((response) => {
if(response.code==200){
this.$modal.msgSuccess("入库成功");
this.queryCodeList();
this.getTaskInfo();
}
})
.catch(() => {});
},
//-
handleFailAll() {
let param = {
agreementId:this.rowData.agreementId,
taskId:this.rowData.taskId,
typeId:this.rowData.typeId,
maCodeList:this.failTemp
} }
this.$modal.confirm("是否确认驳回所选择的设备编码?") this.$modal.confirm("是否确认驳回所选择的设备编码?")
.then(function () { .then(function () {
@ -396,67 +495,6 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
//
selectable(row) {
if (row.status == "0") {
return true;
} else {
return false;
}
},
//
handleSelectionChange(selection) {
this.passTemp = [];
this.failTemp = [];
this.ids = selection.map((item) => item.id);
selection.forEach((item) => {
this.passTemp.push({ id: item.id, status: "1",specificationType: item.specificationType,machineTypeName:item.machineTypeName,
unitName:item.unitName,repairNum:item.repairNum,repairedNum:item.repairedNum,typeId:item.typeId,taskId:item.taskId,
auditId:item.id,repairId:item.repairId,maId:item.maId, });
});
selection.forEach((item) => {
this.failTemp.push({ id: item.id, status: "2",specificationType: item.specificationType,machineTypeName:item.machineTypeName,
unitName:item.unitName,repairNum:item.repairNum,repairedNum:item.repairedNum,typeId:item.typeId,taskId:item.taskId,
auditId:item.id,repairId:item.repairId,maId:item.maId, });
});
this.single = selection.length != 1;
this.multiple = !selection.length;
console.log(this.multiple)
},
//
handlePassAll() {
if (this.ids.length == 0) {
this.$alert("请至少勾选一条入库数据", "提示", {
type: "warning",
confirmButtonText: "确定",
});
return;
} else {
// auditPass(this.passTemp).then((response) => {
// if (response.code == 200) {
// this.$modal.msgSuccess("");
// }
// this.getTaskInfo();
// });
}
},
//
handleFailAll() {
if (this.ids.length == 0) {
this.$alert("请至少勾选一条入库数据", "提示", {
type: "warning",
confirmButtonText: "确定",
});
return;
} else {
// auditPass(this.failTemp).then((response) => {
// if (response.code == 200) {
// this.$modal.msgSuccess("");
// }
// this.getTaskInfo();
// });
}
},
}, },