import fetch from '@/common/fetch.js'; import BASE_URL from './base.js'; import useNetWork from '@/common/useNetWork.js'; const Submit = BASE_URL + '/visitor/apply/submit' const visitReason = BASE_URL + '/sys/dict/code/visitReason' const devicePosition = BASE_URL + '/sys/dict/code/devicePosition' const DEL_APPLY = BASE_URL + '/visitor/delApply' const CHANGE_APPLY = BASE_URL + '/visitor/updateApply' /** * 提交访客记录 * @param {*} */ export function getSubmit(data) { useNetWork(); return fetch.post(Submit,data).then(res => res); } /** * 获取访问目的 * @param {*} */ export function getDictCode(code) { useNetWork(); return fetch.get(visitReason).then(res => res); } /** * 获取访问楼栋 * @param {*} */ export function getResourceType(code) { useNetWork(); return fetch.get(devicePosition).then(res => res); } /** * 申请者删除申请 * @param {Object} code */ export function delApply(applyId) { useNetWork(); const params = { applyId: applyId } return fetch.get(DEL_APPLY, params).then(res => res); } /** * 申请者修改申请 * @param {Object} code */ export function updateApply(params) { useNetWork(); return fetch.post(CHANGE_APPLY, params).then(res => res); }