案例一:MES 下达工单

添加服务配置

image.png
image.png

添加自定义按钮

image.png
image.png
image.png

添加 JS 增强配置

image.png
image.png

  1. Release({record}) {
  2. console.log("record",record)
  3. console.log("that",that)
  4. let ids = that.table.selectedRows.map(item=>item.id)
  5. postAction("/mes-w-main/online/porosServer/mes_check_release",{id:ids.toString()}).then(res=>{
  6. console.log(res.data)
  7. that.batchno = res.data;
  8. if(!res.success){
  9. console.log("接口请求失败!",res.msg);
  10. that.$message.warning("请求接口失败")
  11. }else {
  12. console.log("接口请求成功!",res.msg);
  13. console.log(res.data.map[0].msg.length);
  14. if(res.data.map[0].msg.length>0){
  15. that.$message.success(res.data.map[0].msg)
  16. //that.showModal();
  17. }else{
  18. postAction("/mes-w-main/online/porosServer/mes_release_work_order",{id:ids.toString()}).then(res=>{
  19. console.log(res.data)
  20. that.batchno = res.data;
  21. if(!res.success){
  22. console.log("接口请求失败!",res.msg);
  23. that.$message.warning("请求接口失败")
  24. }else {
  25. console.log("接口请求成功!",res.msg);
  26. that.$message.success("下达成功")
  27. }
  28. })
  29. }
  30. }
  31. })
  32. }

image.png

一键同步数据

image.png

查看效果

image.png