新购验收
This commit is contained in:
parent
e710cbdac0
commit
4d5b66281e
|
|
@ -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
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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:"",//3合格、1不合格
|
||||
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`)
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
</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('操作失败')
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue