lock.js 896 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { checkLock } from "@/api/lock/lock"
  2. export async function checkLocks(data) {
  3. let option
  4. await checkLock(data).then(res => {
  5. //此单据未被锁定
  6. if (res.data.code === 200) {
  7. option = false
  8. } else {
  9. //此单据已被锁定
  10. option = true
  11. }
  12. })
  13. return option
  14. }
  15. export async function inLocks(moduleName, tableName, id, no) {
  16. const data = {
  17. moduleName: moduleName,
  18. tableName: tableName,
  19. billId: id,
  20. no: localStorage.getItem("browserID"),
  21. billNo: no
  22. };
  23. this.inDetailsKey(this.$route.name, {
  24. moduleName: moduleName,
  25. tableName: tableName,
  26. billId: id,
  27. billNo: no
  28. });
  29. await checkLock(data).then(res => {
  30. if (res.data.code == 200) {
  31. this.onLock(data).then(res => {
  32. if (res.data.code == 200) {
  33. return false
  34. } else {
  35. return true
  36. }
  37. });
  38. }
  39. });
  40. }