修改工单审核

This commit is contained in:
龙运模 2025-01-09 18:46:36 +08:00
parent 4f1510d67a
commit 3ae57dfba0
2 changed files with 16 additions and 51 deletions

View File

@ -340,25 +340,18 @@ export default {
if(res.code == 200){ if(res.code == 200){
this.$refs.table.refresh(); this.$refs.table.refresh();
} }
}).catch(() => { }).catch(async () => {
this.dialog.companyWf = true;
this.$nextTick(() => {
this.$refs.companyWfDialog.open('review');
})
})
},
async reviewSave(data) {
let params = { let params = {
order_ids: this.selection.map(em => em.id), order_ids: this.selection.map(em => em.id),
status: true, status: true,
is_verify_erp_inventory: false, is_verify_erp_inventory: false,
maintenance_vendor:data.company_id
} }
const res = await this.$API.orders.order.maintenance.review.post(params); const res = await this.$API.orders.order.maintenance.review.post(params);
if (res.code == 200) { if (res.code == 200) {
this.$refs.companyWfDialog.hideVisible(); this.$refs.companyWfDialog.hideVisible();
this.$refs.table.refresh(); this.$refs.table.refresh();
} }
})
}, },
save_maintenance() { save_maintenance() {
@ -381,8 +374,6 @@ export default {
this.$refs.companyWfDialog.hideVisible(); this.$refs.companyWfDialog.hideVisible();
this.$refs.table.refresh(); this.$refs.table.refresh();
} }
}else if(mode === 'review'){
await this.reviewSave(data);
} }
}, },
// //

View File

@ -37,24 +37,18 @@
</el-scrollbar> </el-scrollbar>
</el-main> </el-main>
</el-container> </el-container>
<manufacturer-dialog v-if="dialog.companyWf" ref="companyWfDialog" @success="handleWfSuccess" @closed="dialog.companyWf=false"></manufacturer-dialog>
</template> </template>
<script> <script>
import detailView from "@/views/order/orderList/detailView"; import detailView from "@/views/order/orderList/detailView";
import manufacturerDialog from "@/views/order/orderList/components/manufacturer"
export default { export default {
name: "", name: "",
components:{ components:{
detailView, detailView
manufacturerDialog
}, },
data(){ data(){
return{ return{
size:'small', size:'small',
dialog: {
companyWf:false
},
loading:false, loading:false,
confirmLoading:false, confirmLoading:false,
cancelLoading:false, cancelLoading:false,
@ -114,21 +108,6 @@ export default {
} }
return obj; return obj;
}, },
async handleWfSuccess(data, mode) {
if (mode === 'review') {
let params = {
order_ids: [this.params.order_id],
status: true,
opinion: this.opinion,
maintenance_vendor: data.company_id
}
const res = await this.$API.orders.order.maintenance.review.post(params);
if (res.code == 200) {
this.$refs.companyWfDialog.hideVisible();
await this.getData();
}
}
},
async save(type) { async save(type) {
let params = { let params = {
order_ids: [this.params.order_id], order_ids: [this.params.order_id],
@ -138,18 +117,13 @@ export default {
if (type == 1) { if (type == 1) {
delete params.opinion delete params.opinion
this.confirmLoading = true; this.confirmLoading = true;
this.dialog.companyWf = true;
this.$nextTick(() => {
this.saveLoading = false;
this.$refs.companyWfDialog.open('review');
})
}else{ }else{
this.cancelLoading = true; this.cancelLoading = true;
}
const res = await this.$API.orders.order.maintenance.review.post(params); const res = await this.$API.orders.order.maintenance.review.post(params);
if (res.code == 200) { if (res.code == 200) {
await this.getData(); await this.getData();
} }
}
this.confirmLoading = false; this.confirmLoading = false;
this.cancelLoading = false; this.cancelLoading = false;
} }