import request from '@/utils/request';
import store from '@/store';
import Vue from 'vue';

/**
 * 列表
 */
export async function getList(params) {
  const res = await request.post('/aps/workorder/page', params);
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

// 下达
export async function releaseWorkOrder(data) {
  const res = await request.post(
    `/aps/workorder/releaseWorkOrder`, data
  );
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}


// 修改优先级
export async function updatePriority(data) {
  const res = await request.post(`/aps/workorder/updatePriority`,  data);
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

