From 7e9aed4d1d60a20c659a3cedeac94e05205cf2ea Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期二, 19 三月 2024 09:00:25 +0800
Subject: [PATCH] 销售订单:编辑时是否取库存数据为否 问题解决
---
WebTM/views/设备管理/Sb_Add_EqpMaintenanceBillList.html | 227 ++++++++++++++++++++++++++++++++++----------------------
1 files changed, 138 insertions(+), 89 deletions(-)
diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_Add_EqpMaintenanceBillList.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_Add_EqpMaintenanceBillList.html"
index 01e0f91..2e2bb19 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_Add_EqpMaintenanceBillList.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_Add_EqpMaintenanceBillList.html"
@@ -8,6 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
+ <script src="../../../layuiadmin/PageTitle.js"></script>
<style type="text/css">
.layui-form-label {
width: 95px;
@@ -37,7 +38,7 @@
<li class="layui-this">鍩烘湰淇℃伅</li>-->
<!--<li>鍏朵粬淇℃伅</li>-->
<!--</ul>-->
- <h1 style="text-align:center;"><b>璁惧缁翠慨璁板綍鍗�</b></h1>
+ <h1 style="text-align: center; padding: 10px 0;"><b>璁惧缁翠慨璁板綍鍗�</b></h1>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<div class="layui-form-item">
@@ -157,11 +158,12 @@
<select name="HMainSourceBillType" lay-filter="HMainSourceBillType" id="HMainSourceBillType">
<option value="璁惧缁翠慨鐧昏鍗�" selected="selected">璁惧缁翠慨鐧昏鍗�</option>
<option value="鎵嬪伐褰曞叆">鎵嬪伐褰曞叆</option>
+ <option value="璁惧缁翠慨娲惧伐鍗�">璁惧缁翠慨娲惧伐鍗�</option>
</select>
</div>
</div>
<div class="layui-inline">
- <label class="layui-form-label">璁惧鏁呴殰鐧昏鍗曢�夊崟鍙�</label>
+ <label class="layui-form-label">閫夊崟鍙�</label>
<div class="layui-input-inline">
<input type="text" name="HMainSourceBillNo" id="HMainSourceBillNo" class="layui-input" value="" style="float:left;width:150px;">
<input type="hidden" name="HMainSourceInterID" id="HMainSourceInterID" class="layui-input" value="" style="float:left;width:150px;">
@@ -281,6 +283,14 @@
//#endregion
//#region 杩涘叆椤甸潰鍗冲姞杞�
+
+ //#region 銆愬姩鎬佽幏鍙栨ā鍧楀悕绉般��
+ var HModuleType = "3910";
+ //閫氳繃鍗曟嵁绫诲瀷锛屼粠鏁版嵁搴撳姩鎬佽幏鍙栧崟鎹ā鍧楀懡鍚�,寮曠敤js鏂囦欢 PageTitle.js
+ var HPageTitle = get_PageTitle(HModuleType) == "" ? $("h1").html() : get_PageTitle(HModuleType);
+ $("h1").html('<b>' + HPageTitle + '</b>');
+ //#endregion
+
//鍒濆鍖栬〃鍗曟彃浠�
set_InitFrom();
//鍒濆鍖栬〃鏍�
@@ -288,6 +298,13 @@
set_InitGrid_pj();
//鍒ゆ柇鎿嶄綔绫诲瀷
if (OperationType == 1) {//鏃犳簮鍗�
+ $("#HEmpID").val(sessionStorage["HEmpID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭缁翠慨浜篒D
+ $("#HEmpName").val(sessionStorage["HEmpName"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭缁翠慨浜�
+ $("#HDeptID").val(sessionStorage["HDeptID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭閮ㄩ棬ID
+ $("#HDeptName").val(sessionStorage["HDept"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭閮ㄩ棬
+ $("#HManagerID").val(sessionStorage["HEmpID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭璐熻矗浜篒D
+ $("#HManagerName").val(sessionStorage["HEmpName"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭璐熻矗浜�
+
set_AddFNew();
}
else if (OperationType == 3) {//缂栬緫
@@ -305,12 +322,12 @@
form.render('select');
switch (Sctag) {
//鏃犳簮鍗曟柊澧�
- case '1':
+ case '鎵嬪伐褰曞叆':
$('#HMainSourceBillNo').attr("disabled", false);
$('#XDHList').addClass("layui-btn-disabled").attr("disabled", true);
break;
//鏈夋簮鍗曟柊澧灺� 聽
- case '2':
+ default:
$('#HMainSourceBillNo').attr("disabled", true);
$('#XDHList').removeClass("layui-btn-disabled").attr("disabled", false);
break;
@@ -325,7 +342,7 @@
table.on('toolbar(mainTable)', function (obj) {
var checkStatus = table.checkStatus('mainTable')
, data = checkStatus.data;;
- var NewRow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": ""/*, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " " */ };
+ var NewRow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRepairExplanation": "", "HRemark": ""/*, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " " */ };
switch (obj.event) {
//澧炲姞涓�琛�
case 'btn-AddLine': set_AddLine(NewRow);
@@ -339,7 +356,7 @@
table.on('toolbar(mainTable1)', function (obj) {
var checkStatus = table.checkStatus('mainTable1')
, data = checkStatus.data;
- var NewRow = { "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HQty": "0", "HRemark": "" };
+ var NewRow = { "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": sessionStorage["HEmpID"], "HManagerNumber": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HQty": "0", "HRemark": "" };
switch (obj.event) {
//鏂板涓�琛�
case 'btn-AddLine1': btnAddLine1(NewRow);
@@ -557,85 +574,115 @@
//琛ㄥご淇℃伅閫夋嫨鍗曟嵁寮圭獥
form.on('submit(XDHList)', function () {
- //椤甸潰灞�-鑷畾涔�
- layer.open({
- type: 2,
- skin: 'layui-layer-rim', //鍔犱笂杈规
- title: '璁惧鏁呴殰鐧昏鍗�',
- shift: 2,
- area: ['90%', '90%'],
- content: ['../璁惧绠$悊/Sb_EqpConkBookBillList.html', 'yes'],
- btn: ['纭畾', '鍙栨秷']
- , btn1: function (index, layero) {
- //var NewRow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " " };
- ////鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
- var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰
- var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
- if (checkStatus.data.length === 0) {
- return layer.msg('璇烽�夋嫨鍗曟嵁鏁版嵁');
- }
- $("#HMainSourceBillNo").val(checkStatus.data[0].鍗曟嵁鍙�);
- $("#HMainSourceInterID").val(checkStatus.data[0].hmainid);
- $("#HMainSourceEntryID").val(checkStatus.data[0].hsubid);
- //鍥炲~璁惧淇℃伅
- $("#HEquipName").val(checkStatus.data[0].璁惧鍚嶇О);
- $("#HEquipID").val(checkStatus.data[0].HEquipID);
- ////鎸夐�夊崟鍙峰姞杞借〃浣撴暟鎹�
- //$.ajax({
- // url: GetWEBURL() + 'Sb_EqpRepairWorkBill/Sb_EqpRepairWorkBillSubByHMainSourceBillNo',
- // type: "GET",
- // data: { "HMainSourceBillNo": checkStatus.data[0].鍗曟嵁鍙� },
- // success: function (result) {
- // if (result.count == 1) {
- // var EndData = result.data;
- // var rowdate = layui.table.cache["mainTable"];
- // if (rowdate.length == 0) //琛ㄤ綋鏁版嵁涓虹┖鏃�
- // {
- // buttonArr = [];//娓呯┖鏁扮粍
- // for (var i = 0; i < checkStatus.data.length; i++) {
- // var checkrow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "", "HSourceInterID": EndData[i].hmainid, "HSourceEntryID": EndData[i].hsubid, "HSourceBillNo": EndData[i].鍗曟嵁鍙�, "HSourceBillType": EndData[i].HBillType };
- // buttonArr.push(checkrow); //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
- // }
- // table.reload("mainTable", {
- // data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
- // })
- // }
- // else {
- // buttonArr = [];//娓呯┖鏁扮粍
- // for (var i = 0; i < EndData.length; i++) {
- // var checkrow = {
- // "HRepairID": rowdate[i].HRepairID, "HRepairCode": rowdate[i].HRepairCode, "HRepairName": rowdate[i].HRepairName,
- // "HRepairExplanation": rowdate[i].HRepairExplanation, "HManagerID": rowdate[i].HManagerID, "HManagerCode": rowdate[i].HManagerCode,
- // "HManagerName": rowdate[i].HManagerName, "HMoney": rowdate[i].HMoney, "HRemark": rowdate[i].HRemark,
- // "HSourceInterID": EndData[i].hmainid, "HSourceEntryID": EndData[i].hsubid,
- // "HSourceBillNo": EndData[i].鍗曟嵁鍙�, "HSourceBillType": EndData[i].HBillType
- // };
- // buttonArr.push(checkrow); //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
- // }
- // table.reload("mainTable", {
- // data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
- // })
- // }
- // } else {
- // layer.alert(result.code + result.Message, { icon: 5 });
- // }
- // }, error: function () {
- // layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
- // }
- //});
- layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
- }
- , btn2: function (index, layero) {
- //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
- //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
- },
- end: function () {
- },
- success: function (layero, index) {
- //layer.full(index);
- }
- });
+ if ($("#HMainSourceBillType").val() == "璁惧缁翠慨鐧昏鍗�") {
+ //椤甸潰灞�-鑷畾涔�
+ layer.open({
+ type: 2,
+ skin: 'layui-layer-rim', //鍔犱笂杈规
+ title: '璁惧鏁呴殰鐧昏鍗�',
+ shift: 2,
+ area: ['90%', '90%'],
+ content: ['../璁惧绠$悊/Sb_EqpConkBookBillList.html', 'yes'],
+ btn: ['纭畾', '鍙栨秷']
+ , btn1: function (index, layero) {
+ //var NewRow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " " };
+ ////鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+ var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰
+ var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+ if (checkStatus.data.length === 0) {
+ return layer.msg('璇烽�夋嫨鍗曟嵁鏁版嵁');
+ }
+ $("#HMainSourceBillNo").val(checkStatus.data[0].鍗曟嵁鍙�);
+ $("#HMainSourceInterID").val(checkStatus.data[0].hmainid);
+ $("#HMainSourceEntryID").val(checkStatus.data[0].hsubid);
+ //鍥炲~璁惧淇℃伅
+ $("#HEquipName").val(checkStatus.data[0].璁惧鍚嶇О);
+ $("#HEquipID").val(checkStatus.data[0].HEquipID);
+ ////鎸夐�夊崟鍙峰姞杞借〃浣撴暟鎹�
+ //$.ajax({
+ // url: GetWEBURL() + 'Sb_EqpRepairWorkBill/Sb_EqpRepairWorkBillSubByHMainSourceBillNo',
+ // type: "GET",
+ // data: { "HMainSourceBillNo": checkStatus.data[0].鍗曟嵁鍙� },
+ // success: function (result) {
+ // if (result.count == 1) {
+ // var EndData = result.data;
+ // var rowdate = layui.table.cache["mainTable"];
+ // if (rowdate.length == 0) //琛ㄤ綋鏁版嵁涓虹┖鏃�
+ // {
+ // buttonArr = [];//娓呯┖鏁扮粍
+ // for (var i = 0; i < checkStatus.data.length; i++) {
+ // var checkrow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "", "HSourceInterID": EndData[i].hmainid, "HSourceEntryID": EndData[i].hsubid, "HSourceBillNo": EndData[i].鍗曟嵁鍙�, "HSourceBillType": EndData[i].HBillType };
+ // buttonArr.push(checkrow); //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
+ // }
+ // table.reload("mainTable", {
+ // data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+ // })
+ // }
+ // else {
+ // buttonArr = [];//娓呯┖鏁扮粍
+ // for (var i = 0; i < EndData.length; i++) {
+ // var checkrow = {
+ // "HRepairID": rowdate[i].HRepairID, "HRepairCode": rowdate[i].HRepairCode, "HRepairName": rowdate[i].HRepairName,
+ // "HRepairExplanation": rowdate[i].HRepairExplanation, "HManagerID": rowdate[i].HManagerID, "HManagerCode": rowdate[i].HManagerCode,
+ // "HManagerName": rowdate[i].HManagerName, "HMoney": rowdate[i].HMoney, "HRemark": rowdate[i].HRemark,
+ // "HSourceInterID": EndData[i].hmainid, "HSourceEntryID": EndData[i].hsubid,
+ // "HSourceBillNo": EndData[i].鍗曟嵁鍙�, "HSourceBillType": EndData[i].HBillType
+ // };
+ // buttonArr.push(checkrow); //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
+ // }
+ // table.reload("mainTable", {
+ // data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+ // })
+ // }
+ // } else {
+ // layer.alert(result.code + result.Message, { icon: 5 });
+ // }
+ // }, error: function () {
+ // layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ // }
+ //});
+ layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ }
+ , btn2: function (index, layero) {
+ //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
+ //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
+ },
+ end: function () {
+
+ },
+ success: function (layero, index) {
+ //layer.full(index);
+ }
+ });
+ } else if ($("#HMainSourceBillType").val() == "璁惧缁翠慨娲惧伐鍗�") {
+ //椤甸潰灞�-鑷畾涔�
+ layer.open({
+ type: 2,
+ skin: 'layui-layer-rim', //鍔犱笂杈规
+ title: '璁惧缁翠慨娲惧伐鍗�',
+ shift: 2,
+ area: ['90%', '90%'],
+ content: ['../璁惧绠$悊/璁惧缁翠慨娲惧伐鍗�/Sb_EquipRepairSendWorkBillList.html', 'yes'],
+ btn: ['纭畾', '鍙栨秷']
+ , btn1: function (index, layero) {
+ //鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+ var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰
+ var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+ if (checkStatus.data.length !=1 ) {
+ return layer.msg('璇烽�夋嫨涓�鏉″崟鎹暟鎹�');
+ }
+ $("#HMainSourceBillNo").val(checkStatus.data[0].鍗曟嵁鍙�);
+ $("#HMainSourceInterID").val(checkStatus.data[0].hmainid);
+ $("#HMainSourceEntryID").val(checkStatus.data[0].hsubid);
+ //鍥炲~璁惧淇℃伅
+ $("#HEquipName").val(checkStatus.data[0].璁惧);
+ $("#HEquipID").val(checkStatus.data[0].HEquipID);
+
+ layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ }
+ });
+ }
});
//淇濆瓨
@@ -725,7 +772,7 @@
function set_InitGrid() {
//琛ㄥご
columns = [
- { type: 'checkbox', fixed: 'left' }
+ { type: 'checkbox', fixed: 'left', totalRowText: '鍚堣琛�' }
, { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
, { field: 'HRepairID', title: 'HRepairID', edit: 'text', event: "", hide: true }
, { field: 'HRepairCode', title: '缁翠慨椤圭洰浠g爜', edit: 'text', event: "", event: "HRepairCode" }
@@ -746,6 +793,7 @@
, elem: '#mainTable'
, toolbar: '#toolbarDemo'
, page: true
+ , totalRow: true
, cellMinWidth: 120
, height: 300
, cols: [columns]
@@ -759,7 +807,7 @@
function set_InitGrid_pj() {
//琛ㄥご
columns = [
- { type: 'checkbox', fixed: 'left' }
+ { type: 'checkbox', fixed: 'left', totalRowText: '鍚堣琛�' }
, { templet: '#xuhao1', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
, { field: 'HMaterID', title: '閰嶄欢ID', edit: 'text', hide: true }
, { field: 'HMaterNumber', title: '閰嶄欢浠g爜', edit: 'text', event: "HMaterCode" }
@@ -770,7 +818,7 @@
, { field: 'HManagerID', title: '璐熻矗浜篒D', edit: 'text', hide: true }
, { field: 'HManagerNumber', title: '璐熻矗浜轰唬鐮�', edit: 'text', event: 'HManagerNumber' }
, { field: 'HManagerName', title: '璐熻矗浜�', edit: 'text' }
- , { field: 'HQty', title: '鐢ㄩ噺', edit: 'text' }
+ , { field: 'HQty', title: '鐢ㄩ噺', edit: 'text', totalRow: true }
, { field: 'HRemark', title: '澶囨敞', edit: 'text' }
, { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo1', width: 150 }
];
@@ -779,6 +827,7 @@
, elem: '#mainTable1'
, toolbar: '#toolbarDemo1'
, page: true
+ , totalRow: true
, cellMinWidth: 120
, height: 300
, cols: [columns]
@@ -792,8 +841,8 @@
function set_AddFNew() {
//鑾峰彇鏈�澶у崟鎹彿
get_MAXNum();
- option.data = [{ "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": ""/*, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " "*/ }];
- option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HQty": "0", "HRemark": "" }];
+ option.data = [{ "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRepairExplanation": "", "HRemark": ""/*, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " "*/ }];
+ option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": sessionStorage["HEmpID"], "HManagerNumber": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HQty": "0", "HRemark": "" }];
table.render(option);
table.render(option1);
}
--
Gitblit v1.9.1