配件领用审核增加loding
This commit is contained in:
parent
4e6cbf18ae
commit
2275cce061
|
|
@ -17,13 +17,13 @@
|
|||
placeholder="请输入领料单号"
|
||||
clearable
|
||||
maxlength="50"
|
||||
style="width: 240px"
|
||||
style="width: 240px"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注:" prop="remark">
|
||||
<el-input
|
||||
v-model="maForm.remark"
|
||||
v-model="maForm.remark"
|
||||
clearable
|
||||
maxlength="200"
|
||||
style="width: 240px"
|
||||
|
|
@ -39,9 +39,9 @@
|
|||
plain
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
:disabled="multiple || auditLoading"
|
||||
@click="handlePassAll"
|
||||
>通过</el-button
|
||||
>通过</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
|
|
@ -50,19 +50,19 @@
|
|||
plain
|
||||
icon="el-icon-close"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
:disabled="multiple || auditLoading"
|
||||
@click="handleFailAll"
|
||||
>驳回</el-button
|
||||
>驳回</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table v-loading="loading" :data="equipmentList" row-key="id" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading || auditLoading" :data="equipmentList" row-key="id" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" :selectable="selectable"/>
|
||||
<el-table-column label="序号" align="center" type="index" />
|
||||
<el-table-column label="配件类型" align="center" prop="partType" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="配件名称" align="center" prop="partName" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column label="规格型号" align="center" prop="partModel" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="预领数量" align="center" prop="preNum" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column label="规格型号" align="center" prop="partModel" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="预领数量" align="center" prop="preNum" :show-overflow-tooltip="true"></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">
|
||||
|
|
@ -74,7 +74,6 @@
|
|||
<div v-if="scope.row.status == '2'" style="color: #f56c6c">
|
||||
{{ "驳回" }}
|
||||
</div>
|
||||
<!-- <div v-else style="color: red;"></div> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="300">
|
||||
|
|
@ -84,8 +83,10 @@
|
|||
style="margin-bottom: 10px"
|
||||
type="success"
|
||||
v-if="scope.row.status == '0'"
|
||||
:disabled="auditLoading"
|
||||
@click="handlePass(scope.row)"
|
||||
>通过
|
||||
:loading="currentAuditId === scope.row.id && auditLoading"
|
||||
>通过
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
|
|
@ -93,7 +94,9 @@
|
|||
type="danger"
|
||||
@click="handleFail(scope.row)"
|
||||
v-if="scope.row.status == '0'"
|
||||
>驳回
|
||||
:disabled="auditLoading"
|
||||
:loading="currentAuditId === scope.row.id && auditLoading"
|
||||
>驳回
|
||||
</el-button>
|
||||
<div v-if="scope.row.status != '0'">-</div>
|
||||
</template>
|
||||
|
|
@ -109,7 +112,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script>
|
||||
import {
|
||||
getPartLeaseByTaskIdApi,auditApi
|
||||
} from "@/api/part/partLease";
|
||||
|
|
@ -152,6 +155,10 @@ export default {
|
|||
taskId: "",
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 审核加载状态
|
||||
auditLoading: false,
|
||||
// 当前正在审核的ID(用于单个审核时的按钮loading)
|
||||
currentAuditId: null,
|
||||
total: 0,
|
||||
//租赁单位
|
||||
uniteList: [],
|
||||
|
|
@ -188,7 +195,7 @@ export default {
|
|||
methods: {
|
||||
//是否可用勾选框
|
||||
selectable(row) {
|
||||
if (row.status == "0") {
|
||||
if (row.status == "0" && !this.auditLoading) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
|
@ -207,27 +214,30 @@ export default {
|
|||
});
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
console.log(this.multiple)
|
||||
},
|
||||
//获取任务详情-列表数据
|
||||
getTaskInfo() {
|
||||
this.loading = true;
|
||||
getPartLeaseByTaskIdApi({ taskId: this.taskId }).then((response) => {
|
||||
getPartLeaseByTaskIdApi({taskId: this.taskId}).then((response) => {
|
||||
this.maForm = this.paramTemp;
|
||||
this.equipmentList = response.data.detailsList;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
//单个通过
|
||||
handlePass(row) {
|
||||
let param={
|
||||
taskId:this.taskId,
|
||||
taskStatus:1,
|
||||
partLeaseDetailsList:[row]
|
||||
}
|
||||
handlePass(row) {
|
||||
this.currentAuditId = row.id;
|
||||
this.auditLoading = true;
|
||||
|
||||
let param = {
|
||||
taskId: this.taskId,
|
||||
taskStatus: 1,
|
||||
partLeaseDetailsList: [row]
|
||||
};
|
||||
|
||||
this.$modal
|
||||
.confirm("是否确认通过所选择的数据项?")
|
||||
.then(function () {
|
||||
.then(() => {
|
||||
return auditApi(param);
|
||||
})
|
||||
.then(() => {
|
||||
|
|
@ -235,22 +245,32 @@ export default {
|
|||
this.$modal.msgSuccess("通过成功");
|
||||
setTimeout(() => {
|
||||
if (this.equipmentList.every((item) => item.status != 0)) {
|
||||
this.$emit('isReset')
|
||||
this.$emit('isReset');
|
||||
}
|
||||
}, 200)
|
||||
}, 200);
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => {
|
||||
// 用户取消或API错误
|
||||
})
|
||||
.finally(() => {
|
||||
this.auditLoading = false;
|
||||
this.currentAuditId = null;
|
||||
});
|
||||
},
|
||||
//单个驳回
|
||||
handleFail(row) {
|
||||
let param={
|
||||
taskId:this.taskId,
|
||||
taskStatus:2,
|
||||
partLeaseDetailsList:[row]
|
||||
}
|
||||
this.currentAuditId = row.id;
|
||||
this.auditLoading = true;
|
||||
|
||||
let param = {
|
||||
taskId: this.taskId,
|
||||
taskStatus: 2,
|
||||
partLeaseDetailsList: [row]
|
||||
};
|
||||
|
||||
this.$modal
|
||||
.confirm("是否确认驳回所选择的数据项?")
|
||||
.then(function () {
|
||||
.then(() => {
|
||||
return auditApi(param);
|
||||
})
|
||||
.then(() => {
|
||||
|
|
@ -258,11 +278,17 @@ export default {
|
|||
this.$modal.msgSuccess("驳回成功");
|
||||
setTimeout(() => {
|
||||
if (this.equipmentList.every((item) => item.status != 0)) {
|
||||
this.$emit('isReset')
|
||||
this.$emit('isReset');
|
||||
}
|
||||
}, 200)
|
||||
}, 200);
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => {
|
||||
// 用户取消或API错误
|
||||
})
|
||||
.finally(() => {
|
||||
this.auditLoading = false;
|
||||
this.currentAuditId = null;
|
||||
});
|
||||
},
|
||||
//多个通过
|
||||
handlePassAll() {
|
||||
|
|
@ -273,18 +299,27 @@ export default {
|
|||
});
|
||||
return;
|
||||
} else {
|
||||
let param={
|
||||
taskId:this.taskId,
|
||||
taskStatus:1,
|
||||
partLeaseDetailsList:this.passTemp
|
||||
}
|
||||
this.auditLoading = true;
|
||||
|
||||
let param = {
|
||||
taskId: this.taskId,
|
||||
taskStatus: 1,
|
||||
partLeaseDetailsList: this.passTemp
|
||||
};
|
||||
|
||||
auditApi(param).then((response) => {
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess("通过成功");
|
||||
}
|
||||
this.getTaskInfo();
|
||||
this.$emit('isReset')
|
||||
});
|
||||
this.$emit('isReset');
|
||||
})
|
||||
.catch(() => {
|
||||
// API错误处理
|
||||
})
|
||||
.finally(() => {
|
||||
this.auditLoading = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
//多个驳回
|
||||
|
|
@ -296,17 +331,26 @@ export default {
|
|||
});
|
||||
return;
|
||||
} else {
|
||||
let param={
|
||||
taskId:this.taskId,
|
||||
taskStatus:2,
|
||||
partLeaseDetailsList:this.failTemp
|
||||
}
|
||||
this.auditLoading = true;
|
||||
|
||||
let param = {
|
||||
taskId: this.taskId,
|
||||
taskStatus: 2,
|
||||
partLeaseDetailsList: this.failTemp
|
||||
};
|
||||
|
||||
auditApi(param).then((response) => {
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess("驳回成功");
|
||||
}
|
||||
this.getTaskInfo();
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
// API错误处理
|
||||
})
|
||||
.finally(() => {
|
||||
this.auditLoading = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
@ -317,16 +361,19 @@ export default {
|
|||
width: 60px !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
//隐藏图片上传框的css
|
||||
::v-deep.disabled {
|
||||
.el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.custom-textarea {
|
||||
width: 300px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.accept-img {
|
||||
color: #409eff;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue