From 7d5e208f291c57e8d4c49c0c965cc6c736f9b31a Mon Sep 17 00:00:00 2001
From: yuyou_x <2336760928@qq.com>
Date: 星期三, 31 一月 2024 17:31:32 +0800
Subject: [PATCH] Merge branch 'yyk'

---
 HTML/views/SystemSettings/Category.html |  301 ++++++++++++++++----------------------------------
 1 files changed, 97 insertions(+), 204 deletions(-)

diff --git a/HTML/views/SystemSettings/Category.html b/HTML/views/SystemSettings/Category.html
index 017b503..661dc76 100644
--- a/HTML/views/SystemSettings/Category.html
+++ b/HTML/views/SystemSettings/Category.html
@@ -25,54 +25,14 @@
 						<div class="layui-inline">
 							<label class="layui-form-label" style="width: 60px;">绫诲埆鍚嶇О</label>
 							<div class="layui-input-inline">
-								<input type="text" id="DictName" name="DictName" placeholder="璇疯緭鍏ュ姛鑳藉悕绉�" autocomplete="off" class="layui-input">
-							</div>
-						</div>
-						<div class="layui-inline">
-							<label class="layui-form-label" style="width: 70px;">鐖剁骇瀛楀吀鍙�</label>
-							<div class="layui-input-inline">
-								<select name="ParentNo" id="ParentNo" lay-verify="" lay-search="">
-									<option value=""></option>
-								</select>
+								<input type="text" id="CategoryName" name="CategoryName" placeholder="璇疯緭鍏ョ被鍒悕绉�" autocomplete="off" class="layui-input">
 							</div>
 						</div>
 						<div class="layui-inline">
 							<label class="layui-form-label" style="width: 45px;">鍖哄煙</label>
 							<div class="layui-input-inline">
-								<select name="Level" id="Level" lay-verify="" lay-search>
+								<select name="AreaNo" id="AreaNo" lay-verify="" lay-search>
 									<option value=""></option>
-									<option value="0">鏍圭洰褰�</option>
-									<option value="1">涓嬬骇鐩綍</option>
-								</select>
-							</div>
-						</div>
-						<!-- <div class="layui-inline">
-							<label class="layui-form-label" style="width: 60px;">鏄惁鍏紑</label>
-							<div class="layui-input-inline">
-								<select name="IsPublic" id="IsPublic" lay-verify="" lay-search>
-									<option value=""></option>
-									<option value="0">鍏紑</option>
-									<option value="1">涓嶅叕寮�</option>
-								</select>
-							</div>
-						</div> -->
-						<div class="layui-inline">
-							<label class="layui-form-label" style="width: 60px;">鍏佽缂栬緫</label>
-							<div class="layui-input-inline">
-								<select name="IsEdit" id="IsEdit" lay-verify="" lay-search>
-									<option value=""></option>
-									<option value="0">鍏佽</option>
-									<option value="1">涓嶅厑璁�</option>
-								</select>
-							</div>
-						</div>
-						<div class="layui-inline">
-							<label class="layui-form-label" style="width: 60px;">鍏佽澧炲姞</label>
-							<div class="layui-input-inline">
-								<select name="IsAdd" id="IsAdd" lay-verify="" lay-search>
-									<option value=""></option>
-									<option value="0">鍏佽</option>
-									<option value="1">涓嶅厑璁�</option>
 								</select>
 							</div>
 						</div>
@@ -90,49 +50,12 @@
 				</div>
 				<div class="layui-card-body">
 					<table id="LAY-app-content-list" lay-filter="LAY-app-content-list"></table>
-					<!-- 鏄惁鍏紑 -->
-                    <script type="text/html" id="buttonIsPublic">
-						{{# if(d.IsPublic=='0'){ }}
-							<button class="layui-btn layui-btn-radius layui-btn-xs">鍏紑</button>
-						{{# } else if(d.IsPublic=='1') { }}
-							<button class="layui-btn layui-btn-radius layui-btn-danger layui-btn-xs">涓嶅叕寮�</button>
-						{{# }  }}
-					</script>
-					
-                    <!-- 灞傜骇 -->
-                    <script type="text/html" id="buttonLevel">
-						{{# if(d.Level=='0'){ }}
-							<button class="layui-btn layui-btn-radius layui-btn-xs">鏍圭洰褰�</button>
-						{{# } else if(d.Level=='1') { }}
-							<button class="layui-btn layui-btn-radius layui-btn-danger layui-btn-xs">涓嬬骇鐩綍</button>
-						{{# }  }}
-					</script>
-                    
-                    <!-- 鍏佽缂栬緫 -->
-                    <script type="text/html" id="buttonIsEdit">
-                        {{# if(d.IsEdit=='0'){ }}
-                            <p>鍏佽</p>
-						{{# } else if(d.IsEdit=='1') { }}
-							<p>涓嶅厑璁�</p>
-						{{# }  }}
-                    </script>
 
-                    <!-- 鍏佽娣诲姞 -->
-                    <script type="text/html" id="buttonIsAdd">
-                        {{# if(d.IsAdd=='0'){ }}
-                            <p>鍏佽</p>
-						{{# } else if(d.IsAdd=='1') { }}
-							<p>涓嶅厑璁�</p>
-						{{# }  }}
-                    </script>
 					<!-- 鎿嶄綔 -->
 					<script type="text/html" id="table-content-list">
-						{{# if(d.IsEdit=='0'){ }}
-							<a class="layui-btn layui-btn-normal layui-btn-xs approvalBtnupt" lay-event="edit">
-								<i class="layui-icon layui-icon-edit"></i>缂栬緫
-							</a>
-						{{# } else if(d.IsEdit=='1') }}
-                       
+						<a class="layui-btn layui-btn-normal layui-btn-xs approvalBtnupt" lay-event="edit">
+							<i class="layui-icon layui-icon-edit"></i>缂栬緫
+						</a>
                         <a class="layui-btn layui-btn-danger layui-btn-xs approvalBtndel" lay-event="del">
 							<i class="layui-icon layui-icon-delete"></i>鍒犻櫎
 						</a>
@@ -157,35 +80,30 @@
 
 				var tableIns;
 
-				//鑾峰彇鐖剁骇瀛楀吀鍙�
-				sendData(IP + "/sys/GetDicParentListByLevel",{},'get',function(res){
+				//鑾峰彇鍖哄煙淇℃伅
+				sendData(IP + "/sys/GetStorageAreaList",{},'get',function(res){
+                    console.log(res)
 					if (res.code == 0) //鎴愬姛
 					{
-						parentnohtml = '<option value =""></option>';
+						Areahtml = '<option value =""></option>';
 						for (var i = 0; i < res.data.length; i++) {
-							//鍒ゆ柇灞傜骇涓嶆槸鎸夐挳
-							if (res.data[i].Level == '0')
-							{
-								//鏍圭洰褰�
-								parentnohtml = parentnohtml + '<option value =' + res.data[i].DictNo + '>' + res.data[i].DictName + '</option>'
-							} 
+                            //鏍圭洰褰�
+                            Areahtml = Areahtml + '<option value =' + res.data[i].AreaNo + '>' + res.data[i].AreaName + '</option>'
 						}
-						$("#ParentNo").append(parentnohtml);
+						$("#AreaNo").append(Areahtml);
 						form.render('select');
 					}
 				})
 
-				function refreshTable(DictName,DictNo,Level,IsEdit,IsAdd) {
+				function refreshTable(CategoryName,AreaNo) {
 					var param = {
-						DictName: DictName,
-						DictNo: DictNo,
-						Level: Level,
-						IsEdit: IsEdit,
-						IsAdd: IsAdd
+						CategoryName: CategoryName,
+						AreaNo: AreaNo,
 					};
+					console.log(param)
 
-					sendData(IP + "/Sys/GetDicList?DictName="+DictName+"&&DictNo="+DictNo+"&&Level="+Level+"&&IsEdit="+IsEdit+"&&IsAdd="+IsAdd, {}, 'get', function(res) {
-						if (res.code == 0) { //鎴愬姛
+					sendData(IP + "/Sys/GetMaterialCategories", param, 'get', function(res) {
+						if (res.code == 1) { //鎴愬姛
 							var list = res.data;
 							$.extend(infoOptions, {
 								data: list
@@ -197,7 +115,7 @@
 						}
 						else //涓嶆垚鍔�
 						{
-							layer.msg('鑾峰彇瀛楀吀鍒楄〃淇℃伅澶辫触锛�', {
+							layer.msg(res.msg, {
 								icon: 2,
 								time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
 							}, function() {});
@@ -216,17 +134,18 @@
 					});
 					if (res.code == 0) { //鎴愬姛
 						for (var k = 0; k < res.data.length; k++) {
-							if (res.data[k].MenuName == "娣诲姞瀛楀吀") {
+							if (res.data[k].MenuName == "鏂板绫诲埆") {
 								$(function() {
 									$("#approvalBtn").show();
 								});
 							}
-							if (res.data[k].MenuName == "鍒犻櫎瀛楀吀") {
+							if (res.data[k].MenuName == "鍒犻櫎绫诲埆") {
 								$(function() {
 									$(".approvalBtndel").show();
 								});
 							}
-							if (res.data[k].MenuName == "缂栬緫瀛楀吀") {
+							if (res.data[k].MenuName == "缂栬緫绫诲埆") {
+								console.log(1)
 								$(function() {
 									$(".approvalBtnupt").show();
 								});
@@ -258,37 +177,37 @@
 							title: '搴忓彿', type: 'numbers', fixed: 'left', width:65
 						}, 
 						{
-							field: 'DictNo', title: '瀛楀吀缂栧彿', align: 'center', fixed: 'left'
+							field: 'CategoryNo', title: '绫诲埆缂栧彿', align: 'center', fixed: 'left',width:100
 						}, 
 						{
-							field: 'DictName', title: '瀛楀吀鍚嶇О', align: 'center'
+							field: 'CategoryName', title: '绫诲埆鍚嶇О', align: 'center',width:100
 						}, 
 						{
-							field: 'ParentNo', title: '鐖剁骇瀛楀吀鍙�', align: 'center'
+							field: 'AreaName', title: '缁戝畾鍖哄煙', align: 'center'
 						}, 
+                        // {
+						// 	field: 'WareHouseName', title: '鎵�灞炰粨搴�', align: 'center'
+						// },
 						{
-							field: 'Ord', title: '鏄剧ず椤哄簭', align: 'center'
+							field: 'Demo', title: '澶囨敞', align: 'center'
 						},
 						{
-							field: 'Level', title: '灞傜骇', align: 'center', templet: '#buttonLevel'
-						},
-						{
-							field: 'IsPublic', templet: '#buttonIsPublic', title: '鏄惁鍏紑', align: 'center'
-						},
-						{
-							field: 'IsEdit', title: '鍏佽缂栬緫', align: 'center',  templet: '#buttonIsEdit'
-						},
-						{
-							field: 'IsAdd', title: '鍏佽澧炲姞', align: 'center', templet: '#buttonIsAdd'
-						},
-						{
-							field: 'CreateName', title: '鍒涘缓浜�', align: 'center'
+							field: 'CreateName', title: '鍒涘缓浜�', align: 'center',width:100
 						},
 						{
 							field: 'CreateTime', title: '鍒涘缓鏃ユ湡', align: 'center',
 							templet: function (d) {
 								return formatDate(d.CreateTime);
-							}
+							},width:165
+						},
+                        {
+							field: 'UpdateName', title: '鏇存敼浜�', align: 'center',width:100
+						},
+						{
+							field: 'UpdateTime', title: '鏇存敼鏃ユ湡', align: 'center',
+							templet: function (d) {
+								return formatDate(d.UpdateTime);
+							},width:165
 						},
 						{
 							title: '鎿嶄綔', fixed: 'right', align: 'center', width: 200 , toolbar: '#table-content-list'
@@ -298,13 +217,10 @@
 
 				//鐩戝惉鎼滅储
 				form.on('submit(LAY-app-contlist-search)', function(data) {
-					console.log(data)
-					var DictName = data.field.DictName;
-					var DictNo = data.field.ParentNo;
-					var Level = data.field.Level;
-					var IsEdit = data.field.IsEdit;
-					var IsAdd = data.field.IsAdd;
-					refreshTable(DictName,DictNo,Level,IsEdit,IsAdd);
+					console.log(data.field)
+					var CategoryName = data.field.CategoryName;
+					var AreaNo = data.field.AreaNo;
+					refreshTable(CategoryName,AreaNo);
 				});
 				var doing = true;
 				var $ = layui.$,
@@ -313,8 +229,8 @@
 						add: function() {
 							layer.open({
 								type: 2,
-								title: '娣诲姞瀛楀吀淇℃伅',
-								content: 'DictionaryForm.html',
+								title: '娣诲姞绫诲埆淇℃伅',
+								content: 'CategoryForm.html',
 								maxmin: true,
 								area: ['530px', '530px'],
 								btn: ['纭畾', '鍙栨秷'],
@@ -327,58 +243,35 @@
 										var field = data.field; //鑾峰彇鎻愪氦鐨勫瓧娈�
 										//鎻愪氦 Ajax 鎴愬姛鍚庯紝闈欐�佹洿鏂拌〃鏍间腑鐨勬暟鎹�
 										var param = {
-                                            DictNo: field.DictNo, //瀛楀吀缂栧彿
-                                            DictName: field.DictName, //瀛楀吀鍚嶇О
-                                            ParentNo: field.ParentNo, //鐖剁骇瀛楀吀鍙�
-                                            Ord: field.Ord, //鏄剧ず椤哄簭
-                                            Level: field.Level, //灞傜骇
-                                            IsPublic: field.IsPublic, //鏄惁鍏紑
-                                            IsEdit: field.IsEdit, //鍏佽缂栬緫
-											IsAdd: field.IsAdd //鍏佽娣诲姞
+                                            CategoryNo: field.CategoryNo, //鍖哄煙缂栧彿
+                                            CategoryName: field.CategoryName, //绫诲埆鍚嶇О
+                                            AreaNo: field.select, //鍖哄煙缂栫爜
+                                            Demo: field.Demo, //澶囨敞
 										};
-										if(field.Level == '1')
-										{
-											if(field.ParentNo == '')
-											{
-												layer.msg("褰撳眰绾т负瀛愮骇鏃讹紝鐖剁骇鐩綍涓嶅彲涓虹┖锛�", {
-													icon: 2,
-													time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-												}, function() {doing = true;});
-											}
-											else
-											{
-												console.log(11)
-												if(doing){
-													doing = false;
-													sendData(IP + "/sys/AddDic", param, 'post',function(res) {
-														console.log(res);
-														if (res.code == 0) { //鎴愬姛
-															layer.msg(res.msg, {
-																icon: 1,
-																time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-															}, function() {
-																layer.close(index); //鍏抽棴寮瑰眰
-																refreshTable($("#DictName").val(),$("#ParentNo").val(),$("#Level").val(), $("#IsEdit").val(), $("#IsAdd").val());
-																doing = true;
-															});
-														}
-														else
-														{ //涓嶆垚鍔�
-															layer.msg(res.msg, {
-																icon: 2,
-																time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
-															}, function() {doing = true;});
-														}
-													});
-												}
-												else
-												{
-													console.log(123);
-												}
-											}
-										}
-										
-									});
+                                        if(doing){
+                                            doing = false;
+                                            sendData(IP + "/sys/InsertMaterialCategories", param, 'post',function(res) {
+                                                console.log(res);
+                                                if (res.code == 1) { //鎴愬姛
+                                                    layer.msg(res.msg, {
+                                                        icon: 1,
+                                                        time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                                                    }, function() {
+                                                        layer.close(index); //鍏抽棴寮瑰眰
+                                                        refreshTable($("#CategoryName").val(),$("#AreaNo").val());
+                                                        doing = true;
+                                                    });
+                                                }
+                                                else
+                                                { //涓嶆垚鍔�
+                                                    layer.msg(res.msg, {
+                                                        icon: 2,
+                                                        time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+                                                    }, function() {doing = true;});
+                                                }
+                                            });
+                                        }
+                                    });
 									submit.trigger('click');
 								}
 							});
@@ -421,32 +314,36 @@
 					}
 				}
 				var uid = $.cookie('userId');
-				refreshTable("","","","","");
+				refreshTable("","");
 				table.on('tool(LAY-app-content-list)', function(obj) {
 					var data = obj.data;
+					// console.log(obj.data)
 					//鍒犻櫎
 					if (obj.event === 'del')
 					{
-						layer.confirm('纭畾鍒犻櫎閫変腑鐨勫瓧鍏革紵', function(index) {
-							// console.log(data);
+						layer.confirm('纭畾鍒犻櫎閫変腑鐨勭被鍒紵', function(index) {
+							
 							cusid = data.Id;
+							console.log(cusid);
 							var arr = [];
-							arr.push(cusid); //灞炴��
+							
 							var param = {
-								Ids: arr
+								Id: cusid
 							};
+							console.log(param);
+							// arr.push(param);
 							if(doing)
 							{
 								doing = false;
-								sendData(IP + "/sys/DelDic?Id="+data.Id+"", {} , 'get', function(res) {
+								sendData(IP + "/sys/DeleteMaterialCategories", param , 'post', function(res) {
 									console.log(res);
-									if (res.code == 0)
+									if (res.code == 1)
 									{ //鎴愬姛
 										layer.msg(res.msg, {
 											icon: 1,
 											time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
 										}, function() {
-											refreshTable($("#DictName").val(),$("#ParentNo").val(),$("#Level").val(), $("#IsEdit").val(), $("#IsAdd").val());
+											refreshTable($("#CategoryName").val(),$("#AreaNo").val());
 											//table.reload('LAY-app-content-list'); //鏁版嵁鍒锋柊
 											doing = true;
 										});
@@ -473,10 +370,10 @@
 						cusId = data.Id;
 						layer.open({
 							type: 2,
-							title: '缂栬緫瀛楀吀淇℃伅',
-							content: 'DictionaryForm.html?id=' + cusId,
+							title: '缂栬緫绫诲埆淇℃伅',
+							content: 'CategoryForm.html?id=' + cusId,
 							maxmin: true,
-							area: ['500px', '450px'],
+							area: ['530px', '530px'],
 							btn: ['纭畾', '鍙栨秷'],
 							yes: function(index, layero) {
 								var iframeWindow = window['layui-layer-iframe' + index],
@@ -488,28 +385,24 @@
 									//鎻愪氦 Ajax 鎴愬姛鍚庯紝闈欐�佹洿鏂拌〃鏍间腑鐨勬暟鎹�
 									var param = {
 										Id: cusId,
-										DictNo: field.DictNo,
-										DictName: field.DictName,
-										ParentNo: field.ParentNo,
-										Ord: field.Ord,
-										Level: field.Level,
-										IsPublic: field.IsPublic,
-										IsEdit: field.IsEdit,
-										IsAdd: field.IsAdd
+										CategoryNo: field.CategoryNo, //鍖哄煙缂栧彿
+                                        CategoryName: field.CategoryName, //绫诲埆鍚嶇О
+                                        AreaNo: field.select, //鍖哄煙缂栫爜
+                                        Demo: field.Demo, //澶囨敞
 									};
 									if(doing)
 									{
 										doing = false;
-										sendData(IP + "/sys/ExitDic", param, 'post',
+										sendData(IP + "/sys/ExitMaterialCategories", param, 'post',
 										function(res) {
-											if (res.code == 0)
+											if (res.code == 1)
 											{ //鎴愬姛
 												layer.msg("淇敼鎴愬姛", {
 													icon: 1,
 													time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
 												}, function() {
 													layer.close(index); //鍏抽棴寮瑰眰
-													refreshTable($("#DictName").val(),$("#ParentNo").val(),$("#Level").val(), $("#IsEdit").val(), $("#IsAdd").val());
+													refreshTable($("#CategoryName").val(),$("#AreaNo").val());
 													//table.reload('LAY-app-content-list'); //鏁版嵁鍒锋柊
 													doing = true;
 												});

--
Gitblit v1.8.0