From b1e6bf7d3ed1a1d64182127f83fdc3fad2233a7e Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期五, 12 十二月 2025 15:36:01 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
fzzy-igdss-web/src/main/resources/static/inout/inout-register.js | 294 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 294 insertions(+), 0 deletions(-)
diff --git a/fzzy-igdss-web/src/main/resources/static/inout/inout-register.js b/fzzy-igdss-web/src/main/resources/static/inout/inout-register.js
new file mode 100644
index 0000000..7144648
--- /dev/null
+++ b/fzzy-igdss-web/src/main/resources/static/inout/inout-register.js
@@ -0,0 +1,294 @@
+var layer;
+var form;
+var snapData;//鐧昏鐓х墖
+
+$(function () {
+ layui.use(['layer', 'form'], function () {
+ layer = layui.layer;
+ form = layui.form;
+
+ // 鐩戝惉绫诲瀷閫夋嫨
+ form.on('select(select_type)', function (obj) {
+ return changeProgress();
+ });
+ });
+
+ initData();
+
+ var rightH = $(".rkbk-left-wrap").height();
+ $(".rkbk-right-wrap").height(rightH);
+
+ $(window).resize(function () {
+ var rightH = $(".rkbk-left-wrap").height();
+ $(".rkbk-right-wrap").height(rightH);
+ });
+
+});
+
+window.onload = function () {
+ // 鍔犺浇瑙嗛
+ initVideo(lprDto, null, null);
+};
+
+
+
+function initData() {
+ if (type) {
+ $("#type").val(type);
+ var actualVal = $("#type").val();
+ console.log("璧嬪�煎悗瀹為檯閫変腑鍊硷細", actualVal);
+ console.log("鏄惁涓庣洰鏍囧�间竴鑷达紵", actualVal === type);
+ }
+
+ showProgress();
+}
+
+/**
+ * 鎺у埗娴佺▼鐜妭鏄剧ず
+ */
+function showProgress() {
+ if (!inoutProgress) {
+ return;
+ }
+ if (inoutProgress.indexOf("REGISTER") === -1) {
+ $("#rk-progress-register").css("display", "none");
+ $("#ck-progress-register").css("display", "none");
+ }
+ if (inoutProgress.indexOf("WEIGHT_FULL") === -1) {
+ $("#rk-progress-fullWeight").css("display", "none");
+ $("#ck-progress-fullWeight").css("display", "none");
+ }
+ if (inoutProgress.indexOf("HANDLE") === -1) {
+ $("#rk-progress-hand").css("display", "none");
+ $("#ck-progress-hand").css("display", "none");
+ }
+ if (inoutProgress.indexOf("WEIGHT_EMPTY") === -1) {
+ $("#rk-progress-emptyWeight").css("display", "none");
+ $("#ck-progress-emptyWeight").css("display", "none");
+ }
+ if (inoutProgress.indexOf("CARD_BACK") === -1) {
+ $("#rk-progress-cardBack").css("display", "none");
+ $("#ck-progress-cardBack").css("display", "none");
+ }
+
+ if (type === "IN") {
+ $("#rk_progress").css("display", "block");
+ $("#ck_progress").css("display", "none");
+ }
+ if (type === "OUT") {
+ $("#ck_progress").css("display", "block");
+ $("#rk_progress").css("display", "none");
+ }
+}
+
+/**
+ * 鍒囨崲娴佺▼
+ * @param obj
+ */
+function changeProgress() {
+ type = $("#type").val();
+ showProgress();
+}
+
+/**
+ * 璇诲彇韬唤璇�
+ */
+function flushIdCard() {
+ var index = layer.load();
+ $.ajax({
+ type: "GET",
+ async: true,
+ url: "http://127.0.0.1:9111/IDCARD",
+ data: {},
+ dataType: "json",
+ success: function (json) {
+ layer.close(index);
+ var data = json;
+ if (data.code === "200" || data.code == 200) {
+ // 涓存椂璧嬪��
+ $("#userName").val(data.cnName);
+ $("#userAddress").val(data.address);
+ $("#userId").val(data.idNum);
+ if (data.Image) {
+ $("#id_img_pers").attr("src", data.Image);
+ }
+ }else{
+ alertError("娌℃湁鑾峰彇鍒拌韩浠借瘉淇℃伅锛�");
+ return;
+ }
+ },
+ error: function () {
+ layer.alert("韬唤璇佽鍙栧け璐ワ紒", {
+ offset: ['300px', '300px']
+ });
+ layer.close(index);
+ }
+ });
+}
+
+/**
+ * 璇诲彇杞︾墝鍙�
+ */
+function flushPlateNum() {
+ var param = JSON.stringify(lprDto);
+ var index = layer.load();
+ $.ajax({
+ type: "POST",
+ url: "/inout/api/get-plateNum",
+ dataType: "json",
+ contentType: "application/json;charset=UTF-8",
+ data: param,
+ success: function (result) {
+ if (result.code != "0000") {
+ alertError(result.msg);
+ } else {
+ $("#plateNum").val(result.data.plateNum);
+ }
+ layer.close(index);
+ },
+ error: function () {
+ layer.close(index);
+ alertError("杞︾墝璇嗗埆澶辫触锛�");
+ }
+ });
+}
+
+/**
+ * 閲嶇疆琛ㄥ崟
+ */
+function resetForm() {
+ $("#form-data")[0].reset();
+ form.render();
+ // 韬唤璇侀噸缃�
+ $("#id_img_pers").attr("src", "/img/web/inout/rkbk-photo_03.png");
+ $("#pz-img").removeClass("kccz-r-img-red");
+ $("#pz-text").text("鑷姩鎶撴媿");
+}
+
+/**
+ * 瀹屾垚鎻愪氦鎶撳浘
+ */
+function submit() {
+ var data = form.val("form-data");
+ if (!data.type) {
+ alertError("鍑哄叆搴撶被鍨嬩笉鑳戒负绌�");
+ return;
+ }
+ if (!data.plateNum) {
+ alertError("杞︾墝鍙蜂笉鑳戒负绌�");
+ return;
+ }
+ if (!data.userName) {
+ alertError("鎵胯繍浜哄鍚嶄笉鑳戒负绌�");
+ return;
+ }
+
+ //绯荤粺鎶撴媿
+ layer.msg("绯荤粺鑷姩鎶撴媿璁板綍鈥︹��");
+ snapData = {
+ companyId: companyId,
+ deptId: deptId,
+ progress: progress,
+ bizType: type,
+ plateNum: data.plateNum,
+ id1: (null != lprDto) ? lprDto.id : null,
+ id2: (null != lprDto) ? lprDto.id : null,
+ };
+ $.ajax({
+ sync: false,
+ type: "POST",
+ url: "../../inout/api/snap-img",
+ dataType: "json",
+ contentType: "application/json;charset=UTF-8",
+ data: JSON.stringify(snapData),
+ success: function (result) {
+ if (result.code != "0000") {
+ layer.alert(result.msg);
+ submitData(data);
+ } else {
+ snapData = result.data;
+
+ $("#pz-img").addClass("kccz-r-img-red");
+ $("#pz-text").text("宸叉媿鐓�");
+
+ submitData(data);
+ }
+ },
+ error: function () {
+ layer.msg("鍚庡彴璋冪敤鎴浘澶辫触锛岃閲嶆柊灏濊瘯锛侊紒");
+ submitData(data);
+ }
+ });
+}
+
+/**
+ * 鎻愪氦鏁版嵁
+ * @param data
+ */
+function submitData(data) {
+ var index = layer.load();
+
+ var files = [{
+ fileName: snapData.fileName1
+ },{
+ fileName: snapData.fileName2
+ }];
+ data.files = files;
+
+ $.ajax({
+ type: "POST",
+ url: "../../basic/inout/submit-register",
+ dataType: "json",
+ contentType: "application/json;charset=UTF-8",
+ data: JSON.stringify(data),
+ success: function (result) {
+ layer.close(index);
+ if (result.code != "0000") {
+ notify(result.msg, result.data);
+ } else {
+ notify("鏁版嵁鎻愪氦鎴愬姛", result.data);
+ // 閲嶇疆椤甸潰
+ resetForm();
+ }
+ },
+ error: function () {
+ layer.close(index);
+ layer.alert("鎻愪氦澶辫触锛岃閲嶆柊灏濊瘯锛侊紒");
+ }
+ });
+}
+
+/**
+ * 寮瑰嚭鎻愰啋妗�
+ * @param msg 鎻愰啋淇℃伅
+ * @param data 鏁版嵁淇℃伅锛屽彲鑳戒负绌�
+ */
+function notify(msg, data) {
+ if (data) {
+ //璧嬪��
+ $("#resultMsg").text(msg);
+ $("#resultUserName").text(data.userName);
+ $("#resultPlateNum").text(data.plateNum);
+ if ("IN" == data.type) {
+ $("#resultType").text("鍏ュ簱-" + INOUT_PROGRESS_MSG(data.progress));
+ } else {
+ $("#resultType").text("鍑哄簱-" + INOUT_PROGRESS_MSG(data.progress));
+ }
+ $("#resultIntelCard").text(data.intelCard);
+
+ layer.open({
+ type: 1,
+ offset: ['150px', '200px'],
+ area: '450px;',
+ shade: 0.8,
+ id: 'dialog_notify_info',
+ btn: ['纭畾'],
+ content: $('#dialog-from-notify'),
+ yes: function (index) {
+ layer.closeAll();
+ }
+ });
+ } else {
+ layer.alert(msg, {offset: ['300px', '300px']});
+ }
+}
\ No newline at end of file
--
Gitblit v1.9.3