init
This commit is contained in:
1903
utils/CLodopfuncs.js
Normal file
1903
utils/CLodopfuncs.js
Normal file
File diff suppressed because it is too large
Load Diff
282
utils/getData2.js
Normal file
282
utils/getData2.js
Normal file
@@ -0,0 +1,282 @@
|
||||
import request from './request.js'
|
||||
|
||||
// 版本更新测试
|
||||
export const pdaUpdate = () => request({
|
||||
url:'api/pda/update'
|
||||
})
|
||||
// export const pdaUpdate = () => {
|
||||
// let res = {
|
||||
// versionName: '1.0.1',
|
||||
// url: 'https://mp-e979e0eb-882b-42b3-a4a1-923ad08ea194.cdn.bspapp.com/cloudstorage/f72ec59f-7b25-487d-a034-fead1b6654c6.apk'
|
||||
// }
|
||||
// return res
|
||||
// }
|
||||
|
||||
// 登录
|
||||
export const handLogin = (user, password) => request({
|
||||
url:'api/bigScreenScreen/login',
|
||||
data: {
|
||||
user: user,
|
||||
password: password
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* 物料组盘入库
|
||||
*/
|
||||
export const storList = () => request({
|
||||
url:'api/pda/common/storList',
|
||||
data: {}
|
||||
})
|
||||
export const groupMaterList = (page, size, search) => request({
|
||||
url:'api/groupMater/maters',
|
||||
data: {page: page, size: size, search: search}
|
||||
})
|
||||
export const groupMaterIn = (code, item) => request({
|
||||
url:'api/groupMater/in',
|
||||
data: {stor_code: code, item: item}
|
||||
})
|
||||
/**
|
||||
* 设备操控
|
||||
*/
|
||||
export const switchInOut = (code, mode) => request({
|
||||
url:'api/deviceManage/changeMode/switchInOut',
|
||||
data: {device_code: code, mode: mode}
|
||||
})
|
||||
export const pinkStartStop = (code, mode) => request({
|
||||
url:'api/deviceManage/changeMode/pinkStartStop',
|
||||
data: {device_code: code, mode: mode}
|
||||
})
|
||||
export const toCommandTP = (code, mode, vcode, isC) => request({
|
||||
url:'api/deviceManage/changeMode/toCommandTP',
|
||||
data: {device_code: code, mode: mode, vehicle_code: vcode, is_check: isC}
|
||||
})
|
||||
/**
|
||||
* 组盘入库
|
||||
*/
|
||||
// 单据类型
|
||||
export const FormTypes = () => request({
|
||||
method: 'GET',
|
||||
url:'api/bmFormStruc/getTypes?type=pda'
|
||||
})
|
||||
// 单据数据
|
||||
export const pmFormData = (page, size, form_type, code) => request({
|
||||
method: 'GET',
|
||||
url:'api/pmFormData?page=' + page + '&size=' + size + '&form_type=' + form_type + '&vehicle_code=' + code
|
||||
})
|
||||
// 组盘确认
|
||||
export const mdGruopDick = (item, code, type) => request({
|
||||
url:'api/mdGruopDick',
|
||||
data: {item: item, stor_code: code, type: type}
|
||||
})
|
||||
/**
|
||||
* 空托盘入库
|
||||
*/
|
||||
export const pdaPalletIostorinvIn = (code, id) => request({
|
||||
url:'api/pdaPalletIostorinv/in',
|
||||
data: {vehicle_code: code, material_id: id}
|
||||
})
|
||||
/**
|
||||
* 托盘出库
|
||||
*/
|
||||
export const targetPoint = () => request({
|
||||
url:'api/pdaPalletIostorinv/targetPoint',
|
||||
method: 'GET'
|
||||
})
|
||||
export const pdaPalletIostorinvOut = (id, qty, point) => request({
|
||||
url:'api/pdaPalletIostorinv/out',
|
||||
data: {material_id: id, qty: qty, pcsn: '1', target_point: point}
|
||||
})
|
||||
/**
|
||||
* 出库确认
|
||||
*/
|
||||
export const ioStorageOut = (code) => request({
|
||||
url:'api/ioStorage/out',
|
||||
data: {vehicle_code: code}
|
||||
})
|
||||
/**
|
||||
* 拣选单列表
|
||||
*/
|
||||
export const pmFormData2 = (page, size, form_type, status, code) => request({
|
||||
method: 'GET',
|
||||
url:'api/pmFormData?page=' + page + '&size=' + size + '&form_type=' + form_type + '&status=' + status + '&vehicle_code=' + code
|
||||
})
|
||||
// 扫载具查看拣选单信息
|
||||
export const queryPick = (type, code) => request({
|
||||
url:'api/pda/pick/queryPick',
|
||||
data: {form_type: type, vehicle_code: code}
|
||||
})
|
||||
export const savePickTask = (data) => request({
|
||||
url:'api/pda/pick/savePickTask',
|
||||
data: data
|
||||
})
|
||||
/**
|
||||
* 盘点作业
|
||||
*/
|
||||
export const checkByVehicle = (code) => request({
|
||||
url:'api/pda/check/byVehicle',
|
||||
data: {vehicle_code: code}
|
||||
})
|
||||
export const checkSaveCheckTask = (id, vehicle, qty, cqty) => request({
|
||||
url:'api/pda/check/saveCheckTask',
|
||||
data: {children_id: id,children_vehicle: vehicle,check_qty, qty,children_qty: cqty}
|
||||
})
|
||||
/**
|
||||
* 任务管理
|
||||
*/
|
||||
export const getStatusEnum = () => request({
|
||||
method: 'GET',
|
||||
url:'api/dict/getStatusEnum?code=TASK_TYPE'
|
||||
})
|
||||
export const schBaseTask = (page, size, sort, code) => request({
|
||||
method: 'GET',
|
||||
url:'api/schBaseTask?page=' + page + '&size=' + size + '&sort=' + sort + '&vehicle_code=' + code
|
||||
})
|
||||
export const saveCheckTask = (code, status) => request({
|
||||
url:'api/pda/check/saveCheckTask',
|
||||
data: {task_code: code, status: status}
|
||||
})
|
||||
/**
|
||||
* 单据出库
|
||||
*/
|
||||
export const outStorageOrder = () => request({
|
||||
method: 'GET',
|
||||
url:'api/pda/outStorage/order'
|
||||
})
|
||||
export const outStorageOrderList = (page, size, type, code) => request({
|
||||
method: 'GET',
|
||||
url:'api/pda/outStorage/orderList?page=' + page + '&size=' + size + '&form_type=' + type + '&code=' + code
|
||||
})
|
||||
export const outStorageOrderConfirm = (code, scode) => request({
|
||||
url:'api/pda/outStorage/orderConfirm',
|
||||
data: {code: code, stor_code: scode}
|
||||
})
|
||||
export const outStorageConfirm = (obj) => request({
|
||||
url:'api/pda/outStorage/confirm',
|
||||
data: obj
|
||||
})
|
||||
// export const outStorageConfirm = (obj) => {
|
||||
// let res = {
|
||||
// code: '200',
|
||||
// msg: 'ok'
|
||||
// }
|
||||
// return res
|
||||
// }
|
||||
|
||||
// 扫描合格证获取物料信息
|
||||
export const getCertificateInfo = (id) => request({
|
||||
url:'api/pda/inStorage/getCertificateInfo/' + id,
|
||||
method: 'GET'
|
||||
})
|
||||
// export const getCertificateInfo = (id) => {
|
||||
// let res = {
|
||||
// moNumber: '订单号',
|
||||
// material_code: 'material_code',
|
||||
// material_name: 'material_name',
|
||||
// material_spec: 'material_spec',
|
||||
// unit_name: 'unit_name',
|
||||
// qty: '100',
|
||||
// stockOrgId: 'StockOrgId',
|
||||
// ownerId_id: 'OwnerId_Id',
|
||||
// single_weight: '500',
|
||||
// pcsn: 'pcsn'
|
||||
// }
|
||||
// return res
|
||||
// }
|
||||
// 单据入库组盘确认
|
||||
export const inStorageConfirm = (obj) => request({
|
||||
url:'api/pda/inStorage/confirm',
|
||||
data: obj
|
||||
})
|
||||
|
||||
/**
|
||||
* 托盘转运
|
||||
*/
|
||||
export const deviceManageTransf = (start) => request({
|
||||
url:'api/deviceManage/transf',
|
||||
data: {start: start}
|
||||
})
|
||||
export const transfConfirm = (start, end, code) => request({
|
||||
url:'api/deviceManage/transfConfirm',
|
||||
data: {start: start, end: end, vehicle_code: code}
|
||||
})
|
||||
|
||||
/**
|
||||
* 库存出库
|
||||
*/
|
||||
export const structattrPage = (page, size, code, mcode, has, pcsn, vcode, stcode) => request({
|
||||
url:'api/structattr/checkQuery?page=' + page + '&size=' + size + '&stor_code=' + code + '&material_code=' + mcode + '&has=' + has + '&pcsn=' + pcsn + '&vehicle_code=' + vcode + '&struct_code=' + stcode,
|
||||
method: 'GET'
|
||||
})
|
||||
export const outStorageMaterConfirm = (obj) => request({
|
||||
url:'api/pda/outStorage/materConfirm',
|
||||
data: obj
|
||||
})
|
||||
|
||||
/**
|
||||
* 二楼生产出库
|
||||
*/
|
||||
export const queryTargetPoint = (scode) => request({
|
||||
url:'api/pdaPalletIostorinv/queryTargetPoint',
|
||||
data: {site_code: scode}
|
||||
})
|
||||
export const getCtuOrderList = (scode, bcode) => request({
|
||||
url:'api/pda/outStorage/getCtuOrderList?site_code=' + scode + '&bill_code=' + bcode,
|
||||
method: 'GET'
|
||||
})
|
||||
export const ctuOutConfirm = (scode, bcode, arr) => request({
|
||||
url:'api/pda/outStorage/ctuOutConfirm',
|
||||
data: {site_code: scode, bill_code: bcode, children: arr}
|
||||
})
|
||||
|
||||
/**
|
||||
* 二楼取货确认
|
||||
*/
|
||||
export const takeConfirm = (scode) => request({
|
||||
url:'api/pda/outStorage/takeConfirm',
|
||||
data: {site_code: scode}
|
||||
})
|
||||
/**
|
||||
* 二楼货架绑定
|
||||
*/
|
||||
export const getPointStatus = (scode) => request({
|
||||
url:'api/point/getPointStatus',
|
||||
data: {site_code: scode}
|
||||
})
|
||||
export const bindOrUnbind = (scode, bcode, mode) => request({
|
||||
url:'api/point/bindOrUnbind',
|
||||
data: {site_code: scode, shelf_code: bcode, mode: mode}
|
||||
})
|
||||
export const pointUnbind = (scode, bcode, mode) => request({
|
||||
url:'api/point/unbind',
|
||||
data: {site_code: scode, shelf_code: bcode}
|
||||
})
|
||||
/**
|
||||
* 单据入库
|
||||
*/
|
||||
export const inStorageOrder = () => request({
|
||||
method: 'GET',
|
||||
url:'api/pda/inStorage/order'
|
||||
})
|
||||
export const getBillNoInfo = (code, type) => request({
|
||||
url:'api/pda/inStorage/getBillNoInfo',
|
||||
data: {code: code, form_type: type}
|
||||
})
|
||||
/**
|
||||
* 盘点入库
|
||||
*/
|
||||
export const queryMaterByVehicleCode = (code) => request({
|
||||
url:'api/structattr/queryMaterByVehicleCode',
|
||||
data: {vehicle_code: code}
|
||||
})
|
||||
export const checkMaterConfirm = (obj) => request({
|
||||
url:'api/groupMater/checkMaterConfirm',
|
||||
data: obj
|
||||
})
|
||||
/**
|
||||
* 扫载具码调接口
|
||||
*/
|
||||
export const getStructCount = (code) => request({
|
||||
url:'api/pda/common/getStructCount',
|
||||
data: {vehicle_code: code}
|
||||
})
|
||||
12
utils/jsencrypt.js
Normal file
12
utils/jsencrypt.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import JSEncrypt from './jsencrypt2.js'
|
||||
let publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANL378k3RiZHWx5AfJqdH9xRNBmD9wGD\n' +
|
||||
'2iRe41HdTNF8RUhNnHit5NpMNtGL0NPTSSpPjjI1kJfVorRvaQerUgkCAwEAAQ==';
|
||||
function RSAencrypt(pas){
|
||||
//实例化jsEncrypt对象
|
||||
let jse = new JSEncrypt();
|
||||
//设置公钥
|
||||
jse.setPublicKey(publicKey);
|
||||
return jse.encrypt(pas);
|
||||
}
|
||||
|
||||
export {RSAencrypt}
|
||||
5373
utils/jsencrypt2.js
Normal file
5373
utils/jsencrypt2.js
Normal file
File diff suppressed because it is too large
Load Diff
399
utils/mork2.js
Normal file
399
utils/mork2.js
Normal file
@@ -0,0 +1,399 @@
|
||||
export const FormTypes = (code) => {
|
||||
let res = [
|
||||
{
|
||||
lable: '收料通知单明细',
|
||||
id: '1778673956455321600',
|
||||
value: 'MRN_DTL'
|
||||
},
|
||||
{
|
||||
lable: '收料通知单',
|
||||
id: '1778676876466851840',
|
||||
value: 'MRN_MST'
|
||||
},
|
||||
{
|
||||
lable: '出入库单主表',
|
||||
id: '1780517070820216832',
|
||||
value: 'st_ivt_iostorinv'
|
||||
}
|
||||
]
|
||||
return res
|
||||
}
|
||||
export const pmFormData = (code) => {
|
||||
let res = {
|
||||
totalElements: '2',
|
||||
content: [
|
||||
{
|
||||
id: '1813491860891635712',
|
||||
code: 'MV20240717001',
|
||||
proc_inst_id: '1813491872891539456',
|
||||
source_form_id: '',
|
||||
source_form_type: '',
|
||||
source_form_date: '',
|
||||
form_type: 'st_ivt_move',
|
||||
status: '80',
|
||||
remark: '',
|
||||
create_time: '2024-07-17 16:32:07',
|
||||
create_name: '管理员',
|
||||
material_id: null,
|
||||
material_name: null,
|
||||
material_code: '100',
|
||||
material_spec: null,
|
||||
single_weight: null,
|
||||
qty: '0.000',
|
||||
assign_qty: '0.000',
|
||||
unit_id: null,
|
||||
pcsn: null,
|
||||
vehicle_code: null,
|
||||
vehicle_id: null,
|
||||
form_data: {
|
||||
stor_code: 'FStockPallet'
|
||||
},
|
||||
parent_id: null,
|
||||
hasChildren: true
|
||||
}
|
||||
],
|
||||
data: null,
|
||||
code: '200',
|
||||
msg: '查询成功'
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
export const groupMaterList = () => {
|
||||
let res = {
|
||||
totalElements: '2',
|
||||
content: [
|
||||
{
|
||||
material_id: '1',
|
||||
material_name: null,
|
||||
material_code: '100',
|
||||
material_spec: null,
|
||||
single_weight: null,
|
||||
qty: '0.000',
|
||||
assign_qty: '0.000',
|
||||
unit_id: null,
|
||||
pcsn: null,
|
||||
vehicle_code: '100',
|
||||
vehicle_id: null
|
||||
},
|
||||
{
|
||||
material_id: '2',
|
||||
material_name: null,
|
||||
material_code: '200',
|
||||
material_spec: null,
|
||||
single_weight: null,
|
||||
qty: '0.000',
|
||||
assign_qty: '0.000',
|
||||
unit_id: null,
|
||||
pcsn: null,
|
||||
vehicle_code: null,
|
||||
vehicle_id: null
|
||||
},
|
||||
{
|
||||
material_id: '3',
|
||||
"material_code": "02.03.05.01.00075",
|
||||
"material_name": "密封球",
|
||||
"material_spec": "D377-DQF-E-2150-01",
|
||||
"single_weight": null,
|
||||
"unit_name": null
|
||||
}
|
||||
],
|
||||
data: null,
|
||||
code: '200',
|
||||
msg: '查询成功'
|
||||
}
|
||||
return res
|
||||
}
|
||||
export const outStorageOrder = () => {
|
||||
let res = [{value: '1', text: 'a'},{"text": "直接调拨单", "value": "STK_TransferDirect"},{"text": "简单领料申请单","value": "ka7c19edf9d4b4b39b8cc4a06802163b0"},{"text": "其他出库单", "value": "STK_MisDelivery"}]
|
||||
return res
|
||||
}
|
||||
export const outStorageOrderList = (page, size, type) => {
|
||||
let res = {
|
||||
"totalElements": 10,
|
||||
"content": [
|
||||
{
|
||||
"code": "PPBOM241102856",
|
||||
"form_type": "ka7c19edf9d4b4b39b8cc4a06802163b0",
|
||||
"remark": "备注",
|
||||
"create_time": "2024-10-20 21:41:50",
|
||||
"create_name": "创建人",
|
||||
"material_code": "04.01.DY.00531",
|
||||
"qty": 0.0,
|
||||
"sto_qty": 8888,
|
||||
"plan_qty": 0.0,
|
||||
"assign_qty": 0.0,
|
||||
"unit_name": "单位",
|
||||
"pcsn": "批次",
|
||||
"stor_code": "FStockPallet",
|
||||
"product_area": "A4",
|
||||
"children": [
|
||||
{
|
||||
"code": "bbb",
|
||||
"material_name": "白色插座下线套 (模号587#)(色号12081407乳白)",
|
||||
"material_code": "物料编码",
|
||||
"material_spec": "物料类型",
|
||||
"stor_code": "FStockPallet",
|
||||
"product_area": "A4",
|
||||
"qty": 1000.0,
|
||||
"sto_qty": 99,
|
||||
"plan_qty": 0.0,
|
||||
"assign_qty": 0.0,
|
||||
"unit_name": "单位",
|
||||
"pcsn": "批次",
|
||||
},
|
||||
{
|
||||
"code": "CCC",
|
||||
"material_name": "物料名称",
|
||||
"material_code": "物料编码",
|
||||
"material_spec": "物料类型",
|
||||
"stor_code": "FStockPallet",
|
||||
"product_area": "A4",
|
||||
"qty": 1000.0,
|
||||
"sto_qty": 88,
|
||||
"plan_qty": 0.0,
|
||||
"assign_qty": 0.0,
|
||||
"unit_name": "单位",
|
||||
"pcsn": "批次"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"data": {},
|
||||
"code": "200",
|
||||
"msg": ""
|
||||
}
|
||||
return res
|
||||
}
|
||||
export const outStorageOrderConfirm = (code) => {
|
||||
let res = {
|
||||
"totalElements": 10,
|
||||
"content": [
|
||||
{
|
||||
"code": "PPBOM241102856",
|
||||
"form_type": "单据类型",
|
||||
"remark": "备注",
|
||||
"create_time": "2024-10-20 21:41:50",
|
||||
"create_name": "创建人",
|
||||
"material_code": "04.01.DY.00531",
|
||||
"qty": 0.0,
|
||||
"sto_qty": 8888,
|
||||
"plan_qty": 0.0,
|
||||
"assign_qty": 0.0,
|
||||
"unit_name": "单位",
|
||||
"pcsn": "批次",
|
||||
"stor_code": "FStockPallet",
|
||||
"product_area": "A4",
|
||||
"children": [
|
||||
{
|
||||
"code": "bbb",
|
||||
"material_name": "白色插座下线套 (模号587#)(色号12081407乳白)",
|
||||
"material_code": "物料编码",
|
||||
"material_spec": "物料类型",
|
||||
"stor_code": "FStockPallet",
|
||||
"product_area": "A4",
|
||||
"qty": 10.0,
|
||||
"sto_qty": 8888,
|
||||
"plan_qty": 0.0,
|
||||
"assign_qty": 0.0,
|
||||
"unit_name": "单位",
|
||||
"pcsn": "批次",
|
||||
},
|
||||
{
|
||||
"code": "CCC",
|
||||
"material_name": "物料名称",
|
||||
"material_code": "物料编码",
|
||||
"material_spec": "物料类型",
|
||||
"stor_code": "FStockPallet",
|
||||
"product_area": "A4",
|
||||
"qty": 10.0,
|
||||
"plan_qty": 0.0,
|
||||
"assign_qty": 0.0,
|
||||
"unit_id": "单位",
|
||||
"pcsn": "批次"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"data": {},
|
||||
"code": "200",
|
||||
"msg": ""
|
||||
}
|
||||
return res
|
||||
}
|
||||
export const deviceManageTransf = () => {
|
||||
let res = [{value: '1109', text: '一楼楼入库点'}, {value: '2109', text: '二楼楼入库点'}]
|
||||
return res
|
||||
}
|
||||
export const structattrPage = () => {
|
||||
let res = {
|
||||
"totalElements": 10,
|
||||
"content": [
|
||||
{
|
||||
"id": '1',
|
||||
"code": "PPBOM241102856",
|
||||
"struct_code": "struct_code",
|
||||
"product_area": "A1",
|
||||
"vehicle_code": "vehicle_code",
|
||||
"material_code": "04.01.DY.00531",
|
||||
"qty": 0.0,
|
||||
"pcsn": "批次",
|
||||
"stor_code": "FStockPallet"
|
||||
}
|
||||
],
|
||||
"data": {},
|
||||
"code": "200",
|
||||
"msg": ""
|
||||
}
|
||||
return res
|
||||
}
|
||||
export const getCtuOrderList = () => {
|
||||
let res = {
|
||||
"code": "200",
|
||||
data: 'JDSCLLSQ250500293',
|
||||
content: [{material_name: '1', status: '1'}, {material_name: '2', status: '1'}, {material_name: '3', status: '1'}, {material_name: '4', status: '1'}, {material_name: '5', status: '1'}, {material_name: '6', status: '1'}, {material_name: '7', status: '1'}, {material_name: '8', status: '1'}, {material_name: '9', status: '0'}, {material_name: '10', status: '1'}]
|
||||
}
|
||||
return res
|
||||
}
|
||||
export const ctuOutConfirm = () => {
|
||||
let res = {
|
||||
"code": "200",
|
||||
msg: 'ok'
|
||||
}
|
||||
return res
|
||||
}
|
||||
export const getPointStatus = () => {
|
||||
let res = {code: 'a', name: 'ldjlfjl', lock_type: '00'}
|
||||
return res
|
||||
}
|
||||
export const queryTargetPoint = () => {
|
||||
let res = {
|
||||
code: '200',
|
||||
site_code: 'a102',
|
||||
msg: '查询成功!'
|
||||
}
|
||||
return res
|
||||
}
|
||||
export const storList = () => {
|
||||
let res = {
|
||||
code: '200',
|
||||
content: [{value: 'FicStockId', label: '虚拟库编码'}, {value: 'FStockId', label: '料箱编码'}, {value: 'FStockPallet', label: '托盘库编码'}]
|
||||
}
|
||||
return res
|
||||
}
|
||||
export const getBillNoInfo = (id) => {
|
||||
let res = [
|
||||
{
|
||||
code: '订单号1',
|
||||
material_code: '1',
|
||||
material_name: 'material_name',
|
||||
material_spec: 'material_spec',
|
||||
unit_name: 'unit_name',
|
||||
qty: '100',
|
||||
stockOrgId: 'StockOrgId',
|
||||
ownerId_id: 'OwnerId_Id',
|
||||
single_weight: '500',
|
||||
pcsn: 'pcsn',
|
||||
vehicle_code: 'T001',
|
||||
unit_id: 'unit_id'
|
||||
},
|
||||
{
|
||||
code: '订单号2',
|
||||
material_code: '2',
|
||||
material_name: 'material_name',
|
||||
material_spec: 'material_spec',
|
||||
unit_name: 'unit_name',
|
||||
qty: '100',
|
||||
stockOrgId: 'StockOrgId',
|
||||
ownerId_id: 'OwnerId_Id',
|
||||
single_weight: '500',
|
||||
pcsn: 'pcsn',
|
||||
vehicle_code: '0001',
|
||||
unit_id: 'unit_id'
|
||||
}
|
||||
]
|
||||
return res
|
||||
}
|
||||
export const inStorageOrder = () => {
|
||||
let res = [{value: '1', text: 'a'},{"text": "直接调拨单", "value": "STK_TransferDirect"},{"text": "简单领料申请单","value": "ka7c19edf9d4b4b39b8cc4a06802163b0"},{"text": "其他出库单", "value": "STK_MisDelivery"}]
|
||||
return res
|
||||
}
|
||||
|
||||
export const inStorageConfirm = () => {
|
||||
let res = {code: '200'}
|
||||
return res
|
||||
}
|
||||
export const queryPick = () => {
|
||||
let res = {
|
||||
'code': 'a00001',
|
||||
'product_area': 'A2',
|
||||
'stor_code': 'FStockId',
|
||||
"point_code": "001",
|
||||
"material_code": "04.05.04.01.01.00100S-07",
|
||||
"material_name": "不锈钢棒(SUS303F)(化学成分Cu≤0.5%)",
|
||||
"material_spec": "LQF-02-07",
|
||||
"prd_ppbom_no": "PPBOM25060",
|
||||
"assign_qty": 80,
|
||||
'qty': 35
|
||||
}
|
||||
return res
|
||||
}
|
||||
export const savePickTask = (data) => {
|
||||
let res = {
|
||||
code: '200',
|
||||
msg: 'ok'
|
||||
}
|
||||
return res
|
||||
}
|
||||
export const queryMaterByVehicleCode = (code) => {
|
||||
let res = {
|
||||
"totalElements": 1,
|
||||
"content": [
|
||||
{
|
||||
"id": "1926551433252048896",
|
||||
"group_id": "1926551433247854592",
|
||||
"stor_code": "FStockPallet",
|
||||
"vehicle_code": "T00000278",
|
||||
"material_id": "985577",
|
||||
"pcsn": "001",
|
||||
"qty": 13.000,
|
||||
"frozen_qty": 0.000,
|
||||
"is_lock": false,
|
||||
"is_delete": false,
|
||||
"unit_id": "100438",
|
||||
"is_check": "1",
|
||||
"parent_vehicle_code": null,
|
||||
"has_child": false,
|
||||
"source_form_type": null,
|
||||
"source_form_id": null,
|
||||
"task_code": "132799",
|
||||
"form_data": {},
|
||||
"update_time": "2025-06-11 21:35:40",
|
||||
"update_name": null,
|
||||
"create_time": "2025-05-25 16:10:29",
|
||||
"create_name": "管理员",
|
||||
"remark": "",
|
||||
"proc_inst_id": null,
|
||||
"prd_ppbom_no": "PPBOM250600121",
|
||||
"need_pick": true,
|
||||
"material_code": "02.03.05.01.00075",
|
||||
"material_name": "密封球(S∅155×116×12×∅100)",
|
||||
"material_spec": "D377-DQF-E-2150-01",
|
||||
"single_weight": null,
|
||||
"unit_name": null
|
||||
}
|
||||
],
|
||||
"data": null,
|
||||
"code": "200",
|
||||
"msg": "查询成功"
|
||||
}
|
||||
return res
|
||||
}
|
||||
export const getStructCount = (code) => {
|
||||
let res = {
|
||||
d: 100,
|
||||
g: 200,
|
||||
z: 300
|
||||
}
|
||||
return res
|
||||
}
|
||||
245
utils/permission.js
Normal file
245
utils/permission.js
Normal file
@@ -0,0 +1,245 @@
|
||||
/// null = 未请求,1 = 已允许,0 = 拒绝|受限, 2 = 系统未开启
|
||||
|
||||
var isIOS
|
||||
|
||||
function album() {
|
||||
var result = 0;
|
||||
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
|
||||
var authStatus = PHPhotoLibrary.authorizationStatus();
|
||||
if (authStatus === 0) {
|
||||
result = null;
|
||||
} else if (authStatus == 3) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(PHPhotoLibrary);
|
||||
return result;
|
||||
}
|
||||
|
||||
function camera() {
|
||||
var result = 0;
|
||||
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
|
||||
var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
|
||||
if (authStatus === 0) {
|
||||
result = null;
|
||||
} else if (authStatus == 3) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(AVCaptureDevice);
|
||||
return result;
|
||||
}
|
||||
|
||||
function location() {
|
||||
var result = 0;
|
||||
var cllocationManger = plus.ios.import("CLLocationManager");
|
||||
var enable = cllocationManger.locationServicesEnabled();
|
||||
var status = cllocationManger.authorizationStatus();
|
||||
if (!enable) {
|
||||
result = 2;
|
||||
} else if (status === 0) {
|
||||
result = null;
|
||||
} else if (status === 3 || status === 4) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(cllocationManger);
|
||||
return result;
|
||||
}
|
||||
|
||||
function push() {
|
||||
var result = 0;
|
||||
var UIApplication = plus.ios.import("UIApplication");
|
||||
var app = UIApplication.sharedApplication();
|
||||
var enabledTypes = 0;
|
||||
if (app.currentUserNotificationSettings) {
|
||||
var settings = app.currentUserNotificationSettings();
|
||||
enabledTypes = settings.plusGetAttribute("types");
|
||||
if (enabledTypes == 0) {
|
||||
result = 0;
|
||||
console.log("推送权限没有开启");
|
||||
} else {
|
||||
result = 1;
|
||||
console.log("已经开启推送功能!")
|
||||
}
|
||||
plus.ios.deleteObject(settings);
|
||||
} else {
|
||||
enabledTypes = app.enabledRemoteNotificationTypes();
|
||||
if (enabledTypes == 0) {
|
||||
result = 3;
|
||||
console.log("推送权限没有开启!");
|
||||
} else {
|
||||
result = 4;
|
||||
console.log("已经开启推送功能!")
|
||||
}
|
||||
}
|
||||
plus.ios.deleteObject(app);
|
||||
plus.ios.deleteObject(UIApplication);
|
||||
return result;
|
||||
}
|
||||
|
||||
function contact() {
|
||||
var result = 0;
|
||||
var CNContactStore = plus.ios.import("CNContactStore");
|
||||
var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
|
||||
if (cnAuthStatus === 0) {
|
||||
result = null;
|
||||
} else if (cnAuthStatus == 3) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(CNContactStore);
|
||||
return result;
|
||||
}
|
||||
|
||||
function record() {
|
||||
var result = null;
|
||||
var avaudiosession = plus.ios.import("AVAudioSession");
|
||||
var avaudio = avaudiosession.sharedInstance();
|
||||
var status = avaudio.recordPermission();
|
||||
console.log("permissionStatus:" + status);
|
||||
if (status === 1970168948) {
|
||||
result = null;
|
||||
} else if (status === 1735552628) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(avaudiosession);
|
||||
return result;
|
||||
}
|
||||
|
||||
function calendar() {
|
||||
var result = null;
|
||||
var EKEventStore = plus.ios.import("EKEventStore");
|
||||
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
|
||||
if (ekAuthStatus == 3) {
|
||||
result = 1;
|
||||
console.log("日历权限已经开启");
|
||||
} else {
|
||||
console.log("日历权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(EKEventStore);
|
||||
return result;
|
||||
}
|
||||
|
||||
function memo() {
|
||||
var result = null;
|
||||
var EKEventStore = plus.ios.import("EKEventStore");
|
||||
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
|
||||
if (ekAuthStatus == 3) {
|
||||
result = 1;
|
||||
console.log("备忘录权限已经开启");
|
||||
} else {
|
||||
console.log("备忘录权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(EKEventStore);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
function requestIOS(permissionID) {
|
||||
return new Promise((resolve, reject) => {
|
||||
switch (permissionID) {
|
||||
case "push":
|
||||
resolve(push());
|
||||
break;
|
||||
case "location":
|
||||
resolve(location());
|
||||
break;
|
||||
case "record":
|
||||
resolve(record());
|
||||
break;
|
||||
case "camera":
|
||||
resolve(camera());
|
||||
break;
|
||||
case "album":
|
||||
resolve(album());
|
||||
break;
|
||||
case "contact":
|
||||
resolve(contact());
|
||||
break;
|
||||
case "calendar":
|
||||
resolve(calendar());
|
||||
break;
|
||||
case "memo":
|
||||
resolve(memo());
|
||||
break;
|
||||
default:
|
||||
resolve(0);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function requestAndroid(permissionID) {
|
||||
return new Promise((resolve, reject) => {
|
||||
plus.android.requestPermissions(
|
||||
[permissionID],
|
||||
function(resultObj) {
|
||||
var result = 0;
|
||||
for (var i = 0; i < resultObj.granted.length; i++) {
|
||||
var grantedPermission = resultObj.granted[i];
|
||||
console.log('已获取的权限:' + grantedPermission);
|
||||
result = 1
|
||||
}
|
||||
for (var i = 0; i < resultObj.deniedPresent.length; i++) {
|
||||
var deniedPresentPermission = resultObj.deniedPresent[i];
|
||||
console.log('拒绝本次申请的权限:' + deniedPresentPermission);
|
||||
result = 0
|
||||
}
|
||||
for (var i = 0; i < resultObj.deniedAlways.length; i++) {
|
||||
var deniedAlwaysPermission = resultObj.deniedAlways[i];
|
||||
console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
|
||||
result = -1
|
||||
}
|
||||
resolve(result);
|
||||
},
|
||||
function(error) {
|
||||
console.log('result error: ' + error.message)
|
||||
resolve({
|
||||
code: error.code,
|
||||
message: error.message
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function gotoAppPermissionSetting() {
|
||||
if (permission.isIOS) {
|
||||
var UIApplication = plus.ios.import("UIApplication");
|
||||
var application2 = UIApplication.sharedApplication();
|
||||
var NSURL2 = plus.ios.import("NSURL");
|
||||
var setting2 = NSURL2.URLWithString("app-settings:");
|
||||
application2.openURL(setting2);
|
||||
plus.ios.deleteObject(setting2);
|
||||
plus.ios.deleteObject(NSURL2);
|
||||
plus.ios.deleteObject(application2);
|
||||
} else {
|
||||
var Intent = plus.android.importClass("android.content.Intent");
|
||||
var Settings = plus.android.importClass("android.provider.Settings");
|
||||
var Uri = plus.android.importClass("android.net.Uri");
|
||||
var mainActivity = plus.android.runtimeMainActivity();
|
||||
var intent = new Intent();
|
||||
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
mainActivity.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
const permission = {
|
||||
get isIOS(){
|
||||
return typeof isIOS === 'boolean' ? isIOS : (isIOS = uni.getSystemInfoSync().platform === 'ios')
|
||||
},
|
||||
requestIOS: requestIOS,
|
||||
requestAndroid: requestAndroid,
|
||||
gotoAppSetting: gotoAppPermissionSetting
|
||||
}
|
||||
|
||||
export default permission
|
||||
133
utils/request.js
Normal file
133
utils/request.js
Normal file
@@ -0,0 +1,133 @@
|
||||
// import qs from 'qs' // 处理data
|
||||
import store from '@/vuex/store'
|
||||
const request = (params) => {
|
||||
let _self = this;
|
||||
let url = params.url;
|
||||
let method = params.method || 'POST';
|
||||
let data = params.data || {};
|
||||
let acsurl = params.acsurl
|
||||
// data.token = "default-access_token"
|
||||
// if (!params.token) {
|
||||
// let token = uni.getStorageSync('token');
|
||||
// if (!token) {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/login/login'
|
||||
// });
|
||||
// } else {
|
||||
// data.token = '179509245-9c91827e0224bdc18d0b118b8be1b5af';
|
||||
// }
|
||||
// }
|
||||
let token = ''
|
||||
if (store.getters.saveToken !== '') {
|
||||
token = store.getters.saveToken
|
||||
}
|
||||
let defaultOpot = {
|
||||
// 'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Terminal-Type': 'innerH5',
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
}
|
||||
let header = {}
|
||||
method = method.toUpperCase()
|
||||
if (method == 'POST') {
|
||||
header = {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
'Authorization': token
|
||||
}
|
||||
// data = qs.stringify(data)
|
||||
}
|
||||
let requestUrl = `${store.getters.baseUrl}/` + url;
|
||||
if (acsurl) {
|
||||
requestUrl = `${store.getters.acsUrl}/` + url;
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: requestUrl,
|
||||
method: method,
|
||||
header: Object.assign({}, defaultOpot, header),
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
})
|
||||
.then(res => { // 成功
|
||||
uni.hideLoading();
|
||||
if (res.length === 1) {
|
||||
uni.showModal({
|
||||
content: 'request:fail',
|
||||
showCancel: false
|
||||
})
|
||||
reject('request:fail')
|
||||
} else if (res[1] && res[1].statusCode === 400) {
|
||||
uni.showModal({
|
||||
content: res[1].data.message,
|
||||
showCancel: false
|
||||
})
|
||||
reject(res[1].data.message)
|
||||
} else if (res[1] && res[1].statusCode === 401) {
|
||||
uni.showModal({
|
||||
content: res[1].data.message,
|
||||
showCancel: false
|
||||
})
|
||||
// store.dispatch('delUserInfo', '')
|
||||
// uni.redirectTo({
|
||||
// url: '/pages/login/login'
|
||||
// })
|
||||
} else if (res[1] && res[1].statusCode === 200) {
|
||||
let {
|
||||
data: dataType
|
||||
} = res[1]
|
||||
resolve(dataType)
|
||||
// switch (dataType.code * 1) { // 拦截返回参数
|
||||
// case 0:
|
||||
// resolve(dataType)
|
||||
// break;
|
||||
// case 1003:
|
||||
// uni.showModal({
|
||||
// title: '登录已过期',
|
||||
// content: '很抱歉,登录已过期,请重新登录',
|
||||
// confirmText: '重新登录',
|
||||
// success: function(res) {
|
||||
// if (res.confirm) {
|
||||
// uni.navigateTo({
|
||||
// // 切记这儿需要哈pages.json保持一致;不能有.vue后缀
|
||||
// url: '/pages/login/login'
|
||||
// });
|
||||
// } else if (res.cancel) {
|
||||
// console.log('用户点击取消');
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// break;
|
||||
// case -1:
|
||||
// uni.showModal({
|
||||
// title: '请求数据失败',
|
||||
// content: '获取数据失败!',
|
||||
// confirmText: '确定',
|
||||
// showCancel: false,
|
||||
// success: function(res) {
|
||||
// if (res.confirm) {} else if (res.cancel) {
|
||||
// console.log('用户点击取消');
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// break
|
||||
// }
|
||||
}else {
|
||||
uni.showModal({
|
||||
content: res[1].data.message,
|
||||
showCancel: false
|
||||
})
|
||||
reject(res[1].data.message)
|
||||
}
|
||||
})
|
||||
.catch(err => { // 错误
|
||||
uni.hideLoading();
|
||||
reject(err)
|
||||
})
|
||||
.finally(() => {
|
||||
// uni.hideLoading();
|
||||
})
|
||||
})
|
||||
}
|
||||
export default request
|
||||
39
utils/utils.js
Normal file
39
utils/utils.js
Normal file
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* 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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user