|
@@ -325,7 +325,7 @@ export default {
|
|
|
// },
|
|
|
handleSure () {
|
|
|
// console.log(this.list);return false;
|
|
|
- this.list.forEach(v => {
|
|
|
+ this.list.forEach((v,index) => {
|
|
|
const data3 = {
|
|
|
url: 'http://121.36.142.167:7774/jbl/api/module-data/completion_orders/completion_orders',
|
|
|
post: {
|
|
@@ -356,65 +356,65 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // this.axios.post('/api/testdwy', { ...data3 }).then(res => {
|
|
|
- // if (res.code == 200) {
|
|
|
- // this.$Message.success(res.msg)
|
|
|
- // // this.$router.push('/cms/home')
|
|
|
- // }
|
|
|
- // })
|
|
|
-
|
|
|
- const data4Dtil = [];
|
|
|
- v.break.forEach(vv =>{
|
|
|
- if(vv.break_id&&vv.break_num){
|
|
|
- v.defective_num = vv.break_num;
|
|
|
- v.defective_remark = vv.break_id;
|
|
|
- data4Dtil.push(v) ;
|
|
|
+ const data4Dtil = []
|
|
|
+ v.break.forEach(vv => {
|
|
|
+ if (vv.break_id && vv.break_num) {
|
|
|
+ v.defective_num = vv.break_num
|
|
|
+ v.defective_remark = vv.break_id
|
|
|
+ data4Dtil.push(v)
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
})
|
|
|
- if(data4Dtil.length > 0){
|
|
|
- const data4 = {
|
|
|
- url: 'http://121.36.142.167:7774/jbl/api/module-data/defective_orders/defective_orders',
|
|
|
- post: {
|
|
|
- bizId: -1,
|
|
|
- bizTypeEk: 'LOWCODE',
|
|
|
- dynamicFormId: "474139280406949888",
|
|
|
- showModelId: "474140935059877888",
|
|
|
- data: {
|
|
|
- defective_orders: {
|
|
|
- defective_order_no: null,
|
|
|
- defection_time: new Date(),
|
|
|
- created_by: null,
|
|
|
- created_date: null,
|
|
|
- employee_id: v.employee_id.toString(),
|
|
|
- employee_id_show: v.employee_id_show,
|
|
|
- equipment_id: v.equipment_id,
|
|
|
- equipment_id_show: v.equipment_id_show,
|
|
|
- last_modified_by: null,
|
|
|
- last_modified_date: null,
|
|
|
- process_id: v.dispatch_orders.process_id,
|
|
|
- process_id_show: v.dispatch_orders.process_id_show,
|
|
|
- site: null,
|
|
|
- team_id: v.team_finish_id,
|
|
|
- team_id_show: v.team_id_show,
|
|
|
- },
|
|
|
- defective_orders_dtl: data4Dtil
|
|
|
+ this.axios.post('/api/testdwy', { ...data3 }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ if (data4Dtil.length > 0) {
|
|
|
+ const data4 = {
|
|
|
+ url: 'http://121.36.142.167:7774/jbl/api/module-data/defective_orders/defective_orders',
|
|
|
+ post: {
|
|
|
+ bizId: -1,
|
|
|
+ bizTypeEk: 'LOWCODE',
|
|
|
+ dynamicFormId: "474139280406949888",
|
|
|
+ showModelId: "474140935059877888",
|
|
|
+ data: {
|
|
|
+ defective_orders: {
|
|
|
+ defective_order_no: null,
|
|
|
+ defection_time: new Date(),
|
|
|
+ created_by: null,
|
|
|
+ created_date: null,
|
|
|
+ employee_id: v.employee_id.toString(),
|
|
|
+ employee_id_show: v.employee_id_show,
|
|
|
+ equipment_id: v.equipment_id,
|
|
|
+ equipment_id_show: v.equipment_id_show,
|
|
|
+ last_modified_by: null,
|
|
|
+ last_modified_date: null,
|
|
|
+ process_id: v.dispatch_orders.process_id,
|
|
|
+ process_id_show: v.dispatch_orders.process_id_show,
|
|
|
+ site: null,
|
|
|
+ team_id: v.team_finish_id,
|
|
|
+ team_id_show: v.team_id_show
|
|
|
+ },
|
|
|
+ defective_orders_dtl: data4Dtil
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ this.axios.post('/api/testdwy', { ...data4 }).then(req => {
|
|
|
+ if (req.code == 200) {
|
|
|
+ if (index == this.list.length-1) {
|
|
|
+ this.$Message.success(req.msg)
|
|
|
+ this.$router.push('/cms/home')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ if(index==this.list.length-1){
|
|
|
+ this.$Message.success(res.msg)
|
|
|
+ this.$router.push('/cms/home')
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
- console.log(JSON.stringify(data4));return false;
|
|
|
- // this.axios.post('/api/testdwy', { ...data3 }).then(res => {
|
|
|
- // if (res.code == 200) {
|
|
|
- // // this.$Message.success(res.msg)
|
|
|
- //
|
|
|
- //
|
|
|
- // }
|
|
|
- // })
|
|
|
- }
|
|
|
-
|
|
|
+ })
|
|
|
})
|
|
|
+
|
|
|
}
|
|
|
}}
|
|
|
</script>
|