This commit is contained in:
2022-08-08 14:08:59 +08:00
commit 6372d7b844
81 changed files with 14579 additions and 0 deletions

33
src/config/getData.js Normal file
View File

@@ -0,0 +1,33 @@
import {post} from '@config/http.js'
// import store from '../vuex/store'
// 登录
export const loginApi = (user, password) => post('api/aqd/hand/handlogin', {
user: user,
password: password
})
// 指令管理
// 1.1 查询未完成指令
export const queryInstraction = (keyword, scode, ncode) => post('api/aqd/hand/insts', {
keyword: keyword,
start_devicecode: scode,
next_devicecode: ncode
})
// 1.2 指令操作
export const instOperation = (uuid, type) => post('api/aqd/hand/inst', {
inst_uuid: uuid,
type: type
})
// 任务管理
// 1.1 查询未完成指令
export const queryTask = (keyword, scode, ncode) => post('api/aqd/hand/tasks', {
keyword: keyword,
start_devicecode: scode,
next_devicecode: ncode
})
// 1.2 指令操作
export const taskOperation = (uuid, type) => post('api/aqd/hand/taskoperation', {
inst_uuid: uuid,
type: type
})

278
src/config/getData1.js Normal file
View File

@@ -0,0 +1,278 @@
import {post} from '@config/http.js'
import store from '../vuex/store'
// 初始化
/** 1.2工序下拉框查询: */
export const workprocedureQuery = () => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'workprocedureQuery',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {}
})
})
/** 1.3缓存线设备下拉框查询: */
export const deviceQuery = () => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'deviceQuery',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {}
})
})
/** 1.4缓存线指令状态下拉框查询: */
export const instStatusQuery = () => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'instStatusQuery',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {}
})
})
// 公共页面
// 1.1缓存线出箱异常-查询:
export const materialQuery = (val) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'materialQuery',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {
search_bar: val
}
})
})
// 空箱初始化
/** 1.1空箱初始化--出入空箱: */
export const inOutEmptyBox = (type, pickerId, val) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'inOutEmptyBox',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {
inOut_type: type,
wcsdevice_code: pickerId,
vehicle_code: val
}
})
})
// 扫码异常
/** 1.1指令查询: */
export const inOutExceptionInstQuery = (type, pickerId, val) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'inOutExceptionInstQuery',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {
inOut_type: type,
wcsdevice_code: pickerId,
vehicle_code: val
}
})
})
/** 1.2确认: */
export const inOutExceptionInstConfirm = (type, pickerId, val, pkId) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'inOutExceptionInstConfirm',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {
inOut_type: type,
wcsdevice_code: pickerId,
vehicle_code: val,
instruct_uuid: pkId
}
})
})
// 缓存线出箱异常
// 1.1缓存线出箱异常-查询:
export const cacheLineOutBoxExceptionQuery = (pickerId, val) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'cacheLineOutBoxExceptionQuery',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {
wcsdevice_code: pickerId,
agv_no: val
}
})
})
// 1.2缓存线出箱异常-确认:
export const cacheLineOutBoxExceptionConfirm = (pickerId, pkId) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'cacheLineOutBoxExceptionConfirm',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {
wcsdevice_code: pickerId,
instruct_uuid: pkId
}
})
})
// agv出箱异常
// 1.1agv出箱异常-查询:
export const agvOutBoxExceptionQuery = (pickerId, val) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'agvOutBoxExceptionQuery',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {
wcsdevice_code: pickerId,
vehicle_code: val
}
})
})
// 1.2agv出箱异常-确认:
export const agvOutBoxExceptionConfirm = (pickerId, val, pkId) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'agvOutBoxExceptionConfirm',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {
wcsdevice_code: pickerId,
vehicle_code: val,
instruct_uuid: pkId
}
})
})
// 1.3agv出箱异常-倒料:
export const pourMaterial = (pickerId, val, pkId) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'pourMaterial',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {
wcsdevice_code: pickerId,
vehicle_code: val,
instruct_uuid: pkId
}
})
})
// agv入箱异常
// 1.1agv入箱异常-查询:
export const agvInBoxExceptionQuery = (pickerId, val1) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'agvInBoxExceptionQuery',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {
wcsdevice_code: pickerId,
vehicle_code: val1
}
})
})
// 1.2agv入箱异常-确认:
export const agvInBoxExceptionConfirm = (pickerId, val1, val2, pkId) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'agvInBoxExceptionConfirm',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {
wcsdevice_code: pickerId,
full_vehicle_code: val1,
empty_vehicle_code: val2,
instruct_uuid: pkId
}
})
})
// 缓存线盘点(满箱初始化盘点)
// 1.1缓存线料箱条码查询料箱信息:
export const cachelineMaterInfoQuery = (type, pickerId, vehicleCode) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'cachelineMaterInfoQuery',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {
type: type,
wcsdevice_code: pickerId,
vehicle_code: vehicleCode
}
})
})
// 1.2设为满框:
export const setfullBox = (wcsdeviceCode, vehicleCode, workprocedureUuid, materialUuid, qty, weight, layer, seat) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'setfullBox',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {
wcsdevice_code: wcsdeviceCode,
vehicle_code: vehicleCode,
workprocedure_uuid: workprocedureUuid,
material_uuid: materialUuid,
quantity: qty,
weight: weight,
layer_num: layer,
seat_order_num: seat
}
})
})
// 1.3设为空框:
export const setEmptyBox = (wcsdeviceCode, vehicleCode, layer, seat) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'setEmptyBox',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {
wcsdevice_code: wcsdeviceCode,
vehicle_code: vehicleCode,
layer_num: layer,
seat_order_num: seat
}
})
})
// 1.4设为空位:
export const setBlankPos = (wcsdeviceCode, vehicleCode, layer, seat) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'setBlankPos',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {
wcsdevice_code: wcsdeviceCode,
vehicle_code: vehicleCode,
layer_num: layer,
seat_order_num: seat
}
})
})
// 指令操作
// 1.1指令分页查询:
export const instPageQuery = (form) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'instPageQuery',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: form
})
})
// 1.2指令操作:
export const instOperation = (uuid, type) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'instOperation',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {
instruct_uuid: uuid,
opt_type: type
}
})
})
// 缓存线异常处理
// 1.1缓存线异常处理:
export const cacheLineExcepOpt = (wcsdeviceCode, type) => post({
'_SRVNAME': 'service.cacheLine.handle',
'_SRVMETHOD': 'cacheLineExcepOpt',
'_DATA': JSON.stringify({
accountId: store.getters.accountId,
form: {
wcsdevice_code: wcsdeviceCode,
opt_type: type
}
})
})

36
src/config/getData2.js Normal file
View File

@@ -0,0 +1,36 @@
import {post} from '@config/http.js'
// import store from '../vuex/store'
// 1.1查询所有区域信息
export const handArea = (type) => post('api/aqd/hand/area', {
area_flag: type
})
// 1.2根据区域查询设备编号及状态
export const handPoint = (reg) => post('api/aqd/hand/point', {
region: reg
})
// 1.3称重前任务
export const handTask3 = (scode, ncode, type, batch, no) => post('api/aqd/hand/task3', {
start_devicecode: scode,
next_devicecode: ncode,
material_type: type,
batch: batch,
carrier: no
})
// 1.4称重后任务
export const handTask = (scode, ncode, type, batch, no) => post('api/aqd/hand/task', {
start_devicecode: scode,
next_devicecode: ncode,
material_type: type,
batch: batch,
carrier: no
})
// 1.5点位放货确认
export const handpointPut = (code, type) => post('api/aqd/hand/pointPut', {
device_code: code,
status_type: type
})

93
src/config/http.js Normal file
View File

@@ -0,0 +1,93 @@
import axios from 'axios'
// import qs from 'qs'
import { Dialog } from './utils.js'
// import { Dialog, toast } from './utils.js'
import store from '../vuex/store'
// import router from './../router'
axios.defaults.timeout = 50000
// axios.defaults.retry = 5
// axios.defaults.retryDelay = 10000
axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'
axios.interceptors.request.use(
config => {
if (config.method === 'post') {
if (!config.data.flag) {
config.data = config.data
} else {
config.data = config.data.formData
}
}
return config
},
error => {
Dialog('错误的传参')
return Promise.reject(error)
}
)
axios.interceptors.response.use(
response => {
return Promise.resolve(response)
},
error => {
// let condata = error.config.data.split('&')
// console.log('condata', condata)
// if (condata[1] === '_SRVMETHOD=queryProduceOrderReprot' || condata[1] === '_SRVMETHOD=queryQCRecord' || condata[1] === '_SRVMETHOD=queryEquipWorkTeam') {
// toast(error.message)
// setTimeout(() => {
// router.replace({
// path: '/login'
// })
// }, 10000)
// } else {
// if (condata[1] === '_SRVMETHOD=queryEquip') {
// toast(error.message)
// } else {
// Dialog(error.message)
// }
// // Dialog(error.message)
// }
// toast(error.message)
// - 20201215-x
// router.push({
// path: '/500',
// query: {redirect: router.currentRoute.fullPath}
// })
// - 20201215-x
return Promise.reject(error)
// let config = error.config
// if (!config || !config.retry) return Promise.reject(error)
// config.__retryCount = config.__retryCount || 0
// if (config.__retryCount >= config.retry) {
// return Promise.reject(error)
// }
// config.__retryCount += 1
// let backoff = new Promise(resolve => {
// setTimeout(() => {
// resolve()
// }, config.retryDelay || 1)
// })
// return backoff.then(() => {
// return axios(config)
// })
}
)
export const post = (sevmethod, params) => {
return new Promise((resolve, reject) => {
axios.post(`${store.getters.baseUrl}/` + sevmethod, params)
.then(response => {
// if (response.data.code === '0') {
// Dialog(response.data.desc)
// }
resolve(response.data)
}, error => {
reject(error.message)
})
.catch((error) => {
reject(error)
})
})
}

13
src/config/rem.js Normal file
View File

@@ -0,0 +1,13 @@
/** 华为平板分辨率1000*600 */
(function (doc, win) {
var docEl = doc.documentElement
var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'
var recalc = function () {
var clientWidth = docEl.clientWidth
if (!clientWidth) return
docEl.style.fontSize = 100 * (clientWidth / 800) + 'px'
}
if (!doc.addEventListener) return
win.addEventListener(resizeEvt, recalc, false)
doc.addEventListener('DOMContentLoaded', recalc, false)
})(document, window)

81
src/config/utils.js Normal file
View File

@@ -0,0 +1,81 @@
import store from '../vuex/store'
/**
* 弹出框
*/
export const Dialog = (str) => {
store.dispatch('showAlert', true)
store.dispatch('alertMsg', str)
setTimeout(() => {
store.dispatch('showAlert', false)
}, 500000)
}
/**
* 提示框
*/
export const toast = (str) => {
store.dispatch('showToast', true)
store.dispatch('toastMsg', str)
setTimeout(() => {
store.dispatch('showToast', false)
}, 3000)
}
/**
* 存储localStorage
*/
export const setStore = (name, content) => {
if (!name) return
if (typeof content !== 'string') {
content = JSON.stringify(content)
}
window.localStorage.setItem(name, content)
}
/**
* 获取localStorage
*/
export const getStore = name => {
if (!name) return
return window.localStorage.getItem(name)
}
/**
* yy-mm-dd
*/
export const dateFtt = date => {
if (date == null) {
return ''
}
let year = date.getFullYear()
let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
return `${year}-${month}-${day}`
}
/**
* yy-mm-dd hh:mm:ss
*/
export const dateTimeFtt = date => {
if (date == null) {
return ''
}
let year = date.getFullYear()
let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
let hh = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
let mm = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
let ss = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
return `${year}-${month}-${day} ${hh}:${mm}:${ss}`
}
/**
* 将字符串形式的日期转换成日期对象
*/
export const dateNew = date => {
if (date === undefined || date === 'undefined') {
return new Date()
}
return new Date(Date.parse(date))
}