/**
@author:fugy
@date:2018.10.22
@info:通用问题对应集团的sop的api
 */
import httputils from '@/api/httputils'
let priorityArr = [
    //优先级数组
    {
        label: 'S',
        value: 'S'
    },
    {
        label: 'A',
        value: 'A'
    },
    {
        label: 'B',
        value: 'B'
    },
    {
        label: 'C',
        value: 'C'
    },
    {
        label: 'D',
        value: 'D'
    }
];
let problemArr = [
    //问题级别数组
    {
        label: '电器',
        value: '电器'
    },
    {
        label: '建筑',
        value: '建筑'
    },
    {
        label: '家具',
        value: '家具'
    },
    {
        label: '其他',
        value: '其他'
    }
]
const api = {
    // 获取sop的列表
    getListData: function(params) {
        return new Promise((resolve, reject) => {
			httputils.postJson('/server/workorder/generalProblem/problem/query', params, res => {
                resolve(res)
			})
		})
    },
    // 获取sop问题的列表数据
    getSopList(params) {
        return new Promise((resolve, reject) => {
			httputils.postJson('/server/workorder/generalProblem/sop/list', params, res => {
                resolve(res)
			})
		})
    },
    // 保存配置sop
    setSop(params) {
        return new Promise((resolve, reject) => {
			httputils.postJson('/server/workorder/generalProblem/sop/set', params, res => {
                resolve(res)
			})
		})
    },
    // 优先级数组
    getPriorityArr: function () {
        return priorityArr
    },
    // 获取问题类型
    getProblemArr: function () {
        return problemArr
    },
}
export default api;