import Vue from 'vue';
import Vuex from 'vuex';
import _ from 'lodash';
Vue.use(Vuex);
const api = {
  intelligentDockingInfo: `/api/financial/intelligentDocking`,
};
const state = () => ({});
const mutations = {};

const actions = {
  //列表查询
  async dockingSearch({ commit }, payload) {
    // 列表
    const res = await this.$axios.$post(`${api.intelligentDockingInfo}/dockingSearch`, payload);
    return res;
  },
  // 修改
  async update({ commit }, { id, ...data }) {
    const res = await this.$axios.$post(`${api.intelligentDockingInfo}/update/${id}`, data);
    return res;
  },
  // 详情
  async one({ commit }, payload) {
    const res = await this.$axios.$post(`${api.intelligentDockingInfo}/one`, payload);
    return res;
  },
  // 拒绝
  async refuseDocking({ commit }, payload) {
    const res = await this.$axios.$post(`${api.intelligentDockingInfo}/refuseDocking`, payload);
    return res;
  },
};
export default {
  namespaced: true,
  state,
  mutations,
  actions,
};
