修试入库接口对接

This commit is contained in:
zzyuan 2024-12-13 10:51:39 +08:00
parent e34ac6f1b0
commit 3dd85bd679
2 changed files with 119 additions and 61 deletions

View File

@ -26,6 +26,24 @@ export function getCodeListApi(query) {
params: query
})
}
//修试入库-通过
export function repairInputWarehouseApi(data) {
return request({
url: '/material/repair_input_details/warehouse',
method: 'post',
data: data,
})
}
//修试入库-驳回
export function rejectWarehouseApi(data) {
return request({
url: '/material/repair_input_details/reject',
method: 'post',
data: data,
})
}
// //修试审核二级-通过,驳回
// export function auditPass(data) {

View File

@ -44,8 +44,8 @@
<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="unitName" :show-overflow-tooltip="true"/>
<el-table-column label="预入库数量" align="center" prop="pendingInputNum" :show-overflow-tooltip="true"/>
<el-table-column label="待入库数量" align="center" prop="repairNum" :show-overflow-tooltip="true"/>
<el-table-column label="预入库数量" align="center" prop="repairNum" :show-overflow-tooltip="true"/>
<el-table-column label="待入库数量" align="center" prop="pendingInputNum" :show-overflow-tooltip="true"/>
<el-table-column label="已入库数量" align="center" prop="inputNum" :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">
@ -55,25 +55,16 @@
<div v-if="scope.row.manageType==1">数量管理</div>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true">
<template slot-scope="scope">
<div v-if="scope.row.status == '0'" style="color: #e6a23c">
{{ "待入库" }}
</div>
<div v-if="scope.row.status == '1'" style="color: #67c23a">
{{ "已入库" }}
</div>
<div v-if="scope.row.status == '2'" style="color: #f56c6c">
{{ "已驳回" }}
</div>
<!-- <div v-else style="color: red;"></div> -->
</template>
<el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true">
<template slot-scope="scope">
<dict-tag :options="dict.type.repair_end_task_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button size="mini" style="margin-bottom: 10px" type="success" v-if="scope.row.status == '0'" @click="handlePass(scope.row)">入库</el-button>
<el-button size="mini" type="danger" v-if="scope.row.status == '0'" @click="handleFail(scope.row)">驳回</el-button>
<div v-if="scope.row.status != '0'">-</div>
<el-button size="mini" type="danger" v-if="scope.row.status == '0'" @click="handleFail(scope.row)">驳回</el-button>
<el-button size="mini" v-if="scope.row.status == '1'&&scope.row.manageType==0" @click="handleViewCode(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
@ -140,8 +131,8 @@
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="">入库</el-button>
<el-button size="mini" type="danger" @click="">驳回</el-button>
<el-button type="primary" size="mini" @click="codeWarehouse(scope.row)" v-if="!isReject&&scope.row.maStatus!='1'">入库</el-button>
<el-button size="mini" type="danger" @click="rejectCodeWarehouse(scope.row)" v-if="scope.row.maStatus!='1'">驳回</el-button>
</template>
</el-table-column>
</el-table>
@ -149,21 +140,19 @@
<el-button type="primary" size="mini" @click="saveDevCode">保存</el-button>
<el-button type="normal" size="mini" @click="open=false">取消</el-button>
</div> -->
</el-dialog>
</el-dialog>
</div>
</template>
<script>
import {
getTestedDetailListApi,getCodeListApi
getTestedDetailListApi,getCodeListApi,repairInputWarehouseApi,rejectWarehouseApi
} from "@/api/repair/testedInBound";
import { auditPass } from "@/api/repair/testExamine";
export default {
name: "",
dicts: ["ma_machine_status"],
dicts: ["ma_machine_status","repair_end_task_status"],
components: {
},
props: {
@ -219,6 +208,7 @@ export default {
numOpen2: false,
// -
open: false,
isReject: false,
keyWord:"",
maCodeList: [],
};
@ -248,7 +238,7 @@ export default {
});
},
//
//
handlePass(row) {
console.log(row)
console.log(row.manageType)
@ -258,20 +248,11 @@ export default {
this.rowData=row;
}else{//-
this.rowData=row;
this.open=true;
this.isReject=false;
this.keyWord=""
this.queryCodeList()
this.open=true;
}
// this.$modal
// .confirm("")
// .then(function () {
// return auditPass(param);
// })
// .then(() => {
// this.getTaskInfo();
// this.$modal.msgSuccess("");
// })
// .catch(() => {});
},
//
saveNumInput(){
@ -279,15 +260,27 @@ export default {
console.log(this.numInput)
if(this.numInput<=0){
this.$modal.msgError("入库数量需大于0!");
}else if(this.numInput>this.rowData.pendingInputNum){
this.$modal.msgError("入库数量不能大于预入库数量!");
this.numInput = this.rowData.pendingInputNum;
}else{
//
let param = {
taskId:this.rowData.taskId,
typeId:this.rowData.typeId,
pendingInputNum:this.rowData.pendingInputNum,
inputNum:this.numInput
}
repairInputWarehouseApi(param).then((response) => {
if(response.code==200){
this.$modal.msgSuccess("入库成功");
this.numOpen=false;
this.getTaskInfo();
}
});
}
},
//
//
handleFail(row) {
console.log(row)
console.log(row.manageType)
@ -298,9 +291,10 @@ export default {
this.rowData=row;
}else{//-
this.rowData=row;
this.open=true;
this.isReject=true;
this.keyWord=""
this.queryCodeList()
this.open=true;
}
},
//
@ -310,14 +304,34 @@ export default {
console.log(this.rejectReason)
if(this.numInput2<=0){
this.$modal.msgError("驳回数量需大于0!");
}else if(this.numInput2>this.rowData.pendingInputNum){
this.$modal.msgError("驳回数量不能大于预入库数量!");
this.numInput2 = this.rowData.pendingInputNum;
}else{
//
//
let param = {
taskId:this.rowData.taskId,
typeId:this.rowData.typeId,
pendingInputNum:this.rowData.pendingInputNum,
inputNum:this.numInput2
}
rejectWarehouseApi(param).then((response) => {
if(response.code==200){
this.$modal.msgSuccess("驳回成功");
this.numOpen2=false;
this.getTaskInfo();
}
});
}
},
//
handleViewCode(row){
this.rowData=row;
this.isReject=true;
this.keyWord=""
this.queryCodeList()
this.open=true;
},
//
queryCodeList(){
console.log(this.rowData)
@ -338,20 +352,46 @@ export default {
this.keyWord=""
this.queryCodeList()
},
//-
codeWarehouse(codeRow){
console.log(this.rowData)
console.log(codeRow)
let param = {
taskId:this.rowData.taskId,
typeId:this.rowData.typeId,
maCodeList:[{maId:codeRow.maId}]
}
this.$modal.confirm("是否确认入库所选择的设备编码?")
.then(function () {
return repairInputWarehouseApi(param);
}).then((response) => {
if(response.code==200){
this.$modal.msgSuccess("入库成功");
this.queryCodeList();
}
})
.catch(() => {});
},
//-
rejectCodeWarehouse(codeRow){
console.log(this.rowData)
console.log(codeRow)
let param = {
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();
}
})
.catch(() => {});
},
//
selectable(row) {
if (row.status == "0") {