领料接口对接

This commit is contained in:
zhouzy062 2024-04-09 17:51:39 +08:00
parent 8df7bf0faf
commit 18bb04f1f7
3 changed files with 241 additions and 78 deletions

View File

@ -66,7 +66,6 @@ export function ApiGetMaterialList(query) {
// 删除 // 删除
export function backApplyDelApi(query) { export function backApplyDelApi(query) {
console.log('query====', query);
return request({ return request({
url: '/material/backApply/del', url: '/material/backApply/del',
method: 'get', method: 'get',
@ -159,14 +158,24 @@ export function receiveView(data) {
} }
// 退料接收弹窗详情 // 退料接收弹窗详情
export function getBackMachine(query) {
return request({
url: '/base/backReceive/getBackMachine',
method: 'get',
params: query
})
}
// 退料接收 查看记录
export function backReceiveRecordWeb(data) { export function backReceiveRecordWeb(data) {
return request({ return request({
url: '/base/backReceive/backReceiveRecordWeb', url: 'base/backReceive/backReceiveRecordWeb ',
method: 'post', method: 'post',
data: data data: data
}) })
} }
// 退料接收 数量接收 // 退料接收 数量接收
export function setNumBack(data) { export function setNumBack(data) {
return request({ return request({
@ -175,3 +184,30 @@ export function setNumBack(data) {
data: data data: data
}) })
} }
// 退料接收 编码接收
export function setCodeBack(data) {
return request({
url: 'base/backReceive/setCodeBack',
method: 'post',
data: data
})
}
// 退料接收 完成前判断是否存在记录
export function getRecord(query) {
return request({
url: 'base/backReceive/getRecord',
method: 'get',
params: query
})
}
// 退料接收 完成接收
export function endBack(data) {
return request({
url: 'base/backReceive/endBack',
method: 'post',
data: data
})
}

View File

@ -150,26 +150,30 @@
<el-table-column label="退料单号" align="center" prop="code" :show-overflow-tooltip="true"/> <el-table-column label="退料单号" align="center" prop="code" :show-overflow-tooltip="true"/>
<el-table-column label="退料单位" align="center" prop="unitName" :show-overflow-tooltip="true"/> <el-table-column label="退料单位" align="center" prop="unitName" :show-overflow-tooltip="true"/>
<el-table-column label="退料工程" align="center" prop="lotName" :show-overflow-tooltip="true"/> <el-table-column label="退料工程" align="center" prop="lotName" :show-overflow-tooltip="true"/>
<el-table-column label="退料机具" align="center" prop="typeName" :show-overflow-tooltip="true"/>
<el-table-column label="退料人员" align="center" prop="backPerson" :show-overflow-tooltip="true"/> <el-table-column label="退料人员" align="center" prop="backPerson" :show-overflow-tooltip="true"/>
<el-table-column label="联系电话" align="center" prop="phone" :show-overflow-tooltip="true"/> <el-table-column label="联系电话" align="center" prop="phone" :show-overflow-tooltip="true"/>
<el-table-column label="申请时间" align="center" prop="backTime" :show-overflow-tooltip="true"/> <el-table-column label="申请时间" align="center" prop="backTime" :show-overflow-tooltip="true"/>
<el-table-column label="协议号" align="center" prop="agreementCode" :show-overflow-tooltip="true"/> <el-table-column label="协议号" align="center" prop="agreementCode" :show-overflow-tooltip="true"/>
<el-table-column label="退料状态" align="center" :show-overflow-tooltip="true"> <el-table-column label="退料状态" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 状态 37-待审核 38-已审核 --> <!-- 状态 37-待审核 38-已审核 -->
<el-button type="text" v-if="scope.row.applyStatus == '0'"> <el-button type="text" v-if="scope.row.taskStatus == '37'">
待审核 待审核
</el-button> </el-button>
<el-button type="text" style="color: #67c23a" v-if="scope.row.applyStatus == '1'||scope.row.applyStatus == '3'"> <el-button type="text" style="color: #67c23a" v-if="scope.row.taskStatus == '38'">
退料通过 已审核
</el-button> </el-button>
<el-button type="text" style="color: red" v-if="scope.row.applyStatus == '2'||scope.row.applyStatus == '4'"> <el-button type="text" v-if="scope.row.taskStatus == '39'">
退料驳回 退料核查
</el-button> </el-button>
<el-button type="text" style="color: #67c23a" v-if="scope.row.taskStatus == '40'&& scope.row.applyStatus != '0'"> <el-button type="text" style="color: #67c23a" v-if="scope.row.taskStatus == '40'">
退料完成 退料完成
</el-button> </el-button>
</template> <el-button type="text" style="color: #67c23a" v-if="scope.row.taskStatus == '101'">
退料驳回
</el-button>
</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
@ -335,7 +339,7 @@
}, },
/** 查询列表 startTime,结束日期endTime */ /** 查询列表 startTime,结束日期endTime */
async getList() { async getList() {
this.loading = true; // this.loading = true;
this.queryParams.startTime = this.dateRange[0] this.queryParams.startTime = this.dateRange[0]
this.queryParams.endTime = this.dateRange[1] this.queryParams.endTime = this.dateRange[1]
try { try {
@ -388,6 +392,7 @@
path:'/claimAndRefund/returnInDetail', path:'/claimAndRefund/returnInDetail',
query:{ query:{
Id:row.id, Id:row.id,
taskId:row.taskId
} }
}) })

View File

@ -57,7 +57,7 @@
<el-col :span="1.5" v-if="!isView"> <el-col :span="1.5" v-if="!isView">
<el-button <el-button
type="primary" type="primary"
size="mini" size="mini" @click="completeBack"
>完成退料</el-button> >完成退料</el-button>
</el-col> </el-col>
</el-row> </el-row>
@ -68,17 +68,17 @@
<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="typeCode" :show-overflow-tooltip="true" /> <el-table-column label="规格型号" align="center" prop="typeCode" :show-overflow-tooltip="true" />
<el-table-column label="退料数量" align="center" prop="preNum" :show-overflow-tooltip="true"/> <el-table-column label="审批数量" align="center" prop="preNum" :show-overflow-tooltip="true"/>
<el-table-column label="待审批数量" align="center" prop="num" :show-overflow-tooltip="true" /> <el-table-column label="退料数量" align="center" prop="num" :show-overflow-tooltip="true" />
<!-- <el-table-column label="维修数量" align="center" prop="" :show-overflow-tooltip="true"/> <!-- <el-table-column label="维修数量" align="center" prop="" :show-overflow-tooltip="true"/>
<el-table-column label="预报废数量" align="center" prop="" :show-overflow-tooltip="true"/> --> <el-table-column label="预报废数量" align="center" prop="" :show-overflow-tooltip="true"/> -->
<el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true"> <!-- <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.status==0">待审批</span> <span v-if="scope.row.status==0">待审批</span>
<span v-if="scope.row.status==1">进行中</span> <span v-if="scope.row.status==1">进行中</span>
<span v-if="scope.row.status==2">已出库</span> <span v-if="scope.row.status==2">已出库</span>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" @click="handleViewCode(scope.row)" v-if="scope.row.manageType=='0'"> <el-button size="mini" @click="handleViewCode(scope.row)" v-if="scope.row.manageType=='0'">
@ -87,10 +87,10 @@
<el-button size="mini" @click="handleViewNum(scope.row)" v-if="scope.row.manageType=='1'"> <el-button size="mini" @click="handleViewNum(scope.row)" v-if="scope.row.manageType=='1'">
查看 查看
</el-button> </el-button>
<el-button size="mini" type="primary" @click="handleCodeReturn(scope.row)" v-if="!isView&&scope.row.manageType=='0'"> <el-button size="mini" type="primary" @click="handleCodeReturn(scope.row)" v-if="!isView&&scope.row.manageType=='0'&&scope.row.num>0">
编码退料 编码退料
</el-button> </el-button>
<el-button size="mini" type="primary" @click="handleNumReturn(scope.row)" v-if="!isView&&scope.row.manageType=='1'"> <el-button size="mini" type="primary" @click="handleNumReturn(scope.row)" v-if="!isView&&scope.row.manageType=='1'&&scope.row.num>0">
数量退料 数量退料
</el-button> </el-button>
<!-- <el-button size="mini" icon="el-icon-zoom-in"> <!-- <el-button size="mini" icon="el-icon-zoom-in">
@ -125,24 +125,30 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8" v-if="!dialogIsView"> <el-row :gutter="10" class="mb8" v-if="!dialogIsView">
<el-col :span="1.5">
<el-button
type="primary"
size="mini"
>保存</el-button>
</el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="success" type="success"
size="mini" size="mini"
:disabled="multiple"
@click="saveCodeBackBatch(1)"
>批量合格</el-button> >批量合格</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
size="mini" size="mini"
:disabled="multiple"
@click="saveCodeBackBatch(2)"
>批量维修</el-button> >批量维修</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="warning"
size="mini"
:disabled="multiple"
@click="saveCodeBackBatch(3)"
>批量报废</el-button>
</el-col>
</el-row> </el-row>
<el-table v-loading="loading" :data="codeList" height="500" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="codeList" height="500" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
@ -150,16 +156,16 @@
<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" />
<el-table-column label="设备编码" align="center" prop="maCode" :show-overflow-tooltip="true" /> <el-table-column label="设备编码" align="center" prop="maCode" :show-overflow-tooltip="true" />
<el-table-column label="退料状态" align="center" prop="maStatus" :show-overflow-tooltip="true" /> <el-table-column label="状态" align="center" prop="maStatus" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="!dialogIsView"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="!dialogIsView" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="success" icon="el-icon-zoom-in"> <el-button size="mini" type="success" @click="saveCodeBack(scope.row,1)">
合格 合格
</el-button> </el-button>
<el-button size="mini" type="primary" icon="el-icon-zoom-in"> <el-button size="mini" type="primary" @click="saveCodeBack(scope.row,2)">
待维修 待维修
</el-button> </el-button>
<el-button size="mini" type="warning" icon="el-icon-zoom-in"> <el-button size="mini" type="warning" @click="saveCodeBack(scope.row,3)">
预报废 预报废
</el-button> </el-button>
</template> </template>
@ -176,6 +182,9 @@
<!-- 数量退料弹窗 --> <!-- 数量退料弹窗 -->
<el-dialog :title="title" :visible.sync="openNum" width="1200px" append-to-body> <el-dialog :title="title" :visible.sync="openNum" width="1200px" append-to-body>
<div style="margin-left: 40px;margin-bottom: 10px;">
退料数量{{returnNum}}
</div>
<el-row :gutter="10" class="mb8" v-if="!dialogIsView"> <el-row :gutter="10" class="mb8" v-if="!dialogIsView">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -190,14 +199,14 @@
<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="typeCode" :show-overflow-tooltip="true" /> <el-table-column label="规格型号" align="center" prop="typeCode" :show-overflow-tooltip="true" />
<el-table-column label="退料数量" align="center" prop="num" :show-overflow-tooltip="true" /> <el-table-column label="退料数量" align="center" prop="backNum" :show-overflow-tooltip="true" />
<el-table-column label="合格数量" align="center" prop="qualifiedNum" :show-overflow-tooltip="true"> <el-table-column label="合格数量" align="center" prop="qualifiedNum" :show-overflow-tooltip="true" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
v-model.number="scope.row.qualifiedNum" v-model.number="scope.row.qualifiedNum"
placeholder="请输入合格数量" placeholder="请输入合格数量"
type="number" min="0" type="number" min="0"
clearable clearable :disabled="dialogIsView"
style="width: 100%" style="width: 100%"
/> />
</template> </template>
@ -208,7 +217,7 @@
v-model.number="scope.row.serviceNum" v-model.number="scope.row.serviceNum"
placeholder="请输入待维修数量" placeholder="请输入待维修数量"
type="number" min="0" type="number" min="0"
clearable clearable :disabled="dialogIsView"
style="width: 100%" style="width: 100%"
/> />
</template> </template>
@ -219,19 +228,19 @@
v-model.number="scope.row.scrapNum" v-model.number="scope.row.scrapNum"
placeholder="请输入待报废数量" placeholder="请输入待报废数量"
type="number" min="0" type="number" min="0"
clearable clearable :disabled="dialogIsView"
style="width: 100%" style="width: 100%"
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="报废信息" align="center" prop="" :show-overflow-tooltip="true" /> <!-- <el-table-column label="报废信息" align="center" prop="" :show-overflow-tooltip="true" /> -->
</el-table> </el-table>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { receiveView ,backReceiveRecordWeb,setNumBack } from "@/api/claimAndRefund/return"; import { receiveView ,getBackMachine,backReceiveRecordWeb,setNumBack,setCodeBack, getRecord, endBack } from "@/api/claimAndRefund/return";
import { getTypeList } from "@/api/store/warehousing"; import { getTypeList } from "@/api/store/warehousing";
import { equipmentTypeTree } from "@/api/store/tools"; import { equipmentTypeTree } from "@/api/store/tools";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
@ -246,7 +255,7 @@
// //
loading: false, loading: false,
// //
ids: [], codeSelectList: [],
// //
single: true, single: true,
// //
@ -296,7 +305,10 @@
this.isView = false this.isView = false
} }
if (this.$route.query.Id) { if (this.$route.query.Id) {
this.queryParams.id = this.$route.query.Id this.queryParams.id = this.$route.query.Id;
}
if (this.$route.query.taskId) {
this.queryParams.taskId = this.$route.query.taskId;
} }
this.getTypeList(); this.getTypeList();
@ -360,50 +372,74 @@
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
//
back(){ back(){
this.$tab.closeOpenPage({ path: "/claimAndRefund/returnIn"}); this.$tab.closeOpenPage({ path: "/claimAndRefund/returnIn"});
}, },
// //退
handleSelectionChange(selection) { async completeBack(){
this.ids = selection.map(item => item.dictId) let param1 = {
this.single = selection.length!=1 parentId:this.queryParams.id
this.multiple = !selection.length }
const res1 = await getRecord(param1)
console.log(res1)
if(res1.code==200){
let param = {
createBy:this.createBy,
parentId:this.queryParams.id,
taskId:this.queryParams.taskId
}
endBack(param).then(response => {
if(response.code==200){
this.$modal.msgSuccess("操作成功");
this.back();
}
});
}
}, },
// //
handleViewCode(row){ handleViewCode(row){
this.title = '查看'; this.title = '查看';
this.openCode = true; this.openCode = true;
this.resetForm("codeQuery");
this.codeQuery.parentId = row.id; this.codeQuery.parentId = row.id;
this.codeQuery.typeId = row.modelId; this.codeQuery.typeId = row.modelId;
this.dialogIsView = true; this.dialogIsView = true;
this.returnNum = row.num; this.returnNum = Number(row.num);
this.handleCodeQuery() this.handleCodeQuery()
}, },
//
handleViewNum(row){ handleViewNum(row){
this.title = '查看'; let param = {
this.openNum = true; parentId:row.id,
this.dialogIsView = true; typeId:row.modelId
let obj = {} }
this.$set(obj,'taskId',row.taskId) backReceiveRecordWeb(param).then(res=>{
this.$set(obj,'parentId',row.id) if(res.code==200){
this.$set(obj,'typeName',row.typeName) this.title = '查看';
this.$set(obj,'typeCode',row.typeCode) this.openNum = true;
this.$set(obj,'typeId',row.modelId) this.dialogIsView = true;
this.$set(obj,'num',row.num)//退 this.numList=res.data.rows;
this.returnNum = row.num this.numList.forEach(item=>{
this.$set(obj,'qualifiedNum',0)// if(item.backStatus=='1'){item.qualifiedNum = item.backNum;item.serviceNum=0;item.scrapNum=0;}
this.$set(obj,'serviceNum',0)// if(item.backStatus=='2'){item.serviceNum = item.backNum;item.qualifiedNum=0;item.scrapNum=0;}
this.$set(obj,'scrapNum',0)// if(item.backStatus=='3'){item.scrapNum = item.backNum;item.qualifiedNum=0;item.serviceNum=0;}
this.numList = [obj] })
}
})
}, },
//退 //退
handleCodeReturn(row){ handleCodeReturn(row){
this.title = '编码退料'; this.title = '编码退料';
this.openCode = true; this.openCode = true;
this.resetForm("codeQuery");
this.codeQuery.parentId = row.id; this.codeQuery.parentId = row.id;
this.codeQuery.taskId = row.taskId;
this.codeQuery.typeId = row.modelId; this.codeQuery.typeId = row.modelId;
this.dialogIsView = false; this.dialogIsView = false;
this.returnNum = row.num this.returnNum = Number(row.num);
this.handleCodeQuery() this.handleCodeQuery()
}, },
//退 //退
@ -417,8 +453,8 @@
this.$set(obj,'typeName',row.typeName) this.$set(obj,'typeName',row.typeName)
this.$set(obj,'typeCode',row.typeCode) this.$set(obj,'typeCode',row.typeCode)
this.$set(obj,'typeId',row.modelId) this.$set(obj,'typeId',row.modelId)
this.$set(obj,'num',row.num)//退 this.$set(obj,'backNum',row.num)//退
this.returnNum = row.num this.returnNum = Number(row.num);
this.$set(obj,'qualifiedNum',0)// this.$set(obj,'qualifiedNum',0)//
this.$set(obj,'serviceNum',0)// this.$set(obj,'serviceNum',0)//
this.$set(obj,'scrapNum',0)// this.$set(obj,'scrapNum',0)//
@ -428,7 +464,12 @@
//退 //退
handleCodeQuery() { handleCodeQuery() {
this.codeQuery.pageNum = 1; this.codeQuery.pageNum = 1;
this.getCodeList(); if(this.dialogIsView){
this.getCodeViewList()
}else{
this.getCodeList();
}
}, },
//退 //退
resetCodeQuery() { resetCodeQuery() {
@ -437,14 +478,24 @@
}, },
//退 //退
getCodeList() { getCodeList() {
// console.log('退') getBackMachine(this.codeQuery).then(response => {
// console.log(this.codeQuery) this.codeList = response.data.rows;
this.codeTotal = response.data.total;
backReceiveRecordWeb(this.codeQuery).then(response => { });
// this.codeList = response.data.rows; },
// this.codeTotal = response.data.total; //退
} getCodeViewList() {
); backReceiveRecordWeb(this.codeQuery).then(response => {
this.codeList = response.data.rows;
this.codeList
this.codeList.forEach(item=>{
item.typeModelName = item.typeCode
if(item.backStatus=='1'){item.maStatus = '合格'}
if(item.backStatus=='2'){item.maStatus = '维修'}
if(item.backStatus=='3'){item.maStatus = '报废'}
})
this.codeTotal = response.data.total;
});
}, },
/** 数量退料按钮 */ /** 数量退料按钮 */
@ -503,6 +554,77 @@
}); });
} }
}, },
/** 编码退料按钮 */
saveCodeBack(row,type){
if(this.returnNum==0){
this.$modal.msgError("退料数量为零,无法操作!");
}else{
let arr = [{
parentId:this.codeQuery.parentId,
typeId:row.typeId,
backNum:1,
backStatus:type,
manageType:0,
createBy:this.createBy,
maId:row.maId
}]
let param = {
taskId:this.codeQuery.taskId,
arr:arr
}
setCodeBack(param).then(response => {
if(response.code==200){
this.$modal.msgSuccess("操作成功");
// this.openCode = false;
this.returnNum = Number(this.returnNum)-1;
this.handleCodeQuery();
this.handleQuery();
}
});
}
},
//
handleSelectionChange(selection) {
this.codeSelectList = selection
this.single = selection.length!=1
this.multiple = !selection.length
},
/** 编码退料 - 批量操作 */
saveCodeBackBatch(type){
if(this.codeSelectList.length>this.returnNum){
this.$modal.msgError("退料总量已大于待退料数量!");
}else{
let arr = [];
arr = this.codeSelectList.map(item=>{
return {
parentId:this.codeQuery.parentId,
typeId:item.typeId,
backNum:1,
backStatus:type,
manageType:0,
createBy:this.createBy,
maId:item.maId
}
})
let param = {
taskId:this.codeQuery.taskId,
arr:arr
}
// console.log(param)
setCodeBack(param).then(response => {
if(response.code==200){
this.$modal.msgSuccess("操作成功");
// this.openCode = false;
this.returnNum = Number(this.returnNum)-this.codeSelectList.length;
this.handleCodeQuery();
this.handleQuery();
}
});
}
}
} }
}; };
</script> </script>