新购验收

This commit is contained in:
zzyuan 2024-11-08 17:40:41 +08:00
parent e710cbdac0
commit 4d5b66281e
7 changed files with 151 additions and 35 deletions

View File

@ -19,10 +19,19 @@ export function getPurchaseDetailsList(query) {
}
// 外层批量验收合格API
export function acceptancePurchase(data) {
export function acceptOuterVerify(data) {
return request({
url: '/material/purchase_check_info/acceptance',
method: 'post',
url: '/material/purchase_check_info/outerVerify',
method: 'put',
data: data
})
}
// 内层批量验收合格API
export function acceptInnerVerifyer(data) {
return request({
url: '/material/purchase_check_info/innerVerify',
method: 'put',
data: data
})
}

View File

@ -380,7 +380,7 @@
},
methods: {
getDeviceType(){
getDeviceType({level:2}).then(response => {
getDeviceType({level:2,skipPermission:1}).then(response => {
let matTypeRes = response.data;
this.materialTypeList = matTypeRes.map((item) => {
return {
@ -389,7 +389,7 @@
};
});
});
getDeviceType({level:3}).then(response => {
getDeviceType({level:3,skipPermission:1}).then(response => {
let matNameRes = response.data;
this.materialNameList = matNameRes.map((item) => {
return {
@ -398,7 +398,7 @@
};
});
});
getDeviceType({level:4}).then(response => {
getDeviceType({level:4,skipPermission:1}).then(response => {
let matModelRes = response.data;
this.materialModelList = matModelRes.map((item) => {
return {

View File

@ -38,7 +38,7 @@
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-col :span="1.5">
<el-button
type="primary"
size="mini"
@ -47,10 +47,13 @@
>新购到货验收</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
type="success" @click="batchPass"
icon="el-icon-check" v-show="!isView"
size="mini" :disabled="multiple"
>合格</el-button>
@ -58,17 +61,16 @@
<el-col :span="1.5">
<el-button
type="danger"
type="danger" @click="batchReject"
icon="el-icon-close" v-show="!isView"
size="mini" :disabled="multiple"
>不合格</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="tableList" ref="multipleTable" row-key="teamId" @selection-change="handleSelectionChange">
<el-table v-loading="loading" :data="tableList" ref="multipleTable" row-key="typeId" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" v-if="!isView"/>
<el-table-column label="序号" align="center" width="80" type="index">
</el-table-column>
<el-table-column label="物资名称" align="center" prop="maTypeName" :show-overflow-tooltip="true"/>
<el-table-column label="规格型号" align="center" prop="typeName" :show-overflow-tooltip="true"/>
@ -87,10 +89,10 @@
<el-table-column label="验收结论" align="center" prop="checkResult" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button size="mini" type="success">
<el-button size="mini" type="success" @click="pass(scope.row)">
合格
</el-button>
<el-button size="mini" type="danger">
<el-button size="mini" type="danger" @click="reject(scope.row)">
不合格
</el-button>
</template>
@ -150,14 +152,25 @@
<img width="100%" height="500px" :src="dialogImageUrl" />
</el-dialog>
<!-- 验收弹窗 -->
<el-dialog :visible.sync="confirmShow" width="500px" height="300px" >
<div style="width: 100%;height: 80%;display: flex;">
<div>验收结论</div>
<el-input type="textarea" :rows="2" placeholder="请输入结论" v-model="checkResult" maxlength="100">
</el-input>
</div>
<div style="width: 100%;height: 20%;display: flex;justify-content: flex-end;align-items: center;">
<el-button type="primary" @click="confirmCheck">确认</el-button>
<el-button size="mini" @click="confirmShow=false">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getDeviceType} from "@/api/ma/device";
import { getManufacturerSelect} from "@/api/ma/supplier";
import { getPurchaseDetailsList,getPurchaseFileList,uploadPurchaseFile } from "@/api/purchase/goodsAccept";
import { getPurchaseDetailsList,acceptInnerVerifyer,getPurchaseFileList,uploadPurchaseFile } from "@/api/purchase/goodsAccept";
import { downloadFile } from '@/utils/download'
import { getToken } from '@/utils/auth'
export default {
@ -180,6 +193,7 @@
materialModelList:[],//
supplierList:[],//
ids:[],
checkList:[],
//
total: 0,
//
@ -205,6 +219,10 @@
supplierId:undefined,
productionTime:undefined,
},
//
confirmShow: false,
taskStatus:"",//31
checkResult:"",
//
dialogImageUrl: '',
dialogVisible: false,
@ -215,10 +233,10 @@
//
url: process.env.VUE_APP_BASE_API + '/file/upload'
},
};
},
mounted() {
const taskId = this.$route.query && this.$route.query.taskId
const Id = this.$route.query && this.$route.query.Id
const isView = this.$route.query && this.$route.query.isView
@ -230,8 +248,7 @@
this.isView=false;
}
this.getDeviceType()
this.getSupplierList()
// this.getSupplierList()
console.log(this.isView)
this.getList()
},
@ -242,7 +259,7 @@
this.$tab.closeOpenPage(obj)
},
getDeviceType(){
getDeviceType({level:4}).then(response => {
getDeviceType({level:4,skipPermission:1}).then(response => {
let matModelRes = response.data;
this.materialModelList = matModelRes.map((item) => {
return {
@ -268,6 +285,7 @@
this.loading = true;
this.queryParams.id=this.Id
this.queryParams.taskId=this.taskId
this.queryParams.taskStatus=2
getPurchaseDetailsList(this.queryParams).then(response => {
this.tableList = response.data.purchaseCheckDetailsList;
this.tableList.forEach((item) => {
@ -290,10 +308,85 @@
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.ids = selection
this.single = selection.length != 1
this.multiple = !selection.length
},
//
pass(row){
this.taskStatus='3';
this.checkResult="合格";
let obj = {
taskId:row.taskId,
typeId:row.typeId,
status:this.taskStatus,
checkResult:this.checkResult
}
this.checkList=[]
this.checkList.push(obj)
this.confirmShow=true;
},
//
reject(row){
this.taskStatus='1';
this.checkResult="不合格";
let obj = {
taskId:row.taskId,
typeId:row.typeId,
status:this.taskStatus,
checkResult:this.checkResult
}
this.checkList=[]
this.checkList.push(obj)
this.confirmShow=true;
},
//
batchPass(){
this.taskStatus='3';
this.checkResult="合格";
this.checkList=[]
this.checkList=this.ids.map(item=>{
let obj = {
taskId:item.taskId,
typeId:item.typeId,
status:this.taskStatus,
checkResult:this.checkResult
}
return obj
})
this.confirmShow=true;
},
//
batchReject(){
this.taskStatus='1';
this.checkResult="不合格";
this.checkList=[]
this.checkList=this.ids.map(item=>{
let obj = {
taskId:item.taskId,
typeId:item.typeId,
status:this.taskStatus,
checkResult:this.checkResult
}
return obj
})
this.confirmShow=true;
},
//
confirmCheck(){
this.checkList.forEach(item=>{
item.checkResult=this.checkResult
})
console.log(this.checkList)
acceptInnerVerifyer(this.checkList).then(response => {
if(response.code==200){
this.$modal.msgSuccess('验收成功')
this.confirmShow=false;
this.getList()
this.$refs.multipleTable.clearSelection()
}
});
},
//
openFileDialog(row){
this.rowData=row;
@ -305,6 +398,7 @@
this.getFileData()
this.open=true
},
//
getFileData(){
let param = {
modelId:this.rowData.typeId,
@ -322,6 +416,7 @@
}).catch(() => {
})
},
//
beforeFileUpload(row){
this.rowData.fileType=row.fileType;
// this.rowData.dictLabel=row.dictLabel;
@ -358,7 +453,10 @@
this.dialogVisible = true
}
},
/** 导出按钮操作 */
handleExport() {
this.download('/material/purchase_check_info/exportDetails',{taskId:this.taskId},`新购到货详情_${new Date().getTime()}.xlsx`)
},
}
};

View File

@ -58,8 +58,8 @@
</el-col>
</el-row>
<el-table v-loading="loading" :data="tableList" ref="multipleTable" row-key="teamId" @selection-change="handleSelectionChange" border>
<el-table v-loading="loading" :data="tableList" ref="multipleTable" row-key="taskId" @selection-change="handleSelectionChange" border>
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" />
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
@ -286,7 +286,7 @@
</template>
<script>
import { getPurchaseList,acceptancePurchase,getPurchaseCheckFormByTaskId } from "@/api/purchase/goodsAccept";
import { getPurchaseList,acceptOuterVerify,getPurchaseCheckFormByTaskId } from "@/api/purchase/goodsAccept";
import { downloadFile } from '@/utils/download'
import { getToken } from '@/utils/auth'
export default {
@ -340,7 +340,7 @@
this.queryParams.startTime=undefined
this.queryParams.endTime=undefined
}
this.queryParams.modelName="新购验收"
this.queryParams.taskStatus="2"
getPurchaseList(this.queryParams).then(response => {
this.tableList = response.rows;
this.total = response.total;
@ -361,7 +361,7 @@
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.ids = selection.map(item => item.taskId)
this.single = selection.length != 1
this.multiple = !selection.length
},
@ -384,9 +384,19 @@
},
//
acceptancePurchase(){
acceptancePurchase(this.ids).then((response) => {
this.$modal.msgSuccess('操作成功')
let param={
taskIds:this.ids,
status:3,
checkResult:"合格"
}
acceptOuterVerify(param).then((response) => {
if(response.code==200){
this.$modal.msgSuccess('操作成功')
}else{
this.$modal.msgSuccess('操作失败')
}
this.getList()
this.$refs.multipleTable.clearSelection()
}).catch(() => {
this.$modal.msgError('操作失败')
})

View File

@ -565,9 +565,8 @@ export default {
//---
getTaskInfo() {
// this.loading = true;
getPurchaseCheckInfo({taskId:this.taskId,id:this.id}).then((response) => {
getPurchaseCheckInfo({taskId:this.taskId,id:this.id,taskStatus:1}).then((response) => {
this.maForm = response.data.purchaseCheckInfo
this.maForm.id = response.data.purchaseCheckInfo.id
this.maForm.taskId = response.data.purchaseCheckInfo.taskId
this.maForm.arrivalTime = response.data.purchaseCheckInfo.arrivalTime

View File

@ -202,7 +202,7 @@
>
<el-button
size="mini" style="margin-bottom: 10px;"
type="primary"
type="primary"
@click="handleUpdate(scope.row)"
v-hasPermi="['purchase:info:edit']"
>编辑</el-button
@ -210,21 +210,21 @@
<el-button
size="mini" style="margin-bottom: 10px;"
type="success"
type="success"
@click="handleNotice(scope.row)"
v-hasPermi="['purchase:person:notice']"
>通知</el-button
>
<el-button
size="mini"
type="warning"
type="warning"
@click="handlePrint(scope.row)"
>验收单</el-button
>
<el-button
size="mini"
type="danger"
type="danger"
@click="handleDeletePurchase(scope.row)"
v-hasPermi="['purchase:info:remove']"
>删除</el-button

View File

@ -242,7 +242,7 @@ export default {
this.$tab.closeOpenPage(obj)
},
getDeviceType(){
getDeviceType({level:4}).then(response => {
getDeviceType({level:4,skipPermission:1}).then(response => {
let matModelRes = response.data;
this.materialModelList = matModelRes.map((item) => {
return {