import request from '@/utils/request';

export default {
  //列表
  list: async (params) => {
    const res = await request.get('/main/producecontrol/page', { params });
    if (res.data.code == 0) {
      return res.data.data;
    }
  },


  //保存
  save: async (data) => {
    const res = await request.post('/main/producecontrol/save', data);
    console.log(res, 'res');
    if (res.data.code == 0) {
      return res.data.message;
    }
  },
  //保存
  update: async (data) => {
    const res = await request.put('/main/producecontrol/update', data);
    if (res.data.code == 0) {
      return res.data.message;
    }
  },
  //删除
  delete: async (data) => {
    const res = await request.delete('/main/producecontrol/delete', { data });
    if (res.data.code == 0) {
      return res.data.message;
    }
  }
};
