<file_sep>import axios from "axios"

export const getUserList=(data)=>axios.post("user/lists",data)//获取用户列表

export const received=(order_id,partment)=>axios.post("order/receive",{order_id,partment})//接收

export const getUserMsg=(user_id)=>axios.get("user/get",user_id)//根据user_id获取用户信息

export const saveRole=(data)=>axios.post("user/save_role",data)//设置用户角色

export const setBlacklist=(user_id,operate)=>axios.put("user/update_blacklist",{user_id,operate})//用户黑名单

export const getProductList=(page,per_page)=>axios.post("product/lists",{page,per_page})

export const getSpecLists=(product_id)=>axios.post("product/spec_lists",product_id)

export const addProduct =(product_code,product_name,product_unit)=>axios.post("product/add",{product_code,product_name,product_unit})//新增商品

export const updateProduct =(product_id,product_code,product_name,product_unit)=>axios.put("product/update",{product_id,product_code,product_name,product_unit})//根据product_id编辑产品信息
export const delProduct =(product_id)=>    axios.delete("product/delete",{params:{product_id}})//删除商品

export const saveSpec =(product_id,product_specs)=>axios.post("product/save_spec",{product_id,product_specs})//保存产品对应规格信息

export const getBySearch =(search_name)=>axios.post("product/get_by_search",{search_name})//根据产品代码或名称获取产品信息

export const getShiGongLists =(page,per_page)=>axios.post("shigong/lists",{page,per_page})//获取施工队列表

export const addShiGong =(shigong_name,contact_name,contact_phone)=>axios.post("shigong/add",{shigong_name,contact_name,contact_phone})//添加施工队

export const updateShiGong =(shigong_id,shigong_name,contact_name,contact_phone)=>axios.put("shigong/update",{shigong_id,shigong_name,contact_name,contact_phone})//编辑施工队记录
export const delShiGong =(shigong_id)=>axios.delete("shigong/del",{params:{shigong_id}})//编辑施工队记录

export const getOrderMsg =(order_id)=>axios.get("order/get",{params:{order_id}})//添加施工队
<file_sep>import axios from "axios"

export const getCangkuLists=(data)=>axios.post("cangku/lists",data);

export const getPeiliaoList=(order_id)=>axios.get("cangku/peiliao_lists",{params:{order_id}});

export const completePeiliao=(order_id)=>axios.put("cangku/complete_peiliao",{order_id});

export const getDesign=(order_id)=>axios.get("cangku/get_design",{params:{order_id}});

export const arrangeShigong=(order_id,shigong_id)=>axios.post("cangku/arrange_shigong",{order_id,shigong_id});

export const confirmLingliao=(order_id)=>axios.put("cangku/confirm_lingliao",{order_id});

export const savePeiliao=(data)=>axios.post("cangku/save_peiliao",data);

export const completeShigong=(order_id)=>axios.put("cangku/complete_shigong",{order_id});

export const jiesuan=(order_id)=>axios.put("cangku/jiesuan_liaodan",{order_id});

export const getShigong=(order_id)=>axios.get("cangku/get_shigong",{params:{order_id}});

export const updateShigong=(order_id,shigong_id)=>axios.put("cangku/update_shigong",{order_id,shigong_id});

export const getcheck=()=>axios.get("cangku/check");
<file_sep>import axios from "axios"

export const getFengKongLists=(data)=>axios.post("fengkong/lists",data);

export const Firstinstance=(data)=>axios.put("fengkong/yishen",data);

export const getPeiliaoLists=(order_id)=>axios.get("fengkong/peiliao_lists",{params:{order_id}});

export const savePeiliao=(data)=>axios.post("fengkong/save_peiliao",data);

export const commitProspect=(data)=>axios.put("fengkong/commit_prospect",data);

export const getProspect=(order_id)=>axios.get("fengkong/get_prospect",{params:{order_id}});

export const getReason2=(order_id)=>axios.get("fengkong/get_reason",{params:{order_id}});

export const getcheck=()=>axios.get("fengkong/check");
<file_sep>import axios from "axios"

export const accountInfo=(login_name,password,remember)=>axios.post("user/login",{login_name,password,remember})

export const getRegisterMess=(login_name,verify_code,password)=>axios.post("user/login",{login_name,verify_code,password})//用户注册

export const weixin=(code)=>axios.get("user/weixin_login",{params:{code}})//用户注册

export const getPhoneNum=(phone)=>axios.post("user/phone_status",{phone})//手机号码存在不存在接口

export const getverify=(type,phone)=>axios.post("notify/verify_code",{type,phone})

export const logout=()=>axios.post("user/logout")

export const getPhoneAllMess=(phone,verify_code,new_password)=>axios.post("user/pwd_reset_phone",{phone,verify_code,new_password})//发送手机验证码重置用户密码

export const imageUpload =(file)=>axios.post("upload_image",file)/*上传图片接口*/
<file_sep>import axios from "axios"

export const getBingWangLists=(data)=>axios.post("bingwang/lists",data);

export const receive=(order_id)=>axios.put("bingwang/receive_data",{order_id});

export const getDataLists=(order_id,type)=>axios.get("bingwang/data_lists",{params:{order_id,type}});

export const getcheck=()=>axios.get("bingwang/check");

export const saveData=(data)=>axios.post("bingwang/save_data",data);

export const firstData=(order_id)=>axios.put("bingwang/first_data",{order_id});

export const secondData=(order_id)=>axios.put("bingwang/second_data",{order_id});

export const getAllData=(order_id)=>axios.all([getDataLists(order_id,1),getDataLists(order_id,2)])

export const allowBeiLiao=(order_id)=>axios.put("bingwang/allow_beiliao",{order_id});

export const bingwangSuccess=(order_id)=>axios.put("bingwang/bingwang_success",{order_id});

export const updateOrder=(data)=>axios.put("bingwang/update_order",data);
<file_sep>export default{
	//删除空对象
	methods:{
    beforeAvatarUpload(file) {
      const isPic = ((file.type === 'image/jpeg') || (file.type === 'image/jpg') || (file.type === 'image/png'));
      const isLt6M = file.size / 1024 / 1024 < 10;
      if (!isPic) {
        this.$message.error('上传图片只能是jpg/png格式!');
      }
      if (!isLt6M) {
        this.$message.error('上传图片大小不能超过10MB!');
      }
      return isPic && isLt6M;
    },
		error(err,file, fileList){
			console.log(err);
			 this.$message.error("图片上传失败");
		}
  }
}
<file_sep>import axios from 'axios'
import store from '@/store'

// axios 配置
axios.defaults.timeout = 15000
//axios.defaults.headers.common["content-type"]="multipart/form-data"
axios.defaults.baseURL = '/admin/'
// http request 拦截器
axios.interceptors.request.use(function (config) {
  return config
}, function (err) {
  return Promise.reject(err)
})

// http response 拦截器
axios.interceptors.response.use(
  response => {
    return response
  },
  err => {
    if (err && err.response) {
      switch (err.response.status) {
        case 400:
          err.message = '请求错误'
        if(err.response.data.errcode==40015){
            store.dispatch("doLoginOut",{
              "user_id": "",
              "is_admin": "",
              "phone": "",
              "nick_name": ""
            });
          }
          break

        case 401:
          err.message = '未授权，请登录'
          break

        case 403:
          err.message = '拒绝访问'
          break

        case 404:
          err.message = `请求地址出错: ${err.response.config.url}`
          break

        case 408:
          err.message = '请求超时'
          break

        case 500:
          err.message = '服务器内部错误'
          break

        case 501:
          err.message = '服务未实现'
          break

        case 502:
          err.message = '网关错误'
          break

        case 503:
          err.message = '服务不可用'
          break

        case 504:
          err.message = '网关超时'
          break

        case 505:
          err.message = 'HTTP版本不受支持'
          break

        default:
      }
    }

    return Promise.reject(err)
  })

export default axios
<file_sep>import {saveData} from '@/api/gird'

export default{
	//删除空对象
	data(){
		  return {
        dataList:{
          "order_id":"",
          "type":"",
          "datas":[]
        },
			}
	},
	methods:{
    save(fileList,type){
      //发送请求
      this.dataList.datas=[];
      type==5?this.dataList.type=1:this.dataList.type=2
      for(let val of fileList){
        let obj={
          "image_url":val.response.path
        };
        if(val.data_id){
          obj.data_id=val.data_id
        }
        this.dataList.datas.push(obj)
      }
      saveData(this.dataList)
      .then(({
        data
      }) => {
        this.isTable=true;
      })
			.catch(({
				response: {
					data
				}
			}) => {  //与后台交互时出现的错误信息
				this.$message.error(data.errorcmt);
			})
    },
  }
}
<file_sep>import axios from "axios"

export const createOrder=(data)=>axios.post("yewu/create",data);

export const getYewuLists=(data)=>axios.post("yewu/lists",data);

export const getcheck=()=>axios.get("yewu/check");

export const getSchedule=(order_id)=>axios.get("yewu/get_schedule",{params:{order_id}});

export const getReason1=(order_id)=>axios.get("yewu/get_reason",{params:{order_id}});

export const sendMsg=(order_id)=>axios.put("yewu/send_data",{order_id});

export const communicate=(order_id,result)=>axios.put("yewu/communicate",{order_id,result});

export const deleteOrder=(orders)=>axios.post("admin/delete_order_batch",{orders});

export const applyTel=(phone)=>axios.get("yewu/choose",{params:{phone}});
<file_sep>import axios from "axios"

export const getYanshouLists=(data)=>axios.post("yanshou/lists",data);

export const getcheck=()=>axios.get("yanshou/check");

export const getShigong=(order_id)=>axios.get("yanshou/get_shigong",{params:{order_id}});

export const confirmYanshou=(order_id)=>axios.put("yanshou/confirm_yanshou",{order_id});
