From e7cfae909181ab9e7ffacd0370b0ad9d4ad50123 Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期五, 30 六月 2023 20:15:09 +0800
Subject: [PATCH] 质检管理
---
igds-web/src/main/resources/static/admin/inout/weight.js | 197 +++++++++++++++++++++++++------------------------
1 files changed, 101 insertions(+), 96 deletions(-)
diff --git a/igds-web/src/main/resources/static/admin/inout/weight.js b/igds-web/src/main/resources/static/admin/inout/weight.js
index b7c9acf..fb9d060 100644
--- a/igds-web/src/main/resources/static/admin/inout/weight.js
+++ b/igds-web/src/main/resources/static/admin/inout/weight.js
@@ -1,9 +1,5 @@
/**
* 鍏ュ簱-绉伴噸鑷姩璁$畻
- * 1銆佸噣閲� = 姣涢噸 - 鐨噸 锛� 鎬绘墸閲� = 鎵f按鏉� + 鐜板満鎵i噸 + 鍏朵粬鎵i噸
- * 2銆佹按鍒嗘墸閲嶆牴鎹寲楠屾按鍒嗕俊鎭嚜鍔ㄨ绠楋紝姝f暟=鎵i噸锛岃礋鏁�=澧為噸
- * 3銆佺粨绠楅噸閲� = 鍑�閲� - 鎬绘墸閲� 锛堝惈姘存潅澧為噸锛夛紱 鍏ュ簱閲嶉噺 = 鍑�閲� - 鎬绘墸閲� 锛堜笉鍚按鏉傚閲嶏級
- * 娉ㄦ剰锛氬鏋滄槸鎵嬪姩淇敼浜嗘按鍒嗗拰鏉傝川鐨勬墸閲嶏紝鍒欎笉鎸夌収閰嶇疆瑙勫垯杩涜澧炴墸閲嶈绠�
* @param name 瑙﹀彂浜嬩欢鐨勫睘鎬у悕绉�
*/
function deAutoByIn(name) {
@@ -11,66 +7,24 @@
if (curData.fullWeight == 0 || curData.emptyWeight == 0) {
return;
}
- //姹囨�荤粨鏋�
- var deSum = 0, addSum = 0, settleWeight = 0, recordWeight = 0;
// 鍑�閲�
var netWeight = curData.fullWeight - curData.emptyWeight;
- //鎵f按鏉�
- var deWet = curData.deWet, deImpurity = curData.deImpurity;
-
if (netWeight <= 0) {
- layer.alert("鍑�閲嶅皬浜�0锛屽綋鍓嶇О閲嶅瓨鍦ㄩ�昏緫闂");
+ alertError("鍑�閲�<=0锛屽綋鍓嶇幆鑺傚瓨鍦ㄩ�昏緫閿欒锛岃鏍稿");
return;
}
+ //鍏朵粬淇℃伅
+ var deHandle = curData.deHandle, dePackage = curData.dePackage, deOther = curData.deOther, settleWeight = 0,
+ recordWeight = 0, deCheck = curData.deCheck, addCheck = curData.addCheck;
+ recordWeight = Number(netWeight) - Number(deHandle) - Number(dePackage) - Number(deOther) - Number(deCheck);
+ settleWeight = Number(recordWeight) + Number(addCheck);
- var deBase = 0, multiple = 0;
- //姘村垎鏉傝川锛屾洿鏀规瘮渚嬪苟涓旀按鍒嗘墸閲嶈繕娌¤绠楁儏鍐典笅
- if ("emptyWeight" == name || null == deWet) {
- var checkItem = this.getCheckItem(recordData.checkItems, CHECK_ST.C01, CHECK_ST.C020101);
- if (checkItem) {
- deBase = Number(curData.wet) - Number(checkItem.upperLimit);
- if (deBase == 0) return;
- multiple = parseInt(deBase / checkItem.ruleNum);//鍊嶆暟
- deWet = (netWeight * multiple * checkItem.ruleReduce / 100.00).toFixed(0);
- }
- }
- //鏉傝川
- if ("emptyWeight" == name || null == deImpurity) {
- checkItem = this.getCheckItem(recordData.checkItems, CHECK_ST.C02, CHECK_ST.C01010301);
- if (checkItem) {
- deBase = Number(curData.impurity) - Number(checkItem.upperLimit);
- if (deBase == 0) return;
- multiple = parseInt(deBase / checkItem.ruleNum);
- deImpurity = (netWeight * multiple * checkItem.ruleReduce / 100.00).toFixed(0);
- }
- }
-
- /** 鎬绘墸閲嶏紝涓嶅惈澧為噸*/
- deSum = Number(curData.deOther) + Number(curData.deHandle);
-
- if (Number(deWet) > 0) {//鎵i噸
- deSum = deSum + Number(deWet);
- } else {
- addSum = addSum + Number(deWet);
- }
- if (Number(deImpurity) > 0) {//鎵i噸
- deSum = deSum + Number(deImpurity);
- } else {
- addSum = addSum + Number(deImpurity);
- }
- deSum = deSum.toFixed(0);
- /** 澧為噸杞鏁帮紝渚夸簬璁$畻 */
- addSum = Math.abs(addSum).toFixed(0);
- /** 鍏ュ簱閲嶉噺 = 鍑�閲� - 鎬绘墸閲� */
- recordWeight = Number(netWeight) - Number(deSum);
- /** 缁撶畻閲嶉噺 = 鍑�閲� - 鎬绘墸閲� + 澧為噸 */
- settleWeight = Number(netWeight) - Number(deSum) + Number(addSum);
+ netWeight = netWeight.toFixed(0);
+ recordWeight = recordWeight.toFixed(0);
+ settleWeight = settleWeight.toFixed(0);
form.val("form-data", {
netWeight: netWeight,
- deImpurity: deImpurity,
- deWet: deWet,
- deSum: deSum,
settleWeight: settleWeight,
recordWeight: recordWeight
});
@@ -207,54 +161,103 @@
});
}
-/**
- * 寮瑰嚭鎻愰啋妗�
- * @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']});
+// ---------------------------閫氱煡鍗�-寮�濮� -------------------//
+// 寮瑰嚭寰�鏉ュ崟浣嶄笅鎷夋
+function showNotice() {
+ var titleCustomer = "閫佽揣鍗曚綅";
+ var url = "../../basic/inout/list-notice-in";
+ if ("OUT" == type) {
+ titleCustomer = "鏀惰揣鍗曚綅";
+ url = "../../basic/inout/list-notice-out"
}
+ var index = layer.load();
+ var param = {
+ type: type
+ };
+
+ console.log(url);
+
+ table.render({
+ elem: '#tableNotice',
+ url: url,
+ page: false,
+ even: true,
+ method: 'POST',
+ contentType: "application/json;charset=UTF-8",
+ cols: [[{
+ field: 'name',
+ title: '閫氱煡鍗曞悕绉�',
+ width: '15%'
+ }, {
+ field: 'customerName',
+ title: titleCustomer
+ }, {
+ field: 'foodVarietyName',
+ title: '绮鍝佺',
+ width: '10%'
+ }, {
+ field: 'year',
+ title: '骞翠唤',
+ width: '8%'
+ }, {
+ field: 'depotName',
+ title: "鎵�娑変粨搴�"
+ }, {
+ field: 'contractName',
+ title: '鎵�灞炲悎鍚�'
+ }]],
+ where: param,
+ parseData: function (res) {
+ if ("0000" == res.code) {
+ return {
+ "code": "0",
+ "msg": res.msg,
+ "data": res.data
+ }
+ } else {
+ return {
+ "code": "1",
+ "msg": res.msg
+ }
+ }
+ },
+ done: function (res) {
+ layer.close(index);
+ }
+ });
+ //鍙屽嚮鏄剧ず閫変腑鏁版嵁
+ table.on('rowDouble(tableNotice)', function (obj) {
+ var data = obj.data;
+ form.val("form-data", {
+ customerName: data.customerName,
+ noticeId: data.id
+ });
+ layer.closeAll();
+ });
+ // 寮瑰嚭瀵硅瘽妗�
+ layer.open({
+ type: 1,
+ offset: ['100px', '250px'],
+ title: "閫氱煡鍗曞垪琛紙鍙屽嚮閫変腑锛�",
+ area: ['900px', '600px'],
+ shade: 0,
+ content: $('#listNotice'),
+ btn: 0,
+ btn: ['鍙栨秷'],
+ yes: function () {
+ layer.closeAll();
+ },
+ closeBtn: 0
+ });
}
-
-// ---------------------------绮浜у湴 -寮�濮� -------------------//
-// 寮瑰嚭寰�鏉ュ崟浣嶄笅鎷夋
+// ---------------------------绮浜у湴-寮�濮� -------------------//
function showFoodLocation() {
var index = layer.load();
- // 娓叉煋寰�鏉ュ崟浣嶅垪琛�
table.render({
elem: '#tableFoodLoaction',
- url: '../../basic/common/page-food-location',
+ url: '../../basic/common/page-dicArea',
page: false,
- // limit : limit,
- // skin : "nob",
- // size : 'sm',
toolbar: '#toolbarFoodLocaton',
even: true,
method: 'POST',
@@ -300,6 +303,7 @@
// 璧嬪��
form.val("form-data", {
foodLocation: data.name,
+ foodLocationId: data.code
});
// 鍏抽棴
layer.closeAll();
@@ -325,7 +329,7 @@
function flushFoodLocation() {
var key = $("#key2").val();
table.reload('tableFoodLoaction', {
- url: "../../basic/common/page-food-location",
+ url: "../../basic/common/page-dicArea",
where: {
key: key
},
@@ -336,4 +340,5 @@
}
});
}
+
// ---------------------------绮浜у湴 -缁撴潫 -------------------//
\ No newline at end of file
--
Gitblit v1.9.3