新购绑定二维码,维修数量检验

This commit is contained in:
jjLv 2024-11-29 13:55:10 +08:00
parent 2f8c6a6060
commit 15c7ffd52d
6 changed files with 228 additions and 152 deletions

View File

@ -51,12 +51,11 @@ export function getListDetailById(query) {
// 导出
export function exportNewBuy(data) {
export function exportNewBuy(purchaseId) {
return request({
url: '/material/purchase/bind/downloadQrCode',
url: '/material/purchase/bind/downloadQrCode?purchaseId='+purchaseId,
method: 'post',
responseType: 'blob',
data: data,
})
}

View File

@ -8,14 +8,14 @@ export function getListTested(query) {
params: query
})
}
// // 查询修试审核详细列表
// export function getAuditInfo(query) {
// return request({
// url: '/material/repair_audit_details/getRepairAuditList',
// method: 'get',
// params: query
// })
// }
// 查询修试审核详细列表
export function getRepairedDetailList(taskId) {
return request({
url: '/material/repair/getRepairedDetailList?taskId='+taskId,
method: 'get',
})
}
// //修试审核二级-通过,驳回
// export function auditPass(data) {

View File

@ -130,7 +130,7 @@
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<el-table-column label="操作" align="center" width="400">
<template slot-scope="{ row }">
<el-button
size="mini"
@ -158,7 +158,6 @@
size="mini"
type="success"
@click="onDownloadQr(row)"
v-if="queryType === 1"
>
<svg-icon icon-class="qr-icon" />
下载
@ -389,7 +388,9 @@ import {
getListDetailById,
getNewBuyBindListDetailsApi,
getMaCodeInfo,
exportNewBuy,
} from "@/api/purchase/goodsBind";
import { downloadFile } from '@/utils/download'
import { getToken } from "@/utils/auth";
import {
uploadPurchaseFile,
@ -712,9 +713,11 @@ export default {
}
},
//
onDownloadQr() {
console.log("二维码下载");
/** 导出二维码按钮操作 */
onDownloadQr(row) {
exportNewBuy(row.id).then(res => {
downloadFile({ fileName: `二维码_${new Date().getTime()}.zip`, fileData: res, fileType: 'application/zip;charset=utf-8' })
})
},
//
handleAdd() {

View File

@ -171,15 +171,6 @@
@click="handleNotice(row)"
>驳回</el-button
>
<el-button
plain
size="mini"
type="success"
@click="onDownloadQr(row)"
>
<svg-icon icon-class="qr-icon" />
下载
</el-button>
</template>
</el-table-column>
</el-table>

View File

@ -102,6 +102,12 @@
align="center"
prop="typeRepairedNum"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="待报废数量"
align="center"
prop="typeScrapNum"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="待修数量"
@ -133,11 +139,6 @@
width="1200px"
append-to-body
>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" size="mini">合格</el-button>
</el-col>
</el-row>
<el-table :data="repairDeviceList" width="100%" height="450px">
<el-table-column label="序号" type="index" width="55" align="center" />
<el-table-column
@ -1140,6 +1141,7 @@ export default {
trigger: "blur",
},
],
},
rulesMiddle: {
repairNum: [
@ -1150,13 +1152,13 @@ export default {
},
],
// supplierId: [
// {
// required: true,
// message: "",
// trigger: "change",
// },
// ],
supplierId: [
{
required: true,
message: "请选择厂家",
trigger: "change",
},
],
partPrice: [
{
@ -1267,7 +1269,7 @@ export default {
const res = await getAppRepairMaTypeList(param);
this.equipmentList = res.data;
this.equipmentList.forEach((e) => {
e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum);
e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum)-Number(e.typeScrapNum);
});
// this.GetDeviceTypeTreeFn(data.backApplyInfo.agreementId)
},
@ -1306,7 +1308,7 @@ export default {
const res = await getAppRepairMaTypeList(param);
this.equipmentList = res.data;
this.equipmentList.forEach((e) => {
e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum);
e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum)-Number(e.typeScrapNum);
});
this.$modal.msgSuccess("通过成功");
}
@ -1330,7 +1332,7 @@ export default {
const res = await getAppRepairMaTypeList(param);
this.equipmentList = res.data;
this.equipmentList.forEach((e) => {
e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum);
e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum)-Number(e.typeScrapNum);
});
this.$modal.msgSuccess("合格成功");
})
@ -1437,7 +1439,7 @@ export default {
const res = await getAppRepairMaTypeList(param);
this.equipmentList = res.data;
this.equipmentList.forEach((e) => {
e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum);
e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum)-Number(e.typeScrapNum);
});
this.openCode = false;
// console.log(this.equipmentList)
@ -1453,7 +1455,7 @@ export default {
const res = await getAppRepairMaTypeList(param);
this.equipmentList = res.data;
this.equipmentList.forEach((e) => {
e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum);
e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum)-Number(e.typeScrapNum);
});
this.openCode = false;
},
@ -1863,10 +1865,23 @@ export default {
}
},
async validateForms(refs){
const validationResults = await Promise.all(refs.map(ref =>ref.validate()))
return validationResults.every(result=> result===true)
},
//
async saveNumAll() {
let refTemp = [];
if(this.formLeft.repairNum!=0){
refTemp.push(this.$refs.formLeft)
}
if(this.formMiddle.repairNum!=0){
refTemp.push(this.$refs.formMiddle)
}
if(this.formRight.scrapNum!=0){
this.$refs["formLeft","formMiddle","formRight"].validate(async(valid)=>{
refTemp.push(this.$refs.formRight)
}
const valid = await this.validateForms(refTemp)
if(valid){
for (let i = 0; i < this.partItems.length; i++) {
this.innerRowData.repairDeviceList[0].numberInRepairPartList.push({
@ -1909,65 +1924,129 @@ export default {
const res = await getAppRepairMaTypeList(param);
this.equipmentList = res.data;
this.equipmentList.forEach((e) => {
e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum);
e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum)-Number(e.typeScrapNum);
});
this.openNum=false;
}
});
}
})
}else{
this.$refs["formLeft","formMiddle"].validate(async(valid)=>{
if(valid){
for (let i = 0; i < this.partItems.length; i++) {
this.innerRowData.repairDeviceList[0].numberInRepairPartList.push({
isCharge: this.partItems[i].isCharge,
partId: this.partItems[i].partId,
partNum: this.partItems[i].partNum,
repairNum: this.formLeft.repairNum,
});
}
for (let i = 0; i < this.partItemsMiddle.length; i++) {
this.innerRowData.repairDeviceList[0].numberOutRepairPartList.push({
isCharge: this.partItemsMiddle[i].isCharge,
partPrice: this.partItemsMiddle[i].partPrice,
partNum: this.partItemsMiddle[i].partNum,
partName: this.partItemsMiddle[i].partName,
supplierId: this.formMiddle.supplierId,
repairNum: this.formMiddle.repairNum,
});
}
this.uploadKey = Date.now();
if(this.fileList.length!=0){
await this.getImaUpload(),
this.formRight.fileList = this.fileListTemp;
}else{
this.formRight.fileList = this.fileListTemp;
}
console.log('this.formRight',this.formRight)
this.innerRowData.repairDeviceList[0].numberScrapRepairPartList.push(this.formRight)
this.innerRowData.repairDeviceList[0].repairType = 1;
saveCodeList(this.innerRowData.repairDeviceList).then(async (response) => {
if (response.code == 200) {
this.$modal.msgSuccess("保存成功");
this.fileList=[];
this.fileListTemp=[];
let param = {
taskId: this.repairRow.taskId,
keyword: "",
};
this.taskIdTemp = this.repairRow.taskId;
const res = await getAppRepairMaTypeList(param);
this.equipmentList = res.data;
this.equipmentList.forEach((e) => {
e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum);
});
this.openNum=false;
}
});
}
})
}
// this.$refs.refTemp.validate(async(valid)=>{
// if(valid){
// for (let i = 0; i < this.partItems.length; i++) {
// this.innerRowData.repairDeviceList[0].numberInRepairPartList.push({
// isCharge: this.partItems[i].isCharge,
// partId: this.partItems[i].partId,
// partNum: this.partItems[i].partNum,
// repairNum: this.formLeft.repairNum,
// });
// }
// }
// })
// }
// if(this.formRight.scrapNum!=0){
// this.$refs["formLeft","formMiddle","formRight"].validate(async(valid)=>{
// if(valid){
// for (let i = 0; i < this.partItems.length; i++) {
// this.innerRowData.repairDeviceList[0].numberInRepairPartList.push({
// isCharge: this.partItems[i].isCharge,
// partId: this.partItems[i].partId,
// partNum: this.partItems[i].partNum,
// repairNum: this.formLeft.repairNum,
// });
// }
// for (let i = 0; i < this.partItemsMiddle.length; i++) {
// this.innerRowData.repairDeviceList[0].numberOutRepairPartList.push({
// isCharge: this.partItemsMiddle[i].isCharge,
// partPrice: this.partItemsMiddle[i].partPrice,
// partNum: this.partItemsMiddle[i].partNum,
// partName: this.partItemsMiddle[i].partName,
// supplierId: this.formMiddle.supplierId,
// repairNum: this.formMiddle.repairNum,
// });
// }
// this.uploadKey = Date.now();
// if(this.fileList.length!=0){
// await this.getImaUpload(),
// this.formRight.fileList = this.fileListTemp;
// }else{
// this.formRight.fileList = this.fileListTemp;
// }
// console.log('this.formRight',this.formRight)
// this.innerRowData.repairDeviceList[0].numberScrapRepairPartList.push(this.formRight)
// this.innerRowData.repairDeviceList[0].repairType = 1;
// saveCodeList(this.innerRowData.repairDeviceList).then(async (response) => {
// if (response.code == 200) {
// this.$modal.msgSuccess("");
// this.fileList=[];
// this.fileListTemp=[];
// let param = {
// taskId: this.repairRow.taskId,
// keyword: "",
// };
// this.taskIdTemp = this.repairRow.taskId;
// const res = await getAppRepairMaTypeList(param);
// this.equipmentList = res.data;
// this.equipmentList.forEach((e) => {
// e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum)-Number(e.typeScrapNum);
// });
// this.openNum=false;
// }
// });
// }
// })
// }else{
// this.$refs["formLeft","formMiddle"].validate(async(valid)=>{
// if(valid){
// for (let i = 0; i < this.partItems.length; i++) {
// this.innerRowData.repairDeviceList[0].numberInRepairPartList.push({
// isCharge: this.partItems[i].isCharge,
// partId: this.partItems[i].partId,
// partNum: this.partItems[i].partNum,
// repairNum: this.formLeft.repairNum,
// });
// }
// for (let i = 0; i < this.partItemsMiddle.length; i++) {
// this.innerRowData.repairDeviceList[0].numberOutRepairPartList.push({
// isCharge: this.partItemsMiddle[i].isCharge,
// partPrice: this.partItemsMiddle[i].partPrice,
// partNum: this.partItemsMiddle[i].partNum,
// partName: this.partItemsMiddle[i].partName,
// supplierId: this.formMiddle.supplierId,
// repairNum: this.formMiddle.repairNum,
// });
// }
// this.uploadKey = Date.now();
// if(this.fileList.length!=0){
// await this.getImaUpload(),
// this.formRight.fileList = this.fileListTemp;
// }else{
// this.formRight.fileList = this.fileListTemp;
// }
// console.log('this.formRight',this.formRight)
// this.innerRowData.repairDeviceList[0].numberScrapRepairPartList.push(this.formRight)
// this.innerRowData.repairDeviceList[0].repairType = 1;
// saveCodeList(this.innerRowData.repairDeviceList).then(async (response) => {
// if (response.code == 200) {
// this.$modal.msgSuccess("");
// this.openNum=false;
// }
// });
// this.fileList=[];
// this.fileListTemp=[];
// let param = {
// taskId: this.repairRow.taskId,
// keyword: "",
// };
// this.taskIdTemp = this.repairRow.taskId;
// const res = await getAppRepairMaTypeList(param);
// this.equipmentList = res.data;
// this.equipmentList.forEach((e) => {
// e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum)-Number(e.typeScrapNum);
// });
// }
// })
// }
},
//

View File

@ -244,7 +244,7 @@
<script>
import {
getListTested,
getRepairedDetailList
} from "@/api/repair/testedInBound";
import { downloadFile } from "@/utils/download";
export default {
@ -340,14 +340,18 @@ export default {
},
//
handleView(){
handleView(row){
// this.getListView()
this.title = "查看"
this.getInBoundInfo = [
{'typeName':'p1','taskStatus':0},
{'typeName':'p2','taskStatus':1}
]
this.totalView = 2
getRepairedDetailList(row.id).then((response) => {
this.getInBoundInfo = response.rows;
this.totalView = response.total;
this.loading = false;
});
// this.getInBoundInfo = [
// {'typeName':'p1','taskStatus':0},
// {'typeName':'p2','taskStatus':1}
// ]
this.showView = true;
},