From bedcac106c96cec26cd1f30b2c4e8f6fa6338b3b Mon Sep 17 00:00:00 2001
From: tom <tom.he@highdatas.com>
Date: 星期日, 04 八月 2024 16:38:22 +0800
Subject: [PATCH] 新增评估/遴选条件

---
 module/config/page/criteria_rule_selection.html  |  330 ++++++++++++++++++++++++++++++
 module/config/page/criteria_rule_evaluation.html |  330 ++++++++++++++++++++++++++++++
 2 files changed, 660 insertions(+), 0 deletions(-)

diff --git a/module/config/page/criteria_rule_evaluation.html b/module/config/page/criteria_rule_evaluation.html
new file mode 100644
index 0000000..0f1b7fa
--- /dev/null
+++ b/module/config/page/criteria_rule_evaluation.html
@@ -0,0 +1,330 @@
+<!doctype html>
+<html>
+	<head>
+		<meta charset="utf-8"><meta http-equiv="Expires" content="0"><meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-control" content="no-cache"><meta http-equiv="Cache" content="no-cache">
+		<title>浜у搧鍒楄〃</title>
+		
+		<script type="text/javascript">
+			var pageVue = null;
+			function loadJsCss(callback) {
+				var jscss_urls = [];
+				window.top.initJsCss(document, jscss_urls, callback);
+			};
+			
+			function initVue() {
+				new ListVue({
+					el: "#vbody",
+					data: {
+						dataname: "md_org_account_criteria_rule",
+						title: "璇勪及琛�",
+						
+						filterfieldClick: {},
+						tablefieldClick: {},
+						formfieldClick: {},
+						tablebuttonclick: [],
+						cbuttons_r: {},
+						filterObj: {
+							
+						},
+						filterObjBydefault: {
+							type_code: "Evaluation"
+						},
+					},
+					created() {
+						
+					},
+					
+					mounted() {
+						var me = this;
+						if (window.top.tab.selected.option.page_id) {
+							// this.page_id = window.top.tab.selected.option.page_id;
+							getPageByPageId(window.top.tab.selected.option.page_id, function(result){
+								me.cbuttons_r = result.buttons_r;
+								
+								//鑾峰彇鏁版嵁
+								me.initData();
+								me.$nextTick(() => { // 浠ユ湇鍔$殑鏂瑰紡璋冪敤鐨� Loading 闇�瑕佸紓姝ュ叧闂�
+									hideLoading();
+								});
+							})
+						}
+					},
+					
+					methods:{
+						initData() {
+							var me = this;
+							this.onQuery(function(result, callback) {//鏌ヨ鍚庣殑鍥炶皟锛岀敤浜庤幏鍙栧瓧娈电殑
+								me.filterObjBydefault = {}
+								if (result.meta && result.meta[me.dataname] && result.meta[me.dataname].fields) {
+									var metas = clone(result.meta[me.dataname].fields);
+									var filterFields_ = [];
+									var tableFields_ = [];
+									
+									metas.map(f=>{
+										f.isshow = "T";
+										if (f.field == 'group_name' || f.field == 'group_batch_name' || f.field == 'content_before' ) {
+											f.isfilter = true
+											filterFields_.push(clone(f));
+
+										}
+										
+										// if (f.isfilter) {
+										// 	filterFields_.push(clone(f));
+										// }
+										else {
+											var filter_f = clone(f);
+											filter_f.isshow = "F";
+											filterFields_.push(filter_f);
+										}
+										
+										tableFields_.push(clone(f));
+									})
+									if (!me.filterFields || (me.filterFields && me.filterFields.length == 0)) {
+										me.filterFields = clone(filterFields_);
+										me.tableFields = clone(tableFields_);
+										
+										//瀛楁鏁扮粍杞瓧娈祇bj锛岀洰鐨勪负浜嗙瓫閫夋椂鑾峰彇瀛楁灞炴��
+										me.fieldsToFieldsObj();
+										
+										//璁剧疆瀛楁浜嬩欢
+										me.tableFieldClick();
+									}
+									me.tableButtonClick();
+								}
+								
+								if (callback) {
+									callback();
+								}
+							});
+						},
+						
+						tableButtonClick() {
+                            var me = this;
+                            var tablebuttonClick = [];
+                            tablebuttonClick = [
+								{
+									isbuttonshow: true,type:"primary",
+									code: "add",isselected: false,classname: "",
+									onclick: function(obj) {
+										// me.onEditData('add', {})
+									}
+								},
+								{
+									isbuttonshow: true,type:"primary",
+									code: "edit", isselected: true, classname:"",
+									disabled: function(selectRowList) {
+                                        var bo_ = true ;
+                                        if (selectRowList[0]) {
+                                            bo_ = false
+                                        }
+                                        return bo_; 
+                                    },
+									onclick: function(obj) {
+										// me.onEditData('edit', obj.selectedList[0]);
+									}
+								},
+							]
+							this.tablebuttonclick = tablebuttonClick;
+						},
+						
+						tableFieldClick() {
+							
+						},
+						
+						onSaveBUProduct(list) {
+							var me = this;
+							if (list.length) {
+								var row = list[0];
+								var param = {
+									dataname: "md_bu_product",
+									data: {},
+								}
+								param.data["md_bu_product"] = row;
+								Server.call("root/data/saveEntity", param, function(result) {
+									console.log(result);
+									if (result.success) {
+										list.remove(row);
+										me.onSaveBUProduct(list);
+									}
+								});
+							}
+							else {
+								me.initData();
+							}
+							
+						},
+						
+						onAllocation(bu_, callback) {
+							var me = this;
+							var config = {
+								totab: false, //true: 浠ab瀵艰埅鐨勬柟寮忔墦寮�
+								width: "400px",
+								height: "400px",
+								icon: "icon-product",
+								text: "浜у搧鍒嗛厤",
+								url: "module/tool/page/popup_allocation.html",
+								data: bu_,
+								delta: {},
+								sceneCode: "add", //"add"//"browse",
+								callback: function(popupobj, popupcallback) {
+									callback(popupobj.row);
+									if (popupcallback) {
+										popupcallback();
+									}
+								}
+							};
+							me.doPopupByPublic(config);
+						},
+						
+						onEditData(sceneCode, row) {
+							var me = this;
+							if (sceneCode == "edit" && !row.id) {
+								Root.message({
+									type: 'warning',
+									message: '璇烽�夋嫨瑕佺紪杈戠殑鏁版嵁'
+								});  
+								return;
+							}
+								
+							//3. popup
+							var config = {
+								totab: false, //true: 浠ab瀵艰埅鐨勬柟寮忔墦寮�
+								width: "500px",
+								height: "290px",
+								icon: "icon-product",
+								text: "浜у搧缂栬緫",
+								id: "product_edit" + row.id,//totab: true鏃堕渶璁剧疆锛岀敤浜庡垽鏂槸鍚﹀凡鎵撳紑姝ら〉闈�
+								url: "module/md/page/product/page/product_edit.html",
+								data: row,
+								delta: null,
+								sceneCode: sceneCode,//"refuseedit",//"approval", //"add"//"browse",
+								callback: function(obj, callback) {
+									me.onQuery();
+									if (callback) {
+										callback();
+									}
+								}
+							};
+							me.doPopupByPublic(config);
+						},
+						
+						onSaveData(type, row) {
+							var me = this;
+							var param = {
+								dataname: me.dataname,
+								data: {},
+							}
+							param.data[me.dataname] = row;
+							Server.call("root/data/saveEntity", param, function(result) {
+								console.log(result);
+								if (result.success) {
+									var message = "宸茬敓鏁�"
+									if (type == "repeal") {
+										message = "宸蹭綔搴�"
+									}
+									Root.message({
+										type: 'success',
+										message: message
+									}); 
+									
+									me.onQuery();
+								}
+							});
+						},
+						
+						onDeleteData(row) {
+							let me = this;
+							if (!row.id) {
+								Root.message({
+									type: 'warning',
+									message: '璇峰厛閫夋嫨瑕佸垹闄ょ殑鏁版嵁'
+								});  
+								return
+							}
+							
+							Root.confirm('纭畾鍒犻櫎' + row.name + '鍚楋紵', '鍒犻櫎鎻愮ず', {
+							  confirmButtonText: '鍒犻櫎',
+							  cancelButtonText: '鍙栨秷',
+							  type: 'warning'
+							}).then(() => {
+								let param = {
+									id: row.id,
+									dataname: me.dataname,
+								}
+								Server.call("root/data/deleteEntity", param, function(result) {
+									Root.message({
+										type: 'success',
+										message: '鍒犻櫎鎴愬姛!'
+									});
+									me.onQuery();
+								});
+							}).catch(() => {
+								Root.message({
+									type: 'info',
+									message: '宸插彇娑堝垹闄�'
+								});          
+							});
+						},
+						
+					}
+				});
+			};
+			
+			loadJsCss(function () {
+				initVue();
+			});
+		</script>
+		<style>
+			/* 鍦╲ue.js涓� v-cloak 杩欎釜鎸囦护鏄槻姝㈤〉闈㈠姞杞芥椂鍑虹幇 vuejs 鐨勫彉閲忓悕鑰岃璁$殑 */
+			[v-cloak] {
+				display: none !important;
+			}
+		</style>
+		
+	</head>
+	
+	<body style="margin: 0px; ">
+		<div v-cloak id="vbody">
+			<div id="page_root">
+				<div class="topbar">
+					<span>{{title}}</span>
+					<div :class="page_title == 'right' ? 'h_page_button_left' : 'h_page_button_right'">
+						<!-- <el-button-group style="margin-left: 3px;">
+						</el-button-group> -->
+					</div>
+				</div>
+				<div class="h_dialog__body">
+					<h-table
+						v-if="isRefresh && tableFields.length"
+						ref="table1"
+						:table-fields="tableFields"
+						:table-data="tableData" 
+						:is-edit-table-data="isEditTableData"
+						:pagesize="pagesize"
+						:pagenum="pagenum"
+						:total="total"
+						:table-height="tableHeight"
+						:table-field-click="tablefieldClick"
+						:table-buttons-click="tablebuttonclick"
+						:tableloading="tableloading"
+						:isdraggableorder="false"
+						:is-highlight-row="true"
+						:filtersobj="filterObj"
+						
+						v-on:get-data="getData"
+						v-on:row-click="rowClick"
+					>
+					</h-table>
+				</div>
+			</div>
+		</div>
+		
+		<div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 50vh;">
+			<div class="spinner">
+			  <div class="cube1"></div>
+			  <div class="cube2"></div>
+			</div>
+		</div>
+		
+	</body>
+</html>
diff --git a/module/config/page/criteria_rule_selection.html b/module/config/page/criteria_rule_selection.html
new file mode 100644
index 0000000..9708204
--- /dev/null
+++ b/module/config/page/criteria_rule_selection.html
@@ -0,0 +1,330 @@
+<!doctype html>
+<html>
+	<head>
+		<meta charset="utf-8"><meta http-equiv="Expires" content="0"><meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-control" content="no-cache"><meta http-equiv="Cache" content="no-cache">
+		<title>閬撮�夋潯浠�</title>
+		
+		<script type="text/javascript">
+			var pageVue = null;
+			function loadJsCss(callback) {
+				var jscss_urls = [];
+				window.top.initJsCss(document, jscss_urls, callback);
+			};
+			
+			function initVue() {
+				new ListVue({
+					el: "#vbody",
+					data: {
+						dataname: "md_org_account_criteria_rule",
+						title: "閬撮�夋潯浠�",
+						
+						filterfieldClick: {},
+						tablefieldClick: {},
+						formfieldClick: {},
+						tablebuttonclick: [],
+						cbuttons_r: {},
+						filterObj: {
+							
+						},
+						filterObjBydefault: {
+							type_code: "Selection"
+						},
+					},
+					created() {
+						
+					},
+					
+					mounted() {
+						var me = this;
+						if (window.top.tab.selected.option.page_id) {
+							// this.page_id = window.top.tab.selected.option.page_id;
+							getPageByPageId(window.top.tab.selected.option.page_id, function(result){
+								me.cbuttons_r = result.buttons_r;
+								
+								//鑾峰彇鏁版嵁
+								me.initData();
+								me.$nextTick(() => { // 浠ユ湇鍔$殑鏂瑰紡璋冪敤鐨� Loading 闇�瑕佸紓姝ュ叧闂�
+									hideLoading();
+								});
+							})
+						}
+					},
+					
+					methods:{
+						initData() {
+							var me = this;
+							this.onQuery(function(result, callback) {//鏌ヨ鍚庣殑鍥炶皟锛岀敤浜庤幏鍙栧瓧娈电殑
+								me.filterObjBydefault = {}
+								if (result.meta && result.meta[me.dataname] && result.meta[me.dataname].fields) {
+									var metas = clone(result.meta[me.dataname].fields);
+									var filterFields_ = [];
+									var tableFields_ = [];
+									
+									metas.map(f=>{
+										f.isshow = "T";
+										if (f.field == 'group_name' || f.field == 'group_batch_name' || f.field == 'content_before' ) {
+											f.isfilter = true
+											filterFields_.push(clone(f));
+
+										}
+										
+										// if (f.isfilter) {
+										// 	filterFields_.push(clone(f));
+										// }
+										else {
+											var filter_f = clone(f);
+											filter_f.isshow = "F";
+											filterFields_.push(filter_f);
+										}
+										
+										tableFields_.push(clone(f));
+									})
+									if (!me.filterFields || (me.filterFields && me.filterFields.length == 0)) {
+										me.filterFields = clone(filterFields_);
+										me.tableFields = clone(tableFields_);
+										
+										//瀛楁鏁扮粍杞瓧娈祇bj锛岀洰鐨勪负浜嗙瓫閫夋椂鑾峰彇瀛楁灞炴��
+										me.fieldsToFieldsObj();
+										
+										//璁剧疆瀛楁浜嬩欢
+										me.tableFieldClick();
+									}
+									me.tableButtonClick();
+								}
+								
+								if (callback) {
+									callback();
+								}
+							});
+						},
+						
+						tableButtonClick() {
+                            var me = this;
+                            var tablebuttonClick = [];
+                            tablebuttonClick = [
+								{
+									isbuttonshow: me.cbuttons_r.add,type:"primary",
+									code: "add",isselected: false,classname: "",
+									onclick: function(obj) {
+										me.onEditData('add', {})
+									}
+								},
+								{
+									isbuttonshow: me.cbuttons_r.edit,type:"primary",
+									code: "edit", isselected: true, classname:"",
+									disabled: function(selectRowList) {
+                                        var bo_ = true ;
+                                        if (selectRowList[0]) {
+                                            bo_ = false
+                                        }
+                                        return bo_; 
+                                    },
+									onclick: function(obj) {
+										me.onEditData('edit', obj.selectedList[0]);
+									}
+								},
+							]
+							this.tablebuttonclick = tablebuttonClick;
+						},
+						
+						tableFieldClick() {
+							
+						},
+						
+						onSaveBUProduct(list) {
+							var me = this;
+							if (list.length) {
+								var row = list[0];
+								var param = {
+									dataname: "md_bu_product",
+									data: {},
+								}
+								param.data["md_bu_product"] = row;
+								Server.call("root/data/saveEntity", param, function(result) {
+									console.log(result);
+									if (result.success) {
+										list.remove(row);
+										me.onSaveBUProduct(list);
+									}
+								});
+							}
+							else {
+								me.initData();
+							}
+							
+						},
+						
+						onAllocation(bu_, callback) {
+							var me = this;
+							var config = {
+								totab: false, //true: 浠ab瀵艰埅鐨勬柟寮忔墦寮�
+								width: "400px",
+								height: "400px",
+								icon: "icon-product",
+								text: "浜у搧鍒嗛厤",
+								url: "module/tool/page/popup_allocation.html",
+								data: bu_,
+								delta: {},
+								sceneCode: "add", //"add"//"browse",
+								callback: function(popupobj, popupcallback) {
+									callback(popupobj.row);
+									if (popupcallback) {
+										popupcallback();
+									}
+								}
+							};
+							me.doPopupByPublic(config);
+						},
+						
+						onEditData(sceneCode, row) {
+							var me = this;
+							if (sceneCode == "edit" && !row.id) {
+								Root.message({
+									type: 'warning',
+									message: '璇烽�夋嫨瑕佺紪杈戠殑鏁版嵁'
+								});  
+								return;
+							}
+								
+							//3. popup
+							var config = {
+								totab: false, //true: 浠ab瀵艰埅鐨勬柟寮忔墦寮�
+								width: "500px",
+								height: "290px",
+								icon: "icon-product",
+								text: "浜у搧缂栬緫",
+								id: "product_edit" + row.id,//totab: true鏃堕渶璁剧疆锛岀敤浜庡垽鏂槸鍚﹀凡鎵撳紑姝ら〉闈�
+								url: "module/md/page/product/page/product_edit.html",
+								data: row,
+								delta: null,
+								sceneCode: sceneCode,//"refuseedit",//"approval", //"add"//"browse",
+								callback: function(obj, callback) {
+									me.onQuery();
+									if (callback) {
+										callback();
+									}
+								}
+							};
+							me.doPopupByPublic(config);
+						},
+						
+						onSaveData(type, row) {
+							var me = this;
+							var param = {
+								dataname: me.dataname,
+								data: {},
+							}
+							param.data[me.dataname] = row;
+							Server.call("root/data/saveEntity", param, function(result) {
+								console.log(result);
+								if (result.success) {
+									var message = "宸茬敓鏁�"
+									if (type == "repeal") {
+										message = "宸蹭綔搴�"
+									}
+									Root.message({
+										type: 'success',
+										message: message
+									}); 
+									
+									me.onQuery();
+								}
+							});
+						},
+						
+						onDeleteData(row) {
+							let me = this;
+							if (!row.id) {
+								Root.message({
+									type: 'warning',
+									message: '璇峰厛閫夋嫨瑕佸垹闄ょ殑鏁版嵁'
+								});  
+								return
+							}
+							
+							Root.confirm('纭畾鍒犻櫎' + row.name + '鍚楋紵', '鍒犻櫎鎻愮ず', {
+							  confirmButtonText: '鍒犻櫎',
+							  cancelButtonText: '鍙栨秷',
+							  type: 'warning'
+							}).then(() => {
+								let param = {
+									id: row.id,
+									dataname: me.dataname,
+								}
+								Server.call("root/data/deleteEntity", param, function(result) {
+									Root.message({
+										type: 'success',
+										message: '鍒犻櫎鎴愬姛!'
+									});
+									me.onQuery();
+								});
+							}).catch(() => {
+								Root.message({
+									type: 'info',
+									message: '宸插彇娑堝垹闄�'
+								});          
+							});
+						},
+						
+					}
+				});
+			};
+			
+			loadJsCss(function () {
+				initVue();
+			});
+		</script>
+		<style>
+			/* 鍦╲ue.js涓� v-cloak 杩欎釜鎸囦护鏄槻姝㈤〉闈㈠姞杞芥椂鍑虹幇 vuejs 鐨勫彉閲忓悕鑰岃璁$殑 */
+			[v-cloak] {
+				display: none !important;
+			}
+		</style>
+		
+	</head>
+	
+	<body style="margin: 0px; ">
+		<div v-cloak id="vbody">
+			<div id="page_root">
+				<div class="topbar">
+					<span>{{title}}</span>
+					<div :class="page_title == 'right' ? 'h_page_button_left' : 'h_page_button_right'">
+						<!-- <el-button-group style="margin-left: 3px;">
+						</el-button-group> -->
+					</div>
+				</div>
+				<div class="h_dialog__body">
+					<h-table
+						v-if="isRefresh && tableFields.length"
+						ref="table1"
+						:table-fields="tableFields"
+						:table-data="tableData" 
+						:is-edit-table-data="isEditTableData"
+						:pagesize="pagesize"
+						:pagenum="pagenum"
+						:total="total"
+						:table-height="tableHeight"
+						:table-field-click="tablefieldClick"
+						:table-buttons-click="tablebuttonclick"
+						:tableloading="tableloading"
+						:isdraggableorder="false"
+						:is-highlight-row="true"
+						:filtersobj="filterObj"
+						
+						v-on:get-data="getData"
+						v-on:row-click="rowClick"
+					>
+					</h-table>
+				</div>
+			</div>
+		</div>
+		
+		<div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 50vh;">
+			<div class="spinner">
+			  <div class="cube1"></div>
+			  <div class="cube2"></div>
+			</div>
+		</div>
+		
+	</body>
+</html>

--
Gitblit v1.8.0