Browse Source

Merge branch 'dev' of http://47.108.105.48:3000/java_project/logpm_page into dev

pre-production
pref_mail@163.com 9 months ago
parent
commit
cd63d6f192
  1. 861
      public/webCamera/eloamWebCamera.js
  2. 4
      public/webCamera/jquery.min.js
  3. 11
      src/api/distribution/truckLoadingDetails.js
  4. 14
      src/axios.js
  5. 320
      src/components/webCameraIMG/webCamera.vue
  6. 10
      src/option/distribution/TripartiteTransfer.js
  7. 27
      src/option/distribution/addVehicleStowage.js
  8. 861
      src/utils/webCamera/eloamWebCamera.js
  9. 4
      src/utils/webCamera/jquery.min.js
  10. 21
      src/views/distribution/artery/VehicleArrivalManagement.vue
  11. 27
      src/views/distribution/artery/VehicleStowage.vue
  12. 2
      src/views/distribution/artery/VehicleStowageDetails.vue
  13. 64
      src/views/distribution/artery/abnormalList.vue
  14. 42
      src/views/distribution/artery/truckLoadingDetails.vue
  15. 8
      src/views/distribution/inventory/distrilbutionBillLading.vue

861
public/webCamera/eloamWebCamera.js

@ -1,861 +0,0 @@
// js扩展方法
(function ($) {
$.extend(
{
'eloamWebCamera': function (data,suc,fail) {
return new WebCamera($,data,suc,fail)
}
}
);
})(jQuery);
var __ELOAM_OBJ = {
el: null,
data: {},
isIE: false,
port: '38088',
hideDivImg: false,
autoTakePhotosStatus: false
}
var WebCamera = function (_$, data, suc, fail) {
// 初始化数额及
if (!_$) {
fail("jquery 不能为空")
return
}
if (!data) {
data = {}
}
var __eloam_uitl = {
_isIE: function () {
if (__eloam_uitl._BrowserType() == "IE")
return true;
else
return false;
},
_BrowserType: function () {
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
if (userAgent.indexOf("Firefox") > -1) {
return "Firefox";
}
if (userAgent.indexOf("Chrome") > -1) {
return "Chrome";
}
return "IE";
},
findTime: function () {
//datetime是拿到的时间戳
var date = new Date();//时间戳为10位需*1000,时间戳为13位的话不需乘1000
var year = date.getFullYear(),
month = ("0" + (date.getMonth() + 1)).slice(-2),
sdate = ("0" + date.getDate()).slice(-2),
hour = ("0" + date.getHours()).slice(-2),
minute = ("0" + date.getMinutes()).slice(-2),
second = ("0" + date.getSeconds()).slice(-2);
var result = year + "-" + month + "-" + sdate + " " + hour + ":" + minute + ":" + second;
return result;
},
isEmptyObj: function (obj) {
for (var item in obj) {
return false
}
return true
},
isExistValue: function (val) {
if(val || val == 0)
return true;
return false
}
}
__ELOAM_OBJ.hideDivImg = !!data.hideDivImg
__ELOAM_OBJ.autoTakePhotosStatus = false
__ELOAM_OBJ.data = data
__ELOAM_OBJ.el = _$
if(data.port){
__ELOAM_OBJ.port = data.port
}
__ELOAM_OBJ.isIE = __eloam_uitl._isIE()
if (__ELOAM_OBJ.isIE) {
if (data.ocxId) {
var __kArr = _$('#' + data.ocxId)
if (__kArr.length !== 1) {
doCal(fail, '请检查IE浏览器对应的OBJECT的id;找到该id对象个数为:' + __kArr.length)
return
} else {
__ELOAM_OBJ.data.ocxName = __kArr[0]
}
}
} else {
if (data.imgMainId) {
var k = _$('#' + data.imgMainId)
if (k.length !== 1) {
doCal(fail, '请检查非IE浏览器对应的img的id;找到该id对象个数为:' + k.length)
return
}
}
}
function doInit() {
// 将有的全部隐藏
if(__ELOAM_OBJ.hideDivImg){
doImgDiv(1)
}else {
if (__ELOAM_OBJ.isIE) {
if (__ELOAM_OBJ.data.imgMainDivId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.imgMainDivId).attr('style', 'display:none;visibility:hidden')
}
} else {
if (__ELOAM_OBJ.data.ocxDivId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.ocxDivId).attr('style', 'display:none;visibility:hidden')
}
}
}
}
function doCal(call, data) {
if (call) {
if (data) {
call(data)
} else {
call()
}
}
}
function doOpenCamera(devIndex,suc, fail) {
OpenCamera(devIndex + "", function () {
doFun(true,'camera=state','{}', function (data) {
// var k = data['video' + devIndex]
var state = data.state
if(state){
localStorage.setItem("devIndex", devIndex)
doCal(suc, 'ok')
// var strings = state.split(',');
// if(strings.length>devIndex){
// if (strings[devIndex] === 'opened') {
// localStorage.setItem("devIndex", devIndex)
// doCal(suc, 'ok')
// }else {
// doCal(fail, 'state数据:{'+state+"},摄像头下标:"+devIndex+";打开失败~")
// }
// }else {
// doCal(fail, 'state数据:{'+state+"},摄像头下标:"+devIndex+";请正确选择下标")
// }
}else {
doCal(fail, 'camera=state返回参数错误~')
}
}, function (err) {
console.log('不支持camera=state方法;调用video=status方法;错误信息:'+err)
setTimeout(function () {
doFun(true,'video=status','{}',function (data) {
var k = data['video'+devIndex]
if(k){
if('run' == k){
doCal(suc,'ok')
}else if('ok' == k){
doCal(fail,'找到摄像头成功,但打开失败~')
}else if("no" == k){
doCal(fail,'没有找到对应的摄像头~')
}
}else {
doCal(fail,'请检查摄像头下标~')
}
},fail)
},2000)
})
})
}
function OpenCamera(DevIndex, call) {
if(__ELOAM_OBJ.hideDivImg){
doImgDiv(2)
}
if (__ELOAM_OBJ.isIE) {
if (__ELOAM_OBJ.data.ocxName) {
__ELOAM_OBJ.data.ocxName.StartPreview(DevIndex)
}
} else {
if (__ELOAM_OBJ.data.imgMainId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.imgMainId).attr('src', "http://127.0.0.1:"+__ELOAM_OBJ.port+"/video=stream&camidx=" + DevIndex+"?"+new Date().getTime())
}
}
call()
//setTimeout(call, 1000)
}
//contentType: 'application/json',
function doFun(isPost, url, data, suc, fail) {
if (!data) {
data = "{}"
}
__ELOAM_OBJ.el.ajax({
type: isPost ? "post" : "get",
url: 'http://127.0.0.1:'+__ELOAM_OBJ.port+'/' + url,
dataType: "json",
headers: {
"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9" ,
"Access-Token":"Access-Token123456",//自定义请求头
"Content-Type":"application/json;charset=utf8"
},
// contentType: 'application/json',
data: data, // 将对象使用这个方法转一下 JSON.stringify(_data)
success: function (data) {
if (data.code == 0) {
if (data.data) {
doCal(suc, data.data)
} else {
doCal(suc, data)
}
} else {
doCal(fail, data)
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
// XMLHttpRequest 对象、错误信息、(可选)捕获的错误对象。
// 如果发生了错误,错误信息(第二个参数)除了得到null之外,还可能是"timeout", "error", "notmodified" 和 "parsererror"。
// textStatus:
//"timeout", "error", "notmodified" 和 "parsererror"。
// XMLHttpRequest.readyState:
/**
0 未初始化还没有调用send()方法
1 载入已调用send()方法正在发送请求 服务器连接已建立
2 载入完成send()方法执行完成已经接收到全部响应内容 请求已接收
3 交互正在解析响应内容 请求处理中
4 完成响应内容解析完成可以在客户端调用了请求已完成且响应已就绪
*/
// 三、data:"{}", data为空也一定要传"{}";不然返回的是xml格式的。并提示parsererror.
// 错误说明:https://www.cnblogs.com/fireporsche/p/6391061.html
var res = {
readyState: XMLHttpRequest.readyState,
textStatus: textStatus,
errorThrown: errorThrown,
msg: '请求AJAX错误'
}
doCal(fail, res)
}
});
}
function findDefaultValue(k, def) {
if (!k) {
return def;
}
return k + ''
}
function doImgDiv(type) {
switch (type) {
case 1:
// 全部关闭
// visibility:hidden
if (__ELOAM_OBJ.data.imgMainDivId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.imgMainDivId).attr('style', 'display:none')
}
if (__ELOAM_OBJ.data.ocxDivId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.ocxDivId).attr('style', 'display:none')
}
break;
case 2:
// 打开
if (__ELOAM_OBJ.isIE) {
if (__ELOAM_OBJ.data.ocxDivId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.ocxDivId).attr('style', 'display:block')
}
} else {
if (__ELOAM_OBJ.data.imgMainDivId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.imgMainDivId).attr('style', 'display:block')
}
}
break;
case 3:
// 关闭
if (__ELOAM_OBJ.isIE) {
if (__ELOAM_OBJ.data.ocxDivId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.ocxDivId).attr('style', 'display:none')
}
} else {
if (__ELOAM_OBJ.data.imgMainDivId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.imgMainDivId).attr('style', 'display:none')
}
}
break;
}
}
function doAutoPhotos(json,suc,fail) {
doFun(true,'video=movedetec',json,function (data) {
doCal(suc,data)
if(__ELOAM_OBJ.autoTakePhotosStatus)
doAutoPhotos(json,suc,fail)
},fail)
}
var __webCamera = {
doCamera: function(data,suc,fail){
var open = findDefaultValue(data.isOpen,'0')
if(open === '0'){
__webCamera.closeCamera(data,suc,fail)
}else if(open === '1'){
__webCamera.openCamera(data,suc,fail)
}
},
openCamera: function (data, suc, fail) {
var devIndex = data.devIndex
// 打开成功
if (!devIndex) {
devIndex = 0;
}
// 打开摄像头需要将这个继续打开
doOpenCamera(devIndex,suc,fail)
},
closeCamera: function (data, suc, fail) {
if (__ELOAM_OBJ.isIE) {
if (__ELOAM_OBJ.data.ocxName) {
__ELOAM_OBJ.data.ocxName.StopPreview();
}
} else {
var DevIndex = data.devIndex
if (!DevIndex) {
DevIndex = 0;
}
var _data = {
camidx: DevIndex + ''
}
doFun(true, 'video=close', JSON.stringify(_data), function (data) {
if (__ELOAM_OBJ.data.imgMainId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.imgMainId).attr('src', '')
}
if(__ELOAM_OBJ.hideDivImg){
doImgDiv(3)
}
localStorage.setItem("devIndex", '')
doCal(suc, data)
}, fail)
}
},
checkCameraStatus: function(suc,fail){
doFun(true, 'camera=state', '{}', suc, fail)
},
getEquipmentType: function (suc, fail) {
doFun(true, 'device=getequipmenttype', '{}', suc, fail)
},
findVideoList: function(suc,fail){
doFun(true,'video=record','{"action":"audio"}',true,fail)
},
findVideoStatus: function(suc,fail){
doFun(true,'video=record','{"action":"status"}',suc,fail)
},
startVideoRecord: function(data,suc,fail){
var _data = {
"action": "start",
parameter: {
camidx: findDefaultValue(data.devIndex,'0'),
width: findDefaultValue(data.width,'640'),
height: findDefaultValue(data.height,'480'),
audio: findDefaultValue(data.audio,''),
framerate: findDefaultValue(data.frameRate,'10'),
filepath: findDefaultValue(data.filePath,''),
bit_rate: findDefaultValue(data.bitRate,'400000'),
}
}
var watermark = data.watermark
if(watermark && __eloam_uitl.isExistValue(watermark.pos)){
_data.parameter.watermark = {
pos: findDefaultValue(watermark.pos,'0'),
content: findDefaultValue(watermark.content,__eloam_uitl.findTime()),
transparency: findDefaultValue(watermark.transparency,'200'),
fontsize: findDefaultValue(watermark.fontSize,'32'),
font: findDefaultValue(watermark.font,'微软雅黑'),
color: findDefaultValue(watermark.color,'yellow'),
}
}
doFun(true,'video=record',JSON.stringify(_data),suc,fail)
},
stopAndFindVideoRecord: function(data, suc, fail){
var findStatus = findDefaultValue(data.findStatus,'0')
doFun(true,'video=record','{"action":"stop"}',function (data) {
if(findStatus == '0'){
doCal(suc,data)
}else {
setTimeout(function () {
doFun(true,'videobase64=get','{}',suc,function (_v) {
doCal(fail,'停止录制成功,获取视频数据失败;原因:'+_v)
})
},1000)
}
},function (err) {
doCal(fail,'停止录制视频失败,失败原因为:'+err)
})
},
getResolution: function (data, suc, fail) {
var devIndex = data.devIndex;
if (!devIndex) {
devIndex = 0
}
var _data = {
camidx: devIndex + "",
mode: '1'
}
doFun(true, 'device=getresolution', JSON.stringify(_data), suc, fail)
},
doZoom: function(data,suc,fail){
var _data = {
camidx: findDefaultValue(data.devIndex,'0'),
corp: findDefaultValue(data.corp,'0')
}
doFun(true, 'stream=zoominout', JSON.stringify(_data), suc, fail)
},
setResolution: function (data, suc, fail) {
// mode
// 视频模式,0:YUY2(高清);1:MJPG(高速)
// "YUY2"---> 0
// "MJPG"---> 1
var _data = {
camidx: findDefaultValue(data.devIndex,'0'),
width: findDefaultValue(data.width,'800'),
height: findDefaultValue(data.height,'600'),
mode: '1'
}
doFun(true, 'device=setresolution', JSON.stringify(_data), suc, fail)
},
getQrCode: function (data, suc, fail) {
var _data = {
time: findDefaultValue(data.timeout, '20')
}
doFun(true, 'barcode=get', JSON.stringify(_data), suc, function (data) {
if (data.code == 1) {
data.errorMessage = '识别超时'
} else if (data.code == 2) {
data.errorMessage = '其他错误'
}
doCal(fail, data)
})
},
readIDCard: function (suc, fail) {
doFun(false, 'card=idcard', '{}', suc, fail)
},
faceLive: function (data, suc, fail) {
var _data = {
time: findDefaultValue(data.timeout, '20')
}
doFun(true, 'faceLive=start', JSON.stringify(_data), suc, fail)
},
faceComparisonEx: function (data, suc, fail) {
if(!data.oneFace){
doCal(fail,'第一个人脸不能为空~')
return
}
if(!data.twoFace){
doCal(fail,'第二个人脸不能为空')
return
}
var _data = {
FaceOne: data.oneFace,
FaceTwo: data.twoFace
}
doFun(true, 'comparison=imgdata', JSON.stringify(_data), suc, fail)
},
grabImageBase64: function (data, suc, fail) {
var _data = {
filepath: 'base64',
rotate: findDefaultValue(data.rotate, '0'),
camidx: findDefaultValue(data.devIndex, '0'),
cutpage: findDefaultValue(data.cutpage, '0'),
}
doFun(true, 'video=grabimage', JSON.stringify(_data), suc, fail)
},
autoFlat: function(data,suc,fail){
var __autoFlat = data.autoFlat
var _data = {
filepath: findDefaultValue(data.filepath,''),
rotate: findDefaultValue(data.rotate,'0'),
devIndex: findDefaultValue(data.devIndex,'0'),
cutpage: findDefaultValue(data.cutPage,'0')
}
if(__autoFlat && !__eloam_uitl.isEmptyObj(__autoFlat)){
_data.autoflat = {
flat: findDefaultValue(__autoFlat.flat,'1'),
leftfilepath: findDefaultValue(__autoFlat.leftFilePath,''),
rightfilepath: findDefaultValue(__autoFlat.rightFilePath,''),
removefinger: findDefaultValue(__autoFlat.removeFinger,''),
doublepage: findDefaultValue(__autoFlat.doublePage,'')
}
}
doFun(true,'video=autoflat',JSON.stringify(_data),suc,fail)
},
autoTakePhotos: function(data,suc,fail){
var _data = {
listpath: findDefaultValue(data.listPath,''),
filepath: findDefaultValue(data.filePathPrefix,'LT'),
movedetecflag: '1'
}
__ELOAM_OBJ.autoTakePhotosStatus = true
var json = JSON.stringify(_data)
doAutoPhotos(json,suc,fail)
},
stopAutoTakePhotos: function(suc,fail){
var _data = {
movedetecflag: '0'
}
__ELOAM_OBJ.autoTakePhotosStatus = false
doFun(true,'video=movedetec',JSON.stringify(_data),suc,fail)
},
twoInchPhoto: function(suc,fail){
doFun(true,'twoinchphoto','{}',suc,fail)
},
imageArea: function(data,suc,fail){
var _data = {
filepath: findDefaultValue(data.filepath,''),
left: findDefaultValue(data.left,'0'),
top: findDefaultValue(data.top,'0'),
right: findDefaultValue(data.right,'100'),
bottom: findDefaultValue(data.bottom,'100'),
}
doFun(true,'select=imagearea',JSON.stringify(_data),suc,fail)
},
grabImage: function (data, suc, fail) {
var watermark = data.watermark
var _data = {
filepath: findDefaultValue(data.filePath, ''),
rotate: findDefaultValue(data.rotate, '0'),
camidx: findDefaultValue(data.devIndex, '0'),
deskew: findDefaultValue(data.deskew, '0'),
deskewval: findDefaultValue(data.deskewval, '0'),
quality: findDefaultValue(data.quality, '1'),
ColorMode: findDefaultValue(data.colorMode, '0'),
bAutoAdjust: findDefaultValue(data.bAutoAdjust, '0'),
bIsPrint1to1: findDefaultValue(data.bIsPrint1to1, '0'),
/*watermark: {
pos: findDefaultValue(watermark.pos, '0'),
content: findDefaultValue(watermark.content, ''),
transparency: findDefaultValue(watermark.transparency, '0'),
fontsize: findDefaultValue(watermark.fontsize, '100'),
font: findDefaultValue(watermark.font, '微软雅黑'),
color: findDefaultValue(watermark.color, 'yellow')
}*/
}
if (watermark && !__eloam_uitl.isEmptyObj(watermark)) {
_data.watermark = {
pos: findDefaultValue(watermark.pos, '4'),
content: findDefaultValue(watermark.content, __eloam_uitl.findTime()),
transparency: findDefaultValue(watermark.transparency, '200'),
fontsize: findDefaultValue(watermark.fontsize, '32'),
font: findDefaultValue(watermark.font, '微软雅黑'),
color: findDefaultValue(watermark.color, 'yellow')
}
}
doFun(true, 'video=grabimage', JSON.stringify(_data), suc, fail)
},
sendSerialport: function (data, suc, fail) {
var _data = {
sendserialport: findDefaultValue(data.sendserialport, "21"),
data: findDefaultValue(data.data, "110"),
}
doFun(true, 'serialport=sendserialport', JSON.stringify(_data), function (data) {
// 这里说明成功啦
setTimeout(function () {
doFun(true, 'serialport=getdata', '{}', suc, fail)
}, 500)
}, fail)
},
pushWebPage: function(data,suc,fail){
var url = data.url
if(!url){
doCal(fail,'推送网页不能为空')
return
}
var _data = {
url: url
}
doFun(true,'pendisplay=pushwebpage',JSON.stringify(_data),suc,fail)
},
closeWebPage: function(suc,fail){
doFun(true,'pendisplay=closewebpage','{}',suc,fail)
},
readIcCard: function (data, suc, fail) {
var icCardType = data.icCardType
if (!icCardType) {
icCardType = 4;
}
// 这里校验ic卡类型
var _icCardType = parseInt(icCardType)
if (_icCardType < 1 || _icCardType > 7) {
doCal(fail, '请检查ic卡类型')
return
}
var _data = {
iccardtype: icCardType
}
doFun(true, 'card=iccard', JSON.stringify(_data), suc, fail)
},
signDlg: function (data, suc, fail) {
var pos = data.pos
if (!pos) {
pos = {
top: 250,
left: 280,
width: 600,
height: 250
}
}
var _data = {
pos: {
top: findDefaultValue(pos.top, "250"),
left: findDefaultValue(pos.left, "280"),
width: findDefaultValue(pos.width, "600"),
height: findDefaultValue(pos.height, "250"),
},
remark: findDefaultValue(data.remark, "开始签名"),
}
doFun(true, 'serialport=sign', JSON.stringify(_data), suc, fail)
},
closeSign: function(suc,fail){
doFun(true,'serialport=close','{}',suc,fail)
},
findSignResult: function(suc,fail){
doFun(true, 'serialport=getdata', '{}', suc,fail)
},
getTerminalSerialNumber: function (suc, fail) {
doFun(true, 'device=getsonixserialnumber', '{}', suc, fail)
},
checkTerminalConnect: function (suc, fail) {
doFun(true, 'device=isconnect', '{}', suc, fail)
},
getAudioList: function (suc, fail) {
var _data = {
action: 'audio'
}
doFun(true, 'video=record', JSON.stringify(_data), suc, fail)
},
leftRotate: function (data, suc, fail) {
var devIndex = data.devIndex
if (!devIndex) {
devIndex = 0;
}
var _data = {
camidx: devIndex + '',
rotate: '90'
}
doFun(true, 'video=rotate', JSON.stringify(_data), suc, fail)
},
rightRotate: function (data, suc, fail) {
var devIndex = data.devIndex
if (!devIndex) {
devIndex = 0;
}
if(devIndex != 0){
doCal(fail,'只有主头才能旋转~请检查')
return
}
var _data = {
camidx: devIndex + '',
rotate: '270'
}
doFun(true, 'video=rotate', JSON.stringify(_data), suc, fail)
},
doOcr: function (data, suc, fail) {
var imgPath = data.imgPath
var savePDFPath = data.savePDFPath
if (!imgPath) {
doCal(fail, '待OCR图片不能为空')
return
}
if (!savePDFPath) {
doCal(fail, '保存识别结果不能为空')
return
}
var _data = {
ocrflag: '1',
picfilepath: imgPath,
savefilepath: savePDFPath
}
doFun(true, 'savefilepath', JSON.stringify(_data), suc, fail)
},
templateOcr: function(data,suc,fail){
doFun(true,'templateOCR',JSON.stringify(data),suc,fail)
},
doDeskew: function (data,suc,fail) {
var devIndex = findDefaultValue(data.devIndex,'0');
if(devIndex != '0'){
doCal(fail,'只有主头才能打开纠偏,请检查~')
return
}
var _data = {
camidx: devIndex,
open: findDefaultValue(data.status,'0')
}
doFun(true,'dvideo=cameradeskew',JSON.stringify(_data),suc,fail)
},
findFingerprint: function (data,suc,fail) {
var _data = {
time:findDefaultValue(data.timeout,'20')
}
doFun(true,'biokey=get',JSON.stringify(_data),suc,fail)
},
showEvaluator: function (suc,fail) {
doFun(true,'sign=showevaluator','{}',suc,fail)
},
closeEvaluator: function (suc,fail) {
doFun(true,'sign=closeevaluator','{}',suc,fail)
},
findFindEvaluator: function(suc,fail){
doFun(true,'sign=getevaluatorresult',suc,fail)
},
a3a4AutoSwitch: function (data,suc,fail) {
var _data = {
switchflag:findDefaultValue(data.switchFlag,'0'),
a3size: findDefaultValue(data.a3size,'0.5'),
a4size: findDefaultValue(data.a4size,'0.9')
}
doFun(true,'device=a3a4switch',JSON.stringify(_data),suc,fail)
},
findEncryptionKey: function (suc,fail) {
doFun(true,'softkey=check','{}',suc,fail)
},
imgCompose: function (data,suc,fail) {
if(!data.oneImgBase64){
doCal(fail,'第一张图片不能为空')
return
}
if(!data.twoImgBase64){
doCal(fail,'第二张图片不能为空')
return
}
var _data = {
imageOne: data.oneImgBase64,
imageTwo: data.twoImgBase64
}
doFun(true,'iamge=compose',JSON.stringify(_data),suc,fail)
},
addImgToPdfQueue: function (data,suc,fail) {
if(!data.imgPath && !data.imgBase64){
doCal(fail,'请检查加入到队列中的图片')
return
}
var _data = {
ImagePath: data.imgPath,
ImageBase64: data.imgBase64
}
doFun(true,'pdf=addimage',JSON.stringify(_data),suc,fail)
},
closePdfQueueAndFind: function(data,suc,fail){
var findStatus = findDefaultValue(data.findStatus,'0')
doFun(true,'pdf=clear','{}',function (_k) {
if(findStatus == 0){
doCal(suc,_k)
}else {
doFun(true,'videobase64=get','{}',suc,function (err) {
doCal(fail,'清除成功,但获取失败;失败原因为:'+err)
})
}
},fail)
},
createPdfRecord: function (data,suc,fail) {
var padPath = data.pdfPath
if(!padPath){
doCal(fail,'保存pdf 路径不能为空')
return
}
var _data = {
PdfPath: padPath
}
doFun(true,'pdf=save',JSON.stringify(_data),suc,fail)
},
composePhotos: function (data,suc,fail) {
if(!data.outputFilePath){
doCal(fail,'输出文件保存地址不能为空')
return
}
if(!data.outputMaxWidth){
doCal(fail,'合成后文件最大宽度不能为空')
return
}
if(!__eloam_uitl.isExistValue(data.inputImageType)){
doCal(fail,'待合成文件类型不能为空')
return
}
if(!__eloam_uitl.isExistValue(data.outputImageType)){
doCal(fail,'合成后文件类型不能为空')
return
}
if(!__eloam_uitl.isExistValue(data.isIdCardCompose)){
doCal(fail,'是否是身份证不能为空')
return
}
if(!data.imageList){
doCal(fail,'待合成图片列表不能为空')
return
}
var _data = {
"outputfilepath": data.outputFilePath,
"outputmaxwidth": data.outputMaxWidth,
"inputimagetype": data.inputImageType,
"outputimagetype": data.outputImageType,
"isIDCardCompose": data.isIdCardCompose,
"imagelist":data.imageList
}
doFun(true,'compose=photos',JSON.stringify(_data),suc,fail)
},
getCurResolutionIndex: function(suc,fail){
},
doCustomCall:function ({method,url,data,success,error}) {
if(!url){
doCal(error,'请求url 不能为空')
return
}
if(!method){
method = 'post'
}
if(!data){
data = '{}'
}else {
if((typeof data === 'string') && data.constructor===String){
//console.log('字符串')
}else {
data = JSON.stringify(data)
}
}
doFun((method == 'post' || method == 'POST'),url,data,success,error)
}
}
var initCamera = !!data.initCamera
// 这里需要增加判断是否连上
doFun(true, 'device=isconnect', '{}', function (data) {
// 这里说明
// console.log(data)
var number = parseInt(data);
if (number < 1) {
doCal(fail, '请检查设备是否插好~')
} else {
suc(number)
if(initCamera){// 检查摄像头状态
// 这里需要检查摄像头状态
doFun(true,'camera=state','{}',function (data) {
var state = data.state
if(state){
var str = state.split(",");
for(var i=0;i<str.length;i++){
if(str[i] === 'opened'){
__webCamera.closeCamera({devIndex:i})
}
}
}
},function (err) {
console.log('不支持camera=state方法,错误信息:'+err)
var devIndex = localStorage.getItem("devIndex")
if (devIndex == 0 || devIndex) {
// 这里需要关闭
__webCamera.closeCamera({devIndex: devIndex}, function (data) {
console.log('刷新后,初始化关闭原来的摄像头成功')
}, function (err) {
console.log('刷新后,初始化关闭原来的摄像头失败')
})
}
})
}
}
//suc("ok")
}, fail)
doInit()
return __webCamera
}
// 使用vue 项目需要打开这个注释
// export default WebCamera

4
public/webCamera/jquery.min.js vendored

File diff suppressed because one or more lines are too long

11
src/api/distribution/truckLoadingDetails.js

@ -88,3 +88,14 @@ export const postLoadingDetailExport = (data = {}) => {
responseType: 'blob',
});
};
/**
* 零担二维码
*/
export const postShowOrderCodeByCode = params => {
return request({
url: '/api/logpm-distribution/distributionStockArticle/showOrderCodeByCode',
method: 'get',
params,
});
};

14
src/axios.js

@ -59,6 +59,8 @@ function removePendingRequest(config) {
//axios请求拦截器
axios.interceptors.request.use(
config => {
// 检查 config.url 是否以 http 开头
console.log(config,'config');
// 在请求开始前,对之前的请求做检查取消操作
removePendingRequest(config);
// 将当前请求添加到pendingRequests对象中
@ -67,13 +69,13 @@ axios.interceptors.request.use(
NProgress.start();
// // 检查URL是否完整,如果不完整或不是URL,则添加baseUrl前缀
// if (!isURL(config.url) && !config.url.startsWith(baseUrl)) {
// config.url = baseUrl + config.url;
// }
// 检查URL是否完整,如果不完整或不是URL,并且不以 /imgapi 开头,则添加 baseUrl 前缀
if (!isURL(config.url) && !config.url.startsWith(baseUrl) && !config.url.startsWith('/imgapi')) {
if (!isURL(config.url) && !config.url.startsWith(baseUrl)) {
config.url = baseUrl + config.url;
}
// 检查URL是否完整,如果不完整或不是URL,并且不以 /imgapi 开头,则添加 baseUrl 前缀
// if (!isURL(config.url) && !config.url.startsWith(baseUrl) && !config.url.startsWith('/imgapi')) {
// config.url = baseUrl + config.url;
// }
// 添加授权头部(如果请求中没有设置authorization属性为false)
const authorization = config.authorization === false;
if (!authorization) {
@ -103,6 +105,8 @@ axios.interceptors.request.use(
if (config.method === 'post' && meta.isSerialize === true) {
config.data = serialize(config.data);
}
return config;
},
error => {

320
src/components/webCameraIMG/webCamera.vue

@ -5,7 +5,7 @@
<div class="IMG_VIEW_container">
<!-- 主摄像头 -->
<div id="IMG_VIEW_Content" class="IMG_VIEW1">
<img id="IMG_VIEW1" ref="IMG_VIEW" src="http://127.0.0.1:38088/video=stream&camidx=0" alt="主摄像头" />
<img id="IMG_VIEW1" ref="IMG_VIEW" src="../../../public/img/load.gif" alt="主摄像头" />
<el-icon v-if="!IMG_startUp" @click="Devicerestart" class="SwitchButton"
><SwitchButton
/></el-icon>
@ -59,21 +59,16 @@
</template>
<script setup>
import { reactive, ref, onMounted } from 'vue';
// import axios_serve from '../../../src/axios_IMG.js';
import { reactive, ref, onMounted, watch, nextTick } from 'vue';
import { ElMessage } from 'element-plus';
import IMG_error from '../../../public/img/loaderror.png'; //
import IMG_drive from '../../../public/img/driveerror.png'; //
import IMG_load from '../../../public/img/load.gif'; //
// import Axios_IMG from '../../axiosimg.js';
const IMG_camera = ref(false); //
// const IMG_URL = 'http://127.0.0.1:38088/video=stream&camidx=0';
const IMG_URL = "http://127.0.0.1:38088/video=stream&camidx=0";//
// const IMG_error = '../../../public/img/loaderror.png'; //
// const IMG_drive = '../../../public/img/driveerror.png'; //
const IMG_URL = 'http://127.0.0.1:38088/video=stream&camidx=0?' + Math.random(); //
const IMG_VIEW = ref(null); //
const IMG_Thumbnail = ref(null); //
const IMG_TITLE = ref('设备正在初始化中...');
const IMG_suoluetuList = ref([]); //
const initialIndex = ref(0); //
const imagePreviewRefs = ref([]);
@ -91,15 +86,39 @@ const props = defineProps({
default: 1, //;0,.1
},
});
watch(
() => props.IMGstate,
(newValue, oldValue) => {
(newValue) => {
if (newValue != IMGstate.value) {
IMGstate.value = props.IMGstate;
IMG_suoluetuList.value = []; //
}
}
);
onMounted(() => {
onLoad(); //
});
//
const request = (url, method = 'POST', data = {}) => {
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.open(method, url, true);
xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
xhr.onload = () => {
if (xhr.status >= 200 && xhr.status < 300) {
resolve(JSON.parse(xhr.responseText));
} else {
reject(new Error(`Error: ${xhr.statusText}`));
}
};
xhr.onerror = () => reject(new Error(`Error: ${xhr.statusText}`));
xhr.send(JSON.stringify(data));
});
};
//
const mylog = val => {
let element = document.getElementById('log');
@ -114,6 +133,7 @@ const setImagePreviewRef = (el, index) => {
imagePreviewRefs.value[index] = el.$refs.imageRef;
}
};
const showPreview = async index => {
initialIndex.value = index; //
await nextTick();
@ -122,156 +142,68 @@ const showPreview = async index => {
imagePreviewRefs.value[index].click();
}
};
//
const IsConnect = async () => {
IMG_startUp.value = true; //
return true
let timeoutMs = 6000; // 6
let startTime = Date.now();
while (Date.now() - startTime < timeoutMs) {
try {
const response = await axios.post(
`${
IMG_API_SERVER ? 'http://127.0.0.1:38088/device=isconnect' : '/imgapi/device=isconnect'
}`,
{},
{ timeout: timeoutMs }
);
console.log(response.data, 'res');
if (response.data.code === '0') {
console.log('设备数量:', response.data);
return response.data; //
} else {
throw new Error('设备未连接');
}
} catch (error) {
console.error(error);
//
const IsConnect = async () => {
try {
const response = await request('http://127.0.0.1:38088/device=isconnect');
if (response.code === '0') {
return response;
} else {
throw new Error('设备未连接');
}
//
await new Promise(resolve => setTimeout(resolve, 1000)); // 1
} catch (error) {
console.error(error.message);
return false;
}
// 6false
return false;
};
//(/)
const Opentrimming = () => {
IMG_Trimming_edge.value = !IMG_Trimming_edge.value;
if (IMG_Trimming_edge.value) {
ElMessage({ message: '图像裁边已开启', type: 'success' });
mylog('图像裁边已开启');
} else {
ElMessage({ message: '图像裁边已关闭', type: 'success' });
mylog('图像裁边已关闭');
}
const message = IMG_Trimming_edge.value ? '图像裁边已开启' : '图像裁边已关闭';
ElMessage({ message, type: 'success' });
mylog(message);
};
//
const Deviceinitialization = async () => {
IMG_startUp.value = true; //
return
// let IMG_state = await IsConnect();
console.log(IMG_state, 'IMG_state');
//
if (IMG_state == false) {
let IMG_state = await IsConnect();
if (!IMG_state) {
ElMessage({ message: '设备驱动未连接', type: 'warning' });
mylog('设备驱动未连接');
IMG_VIEW.value.src = IMG_drive; //
IMG_VIEW.value.src = IMG_drive;
return;
}
//
if (IMG_state.code == '0' && IMG_state.data == '1') {
if (IMG_state.code === '0' && IMG_state.data === '1') {
ElMessage({ message: '设备已连接,设备数量:1', type: 'success' });
mylog('设备已连接,设备数量:1');
let TIME_IMG_VIEW = setTimeout(() => {
if (IMG_VIEW.value) {
IMG_startUp.value = true; //
IMG_VIEW.value.src = IMG_URL; //
IMG_TITLE.value = '';
IMG_startUp.value = true;
IMG_VIEW.value.src = IMG_URL;
ElMessage({ message: '摄像头已启动', type: 'success' });
mylog('摄像头已启动');
}
clearTimeout(TIME_IMG_VIEW);
}, 2000);
} else {
IMG_VIEW.value.src = IMG_error; //
IMG_VIEW.value.src = IMG_error;
ElMessage({ message: '设备未连接', type: 'warning' });
mylog('设备未连接');
}
};
//
const onLoad = async () => {
await Deviceinitialization(); //
await Deviceinitialization();
};
onLoad()
//
const Devicerestart = () => {
IMG_camera.value = true; //
IMG_camera.value = true;
mylog('重启设备');
IMG_VIEW.value.src = IMG_load; //
Deviceinitialization(); //
};
// API
const zoomAPI = attribute => {
let data = {
camidx: '0', // 0:1:
corp: JSON.stringify(zoom.value), // 0~909
};
axios
.post(
`${IMG_API_SERVER ? 'http://127.0.0.1:38088/stream=zoominout' : '/imgapi/stream=zoominout'}`,
JSON.stringify(data)
)
.then(() => {})
.catch(error => {
console.error('请求出错', error);
});
};
//
const Enlargeimage = () => {
if (zoom.value == 9) {
ElMessage({
message: '已经最大了',
type: 'warning',
});
return;
}
zoom.value += 1;
zoomAPI();
};
//
const Reduceimage = () => {
if (zoom.value == 0) {
ElMessage({
message: '已经最小了',
type: 'warning',
});
return;
}
zoom.value -= 1;
zoomAPI();
};
//
const Turnoffcamera = () => {
let data = {
camidx: 0,
};
axios
.post(`${IMG_API_SERVER ? 'http://127.0.0.1:38088/video=close' : '/imgapi/video=close'}`, data)
.then(() => {
IMG_VIEW.value.src = ''; //
IMG_startUp.value = false; //
ElMessage({ message: '摄像头已关闭', type: 'success' });
mylog('摄像头已关闭');
IMG_camera.value = false; //
})
.catch(error => {
console.error('请求出错', error);
});
IMG_VIEW.value.src = IMG_load;
Deviceinitialization();
};
// base64 Blob
@ -280,7 +212,6 @@ const base64ToBlob = (base64, mime) => {
console.error('base64 数据为空');
return null;
}
const byteString = atob(base64);
const ab = new ArrayBuffer(byteString.length);
const ia = new Uint8Array(ab);
@ -292,129 +223,76 @@ const base64ToBlob = (base64, mime) => {
//
const Upload_Images = file => {
// FormData
const formData = new FormData();
//
const filename = file.name || 'image.jpg'; //
const filetype = file.type || 'image/jpeg'; //
// 使File
const filename = file.name || 'image.jpg';
const filetype = file.type || 'image/jpeg';
const fileBlob = new Blob([file], { type: filetype });
const fileWithMetadata = new File([fileBlob], filename, { type: filetype });
// FormData
formData.append('file', fileWithMetadata);
// 使axiosPOST
axios
.post(IMG_API.value, formData, {
headers: {
'Content-Type': 'multipart/form-data',
},
})
axios.post(IMG_API.value, formData)
.then(res => {
console.log(res, '图片上传成功');
//
$emit('upload-success', res);
if(res.data.code ===200){
console.log(res, '图片上传成功');
ElMessage({ message: '图片上传成功', type: 'success' });
$emit('upload-success', res);//
}
})
.catch(error => {
ElMessage({ message: '图片上传失败', type: 'error' });
console.error('上传失败', error);
});
};
//
const IMG_add = img_base64 => {
// base64
const base64Data = img_base64.replace(/^data:image\/\w+;base64,/, '');
const blob = base64ToBlob(base64Data, 'image/jpeg');
const url = URL.createObjectURL(blob);
//
if (IMG_Thumbnail.value) {
IMG_suoluetuList.value.push(url);
mylog('添加缩略图成功');
}
Upload_Images(blob); //
Upload_Images(blob);
};
//
const Rotatingcamera = angle => {
// angle:
let data = { camidx: '0', rotate: String(angle) };
axios
.post(
`${IMG_API_SERVER ? 'http://127.0.0.1:38088/video=rotate' : '/imgapi/video=rotate'}`,
JSON.stringify(data)
)
.then(res => {
console.log(res);
mylog('旋转摄像头成功');
const data = { camidx: '0', rotate: String(angle) };
request('http://127.0.0.1:38088/video=rotate', 'POST', data)
.then(response => {
if (response.code !== '0') {
ElMessage.error('拍摄失败请重新尝试');
} else {
mylog('旋转摄像头成功');
}
})
.catch(error => {
console.error('Error:', error);
});
};
//
let view1_scan = async () => {
let data = {
"filepath": "",
"rotate": "",
"deskew": "",
"deskewval": "",
"camidx": "0",
"ColorMode": "",
"quality": "1",
"bAutoAdjust": "",
"bIsPrint1to1": "",
"watermark": {
"pos": "",
"content": "",
"transparency": "",
"fontsize": "",
"font": "",
"color": ""
}
};
const xhr = new XMLHttpRequest();
xhr.open('POST', 'http://127.0.0.1:38088/video=grabimage', true);
// xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onload = function() {
if (xhr.status >= 200 && xhr.status < 300) {
const response = JSON.parse(xhr.responseText);
console.log(response, 'response');
console.log(response, '图片地址');
// : res.photoBase64 'data:image/jpeg;base64,' base64
if (response.code !== '0') {
return ElMessage.error('拍摄失败请重新尝试');
}
ElMessage({ message: '拍摄成功', type: 'success' });
IMG_add(response.photoBase64); //
} else {
console.error('Error:', xhr.statusText);
}
};
xhr.onerror = function() {
console.error('Error:', xhr.statusText);
};
xhr.send(JSON.stringify(data));
// return
// Axios_IMG.post(
// `${
// IMG_API_SERVER ? 'http://127.0.0.1:38088/video=grabimage' : '/imgapi/video=grabimage'
// }`,
// data
// )
// .then(res => {
// console.log(res, '');
// // : res.data.photoBase64 'data:image/jpeg;base64,' base64
// if (res.data.code !== '0') {
// return ElMessage.error('');
// }
// ElMessage({ message: '', type: 'success' });
// IMG_add(res.data.photoBase64); //
// });
const data = {
filepath: 'base64',
rotate: '0',
cutpage: '0',
camidx: '0',
ColorMode: '0',
quality: '3',
};
request('http://127.0.0.1:38088/video=grabimage', 'POST', data)
.then(response => {
if (response.code !== '0') {
ElMessage.error('拍摄失败请重新尝试');
} else {
ElMessage({ message: '拍摄成功', type: 'success' });
IMG_add(response.photoBase64);
}
})
.catch(error => {
console.error('Error:', error);
});
};
</script>

10
src/option/distribution/TripartiteTransfer.js

@ -468,6 +468,16 @@ export const detailsColumnList = [
fixed: false,
sortable: true,
},
{
prop: 'unloadNum',
label: '卸车数',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'isDataName',
label: '有无数据',

27
src/option/distribution/addVehicleStowage.js

@ -1046,18 +1046,21 @@ export const detailsColumnList = [
isColumnMerge: true,
sortable: true,
},
// {
// prop: 'totalFee',
// label: '审核状态',
// type: 2,
// values: '',
// width: '130',
// checkarr: [],
// fixed: false,
// isshowSummary: true,
// isColumnMerge: true,
// sortable: true,
// },
{
prop: 'checkStatusName',
label: '审核状态',
type: 3,
values: '',
width: '130',
checkarr: [
{ label: '未审核', value: '0' },
{ label: '已审核', value: '1' },
],
fixed: false,
isshowSummary: true,
isColumnMerge: true,
sortable: true,
},
// {
// prop: 'freight',
// label: '作废运单号',

861
src/utils/webCamera/eloamWebCamera.js

@ -1,861 +0,0 @@
// js扩展方法
(function ($) {
$.extend(
{
'eloamWebCamera': function (data,suc,fail) {
return new WebCamera($,data,suc,fail)
}
}
);
})(jQuery);
var __ELOAM_OBJ = {
el: null,
data: {},
isIE: false,
port: '38088',
hideDivImg: false,
autoTakePhotosStatus: false
}
var WebCamera = function (_$, data, suc, fail) {
// 初始化数额及
if (!_$) {
fail("jquery 不能为空")
return
}
if (!data) {
data = {}
}
var __eloam_uitl = {
_isIE: function () {
if (__eloam_uitl._BrowserType() == "IE")
return true;
else
return false;
},
_BrowserType: function () {
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
if (userAgent.indexOf("Firefox") > -1) {
return "Firefox";
}
if (userAgent.indexOf("Chrome") > -1) {
return "Chrome";
}
return "IE";
},
findTime: function () {
//datetime是拿到的时间戳
var date = new Date();//时间戳为10位需*1000,时间戳为13位的话不需乘1000
var year = date.getFullYear(),
month = ("0" + (date.getMonth() + 1)).slice(-2),
sdate = ("0" + date.getDate()).slice(-2),
hour = ("0" + date.getHours()).slice(-2),
minute = ("0" + date.getMinutes()).slice(-2),
second = ("0" + date.getSeconds()).slice(-2);
var result = year + "-" + month + "-" + sdate + " " + hour + ":" + minute + ":" + second;
return result;
},
isEmptyObj: function (obj) {
for (var item in obj) {
return false
}
return true
},
isExistValue: function (val) {
if(val || val == 0)
return true;
return false
}
}
__ELOAM_OBJ.hideDivImg = !!data.hideDivImg
__ELOAM_OBJ.autoTakePhotosStatus = false
__ELOAM_OBJ.data = data
__ELOAM_OBJ.el = _$
if(data.port){
__ELOAM_OBJ.port = data.port
}
__ELOAM_OBJ.isIE = __eloam_uitl._isIE()
if (__ELOAM_OBJ.isIE) {
if (data.ocxId) {
var __kArr = _$('#' + data.ocxId)
if (__kArr.length !== 1) {
doCal(fail, '请检查IE浏览器对应的OBJECT的id;找到该id对象个数为:' + __kArr.length)
return
} else {
__ELOAM_OBJ.data.ocxName = __kArr[0]
}
}
} else {
if (data.imgMainId) {
var k = _$('#' + data.imgMainId)
if (k.length !== 1) {
doCal(fail, '请检查非IE浏览器对应的img的id;找到该id对象个数为:' + k.length)
return
}
}
}
function doInit() {
// 将有的全部隐藏
if(__ELOAM_OBJ.hideDivImg){
doImgDiv(1)
}else {
if (__ELOAM_OBJ.isIE) {
if (__ELOAM_OBJ.data.imgMainDivId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.imgMainDivId).attr('style', 'display:none;visibility:hidden')
}
} else {
if (__ELOAM_OBJ.data.ocxDivId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.ocxDivId).attr('style', 'display:none;visibility:hidden')
}
}
}
}
function doCal(call, data) {
if (call) {
if (data) {
call(data)
} else {
call()
}
}
}
function doOpenCamera(devIndex,suc, fail) {
OpenCamera(devIndex + "", function () {
doFun(true,'camera=state','{}', function (data) {
// var k = data['video' + devIndex]
var state = data.state
if(state){
localStorage.setItem("devIndex", devIndex)
doCal(suc, 'ok')
// var strings = state.split(',');
// if(strings.length>devIndex){
// if (strings[devIndex] === 'opened') {
// localStorage.setItem("devIndex", devIndex)
// doCal(suc, 'ok')
// }else {
// doCal(fail, 'state数据:{'+state+"},摄像头下标:"+devIndex+";打开失败~")
// }
// }else {
// doCal(fail, 'state数据:{'+state+"},摄像头下标:"+devIndex+";请正确选择下标")
// }
}else {
doCal(fail, 'camera=state返回参数错误~')
}
}, function (err) {
console.log('不支持camera=state方法;调用video=status方法;错误信息:'+err)
setTimeout(function () {
doFun(true,'video=status','{}',function (data) {
var k = data['video'+devIndex]
if(k){
if('run' == k){
doCal(suc,'ok')
}else if('ok' == k){
doCal(fail,'找到摄像头成功,但打开失败~')
}else if("no" == k){
doCal(fail,'没有找到对应的摄像头~')
}
}else {
doCal(fail,'请检查摄像头下标~')
}
},fail)
},2000)
})
})
}
function OpenCamera(DevIndex, call) {
if(__ELOAM_OBJ.hideDivImg){
doImgDiv(2)
}
if (__ELOAM_OBJ.isIE) {
if (__ELOAM_OBJ.data.ocxName) {
__ELOAM_OBJ.data.ocxName.StartPreview(DevIndex)
}
} else {
if (__ELOAM_OBJ.data.imgMainId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.imgMainId).attr('src', "http://127.0.0.1:"+__ELOAM_OBJ.port+"/video=stream&camidx=" + DevIndex+"?"+new Date().getTime())
}
}
call()
//setTimeout(call, 1000)
}
//contentType: 'application/json',
function doFun(isPost, url, data, suc, fail) {
if (!data) {
data = "{}"
}
__ELOAM_OBJ.el.ajax({
type: isPost ? "post" : "get",
url: 'http://127.0.0.1:'+__ELOAM_OBJ.port+'/' + url,
dataType: "json",
headers: {
"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9" ,
"Access-Token":"Access-Token123456",//自定义请求头
"Content-Type":"application/json;charset=utf8"
},
// contentType: 'application/json',
data: data, // 将对象使用这个方法转一下 JSON.stringify(_data)
success: function (data) {
if (data.code == 0) {
if (data.data) {
doCal(suc, data.data)
} else {
doCal(suc, data)
}
} else {
doCal(fail, data)
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
// XMLHttpRequest 对象、错误信息、(可选)捕获的错误对象。
// 如果发生了错误,错误信息(第二个参数)除了得到null之外,还可能是"timeout", "error", "notmodified" 和 "parsererror"。
// textStatus:
//"timeout", "error", "notmodified" 和 "parsererror"。
// XMLHttpRequest.readyState:
/**
0 未初始化还没有调用send()方法
1 载入已调用send()方法正在发送请求 服务器连接已建立
2 载入完成send()方法执行完成已经接收到全部响应内容 请求已接收
3 交互正在解析响应内容 请求处理中
4 完成响应内容解析完成可以在客户端调用了请求已完成且响应已就绪
*/
// 三、data:"{}", data为空也一定要传"{}";不然返回的是xml格式的。并提示parsererror.
// 错误说明:https://www.cnblogs.com/fireporsche/p/6391061.html
var res = {
readyState: XMLHttpRequest.readyState,
textStatus: textStatus,
errorThrown: errorThrown,
msg: '请求AJAX错误'
}
doCal(fail, res)
}
});
}
function findDefaultValue(k, def) {
if (!k) {
return def;
}
return k + ''
}
function doImgDiv(type) {
switch (type) {
case 1:
// 全部关闭
// visibility:hidden
if (__ELOAM_OBJ.data.imgMainDivId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.imgMainDivId).attr('style', 'display:none')
}
if (__ELOAM_OBJ.data.ocxDivId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.ocxDivId).attr('style', 'display:none')
}
break;
case 2:
// 打开
if (__ELOAM_OBJ.isIE) {
if (__ELOAM_OBJ.data.ocxDivId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.ocxDivId).attr('style', 'display:block')
}
} else {
if (__ELOAM_OBJ.data.imgMainDivId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.imgMainDivId).attr('style', 'display:block')
}
}
break;
case 3:
// 关闭
if (__ELOAM_OBJ.isIE) {
if (__ELOAM_OBJ.data.ocxDivId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.ocxDivId).attr('style', 'display:none')
}
} else {
if (__ELOAM_OBJ.data.imgMainDivId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.imgMainDivId).attr('style', 'display:none')
}
}
break;
}
}
function doAutoPhotos(json,suc,fail) {
doFun(true,'video=movedetec',json,function (data) {
doCal(suc,data)
if(__ELOAM_OBJ.autoTakePhotosStatus)
doAutoPhotos(json,suc,fail)
},fail)
}
var __webCamera = {
doCamera: function(data,suc,fail){
var open = findDefaultValue(data.isOpen,'0')
if(open === '0'){
__webCamera.closeCamera(data,suc,fail)
}else if(open === '1'){
__webCamera.openCamera(data,suc,fail)
}
},
openCamera: function (data, suc, fail) {
var devIndex = data.devIndex
// 打开成功
if (!devIndex) {
devIndex = 0;
}
// 打开摄像头需要将这个继续打开
doOpenCamera(devIndex,suc,fail)
},
closeCamera: function (data, suc, fail) {
if (__ELOAM_OBJ.isIE) {
if (__ELOAM_OBJ.data.ocxName) {
__ELOAM_OBJ.data.ocxName.StopPreview();
}
} else {
var DevIndex = data.devIndex
if (!DevIndex) {
DevIndex = 0;
}
var _data = {
camidx: DevIndex + ''
}
doFun(true, 'video=close', JSON.stringify(_data), function (data) {
if (__ELOAM_OBJ.data.imgMainId) {
__ELOAM_OBJ.el('#' + __ELOAM_OBJ.data.imgMainId).attr('src', '')
}
if(__ELOAM_OBJ.hideDivImg){
doImgDiv(3)
}
localStorage.setItem("devIndex", '')
doCal(suc, data)
}, fail)
}
},
checkCameraStatus: function(suc,fail){
doFun(true, 'camera=state', '{}', suc, fail)
},
getEquipmentType: function (suc, fail) {
doFun(true, 'device=getequipmenttype', '{}', suc, fail)
},
findVideoList: function(suc,fail){
doFun(true,'video=record','{"action":"audio"}',true,fail)
},
findVideoStatus: function(suc,fail){
doFun(true,'video=record','{"action":"status"}',suc,fail)
},
startVideoRecord: function(data,suc,fail){
var _data = {
"action": "start",
parameter: {
camidx: findDefaultValue(data.devIndex,'0'),
width: findDefaultValue(data.width,'640'),
height: findDefaultValue(data.height,'480'),
audio: findDefaultValue(data.audio,''),
framerate: findDefaultValue(data.frameRate,'10'),
filepath: findDefaultValue(data.filePath,''),
bit_rate: findDefaultValue(data.bitRate,'400000'),
}
}
var watermark = data.watermark
if(watermark && __eloam_uitl.isExistValue(watermark.pos)){
_data.parameter.watermark = {
pos: findDefaultValue(watermark.pos,'0'),
content: findDefaultValue(watermark.content,__eloam_uitl.findTime()),
transparency: findDefaultValue(watermark.transparency,'200'),
fontsize: findDefaultValue(watermark.fontSize,'32'),
font: findDefaultValue(watermark.font,'微软雅黑'),
color: findDefaultValue(watermark.color,'yellow'),
}
}
doFun(true,'video=record',JSON.stringify(_data),suc,fail)
},
stopAndFindVideoRecord: function(data, suc, fail){
var findStatus = findDefaultValue(data.findStatus,'0')
doFun(true,'video=record','{"action":"stop"}',function (data) {
if(findStatus == '0'){
doCal(suc,data)
}else {
setTimeout(function () {
doFun(true,'videobase64=get','{}',suc,function (_v) {
doCal(fail,'停止录制成功,获取视频数据失败;原因:'+_v)
})
},1000)
}
},function (err) {
doCal(fail,'停止录制视频失败,失败原因为:'+err)
})
},
getResolution: function (data, suc, fail) {
var devIndex = data.devIndex;
if (!devIndex) {
devIndex = 0
}
var _data = {
camidx: devIndex + "",
mode: '1'
}
doFun(true, 'device=getresolution', JSON.stringify(_data), suc, fail)
},
doZoom: function(data,suc,fail){
var _data = {
camidx: findDefaultValue(data.devIndex,'0'),
corp: findDefaultValue(data.corp,'0')
}
doFun(true, 'stream=zoominout', JSON.stringify(_data), suc, fail)
},
setResolution: function (data, suc, fail) {
// mode
// 视频模式,0:YUY2(高清);1:MJPG(高速)
// "YUY2"---> 0
// "MJPG"---> 1
var _data = {
camidx: findDefaultValue(data.devIndex,'0'),
width: findDefaultValue(data.width,'800'),
height: findDefaultValue(data.height,'600'),
mode: '1'
}
doFun(true, 'device=setresolution', JSON.stringify(_data), suc, fail)
},
getQrCode: function (data, suc, fail) {
var _data = {
time: findDefaultValue(data.timeout, '20')
}
doFun(true, 'barcode=get', JSON.stringify(_data), suc, function (data) {
if (data.code == 1) {
data.errorMessage = '识别超时'
} else if (data.code == 2) {
data.errorMessage = '其他错误'
}
doCal(fail, data)
})
},
readIDCard: function (suc, fail) {
doFun(false, 'card=idcard', '{}', suc, fail)
},
faceLive: function (data, suc, fail) {
var _data = {
time: findDefaultValue(data.timeout, '20')
}
doFun(true, 'faceLive=start', JSON.stringify(_data), suc, fail)
},
faceComparisonEx: function (data, suc, fail) {
if(!data.oneFace){
doCal(fail,'第一个人脸不能为空~')
return
}
if(!data.twoFace){
doCal(fail,'第二个人脸不能为空')
return
}
var _data = {
FaceOne: data.oneFace,
FaceTwo: data.twoFace
}
doFun(true, 'comparison=imgdata', JSON.stringify(_data), suc, fail)
},
grabImageBase64: function (data, suc, fail) {
var _data = {
filepath: 'base64',
rotate: findDefaultValue(data.rotate, '0'),
camidx: findDefaultValue(data.devIndex, '0'),
cutpage: findDefaultValue(data.cutpage, '0'),
}
doFun(true, 'video=grabimage', JSON.stringify(_data), suc, fail)
},
autoFlat: function(data,suc,fail){
var __autoFlat = data.autoFlat
var _data = {
filepath: findDefaultValue(data.filepath,''),
rotate: findDefaultValue(data.rotate,'0'),
devIndex: findDefaultValue(data.devIndex,'0'),
cutpage: findDefaultValue(data.cutPage,'0')
}
if(__autoFlat && !__eloam_uitl.isEmptyObj(__autoFlat)){
_data.autoflat = {
flat: findDefaultValue(__autoFlat.flat,'1'),
leftfilepath: findDefaultValue(__autoFlat.leftFilePath,''),
rightfilepath: findDefaultValue(__autoFlat.rightFilePath,''),
removefinger: findDefaultValue(__autoFlat.removeFinger,''),
doublepage: findDefaultValue(__autoFlat.doublePage,'')
}
}
doFun(true,'video=autoflat',JSON.stringify(_data),suc,fail)
},
autoTakePhotos: function(data,suc,fail){
var _data = {
listpath: findDefaultValue(data.listPath,''),
filepath: findDefaultValue(data.filePathPrefix,'LT'),
movedetecflag: '1'
}
__ELOAM_OBJ.autoTakePhotosStatus = true
var json = JSON.stringify(_data)
doAutoPhotos(json,suc,fail)
},
stopAutoTakePhotos: function(suc,fail){
var _data = {
movedetecflag: '0'
}
__ELOAM_OBJ.autoTakePhotosStatus = false
doFun(true,'video=movedetec',JSON.stringify(_data),suc,fail)
},
twoInchPhoto: function(suc,fail){
doFun(true,'twoinchphoto','{}',suc,fail)
},
imageArea: function(data,suc,fail){
var _data = {
filepath: findDefaultValue(data.filepath,''),
left: findDefaultValue(data.left,'0'),
top: findDefaultValue(data.top,'0'),
right: findDefaultValue(data.right,'100'),
bottom: findDefaultValue(data.bottom,'100'),
}
doFun(true,'select=imagearea',JSON.stringify(_data),suc,fail)
},
grabImage: function (data, suc, fail) {
var watermark = data.watermark
var _data = {
filepath: findDefaultValue(data.filePath, ''),
rotate: findDefaultValue(data.rotate, '0'),
camidx: findDefaultValue(data.devIndex, '0'),
deskew: findDefaultValue(data.deskew, '0'),
deskewval: findDefaultValue(data.deskewval, '0'),
quality: findDefaultValue(data.quality, '1'),
ColorMode: findDefaultValue(data.colorMode, '0'),
bAutoAdjust: findDefaultValue(data.bAutoAdjust, '0'),
bIsPrint1to1: findDefaultValue(data.bIsPrint1to1, '0'),
/*watermark: {
pos: findDefaultValue(watermark.pos, '0'),
content: findDefaultValue(watermark.content, ''),
transparency: findDefaultValue(watermark.transparency, '0'),
fontsize: findDefaultValue(watermark.fontsize, '100'),
font: findDefaultValue(watermark.font, '微软雅黑'),
color: findDefaultValue(watermark.color, 'yellow')
}*/
}
if (watermark && !__eloam_uitl.isEmptyObj(watermark)) {
_data.watermark = {
pos: findDefaultValue(watermark.pos, '4'),
content: findDefaultValue(watermark.content, __eloam_uitl.findTime()),
transparency: findDefaultValue(watermark.transparency, '200'),
fontsize: findDefaultValue(watermark.fontsize, '32'),
font: findDefaultValue(watermark.font, '微软雅黑'),
color: findDefaultValue(watermark.color, 'yellow')
}
}
doFun(true, 'video=grabimage', JSON.stringify(_data), suc, fail)
},
sendSerialport: function (data, suc, fail) {
var _data = {
sendserialport: findDefaultValue(data.sendserialport, "21"),
data: findDefaultValue(data.data, "110"),
}
doFun(true, 'serialport=sendserialport', JSON.stringify(_data), function (data) {
// 这里说明成功啦
setTimeout(function () {
doFun(true, 'serialport=getdata', '{}', suc, fail)
}, 500)
}, fail)
},
pushWebPage: function(data,suc,fail){
var url = data.url
if(!url){
doCal(fail,'推送网页不能为空')
return
}
var _data = {
url: url
}
doFun(true,'pendisplay=pushwebpage',JSON.stringify(_data),suc,fail)
},
closeWebPage: function(suc,fail){
doFun(true,'pendisplay=closewebpage','{}',suc,fail)
},
readIcCard: function (data, suc, fail) {
var icCardType = data.icCardType
if (!icCardType) {
icCardType = 4;
}
// 这里校验ic卡类型
var _icCardType = parseInt(icCardType)
if (_icCardType < 1 || _icCardType > 7) {
doCal(fail, '请检查ic卡类型')
return
}
var _data = {
iccardtype: icCardType
}
doFun(true, 'card=iccard', JSON.stringify(_data), suc, fail)
},
signDlg: function (data, suc, fail) {
var pos = data.pos
if (!pos) {
pos = {
top: 250,
left: 280,
width: 600,
height: 250
}
}
var _data = {
pos: {
top: findDefaultValue(pos.top, "250"),
left: findDefaultValue(pos.left, "280"),
width: findDefaultValue(pos.width, "600"),
height: findDefaultValue(pos.height, "250"),
},
remark: findDefaultValue(data.remark, "开始签名"),
}
doFun(true, 'serialport=sign', JSON.stringify(_data), suc, fail)
},
closeSign: function(suc,fail){
doFun(true,'serialport=close','{}',suc,fail)
},
findSignResult: function(suc,fail){
doFun(true, 'serialport=getdata', '{}', suc,fail)
},
getTerminalSerialNumber: function (suc, fail) {
doFun(true, 'device=getsonixserialnumber', '{}', suc, fail)
},
checkTerminalConnect: function (suc, fail) {
doFun(true, 'device=isconnect', '{}', suc, fail)
},
getAudioList: function (suc, fail) {
var _data = {
action: 'audio'
}
doFun(true, 'video=record', JSON.stringify(_data), suc, fail)
},
leftRotate: function (data, suc, fail) {
var devIndex = data.devIndex
if (!devIndex) {
devIndex = 0;
}
var _data = {
camidx: devIndex + '',
rotate: '90'
}
doFun(true, 'video=rotate', JSON.stringify(_data), suc, fail)
},
rightRotate: function (data, suc, fail) {
var devIndex = data.devIndex
if (!devIndex) {
devIndex = 0;
}
if(devIndex != 0){
doCal(fail,'只有主头才能旋转~请检查')
return
}
var _data = {
camidx: devIndex + '',
rotate: '270'
}
doFun(true, 'video=rotate', JSON.stringify(_data), suc, fail)
},
doOcr: function (data, suc, fail) {
var imgPath = data.imgPath
var savePDFPath = data.savePDFPath
if (!imgPath) {
doCal(fail, '待OCR图片不能为空')
return
}
if (!savePDFPath) {
doCal(fail, '保存识别结果不能为空')
return
}
var _data = {
ocrflag: '1',
picfilepath: imgPath,
savefilepath: savePDFPath
}
doFun(true, 'savefilepath', JSON.stringify(_data), suc, fail)
},
templateOcr: function(data,suc,fail){
doFun(true,'templateOCR',JSON.stringify(data),suc,fail)
},
doDeskew: function (data,suc,fail) {
var devIndex = findDefaultValue(data.devIndex,'0');
if(devIndex != '0'){
doCal(fail,'只有主头才能打开纠偏,请检查~')
return
}
var _data = {
camidx: devIndex,
open: findDefaultValue(data.status,'0')
}
doFun(true,'dvideo=cameradeskew',JSON.stringify(_data),suc,fail)
},
findFingerprint: function (data,suc,fail) {
var _data = {
time:findDefaultValue(data.timeout,'20')
}
doFun(true,'biokey=get',JSON.stringify(_data),suc,fail)
},
showEvaluator: function (suc,fail) {
doFun(true,'sign=showevaluator','{}',suc,fail)
},
closeEvaluator: function (suc,fail) {
doFun(true,'sign=closeevaluator','{}',suc,fail)
},
findFindEvaluator: function(suc,fail){
doFun(true,'sign=getevaluatorresult',suc,fail)
},
a3a4AutoSwitch: function (data,suc,fail) {
var _data = {
switchflag:findDefaultValue(data.switchFlag,'0'),
a3size: findDefaultValue(data.a3size,'0.5'),
a4size: findDefaultValue(data.a4size,'0.9')
}
doFun(true,'device=a3a4switch',JSON.stringify(_data),suc,fail)
},
findEncryptionKey: function (suc,fail) {
doFun(true,'softkey=check','{}',suc,fail)
},
imgCompose: function (data,suc,fail) {
if(!data.oneImgBase64){
doCal(fail,'第一张图片不能为空')
return
}
if(!data.twoImgBase64){
doCal(fail,'第二张图片不能为空')
return
}
var _data = {
imageOne: data.oneImgBase64,
imageTwo: data.twoImgBase64
}
doFun(true,'iamge=compose',JSON.stringify(_data),suc,fail)
},
addImgToPdfQueue: function (data,suc,fail) {
if(!data.imgPath && !data.imgBase64){
doCal(fail,'请检查加入到队列中的图片')
return
}
var _data = {
ImagePath: data.imgPath,
ImageBase64: data.imgBase64
}
doFun(true,'pdf=addimage',JSON.stringify(_data),suc,fail)
},
closePdfQueueAndFind: function(data,suc,fail){
var findStatus = findDefaultValue(data.findStatus,'0')
doFun(true,'pdf=clear','{}',function (_k) {
if(findStatus == 0){
doCal(suc,_k)
}else {
doFun(true,'videobase64=get','{}',suc,function (err) {
doCal(fail,'清除成功,但获取失败;失败原因为:'+err)
})
}
},fail)
},
createPdfRecord: function (data,suc,fail) {
var padPath = data.pdfPath
if(!padPath){
doCal(fail,'保存pdf 路径不能为空')
return
}
var _data = {
PdfPath: padPath
}
doFun(true,'pdf=save',JSON.stringify(_data),suc,fail)
},
composePhotos: function (data,suc,fail) {
if(!data.outputFilePath){
doCal(fail,'输出文件保存地址不能为空')
return
}
if(!data.outputMaxWidth){
doCal(fail,'合成后文件最大宽度不能为空')
return
}
if(!__eloam_uitl.isExistValue(data.inputImageType)){
doCal(fail,'待合成文件类型不能为空')
return
}
if(!__eloam_uitl.isExistValue(data.outputImageType)){
doCal(fail,'合成后文件类型不能为空')
return
}
if(!__eloam_uitl.isExistValue(data.isIdCardCompose)){
doCal(fail,'是否是身份证不能为空')
return
}
if(!data.imageList){
doCal(fail,'待合成图片列表不能为空')
return
}
var _data = {
"outputfilepath": data.outputFilePath,
"outputmaxwidth": data.outputMaxWidth,
"inputimagetype": data.inputImageType,
"outputimagetype": data.outputImageType,
"isIDCardCompose": data.isIdCardCompose,
"imagelist":data.imageList
}
doFun(true,'compose=photos',JSON.stringify(_data),suc,fail)
},
getCurResolutionIndex: function(suc,fail){
},
doCustomCall:function ({method,url,data,success,error}) {
if(!url){
doCal(error,'请求url 不能为空')
return
}
if(!method){
method = 'post'
}
if(!data){
data = '{}'
}else {
if((typeof data === 'string') && data.constructor===String){
//console.log('字符串')
}else {
data = JSON.stringify(data)
}
}
doFun((method == 'post' || method == 'POST'),url,data,success,error)
}
}
var initCamera = !!data.initCamera
// 这里需要增加判断是否连上
doFun(true, 'device=isconnect', '{}', function (data) {
// 这里说明
// console.log(data)
var number = parseInt(data);
if (number < 1) {
doCal(fail, '请检查设备是否插好~')
} else {
suc(number)
if(initCamera){// 检查摄像头状态
// 这里需要检查摄像头状态
doFun(true,'camera=state','{}',function (data) {
var state = data.state
if(state){
var str = state.split(",");
for(var i=0;i<str.length;i++){
if(str[i] === 'opened'){
__webCamera.closeCamera({devIndex:i})
}
}
}
},function (err) {
console.log('不支持camera=state方法,错误信息:'+err)
var devIndex = localStorage.getItem("devIndex")
if (devIndex == 0 || devIndex) {
// 这里需要关闭
__webCamera.closeCamera({devIndex: devIndex}, function (data) {
console.log('刷新后,初始化关闭原来的摄像头成功')
}, function (err) {
console.log('刷新后,初始化关闭原来的摄像头失败')
})
}
})
}
}
//suc("ok")
}, fail)
doInit()
return __webCamera
}
// 使用vue 项目需要打开这个注释
export default WebCamera

4
src/utils/webCamera/jquery.min.js vendored

File diff suppressed because one or more lines are too long

21
src/views/distribution/artery/VehicleArrivalManagement.vue

@ -592,6 +592,7 @@ import {
debounce,
handleClearTableQuery,
handleTranslationDataSeclect,
computeNumber,
} from '@/utils/util';
import { columnList } from '@/option/distribution/VehicleArrivalManagement';
import { packageColumnList } from '@/option/distribution/VehicleStowage';
@ -824,14 +825,20 @@ const onLoad = debounce(async (params = {}) => {
const { code, data } = res.data;
if (code !== 200) return;
details.data = data.records;
//
// const codes = details.carsStatus.map(val => val.value);
// for (let item of details.data) {
// const _index = codes.indexOf(Number(item.loadStatus));
// item.loadStatusName = _index !== -1 ? details.carsStatus[_index].label : '';
// item.NumberOfPiecesInTheCar = item.realLoadingNumber - item.unloadNumber;
// }
//
handleTranslationDataSeclect(details.data, details.columnList);
//
for (let i = 0; i < details.data.length; i++) {
const value = details.data[i];
value.NumberOfPiecesInTheCar = computeNumber(
value.realLoadingNumber || 0,
'-',
value.unloadNumber || 0
).result;
}
details.page.total = data.total;
} catch (error) {
console.log('error :>> ', error);

27
src/views/distribution/artery/VehicleStowage.vue

@ -539,6 +539,7 @@ import {
deepClone,
handleClearTableQuery,
handleTranslationDataSeclect,
computeNumber,
} from '@/utils/util';
import { columnList, packageColumnList } from '@/option/distribution/VehicleStowage';
import {
@ -767,23 +768,19 @@ const onLoad = debounce(async (params = {}) => {
if (code !== 200) return;
details.data = data.records;
//
handleTranslationDataSeclect(details.data, details.columnList);
// for (let item of details.data) {
// item.loadStatusName = item.loadStatusName = carStateDictionaries.find(
// val => Number(item.loadStatus) === val.value
// ).label;
// item.NumberOfPiecesInTheCar = item.realLoadingNumber - item.unloadNumber;
// for (let index = 0; index < details.selectionList.length; index++) {
// const element = details.selectionList[index];
// if (element.id === item.id) {
// details.selectionList.splice(index, 1, element);
// break;
// }
// }
// }
//
for (let i = 0; i < details.data.length; i++) {
const value = details.data[i];
value.NumberOfPiecesInTheCar = computeNumber(
value.realLoadingNumber || 0,
'-',
value.unloadNumber || 0
).result;
}
details.page.total = data.total;
} catch (error) {

2
src/views/distribution/artery/VehicleStowageDetails.vue

@ -465,6 +465,7 @@ import {
handleSelectQuery,
handleTimeQuery,
handleFilterData,
handleTranslationDataSeclect,
} from '@/utils/util';
import { detailsColumnList, nodeInfoColumnList } from '@/option/distribution/addVehicleStowage';
import { detailsColumnList as abnormalColumn } from '@/option/distribution/TripartiteTransfer';
@ -913,6 +914,7 @@ const handleData = async () => {
console.log('_data :>> ', _data);
details.renderData = _data;
handleTranslationDataSeclect(details.renderData, details.detailsColumnList);
console.log('details.renderData :>> ', details.renderData);
};

64
src/views/distribution/artery/abnormalList.vue

@ -15,37 +15,18 @@
<el-form-item label="运单号:" class="el-times">
<el-input v-model="query.stockupArea" clearable placeholder="请输入运单号"></el-input>
</el-form-item>
<el-form-item label="制单时间:" class="el-times">
<el-date-picker
v-model="stockupDate"
type="daterange"
unlink-panels
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
:shortcuts="shortcuts"
value-format="YYYY-MM-DD"
clearable
/>
</el-form-item>
<el-form-item label="创建时间:" class="el-times">
<el-date-picker
v-model="stockupDate"
type="daterange"
unlink-panels
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
:shortcuts="shortcuts"
value-format="YYYY-MM-DD"
<el-form-item label="仓库:" class="el-times">
<el-input
v-model="query.warehouseName"
clearable
/>
placeholder="请输入仓库名称"
></el-input>
</el-form-item>
<el-form-item label="送货时间:" class="el-times">
<el-form-item label="处理时间:" class="el-times">
<el-date-picker
v-model="stockupDate"
v-model="query.dealDateArr"
type="daterange"
unlink-panels
range-separator="至"
@ -57,9 +38,9 @@
/>
</el-form-item>
<el-form-item label="签收时间:" class="el-times">
<el-form-item label="创建时间:" class="el-times">
<el-date-picker
v-model="stockupDate"
v-model="query.createDateArr"
type="daterange"
unlink-panels
range-separator="至"
@ -70,6 +51,7 @@
clearable
/>
</el-form-item>
<!-- 查询按钮 -->
<el-form-item class="el-btn">
<el-button type="primary" icon="el-icon-search" @click="searchChange"> </el-button>
@ -146,9 +128,9 @@
<div class="flex-c-c mt20">
<el-button @click="details.popUpShow.abnormalVisited = false"> </el-button>
<el-button type="primary" icon="Delete" @click="handleDeleteOrder">无效包条</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleSynchronization"
>同步数据</el-button
>
<el-button type="primary" icon="el-icon-search" @click="handleSynchronization">
同步数据
</el-button>
</div>
</el-dialog>
@ -175,6 +157,7 @@ import {
getHtmls,
deepClone,
handleClearTableQuery,
getObjType,
} from '@/utils/util';
import { columnList } from '@/option/distribution/abnormalList';
import { useRouter } from 'vue-router';
@ -292,7 +275,23 @@ const onLoad = async (page?: any, params = {}) => {
let _page = details.page;
if (page) _page = page;
//
const res = await postFindPageList({ ..._page, ...details.query, ...params });
const submitData = { ..._page, ...details.query, ...params };
const { createDateArr, dealDateArr } = details.query;
if (getObjType(createDateArr) === 'array' && createDateArr.length > 0) {
submitData.createDateStartStr = details.query.createDateArr[0];
submitData.createDateEndStr = details.query.createDateArr[1];
}
if (getObjType(dealDateArr) === 'array' && dealDateArr.length > 0) {
submitData.dealDateStartStr = details.query.dealDateArr[0];
submitData.dealDateEndStr = details.query.dealDateArr[1];
}
delete submitData.createDateArr;
delete submitData.dealDateArr;
const res = await postFindPageList(submitData);
console.log('res :>> ', res);
const { code, data } = res.data;
if (code !== 200) return;
@ -314,6 +313,7 @@ const onLoad = async (page?: any, params = {}) => {
details.page.total = data.total;
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.list = false;
}

42
src/views/distribution/artery/truckLoadingDetails.vue

@ -135,11 +135,11 @@
<template v-if="Number(slotProps.scope.row.type) === 2">
<el-text
type="text"
@click="handleZeroUnLoad(slotProps.scope)"
@click="() => handleZeroUnLoad(slotProps.scope)"
v-if="
permissionObj.truckLoadingDetails_zeroUnload &&
details.pageInfo.type !== 'VehicleStowage' &&
Number(slotProps.scope.row.scanStatus) === 1
Number(slotProps.scope.row.unloadCheck) === 0
"
>
零担卸车
@ -157,7 +157,8 @@
v-if="
permissionObj.truckLoadingDetails_packageUnload &&
details.pageInfo.type !== 'VehicleStowage' &&
Number(slotProps.scope.row.scanStatus) === 1
Number(slotProps.scope.row.scanStatus) === 1 &&
Number(slotProps.scope.row.unloadCheck) === 0
"
>
包件卸车
@ -297,6 +298,7 @@ import {
postRemoveCarsLoadScan,
postSignLoadScanByIds,
postLoadingDetailExport,
postShowOrderCodeByCode,
} from '@/api/distribution/truckLoadingDetails';
import {
postFindNextNodeList,
@ -854,22 +856,22 @@ const handleBatchUnLoad = async () => {
let isHaveAbnormalData = false;
for (const iterator of details.selectionList) {
if (Number(iterator.scanStatus) === 1) {
//
if (Number(iterator.type) === 1) {
//
if (Number(iterator.type) === 1) {
if (Number(iterator.scanStatus) === 1) {
_orderArr.push({ orderPackageCode: iterator.scanCode, carsLoadScanId: iterator.id });
} else {
_zeroArr.push({
waybillNo: iterator.waybillNo,
enterNum: iterator.num,
orderCode: iterator.orderCode,
});
}
} else {
_zeroArr.push({
waybillNo: iterator.waybillNo,
enterNum: iterator.num,
orderCode: iterator.orderCode,
});
}
//
if (!isHaveAbnormalData) {
isHaveAbnormalData = iterator.finalNodeId !== myWarehouseId;
}
//
if (!isHaveAbnormalData) {
isHaveAbnormalData = iterator.finalNodeId !== myWarehouseId;
}
}
@ -1160,7 +1162,7 @@ const handleZeroUnLoad = async ({ row }) => {
}
details.zeroItem = { ...row };
details.zeroItem.enterNum = row.num;
details.zeroItem.enterNum = !details.zeroItem.unloadNum ? row.num : details.zeroItem.unloadNum;
details.popUpShow.transferVisited = true;
};
@ -1179,7 +1181,7 @@ const handleZeroUnLoadSubmit = async () => {
unloadZeroList: [
{
waybillNo: details.zeroItem.waybillNo,
enterNum: details.zeroItem.num,
enterNum: details.zeroItem.enterNum,
orderCode: details.zeroItem.orderCode,
},
],
@ -1239,10 +1241,10 @@ const printOrderByZero = async ({ row }) => {
details.loadingObj.pageLoading = true;
let ids = {
ids: row.id,
orderCodes: row.orderCode,
};
const res = await postShowOrderCode(ids);
const res = await postShowOrderCodeByCode(ids);
if (res.data.code !== 200) return;
details.popUpShow.QRCodeVisible = true;

8
src/views/distribution/inventory/distrilbutionBillLading.vue

@ -212,7 +212,7 @@
uploadSuccess(fileListSell);
}
"
:on-remove="handleRemove"
list-type="picture"
>
<el-button type="primary" @click="smIMG=false">上传</el-button>
@ -2121,17 +2121,18 @@ export default {
},
//
IMGUploadSuccess(value){
console.log(this.fileListSell,'this.fileListSell');
console.log(value,'接收上传成功图片地址');
if(this.imgValue ==1){
this.fileListSell.push({
name:value.data.data.originalName,
url:value.data.data.link,
})
}else if(this.imgValue ==2){
this.fileListClerk.push({
name:value.data.data.originalName,
url:value.data.data.link,
})
}else if(this.imgValue ==3){
this.fileListLibrary.push({
@ -2139,8 +2140,7 @@ export default {
url:value.data.data.link,
})
}
this.smIMG=false;//
},
scrollToElementWithinTableRow(partialIdString) {
//

Loading…
Cancel
Save