From 64b37e266f4f95f8167d34dfbc5bca668a555f75 Mon Sep 17 00:00:00 2001 From: zhangyanpeng <bob.zhang@highdatas.com> Date: 星期六, 03 八月 2024 22:15:26 +0800 Subject: [PATCH] Merge branch 'master' of http://highdatas.com:9000/r/promotion/promotion_html --- module/md/page/customer/page/customer_list_account.html | 44 module/md/page/customer/page/customer_basic.html | 26 module/md/page/customer/page/customer_basic_acc_cooperation.html | 2131 ++++++++++++++++++++++++++++++++++++++++ module/visit/page/popup/visit_log_detail.html | 396 ------ module/md/page/customer/page/evaluation_management.html | 38 module/md/page/customer/page/customer_basic_acct.html | 176 ++ module/md/page/customer/page/evaluation_management_edit.html | 320 +++-- 7 files changed, 2,561 insertions(+), 570 deletions(-) diff --git a/module/md/page/customer/page/customer_basic.html b/module/md/page/customer/page/customer_basic.html index 75eefe9..5a4d32a 100644 --- a/module/md/page/customer/page/customer_basic.html +++ b/module/md/page/customer/page/customer_basic.html @@ -913,19 +913,19 @@ data: {}, } //鏂板鐨勬儏鍐� - me.formdata_group.map(group => {// - group.children.map(unitobj => { - var row_ = { - id: uuid_short(), - parent_id: me.formData.id, - criteria_id: unitobj.id, - criteria_value: unitobj.criteria_value, - remark: unitobj.remark, - } - md_org_account_criteria_.push(row_); - }) - }) - param.data["md_org_account_criteria"] = md_org_account_criteria_.length ? md_org_account_criteria_ : null; + // me.formdata_group.map(group => {// + // group.children.map(unitobj => { + // var row_ = { + // id: uuid_short(), + // parent_id: me.formData.id, + // criteria_id: unitobj.id, + // criteria_value: unitobj.criteria_value, + // remark: unitobj.remark, + // } + // md_org_account_criteria_.push(row_); + // }) + // }) + // param.data["md_org_account_criteria"] = md_org_account_criteria_.length ? md_org_account_criteria_ : null; param.data[this.dataname] = entity; diff --git a/module/md/page/customer/page/customer_basic_acc_cooperation.html b/module/md/page/customer/page/customer_basic_acc_cooperation.html new file mode 100644 index 0000000..03e03fd --- /dev/null +++ b/module/md/page/customer/page/customer_basic_acc_cooperation.html @@ -0,0 +1,2131 @@ +<!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 FormVue({ + el: "#vbody", + data: { + dataname: "md_org_account", + table_dataname: "md_org_account_position", + + change_dataname: "md_org_account_change", + title: "缁忛攢鍟嗗紑鎴蜂俊鎭�", + // 棰勫姞杞借缃� + dataRequest: [ + { + name: "md_org_master", // 鍏徃涓嬫媺椤� + dataname: "md_org_master", + // url: "root/data/newEntity", + // paramsobj: {dataname: "md_org_data"}, + isnotoption: false, //true:涓嶆槸閫夐」 + code:"id",//鏄笅鎷夐�夐」鏃惰缃� + label:"short_name",//鏄笅鎷夐�夐」鏃惰缃� + filter: "", + orderby: "name" + }, + { + name: "md_bu", // BU涓嬫媺椤� + dataname: "md_bu_org", + // url: "root/data/newEntity", + // paramsobj: {dataname: "md_org_data"}, + isnotoption: false, //true:涓嶆槸閫夐」 + code:"bu_id",//鏄笅鎷夐�夐」鏃惰缃� + label:"bu_name",//鏄笅鎷夐�夐」鏃惰缃� + filter: "state_code='Open'", + orderby: "" + }, + // { + // name: "md_bu_product", // 浜у搧涓嬫媺椤� + // dataname: "md_bu_product", + // isnotoption: false, //true:涓嶆槸閫夐」 + // code:"id",//鏄笅鎷夐�夐」鏃惰缃� + // label:"product_name",//鏄笅鎷夐�夐」鏃惰缃� + // filter: "", + // orderby: "product_name" + // }, + { + name: "md_geo_province", // 鐪佷唤涓嬫媺椤� + dataname: "md_geo_province", + isnotoption: false, //true:涓嶆槸閫夐」 + code:"name",//鏄笅鎷夐�夐」鏃惰缃� + label:"name",//鏄笅鎷夐�夐」鏃惰缃� + filter: "", + orderby: "name" + }, + + { + name: "meta_account_position_list", // 涓氬姟璐熻矗浜哄瓧娈� + dataname: "md_org_account_position", + url: "root/data/getEntitySet", + paramsobj: {dataname: "md_org_account_position", attachMeta: true, filter: "1<>1"}, + isnotoption: true, //true:涓嶆槸閫夐」 + filter: "1<>1", + }, + { + name: "md_org_account_criteria_rule", //rule绛斿嵎瀛楁 + dataname: "md_org_account_criteria_rule", + isnotoption: true, //true:涓嶆槸閫夐」 + filter: "", + }, + ], + options_md_org_master: [], + isExistsAccount: false, + exists_account: {}, // + md_bu_org_obj: {}, + options_md_bu: [], + options_md_geo_province: [], + old_md_org_account_product_obj: {}, + old_md_org_account_province_obj: {}, + productobj_map: {}, + md_bu_product_bu_obj: {}, + options_tree_product: [], + options_province: [], + options_tree_province: [], + + meta_account_position_list: [], + + meta_account_change: [], + formFields_criteria: [], + formData_change: {}, + formdata_rule_group:[], + + formAttr: { + istitle: false, + title: "琛ㄥ崟鍚嶇О", + columnnumber: 4, + labelwidth: "100px", + labelposition: "left",//"left",// right//top + size: "mini", + border: "10px solid #c6c6c600", + disabled: true + }, + formAttr_change: { + istitle: false, + title: "琛ㄥ崟鍚嶇О", + columnnumber: 4, + labelwidth: "100px", + labelposition: "left",//"left",// right//top + size: "mini", + border: "10px solid #c6c6c600", + disabled: false + }, + tableAttr: { + istitle: true, + title: "鎴戞柟涓氬姟璐熻矗浜�", + isborder: true, // 鏄剧ず琛ㄦ牸鐨勭綉鏍肩嚎 + toolbarobj: {} + }, + accountnccdata: {}, // NCC鐨勬暟鎹紙鍚粡閿�鍟嗗拰鍏徃淇℃伅锛� + orgdata: {}, + formFields: [], + newformData: { + //id: uuid_short(), + // code: createCode("BA"), + // create_time: createDatetime(), + credit_amt: 0, + state_code: "Input", + state_name: "鑽夌", + }, + newchangeformData: { + state_code: "Input", + state_name: "鑽夌", + }, + formData: {}, + + isRefresh: true, + tableFields: [], + newTableData: { + md_position__name:"", + position_id:"", + is_editable: false, + is_share: false, + rate_share: "", + }, + tableData: [], + tablebuttonclick: [], + + //鎸夐敭鏉冮檺璁剧疆 + table_isedit: false, // 琛ㄦ牸鍙紪杈� + isedit: false,//鎻愪氦鍓嶇紪杈戯紝淇濆瓨/鎻愪氦 + isrefuseedit: false,//鎷掔粷鍚庣紪杈戯紝淇濆瓨/鍐嶆鎻愪氦 + isapproval: false,//瀹℃壒锛屽悓鎰�/鎷掔粷/杞姙/閫�鍥� + isChange: false, // 鏄彉鏇寸敵璇� + iscommit: false,//鎻愪氦鏍囪 + + //寮圭獥鍙傛暟 + popupParames: {}, + //瀛楁璁剧疆 + tablefieldClick: {}, + formfieldClick: {}, + + dheight: null, // 涓讳綋楂樺害 + + // 瀹℃壒 + reasonvisible: false, // 瀹℃壒澶囨敞濉啓寮圭獥 + approveremark: "", // 瀹℃壒澶囨敞 + passOrRefuse: false, // 閫氳繃鎴栨嫆缁� + loading_pass: false, + + }, + created() { + this.popupParames = clone(Root.popupParames); + this.title = this.popupParames.title || this.popupParames.text + if (this.popupParames.data) { + this.formData = this.popupParames.data + } + + var customer_id = "" + if (this.popupParames.delta && this.popupParames.delta.accountnccdata) { + this.accountnccdata = clone(this.popupParames.delta.accountnccdata); + customer_id = this.accountnccdata.org_id; + } + else if (this.popupParames.delta && this.popupParames.delta.orgdata) { + this.orgdata = clone(this.popupParames.delta.orgdata); + customer_id = this.accountnccdata.id; + } + else if (this.formData.id) { + customer_id = this.formData.org_ncc_id; + } + + // 娣诲姞宸插紑鎴风殑棰勫姞杞斤紝涓轰簡鍒ゆ柇鍞竴鎬� + if (customer_id) { + var exists_account = { + name: "exists_account", // 鍏徃涓嬫媺椤� + dataname: "md_org_account", + // url: "root/data/newEntity", + // paramsobj: {dataname: "md_org_data"}, + isnotoption: true, //true:涓嶆槸閫夐」 + filter: "org_id='" + customer_id + "' and md_org_account.state_code in ('Open', 'OpeningApproval')", + } + if (this.formData.id) { + exists_account.filter += " and md_org_account.id<>'" + this.formData.id + "'" + } + this.dataRequest.push(exists_account); + } + + if (this.popupParames.sceneCode) { + if (this.popupParames.sceneCode == "add") {//鏂板 + //鍔ㄦ�佽幏鍙栭粯璁ゆ暟鎹� + var newEntity_ = { + name: "newEntity", + url: "root/data/newEntity", + paramsobj: {dataname: this.dataname}, + isnotoption: true, //true:涓嶆槸閫夐」 + } + this.dataRequest.push(newEntity_); + + this.isedit = true; + this.table_isedit = true; + this.formAttr.disabled = false; + this.tablebuttonClick_ywlxr(); + } + else if (this.popupParames.sceneCode == "browse") {//鍙 + this.formAttr.disabled = true; + } + else if (this.popupParames.sceneCode == "close") {//鍏虫埛 + // this.formAttr.disabled = true; + this.change_dataname = "md_org_account_close"; + this.newchangeformData.type_code = "close"; + this.newchangeformData.type_name = "鍏虫埛鐢宠"; + var meta_account_change = { + name: "meta_account_change", // 涓氬姟璐熻矗浜哄瓧娈� + dataname: "md_org_account_change", + url: "root/data/getEntity", + paramsobj: {dataname: "md_org_account_change", id:"1", attachMeta: true}, + isnotoption: true, //true:涓嶆槸閫夐」 + filter: "", + } + this.dataRequest.push(meta_account_change); + + var newChangeEntity_ = { + name: "newChangeEntity", + url: "root/data/newEntity", + paramsobj: {dataname: this.change_dataname}, + isnotoption: true, //true:涓嶆槸閫夐」 + } + this.dataRequest.push(newChangeEntity_); + + this.isChange = true; + + this.table_isedit = false; + this.formAttr.disabled = true; + this.tablebuttonClick_ywlxr(); + } + else if (this.popupParames.sceneCode == "change") {//鍙樻洿 + // 鑾峰彇鍙樻洿澶村瓧娈� + var meta_account_change = { + name: "meta_account_change", // 涓氬姟璐熻矗浜哄瓧娈� + dataname: "md_org_account_change", + url: "root/data/getEntity", + paramsobj: {dataname: "md_org_account_change", id:"1", attachMeta: true}, + isnotoption: true, //true:涓嶆槸閫夐」 + filter: "", + } + this.dataRequest.push(meta_account_change); + + var newChangeEntity_ = { + name: "newChangeEntity", + url: "root/data/newEntity", + paramsobj: {dataname: this.change_dataname}, + isnotoption: true, //true:涓嶆槸閫夐」 + } + this.dataRequest.push(newChangeEntity_); + + this.isChange = true; + + this.table_isedit = true; + this.formAttr.disabled = false; + this.tablebuttonClick_ywlxr(); + } + else if (this.popupParames.sceneCode == "edit") {//缂栬緫 + this.isedit = true; + this.table_isedit = true; + this.formAttr.disabled = false; + this.tablebuttonClick_ywlxr(); + } + else if (this.popupParames.sceneCode == "approval") {//瀹℃壒 + this.formAttr.disabled = true; + this.isapproval = true; + } + else if (this.popupParames.sceneCode == "refuseedit") {//鎷掔粷鍚庣殑缂栬緫 + this.isrefuseedit = true; + this.formAttr.disabled = false; + this.tablebuttonClick_ywlxr(); + } + } + }, + + mounted() { + var me = this; + var title_h = 0; + if (me.popupParames.totab){ + title_h = 42; + } + me.dheight = document.documentElement.clientHeight - 50 - title_h; + + //棰勫姞杞芥暟鎹� + if (this.dataRequest && this.dataRequest.length) { + var result = {}; + this.loadRequestData(this.dataRequest, result, function(data) { + me.dataRequestObj = data; + //棰勫姞杞芥暟鎹悗缁欏摢浜涘瓧娈佃缃畂ptions鎴杅ormatterjson + if (me.dataRequestObj.newEntity) { + var formData = clone(me.dataRequestObj.newEntity.data[me.dataname]); + formData['company_id'] = '1181' + formData['company_name'] = '姹囧畤鍒惰嵂' + formData['bu_id'] = 'BU-GM' + formData['bu_name'] = '鑲跨槫' + // formData.product_category_name = []; + if (me.newformData) { + let formData_ = clone(formData); + + for (var k in me.newformData) { + if (!formData_[k]) { + formData_[k] = me.newformData[k]; + } + } + + me.formData = formData_; + } + } + + if (me.dataRequestObj.meta_account_position_list) { + me.meta_account_position_list = me.dataRequestObj.meta_account_position_list.meta.md_org_account_position.fields; + } + + // new 鍙樻洿淇℃伅 + if (me.dataRequestObj.newChangeEntity) { + var formData = clone(me.dataRequestObj.newChangeEntity.data[me.change_dataname]); + // formData.product_category_name = []; + if (me.newchangeformData) { + let formData_ = clone(formData); + + for (var k in me.newchangeformData) { + if (!formData_[k]) { + formData_[k] = me.newchangeformData[k]; + } + } + + me.formData_change = formData_; + } + } + // 鑾峰彇鍙樻洿鐨勫瓧娈� + if (me.dataRequestObj.meta_account_change) { + var meta_account_change_ = me.dataRequestObj.meta_account_change.meta.md_org_account_change.fields; + meta_account_change_.map(f=>{ + f.isshow = "T"; + f.group_name = "鍙樻洿淇℃伅" + if (me.popupParames.sceneCode == "close" && f.field == "type_code") { //褰撲负鍏虫埛鏃讹紝鍙樻洿绫诲瀷涓嶅彲鏇存敼 + f.readonly = true + f.optionsgroup = "account_type_close" + } + else if (f.field == "type_code") { //鍙樻洿绫诲瀷鐨勪笅鎷夋帶鍒� + console.log(f.optionsgroup); + f.optionsgroup = "account_type" + } + + if(f.field == "termination_date") {//缁堟鏃ユ湡鑼冨洿璁剧疆 + f.pickerOptions = { + disabledDate: function(time) { + var currentDate = new Date(); + currentDate.setDate(currentDate.getDate() - 1); + return time < currentDate + }, + cellClassName: function(date) { + return "aaaa"; + } + } + } + // if (dataname_ == "md_org_account" && f.field == "company_id") { + // f.options = me.options_md_org_master; + // } + }) + + me.meta_account_change = meta_account_change_; + } + + + if (me.dataRequestObj.md_org_master) { + me.options_md_org_master = me.dataRequestObj.md_org_master; + } + + if (me.dataRequestObj.exists_account) { + var exists_account_ = []; + var exists_account_ = {}; + exists_account_ = me.dataRequestObj.exists_account; + exists_account_.map(account=>{ + // 鍏徃 + BU + 寮�鎴风被鍨� + 缁忛攢鍟� + var account_id_filter = account.company_id + account.bu_id + account.actor_code + account.org_id + exists_account_[account_id_filter] = account.id; + }) + me.exists_account = clone(exists_account_) + } + + if (me.dataRequestObj.md_bu) { + // exists_account + var md_bu_org_obj_ = {}; + var options_md_bu = []; + var md_bu_list = clone(me.dataRequestObj.md_bu); + md_bu_list.map(bl=>{ + if (!md_bu_org_obj_[bl.company_id]) { + md_bu_org_obj_[bl.company_id] = []; + } + // if (!exists_account_[bl.code]) { + md_bu_org_obj_[bl.company_id].push(bl); + // } + }) + me.md_bu_org_obj = clone(md_bu_org_obj_) + // me.options_md_bu = me.dataRequestObj.md_bu; + } + // options_tree_product + // if (me.dataRequestObj.md_bu_product) { + // var md_bu_product_array_ = clone(me.dataRequestObj.md_bu_product); + // var md_bu_product_line_obj_ = {}; + // var md_bu_product_line_array_ = []; + // var md_bu_product_bu_obj_ = {}; + // var productobj_map_ = {}; + + // md_bu_product_array_.map(p=>{ + // if (!md_bu_product_line_obj_[p.product_line_id]) { + // productobj_map_[p.product_line_id] = p.product_line_name; + // md_bu_product_line_obj_[p.product_line_id] = { + // code: p.product_line_id, + // value: p.product_line_name, + // bu_id: p.bu_id, + // children: [], + // } + // } + // var p_ = { + // code: p.product_id, + // value: p.product_name + // } + // productobj_map_[p.product_id] = p.product_name; + // md_bu_product_line_obj_[p.product_line_id].children.push(p_); + // }) + + // me.productobj_map = clone(productobj_map_); + + // for (var line in md_bu_product_line_obj_) { + // md_bu_product_line_array_.push(md_bu_product_line_obj_[line]); + // } + + // md_bu_product_line_array_.map(l=>{ + // if (!md_bu_product_bu_obj_[l.bu_id]) { + // md_bu_product_bu_obj_[l.bu_id] = [] + // } + // md_bu_product_bu_obj_[l.bu_id].push(l); + // }) + // me.md_bu_product_bu_obj = clone(md_bu_product_bu_obj_); + // // me.options_tree_product = md_bu_product_bu_obj[bu_id]; + // } + + // options_tree_province + if (me.dataRequestObj.md_geo_province) { + var options_tree_province_ = listTOListGroup(me.dataRequestObj.md_geo_province, "area", "value"); + // me.options_tree_province = options_tree_province_; + me.options_province = clone(me.dataRequestObj.md_geo_province); + } + if (me.dataRequestObj.md_org_account_criteria_rule) { + var obj_ = {} + me.formFields_criteria = me.dataRequestObj.md_org_account_criteria_rule; + me.formFields_criteria.map(e=>{ + if (!obj_[e.group_code]) { + var obj = {} + obj_[e.group_code] = e.group_code + obj_[e.group_name] = e.group_name + //obj_鐢ㄤ綔妫�娴嬫槸鍚﹂噸澶嶏紝鑻ユ湭閲嶅锛屽垯灏嗚obj鏀惧叆(鑰屼笉鏄斁鍏bj_) 鏋勫缓鐨刦ormdata_rule_group缁撴瀯濡備笅 + // formdata_rule_group:[{group_name:'瀹㈣璇勫垎',group_code:'Objective',children:[]},{group_name:'涓昏璇勫垎',group_code:'Subjective',children:[]}], + obj['group_code'] = e.group_code + obj['group_name'] = e.group_name + obj['type_code'] = e.type_code + obj['type_name'] = e.type_name + obj['children'] = [] + // obj.children.push(e) + me.formdata_rule_group.push(obj) + } + }) + } + me.initData(); + + // 浠ユ湇鍔$殑鏂瑰紡璋冪敤鐨� Loading 闇�瑕佸紓姝ュ叧闂� + me.$nextTick(() => { + hideLoading(); + }); + }); + } + else { + this.initData(); + // 浠ユ湇鍔$殑鏂瑰紡璋冪敤鐨� Loading 闇�瑕佸紓姝ュ叧闂� + me.$nextTick(() => { + hideLoading(); + }); + } + }, + + methods:{ + //鍏抽棴寮圭獥 + closeDialog() { + var me = this; + if (me.popupParames.totab){ + Root.tab.removeItem(Root.tab.selected); + Root.tab.open(me.popupParames.parentOption, false); + } + else { + Root.hidePopup(); + } + }, + //鍏抽棴鍓嶈皟鍥炶皟 + saveAfter() { + var me = this; + if(this.popupParames.callback) { + let obj = { + //row: this.formData + } + this.popupParames.callback(obj, function() { + me.closeDialog(); + }); + } + else { + me.closeDialog(); + } + }, + + // 浜嬩欢 + tablebuttonClick_ywlxr() { + var me = this; + var tablebuttonClick = []; + tablebuttonClick = [ + { + // name: "鏂板", // type: "primary", // icon: "el-icon-edit", + isbuttonshow: this.table_isedit, + code: "add", isselected: false, classname: "", + onclick: function(obj) { + // popup_position + // 鑾峰彇鎺堟潈浜у搧 + if (!me.formData.bu_id) { + Root.message({ + type: 'warning', + message: '璇峰厛閫夋嫨BU' + }); + return; + } + else { + me.openPositionTree("add", function(popupobj){ + var table_row = clone(me.newTableData); + table_row.position_id = popupobj.row.id; + table_row.md_position_hierarchy__position_path = popupobj.row.md_position_hierarchy__position_path; + table_row.md_position_hierarchy__employee_name = popupobj.row.md_position_hierarchy__employee_name; + + me.addTableData(table_row) + }); + } + + } + }, + { + // name: "鍒犻櫎", , // icon: "el-icon-edit", + isbuttonshow: this.table_isedit, type: "danger", + code: "delete", isselected: true, classname: "", + onclick: function(obj) { + var row = obj.selectedList[0]; + var txt = clone(row.md_position_hierarchy__position_path) + clone(row.md_position_hierarchy__employee_name); + me.deleteDataById(row.id, me.table_dataname, "銆�" + txt + "銆�", function(){ + me.tableData.splice(obj.selectRowIndex, 1); + + var tableData_ = clone(me.tableData); + if (row.is_main_approver) { + if (tableData_.length) { + tableData_[0].is_main_approver = true; + me.tableData = clone(tableData_); + } + } + }) + // me.tableData.remove(obj.selectedList[0]) + // obj.selectedList + // me.closeData('browse', obj.selectedList[0]); + // me.closeData(); + + + } + }, + ] + + this.tablebuttonclick = tablebuttonClick; + }, + + initData() { + let me = this + var id_ = null; + if (this.formData.id) { + id_ = this.formData.id; + } + this.getRowDataById(id_, function(result) {//鏌ヨ鍚庣殑鍥炶皟锛岀敤浜庤幏鍙栧瓧娈电殑 + if (result.data.md_org_account_criteria && result.data.md_org_account_criteria.length>0) { + var criteria_data = [] + me.formData_criteria = result.data.md_org_account_criteria + me.formFields_criteria.map(f=>{ + me.formData_criteria.map(v=>{ + if (f.id == v.criteria_id) { + var obj_ = {} + Object.assign(obj_,f,v) + criteria_data.push(obj_) + } + }) + }) + me.formdata_rule_group.map(g => { + criteria_data.map(v => { + if (v.group_code == g.group_code) { + g.children.push(v) + } + }) + }) + } + else { + me.formdata_rule_group.map(g=>{ + me.formFields_criteria.map(f=>{ + if(f.group_code == g.group_code) { + g.children.push(f) + } + }) + }) + } + if (result.meta) { + var metaBydataname = {}; + for (var dataname_ in result.meta) { + var formFields_ = []; + var metas = clone(result.meta[dataname_].fields); + + if (dataname_ == "md_org_account_position") { + metas = clone(me.meta_account_position_list); + } + + metas.map(f=>{ + f.isshow = "T"; + + if (dataname_ == "md_org_account" && f.field == "company_id") { + f.options = me.options_md_org_master; + } + else if (dataname_ == "md_org_account" && f.field == "actor_code") { + if (me.isChange) { + f.readonly = true + } + if (me.formData.md_org__source && me.formData.md_org__source == "NCC") { + f.optionsgroup = "actor_ncc"; + } + else if (me.formData.md_org__source && me.formData.md_org__source == "DMS") { + f.optionsgroup = "actor_dms"; + } + + } + else if (dataname_ == "md_org_account" && f.field == "authorize_province") { + f.options = me.options_province; + f.isfilterable = true + } + else if (dataname_ == "md_org_account" && f.field == "bu_id") { + f.options = [] + if (me.isChange) { + f.readonly = true + } + } + else if (dataname_ == "md_org_account" && me.accountnccdata.id && (f.field == "company_name" || f.field == "account_name")) { + f.inputtype = "span"; + } + else if (dataname_ == "md_org_account" && me.isChange && (f.field == "company_name" || f.field == "account_name")) { + f.inputtype = "span"; + } + else if (dataname_ == "md_org_account" && me.orgdata.id && f.field == "account_name") { + f.inputtype = "span"; + } + else if (dataname_ == "md_org_account" && f.field == "company_name") { + f.inputtype = "span"; + } + else if (dataname_ == "md_org_account_position") { + if (f.field == "md_org_account__account_name" + || f.field == "creator_name" + || f.field == "create_time" + || f.field == "update_time" + || f.field == "md_org_account__actor_name" + || f.field == "md_org_account__company_name" + || f.field == "md_org_account__bu_name") { + f.isshow = "F"; + } + if (f.field == "md_position__name") { + f.inputtype = "popup" + } + + } + + // 鍦ㄦ巿鏉冪渷浠借鏄庡墠鍔犳巿鏉冧骇鍝佸拰鎺堟潈鐪佷唤 + // if (dataname_ == "md_org_account" && f.field == "authorize_province_remark") { + // if (result.meta["md_org_account_product"].fields) { + // var metas_ = clone(result.meta["md_org_account_product"].fields); + // metas_.map(mp=>{ + // if (mp.field == "product_id") { + // mp.isshow = "T"; + // mp.colspan = 2; + // mp.group_name = "寮�鎴蜂俊鎭�"; + // // mp.props = {label: "value", value: "code", multiple: true, checkStrictly: true}; + // mp.props = {label: "value", value: "code", multiple: true}; + // if (me.formData.bu_id) { + // mp.options = clone(me.md_bu_product_bu_obj[me.formData.bu_id]); + // } + // else { + // mp.options = []; + // } + // formFields_.push(clone(mp)); + // } + // }) + // } + // if (result.meta["md_org_account_province"] && result.meta["md_org_account_province"].fields) { + // var metas_ = clone(result.meta["md_org_account_province"].fields); + // metas_.map(mp=>{ + // if (mp.field == "province") { + // mp.isshow = "T"; + // mp.colspan = 2; + // mp.group_name = "寮�鎴蜂俊鎭�"; + // mp.props = {label: "value", value: "code", multiple: true }; + // mp.options = me.options_tree_province; + // formFields_.push(clone(mp)); + // } + // }) + // } + // } + + formFields_.push(clone(f)); + }) + + if (dataname_ == "md_org_account") { + me.formFields = clone(formFields_); + } + else if (dataname_ == "md_org_account_position") { + me.tableFields = clone(formFields_); + } + + // metaBydataname[dataname_] = clone(formFields_); + } + + //瀛楁鏁扮粍杞瓧娈祇bj锛岀洰鐨勪负浜嗙瓫閫夋椂鑾峰彇瀛楁灞炴�� + me.fieldsToFieldsObj(); + + //璁剧疆瀛楁浜嬩欢 + me.tableFieldClick(); + } + //鏁版嵁澶勭悊 + + + var formData_ = {}; + if (me.accountnccdata.id) { + formData_ = { + // NCCid + org_ncc_id: me.accountnccdata.id, + // 鍏徃 + company_id: me.accountnccdata.company_id, + company_name: me.accountnccdata.company_name, + + // 缁忛攢鍟� + org_id: me.accountnccdata.org_id, + account_name: me.accountnccdata.md_org__name, + business_address: me.accountnccdata.md_org__business_address, + + // 缁忛攢鍟嗗叧鑱斾俊鎭� + business_person: me.accountnccdata.md_org__business_person, + business_phone: me.accountnccdata.md_org__business_phone, + business_email: me.accountnccdata.md_org__business_email, + md_org__license_business_no: me.accountnccdata.md_org__license_business_no, + md_org__register_address: me.accountnccdata.md_org__register_address, + md_org__code: me.accountnccdata.md_org__code, + md_org__ncc_code: me.accountnccdata.md_org__ncc_code, + md_org__province: me.accountnccdata.md_org__province, + md_org__city: me.accountnccdata.md_org__city, + md_org__county: me.accountnccdata.md_org__county, + + md_org__receive_address: me.accountnccdata.md_org__receive_address, + md_org__receiver_name: me.accountnccdata.md_org__receiver_name, + md_org__receiver_phone: me.accountnccdata.md_org__receiver_phone, + + } + for (var k in me.formData) { + if (me.formData[k]){ + formData_[k] = me.formData[k]; + } + } + } + else if (me.orgdata.id) { + formData_ = { + // 缁忛攢鍟� + org_id: me.orgdata.id, + account_name: me.orgdata.name, + business_address: me.orgdata.business_address, + + // 缁忛攢鍟嗗叧鑱斾俊鎭� + business_person: me.orgdata.business_person, + business_phone: me.orgdata.business_phone, + business_email: me.orgdata.business_email, + md_org__license_business_no: me.orgdata.license_business_no, + md_org__register_address: me.orgdata.register_address, + md_org__code: me.orgdata.code, + md_org__ncc_code: me.orgdata.ncc_code, + md_org__province: me.orgdata.province, + md_org__city: me.orgdata.city, + md_org__county: me.orgdata.county, + + md_org__receive_address: me.orgdata.receive_address, + md_org__receiver_name: me.orgdata.receiver_name, + md_org__receiver_phone: me.orgdata.receiver_phone, + } + for (var k in me.formData) { + if (me.formData[k]){ + formData_[k] = me.formData[k]; + } + } + } + + if (me.rowData[me.dataname]) { + formData_ = me.rowData[me.dataname]; + } + + // 濡傛灉閫夋嫨浜嗗叕鍙革紝 鍒檅u鐨勪笅鎷夐」鏍规嵁鍏徃鏉� + if (formData_.company_id) { + var formFields_ = clone(me.formFields); + formFields_.map(f=>{ + if (f.field == "bu_id") { + if (me.md_bu_org_obj[formData_.company_id] && me.md_bu_org_obj[formData_.company_id].length) { + f.options = clone(me.md_bu_org_obj[formData_.company_id]) + } + } + }) + + me.formFields = clone(formFields_); + } + + if (me.rowData[me.table_dataname]) { + me.tableData = me.rowData[me.table_dataname]; + } + + // if (me.rowData["md_org_account_product"]) { + // var product_id_ = [] + // me.old_md_org_account_product_obj = {}; + // me.rowData["md_org_account_product"].map(p=>{ + // me.old_md_org_account_product_obj[p.product_line_id + p.product_id] = p; + // var select_p_ = [p.product_line_id, p.product_id]; + // product_id_.push(select_p_); + // }) + // formData_.product_id = product_id_ + // } + // if (me.rowData["md_org_account_province"]) { + // var province_id_ = [] + // me.old_md_org_account_province_obj = {}; + // me.rowData["md_org_account_province"].map(p=>{ + // me.old_md_org_account_province_obj[p.area + p.province] = p; + // var select_p_ = [p.area, p.province]; + // province_id_.push(select_p_); + // }) + // formData_.province = province_id_; + // } + + // 璁剧疆鍒濆鍖栨暟鎹� + me.formData = getDataByFields(formData_, me.formFields); + + /* + param.data["md_org_account_product"] = table_products_; + param.data["md_org_account_province"] = table_provinces_; + if (r == "product_id") { + var products_ = entity_[r]; + products_.map(p=>{ + var p_ = { + product_line_id: p[0] + }; + if (p.length == 2) { + p_.product_id = p[1]; + } + + table_products_.push(p_); + }) + } + else if (r == "province") { + var provinces_ = entity_[r]; + provinces_.map(p=>{ + var p_ = { + area: p[0], + province: p[1] + }; + table_provinces_.push(p_); + }) + } + + */ + + + // 涓氬姟璐熻矗浜� + me.getPositionDataByAccountId(); + }) + }, + + openPositionTree(sceneCode, callback) { + var me = this; + var data_ = {}; + var text_ = "宀椾綅璐熻矗浜�" + var config = { + totab: false, //true: 浠ab瀵艰埅鐨勬柟寮忔墦寮� + width: "500px", + height: "80vh", + icon: "icon-product", + text: text_ + "閫夋嫨", + id: "popup_position",//totab: true鏃堕渶璁剧疆锛岀敤浜庡垽鏂槸鍚﹀凡鎵撳紑姝ら〉闈� + url: "module/md/page/popup/page/popup_position.html", + data: data_, + delta: { + company_id: me.formData.company_id, + bu_id: me.formData.bu_id, + select_position: this.tableData // position_id + }, + // filter: "org_id='"+ me.selectedrow.org_id + "' and bu_id='" + me.selectedrow.bu_id + "'", + sceneCode: sceneCode,//"refuseedit",//"approval", //"add"//"browse", + callback: function(popupobj, popupcallback) { + callback(popupobj) + + if (popupcallback) { + popupcallback(); + } + } + }; + me.doPopupByPublic(config); + }, + + deleteDataById(id, dataname, confirm_txt, callback){ + var me = this; + var formData_ = clone(me.formData); + Root.confirm('纭畾鍒犻櫎璇�' + "鎴戞柟涓氬姟璐熻矗浜�" + confirm_txt + '鍚楋紵', '鍒犻櫎鎻愮ず', { + confirmButtonText: '鍒犻櫎', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + if (id) { + let param = { + dataname: dataname, + id: id + } + Server.call("root/data/deleteEntity", param, function(result) { + console.log(result); + if (result && result.data) { + callback(); + } + }); + } + else { + callback(); + } + + }).catch(() => { + Root.message({ + type: 'info', + message: '宸插彇娑堝垹闄�' + }); + }); + + }, + + getPositionDataByAccountId() { + var me = this; + if (!this.formData.id) { + return + } + var params = { + dataname: "md_org_account_position", + filter: [ + {"field": "parent_id", "value": this.formData.id}, + ] + } + Server.call("root/data/getEntitySet", params, function(result) { + if (result && result.data && result.data.entityset && result.data.entityset.length) { + var data_ = result.data.entityset; + me.tableData = data_; + } + + me.$nextTick(() => { + me.isRefresh = true; + me.$forceUpdate(); + }); + }) + }, + + tableFieldClick() { + var me = this; + //琛ㄥ崟瀛楁浜嬩欢璁剧疆 + this.formfieldClick = { + + actor_code: { + select: { + onchange: function(obj) { + obj.data.actor_code = obj.selectoption.code || ""; + obj.data.actor_name = obj.selectoption.value || ""; + } + } + }, + company_id: { + select: { + onchange: function(obj) { + obj.data.company_name = obj.selectoption.value || ""; + + //鏇存敼bu涓嬫媺椤� + var formFields_ = clone(me.formFields); + formFields_.map(f=>{ + if (f.field == "bu_id") { + if (me.md_bu_org_obj[me.formData.company_id] && me.md_bu_org_obj[me.formData.company_id].length) { + f.options = clone(me.md_bu_org_obj[me.formData.company_id]) + } + } + }) + me.formFields = clone(formFields_); + } + } + }, + bu_id: { + select: { + onchange: function(obj) { + obj.data.bu_name = obj.selectoption.value || ""; + obj.data.product_id = []; + var formFields_ = clone(me.formFields); + + formFields_.map(f=>{ + if (f.field == "product_id") { + if (obj.selectoption.id) { + f.options = clone(me.md_bu_product_bu_obj[obj.selectoption.id]); + } + else { + f.options = []; + } + } + }) + me.formFields = clone(formFields_); + } + } + }, + business_need_code: { + select: { + onchange: function(obj) { + obj.data.business_need_name = obj.selectoption.value || ""; + } + } + }, + + platform_account_name: { + popup: { + onclick: function(obj) {//寮圭獥鐐瑰嚮浜嬩欢 + var filter_ = " 1=1 " + if (me.formData.bu_name) { + // filter_ = "company_name='" + this.formData.company_name + "' and bu_name='" + this.formData.bu_name + "' and actor_code='Platform'" + filter_ = "bu_name='" + me.formData.bu_name + "' and actor_code='Platform'" + } + else { + Root.message({ + type: 'warning', + message: '璇峰厛閫夋嫨BU' + }); + return; + } + + //鎵撳紑寮�鎴峰钩鍙板脊绐� + me.openAccount(filter_, "add", obj, function(popupobj){ + let row_ = clone(me.formData); + row_.platform_account_id = popupobj.row.id; + row_.platform_account_code = popupobj.row.code; + row_.platform_org_id = popupobj.row.org_id; + row_.platform_account_name = popupobj.row.account_name; + + me.formData = clone(row_); + }); + } + } + }, + replace_account_name: { + popup: { + onclick: function(obj) {//寮圭獥鐐瑰嚮浜嬩欢 + var filter_ = " md_org_account.id<>'"+ me.formData.id +"' and bu_name='" + me.formData.bu_name + "'" + // var filter_ = " md_org_account.id<>'"+ me.formData_change.host_id +"'" + + //鎵撳紑寮�鎴峰钩鍙板脊绐� + me.openAccount(filter_, "add", obj, function(popupobj){ + let row_ = clone(me.formData_change); + row_.replace_account_id = popupobj.row.id; + row_.replace_account_code = popupobj.row.code; + row_.replace_account_name = popupobj.row.account_name; + me.formData_change = clone(row_); + }); + } + } + }, + + + // 鍙樻洿绫诲瀷 + type_code: { + select: { + onchange: function(obj) { + obj.data.type_name = obj.selectoption.value || ""; + } + } + }, + }; + + //琛ㄦ牸瀛楁浜嬩欢璁剧疆 + this.tablefieldClick = { + is_main_approver: { + input: { + onchange: function(obj) { + // + var tableData_ = clone(me.tableData); + var index_ = obj.$index; + if (obj.row.is_main_approver) { // 璇ヨ璁剧疆涓轰富閿�鍞紝 濡傛灉杩樻湁鍏朵粬琛岋紝鍒欏叾浠栬鐨勪富閿�鍞爣璇嗘秷澶� + // tableData_ + for (var i = 0; i < tableData_.length; i++) { + var row_ = tableData_[i]; + if (i != index_) { + row_.is_main_approver = false; + } + } + } + else { // 璇ヨ鍙栨秷涓婚攢鍞爣璇嗘椂锛岃缃涓�琛岀殑涓轰富閿�鍞� + tableData_[0].is_main_approver = true; + } + me.tableData = clone(tableData_); + } + }, + }, + md_position__name: { + popup: { + onclick: function(obj) {//寮圭獥鐐瑰嚮浜嬩欢 + //鎵撳紑宀椾綅寮圭獥 + me.openPositionEmployee("add", obj, function(popupobj){ + var ywlxr_tableData_ = clone(me.tableData); + let row_ = clone(ywlxr_tableData_[obj.$index]); + row_.md_position__name = popupobj.row.name; + row_.position_id = popupobj.row.id; + row_.region = popupobj.row.region; + row_.md_employee__name = popupobj.row.remark; + ywlxr_tableData_[obj.$index] = row_; + me.tableData = clone(ywlxr_tableData_); + // me.$set(obj,"row", row_) + // me.$forceUpdate() + }); + } + }, + }, + }; + }, + openOrg(sceneCode, filter, callback) { + var me = this; + var config = { + totab: false, //true: 浠ab瀵艰埅鐨勬柟寮忔墦寮� + width: "800px", + height: "520px", + icon: "icon-product", + text: "閫夋嫨瀹㈠晢", + id: "popup_customer",//totab: true鏃堕渶璁剧疆锛岀敤浜庡垽鏂槸鍚﹀凡鎵撳紑姝ら〉闈� + url: "module/md/page/popup/page/popup_customer.html", + data: {}, + delta: "", + // filter: "category_code='"+ me.positiondata.org_id + "' and bu_id='" + me.positiondata.bu_id + "'", + filter: filter, + sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse", + callback: function(popupobj, popupcallback) { + callback(popupobj); + if (popupcallback) { + popupcallback(); + } + } + }; + me.doPopupByPublic(config); + }, + openAccount(filter, sceneCode, obj, callback) { + var me = this; + var data_ = {}; + var filter_ = ""; + + if (filter) { + filter_ = filter; + } + var config = { + totab: false, //true: 浠ab瀵艰埅鐨勬柟寮忔墦寮� + width: "1100px", + height: "520px", + icon: "icon-product", + text: "骞冲彴缁忛攢鍟嗛�夋嫨", + id: "popup_account",//totab: true鏃堕渶璁剧疆锛岀敤浜庡垽鏂槸鍚﹀凡鎵撳紑姝ら〉闈� + url: "module/md/page/popup/page/popup_account.html", + data: data_, + delta: {}, + // filter: "org_id='"+ me.selectedrow.org_id + "' and bu_id='" + me.selectedrow.bu_id + "'", + filter: filter_, + sceneCode: sceneCode,//"refuseedit",//"approval", //"add"//"browse", + callback: function(popupobj, popupcallback) { + callback(popupobj); + if (popupcallback) { + popupcallback(); + } + } + }; + me.doPopupByPublic(config); + }, + + openPositionEmployee(sceneCode, obj, callback) { + var me = this; + var data_ = {}; + // if (sceneCode == "edit") { + // data_ = obj.selectedList[0] + // } + var config = { + totab: false, //true: 浠ab瀵艰埅鐨勬柟寮忔墦寮� + width: "800px", + height: "520px", + icon: "icon-product", + text: "宀椾綅閫夋嫨", + id: "popup_position_employee_list",//totab: true鏃堕渶璁剧疆锛岀敤浜庡垽鏂槸鍚﹀凡鎵撳紑姝ら〉闈� + url: "module/md/page/popup/page/popup_position_employee_list.html", + data: data_, + delta: {}, + // filter: "org_id='"+ me.selectedrow.org_id + "' and bu_id='" + me.selectedrow.bu_id + "'", + filter: "md_position.bu_id='" + this.formData.bu_id + "'", + sceneCode: sceneCode,//"refuseedit",//"approval", //"add"//"browse", + callback: function(popupobj, popupcallback) { + callback(popupobj); + if (popupcallback) { + popupcallback(); + } + } + }; + me.doPopupByPublic(config); + }, + + addTableData(row) { + if (this.tableData.length == 0) { + row.is_main_approver = true; + } + else { + row.is_main_approver = false; + } + this.tableData.unshift(row); + // this.rowChange(table_row, "add", this.table_dataname); + }, + + delData(scope) { + let me = this; + let row = scope.row; + let index_ = scope.$index; + + Root.confirm('纭畾鍒犻櫎鏁版嵁銆�' + row.md_position__name + '銆戝悧锛�', '鍒犻櫎鎻愮ず', { + confirmButtonText: '鍒犻櫎', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + me.rowChange(row, "del", me.table_dataname); + }).catch(() => { + Root.message({ + type: 'info', + message: '宸插彇娑堝垹闄�' + }); + }); + }, + + rowChange(row, type, tablename) { + var me = this; + if (type == "add") { + if (this.tableData.length == 0) { + row.is_main_approver = true; + } + this.tableData.unshift(row); + } + else if (type == "del") { + if (row.id) { + let param = { + dataname: tablename, + id: row.id + } + + Server.call("root/data/deleteEntity", param, function(result) { + console.log(result); + if (result && result.data) { + me.tableData.remove(row); + Root.message({ + type: 'success', + message: '鍒犻櫎鎴愬姛!' + }); + } + }); + } + else { + this.tableData.remove(row); + } + } + else { + + } + }, + + //鎻愪氦 + submitRowTable() { + var me = this; + if (this.isChange) { // 鍙樻洿鎻愪氦 + var bo_change = this.$refs.change.checkForm(); + if (!bo_change) { + bo_ = false; + Root.message({ + type: 'error', + message: '璇峰~鍐欏繀濉」' + }); + return + } + this.iscommit = true; + this.saveChangeRowTable(); + } + else { // 寮�鎴锋彁浜� + var bo_JCXX = this.$refs.JCXX.checkForm(); + + if (!bo_JCXX) { + bo_ = false; + Root.message({ + type: 'error', + message: '璇峰~鍐欏繀濉」' + }); + return + } + + if (this.formData.business_email) { // 濉啓浜嗛偖绠憋紝鍒欐洿鏂癿d_org涓殑閭淇℃伅 + var param = { + dataname: "md_org_account", + id: this.formData.org_id, + data: { + md_org: { + id: this.formData.org_id, + business_email: this.formData.business_email + } + } + } + Server.call("root/data/saveEntity", param, function(result) { + me.iscommit = true; + me.saveRowTable(); + }) + } + + } + }, + // 鍙樻洿鎻愪氦淇濆瓨 + saveChangeRowTable() { + var me = this; + var operator_ = "saveEntity";// 鍙樻洿淇濆瓨 + if(me.iscommit) { + // operator_ = "commit";//鍙樻洿鎻愪氦 + operator_ = "toChange";//鍙樻洿鎻愪氦 + + if (this.formData_change.type_code == "close") { + operator_ = "toClose";//鍙樻洿鎻愪氦 + } + else { + operator_ = "toChange";//鍙樻洿鎻愪氦 + } + } + + var change_entity = clone(this.formData_change); + var entity_ = clone(this.formData); + change_entity.host_id = entity_.id + change_entity.account_id = entity_.id + change_entity.account_code = entity_.code + change_entity.account_name = entity_.account_name + change_entity.bu_id = entity_.bu_id + change_entity.bu_name = entity_.bu_name + change_entity.company_id = entity_.company_id + change_entity.company_name = entity_.company_name + change_entity.org_id = entity_.org_id + + var entity = {}; + for (var r in entity_) { + if (entity_[r] || entity_[r] == "" || entity_[r] == false || entity_[r] == 0) { + entity[r] = entity_[r]; + } + } + + var tableData_ = []; + this.tableData.map(r=>{ + var row_ = {}; + for (var k in r) { + if (r[k] || r[k] == false || r[k] == 0) { + row_[k] = r[k]; + } + } + tableData_.push(row_); + }) + + if (tableData_.length == 0) { + Root.message({ + type: 'warning', + message: '璇峰厛娣诲姞鏄庣粏鏁版嵁' + }); + me.iscommit = false + return + } + + let param = { + dataname: this.change_dataname, + data: {}, + host: {}, + } + if (change_entity.id) { + param.id = change_entity.id + } + + param.data[this.change_dataname] = change_entity; + param.host[this.dataname] = entity; + param.host[this.table_dataname] = tableData_; + + // 鏍¢獙鏄惁瀛樺湪鍙樻洿鎴栧叧鎴蜂腑鐨勬暟鎹� + // var account_entity_id_filter = entity.company_id + entity.bu_id + entity.actor_code + entity.org_id + // if (me.exists_account[account_entity_id_filter] && me.exists_account[account_entity_id_filter] != entity.id) { + // Root.message({ + // type: 'warning', + // message: "缁忛攢鍟�" + entity.account_name + "宸插紑杩囨埛锛屽湪" + entity.company_name + entity.bu + entity.actor_name + "涓�" + // }); + // me.iscommit = false + // return + // } + + // return 0 + Server.call("root/data/" + operator_, param, function(result) { + console.log(result); + if (result.success) { + if(me.iscommit){ + me.iscommit = false; + Root.message({ + type: 'success', + message: '鎻愪氦鎴愬姛' + }); + me.saveAfter(); + } + else { + Root.message({ + type: 'success', + message: '淇濆瓨鎴愬姛' + }); + me.saveAfter(); + } + } + }, function(errorresult) { + console.log("閿欒淇℃伅", errorresult); + if (errorresult.messages && errorresult.messages.count && errorresult.messages.count.error) { + if (errorresult.messages.list) { + me.iscommit = false; + var config = { + totab: false, + // width: "1200px", + // height: 800, + icon: "icon-product", + text: "閿欒淇℃伅", + url: "module/tool/page/popup_error_messages.html", + data: {}, + delta: errorresult.messages.list, + callback: function(obj, callback) { + if (callback) { + callback(); + } + } + }; + me.doPopupByPublic(config); + } + } + else { + me.iscommit = false; + Root.message({ + type: 'error', + message: '鎻愪氦澶辫触' + }); + } + }); + }, + + // 寮�鎴蜂繚瀛� + saveRowTable() { + var me = this; + var operator_ = "saveEntity";//淇濆瓨 + if(me.iscommit) { + operator_ = "commit";//鎻愪氦 + } + + var entity_ = clone(this.formData); + var entity = {}; + // var table_products_ = []; + // var table_provinces_ = []; + + for (var r in entity_) { + if (entity_[r] || entity_[r] == 0) { + entity[r] = entity_[r]; + } + } + + var tableData_ = []; + var md_org_account_criteria_ = [] + this.tableData.map(r=>{ + var row_ = {}; + for (var k in r) { + if (r[k] || r[k] == false || r[k] == 0) { + row_[k] = r[k]; + } + } + tableData_.push(row_); + }) + + if (tableData_.length == 0) { + Root.message({ + type: 'warning', + message: '璇峰厛娣诲姞鏄庣粏鏁版嵁' + }); + me.iscommit = false + return + } + if (tableData_.length == 0) { + Root.message({ + type: 'warning', + message: '璇峰厛娣诲姞鏄庣粏鏁版嵁' + }); + me.iscommit = false + return + } + + let param = { + dataname: 'md_org_account', + data: {}, + } + if (me.formData.id) { + param.id = me.formData.id + } + if(me.iscommit) { + // param.to_state = "OpeningApproval";//鎻愪氦 + if (me.formData.org_ncc_id) { + // param.refer = { + // dataname: "md_org_account", + // id: me.formData.org_ncc_id + // } + } + + } + if (me.formData_criteria && me.formData_criteria.length > 0) { //涓嶆槸鏂板 + me.formdata_rule_group.map(group => {// + group.children.map(unitobj => { + if (!unitobj.criteria_value) { + Root.message({ + type: 'warning', + message: '璇峰厛娣诲姞鏄庣粏鏁版嵁' + }); + me.iscommit = false + return + } + var row_ = { + id: unitobj.id, + parent_id: me.formData.id, + criteria_id: unitobj.criteria_id, + criteria_value: unitobj.criteria_value, + remark: unitobj.remark ? unitobj.remark : '', + } + md_org_account_criteria_.push(row_); + }) + }) + } + else { + me.formdata_rule_group.map(group => {// + group.children.map(unitobj => { + if (!unitobj.criteria_value) { + Root.message({ + type: 'warning', + message: '璇峰厛娣诲姞鏄庣粏鏁版嵁' + }); + me.iscommit = false + return + } + var row_ = { + parent_id: me.formData.id, + criteria_id: unitobj.id, + criteria_value: unitobj.criteria_value, + remark: unitobj.remark ? unitobj.remark : '', + } + md_org_account_criteria_.push(row_); + }) + }) + } + + param.data["md_org_account_criteria"] = md_org_account_criteria_.length ? md_org_account_criteria_ : null; + + param.data[this.dataname] = entity; + param.data[this.table_dataname] = tableData_; + + // param.data["md_org_account_product"] = table_products_; + // param.data["md_org_account_province"] = table_provinces_; + + // 鏍¢獙鍞竴鎬� + var account_entity_id_filter = entity.company_id + entity.bu_id + entity.actor_code + entity.org_id + if (me.exists_account[account_entity_id_filter] && me.exists_account[account_entity_id_filter] != entity.id) { + Root.message({ + type: 'warning', + message: "缁忛攢鍟�" + entity.account_name + "宸插紑杩囨埛锛屽湪" + entity.company_name + entity.bu_name + entity.actor_name + "涓�" + }); + me.iscommit = false + return + } + + Server.call("root/data/" + operator_, param, function(result) { + console.log(result); + if (result.success) { + if(me.iscommit){ + me.iscommit = false; + Root.message({ + type: 'success', + message: '鎻愪氦鎴愬姛' + }); + me.saveAfter(); + } + else { + Root.message({ + type: 'success', + message: '淇濆瓨鎴愬姛' + }); + me.saveAfter(); + } + } + }, function(errorresult) { + console.log("閿欒淇℃伅", errorresult); + if (errorresult.messages && errorresult.messages.count && errorresult.messages.count.error) { + if (errorresult.messages.list) { + me.iscommit = false; + var config = { + totab: false, + // width: "1200px", + // height: 800, + icon: "icon-product", + text: "閿欒淇℃伅", + url: "module/tool/page/popup_error_messages.html", + data: {}, + delta: errorresult.messages.list, + callback: function(obj, callback) { + if (callback) { + callback(); + } + } + }; + me.doPopupByPublic(config); + } + } + else { + me.iscommit = false; + Root.message({ + type: 'error', + message: '鎻愪氦澶辫触' + }); + } + }); + }, + + // 閫氳繃鎴栨嫆缁� + onShowApproval(passOrRefuse) { + this.approveremark = ""; + this.reasonvisible = true;//瀹℃壒澶囨敞濉啓寮圭獥 + this.passOrRefuse = passOrRefuse;// commit涓嬩竴涓姸鎬�;approve閫氳繃;gohome;//鎷掔粷 goback;//鍥為�� + }, + saveReason() { + this.loading_pass = true; + if(this.passOrRefuse == "commit" || this.passOrRefuse == "approve"){ + this.doApproval(); + } + else{ + if(this.approveremark != ""){ + this.doApproval(); + } + else{ + Root.message({ + type: 'warning', + message: '璇峰~鍐欏師鍥�' + }); + this.loading_pass = false; + } + } + }, + doApproval() { + var me = this; + me.doRunApproval(); + + // this.getMachine(function(next_step, up_step) { // + // me.doRunApproval(next_step, up_step); + // }); + }, + + getMachine(callback) { + var me = this; + let param = { + dataname: "md_org_account", + } + Server.call("root/state/getMachine", param, function(result) { + var next_step = {}; // 鍚戜笅娴佺▼ + var up_step = {}; // 鍚戜笂娴佺▼ + + if (result && result.machine && result.machine.detail) { + result.machine.detail.map(md=>{ + next_step[md.from_code] = md.to_code; + up_step[md.to_code] = md.from_code; + }) + + callback(next_step, up_step); + } + }) + }, + + doRunApproval(next_step, up_step) { + var me = this; + if (!next_step) { + next_step = {} + } + if (!up_step) { + up_step = {} + } + + // this.passOrRefuse;//棣栨寮�鎴�-閫氳繃 + // commit // 涓嬩竴涓姸鎬� + // approve // 閫氳繃 + // gohome // 鎷掔粷 + // goback // 鍥為�� + + var to_state_ = ""; + if (this.passOrRefuse == "commit") { + to_state_ = next_step[this.formData.state_code]; + } + else if (this.passOrRefuse == "approve") { + // to_state_ = up_step[this.formData.state_code]; + } + else if (this.passOrRefuse == "gohome") { + // to_state_ = up_step[this.formData.state_code]; + } + else if (this.passOrRefuse == "goback") { + to_state_ = up_step[this.formData.state_code]; + } + + let param = { + dataname: "md_org_partnership", + id: me.formData.id, + remark: this.approveremark + } + if (to_state_) { + param.to_state = to_state_ + } + // + // return + Server.call("root/data/" + this.passOrRefuse, param, function(result) { + me.loading_pass = false; + console.log(result); + if (me.passOrRefuse == "commit" || me.passOrRefuse == "approve") { + Root.message({ + type: 'success', + message: '瀹℃壒鎴愬姛' + }); + } + else if (me.passOrRefuse == "goback") { + Root.message({ + type: 'success', + message: '宸查��鍥�' + }); + } + else if (me.passOrRefuse == "gohome") { + Root.message({ + type: 'success', + message: '宸叉嫆缁�' + }); + } + me.saveAfter(); + }, function(errorresult) { + console.log("閿欒淇℃伅", errorresult); + me.loading_pass = false; + if (errorresult.messages && errorresult.messages.count && errorresult.messages.count.error) { + if (errorresult.messages.list) { + var config = { + totab: false, + // width: "1200px", + // height: 800, + icon: "icon-product", + text: "閿欒淇℃伅", + url: "module/tool/page/popup_error_messages.html", + data: {}, + delta: errorresult.messages.list, + callback: function(obj, callback) { + if (callback) { + callback(); + } + } + }; + me.doPopupByPublic(config); + + } + } + else { + Root.message({ + type: 'error', + message: '瀹℃壒澶辫触' + }); + } + }); + }, + + } + }); + }; + + loadJsCss(function () { + initVue(); + }); + </script> + <style> + /* 鍦╲ue.js涓� v-cloak 杩欎釜鎸囦护鏄槻姝㈤〉闈㈠姞杞芥椂鍑虹幇 vuejs 鐨勫彉閲忓悕鑰岃璁$殑 */ + [v-cloak] { + display: none !important; + } + + .h_change_body { + border: 1px solid #C0C4CC; + border-radius: 4px; + padding: 5px; + box-sizing: border-box; + } + .me_h_itemgroup_row { + margin-bottom: 10px; + } + .me_h_itemgroup_row .me_h_unitlabel:before { + content: '*'; + color: #F56C6C; + margin-right: 4px; + } + .me_h_itemgroup_row .me_h_nounitlabel:before { + content: '*'; + color: #F56C6C00; + margin-right: 4px; + } + .itemgroup_row_item { + text-align: left; + } + </style> + + </head> + + <body style="margin: 0px;"> + <div v-cloak id="vbody"> + <div id="page_root"> + <div ref="popup_body" style="padding: 0 20px;"> + <div v-if="popupParames.totab" class="el-dialog__header"> + <div class="dialog-title"> + <i class="iconfont icon-customermanagement"></i> + <span> {{title}}</span> + </div> + </div> + <div :style="{height: dheight + 'px', 'overflow-y': 'auto'}"> + <div class="el-dialog__body"> + <div v-if="isChange && meta_account_change.length"> + <h-form + ref="change" + :form-attr="formAttr_change" + :table-fields="meta_account_change" + :form-data="formData_change" + :table-field-click="formfieldClick" + > + </h-form> + </div> + <div :class="meta_account_change.length ? 'h_change_body' : ''"> + <h-form + ref="JCXX" + :form-attr="formAttr" + :table-fields="formFields" + :form-data="formData" + :table-field-click="formfieldClick" + > + </h-form> + <div class="h_BU"> + <div > + <!-- <div class="h_title"> + <i class="iconfont icon-fuzhushuxian" style="color: #0270c1;"></i><span style="font-size: 14px;">鎴戞柟涓氬姟璐熻矗浜�</span> + </div> --> + <div style="padding: 0px;"> + <h-table v-if="tableFields.length" + ref="table1" + :table-attr="tableAttr" + :table-fields="tableFields" + :table-data="tableData" + :table-field-click="tablefieldClick" + :isfilterfield="false" + :isdraggableorder="false" + :table-buttons-click="tablebuttonclick" + :is-pagination="false" + :is-highlight-row="true" + :isbasicfilterfields="false" + + :is-within-edit-table-data="table_isedit" + > + </h-table> + </div> + </div> + </div> + + </div> + + + </div> + <div class="el-dialog__body" style="width: 100%; float: right; " > + <div v-if="formFields.length>0" > + <div class="h_table_title"><i class="iconfont icon-fuzhushuxian" style="color: rgb(2, 112, 193);"></i><span style="font-size: 16px;">閬撮�夋潯浠�</span></div> + </i> + <!-- <el-row style="display: flex;flex-direction: row;justify-content:space-between;padding-left: 91px;padding-top: 10px;" > + <el-col :span="16"><div class="itemgroup_field"><span>璇勫垎椤�</span></div></el-col> + <el-col :span="8"><div class="itemgroup_field"><span>璇勫垎</span></div></el-col> + </el-row> --> + <div style="width: 100%;height: 5px;margin: 10px 0px 25px 0px;background-color: gainsboro; opacity: 40%;"></div> + <template v-for="(formgroup, k) in formdata_rule_group.filter(e=>e.type_code == 'Selection')" > + <div style="display: flex;justify-content: space-between;padding: 5px;"> + <div style="width: 7%; display: flex; align-items: center; justify-content: center; text-align: center;font-weight: bold;border-right: 3px solid gainsboro;"> + <div style="display: flex;justify-content: center;align-items: center;margin-right: 15px;"> + <!-- {{formgroup.groupname}} --> + {{formgroup.group_name}} + </div> + </div> + <div style="width: 93%;padding: 0 10px;"> + + <el-row v-for="(unitobj, kc) in formgroup.children" :key="'YWNL' + k + kc" class="me_h_itemgroup_row"> + <el-col :span="6" class="itemgroup_row_item"> + <div> + <span :class="[unitobj.required_no ? 'me_h_nounitlabel' : 'me_h_unitlabel']" style="font-size: 12px;"> + <!-- {{unitobj.content_before}} --> + {{unitobj.content_before}} + </span> + </div> + </el-col> + <el-col :span="18" > + <div v-if="unitobj.content_type == 'textarea'"> + <el-input :disabled="formAttr.disabled" style="width:100%" type="textarea" + v-model="unitobj.criteria_value"> + </el-input> + </div> + <div v-else-if="unitobj.content_type == 'radio' && !unitobj.dictionary_id"> + <el-radio-group :disabled="formAttr.disabled" v-model="unitobj.criteria_value"> + <el-radio label="T">鏄�</el-radio> + <el-radio label="F">鍚�</el-radio> + </el-radio-group> + </div> + <div v-else-if="unitobj.content_type == 'radio' && unitobj.dictionary_id"> + <el-radio-group v-model="unitobj.criteria_value"> + <el-radio :disabled="formAttr.disabled" v-for="(r, k) in unitobj.options" :key="unitobj.id + k" :label="r.code">{{r.value}}</el-radio> + </el-radio-group> + </div> + <div v-else-if="unitobj.content_type == 'input'"> + <el-input :disabled="formAttr.disabled" style="width:100%" + v-model="unitobj.criteria_value"> + </el-input> + </div> + <div v-else-if="unitobj.content_type == 'date'"> + <el-date-picker + :disabled="formAttr.disabled" + style="width:100%" type="date" value-format="yyyy-MM-dd" + v-model="unitobj.criteria_value"> + </el-date-picker> + </div> + <div v-else-if="unitobj.content_type == 'upload'"> + <table> + <tr> + <td align="left" style="width: 100%; padding: 0px; overflow: hidden; border-bottom: 1px solid #DCDFE6;"> + <span class="h_cellclick" @click="buttonArrayClick(unitobj, {code:'showfile'})">{{unitobj.criteria_value}}</span> + </td> + <td > + <template v-if="isBusiness && unitobj.criteria_value"> + <el-button :disabled="formAttr.disabled" type="primary" style="padding: 5px;" @click="buttonArrayClick(unitobj, {code:'delfile'})" icon="el-icon-delete" class="form_delfile">鍒犻櫎闄勪欢</el-button> + </template > + + <template v-else-if="isBusiness && !unitobj.criteria_value"> + <el-button :disabled="formAttr.disabled" type="primary" style="padding: 5px;" @click="buttonArrayClick(unitobj, {code:'upload'})" icon="el-icon-upload" class="form_uploadfile">闄勪欢涓婁紶</el-button> + </template > + </td> + </tr> + </table> + </div> + </el-col> + </el-row> + </div> + </div> + <div style="width: 100%;height: 5px;margin-top: 25px;background-color: gainsboro;opacity: 40%"></div> + </template > + </div> + </div> + <div class="el-dialog__body" style="width: 100%; float: right; " > + <div v-if="formFields.length>0 " > + <div class="h_table_title"><i class="iconfont icon-fuzhushuxian" style="color: rgb(2, 112, 193);"></i><span style="font-size: 16px;">璇勪及琛�</span></div> + </i> + <!-- <el-row style="display: flex;flex-direction: row;justify-content:space-between;padding-left: 91px;padding-top: 10px;" > + <el-col :span="16"><div class="itemgroup_field"><span>璇勫垎椤�</span></div></el-col> + <el-col :span="8"><div class="itemgroup_field"><span>璇勫垎</span></div></el-col> + </el-row> --> + <div style="width: 100%;height: 5px;margin: 10px 0px 25px 0px;background-color: gainsboro; opacity: 40%;"></div> + <template v-for="(formgroup, k) in formdata_rule_group.filter(e=>e.type_code == 'Evaluation')"> + <div style="display: flex;justify-content: space-between;padding: 5px;"> + <div style="width: 7%; display: flex; align-items: center; justify-content: center; text-align: center;font-weight: bold;border-right: 3px solid gainsboro;"> + <div style="display: flex;justify-content: center;align-items: center;margin-right: 15px;"> + <!-- {{formgroup.groupname}} --> + {{formgroup.group_name}} + </div> + </div> + <div style="width: 93%;padding: 0 10px;"> + + <el-row v-for="(unitobj, kc) in formgroup.children" :key="'YWNL' + k + kc" class="me_h_itemgroup_row"> + <el-col :span="6" class="itemgroup_row_item"> + <div> + <span :class="[unitobj.required_no ? 'me_h_nounitlabel' : 'me_h_unitlabel']" style="font-size: 12px;"> + <!-- {{unitobj.content_before}} --> + {{unitobj.content_before}} + </span> + </div> + </el-col> + <el-col :span="18" > + <div v-if="unitobj.content_type == 'textarea'"> + <el-input :disabled="formAttr.disabled" style="width:100%" type="textarea" + v-model="unitobj.criteria_value"> + </el-input> + </div> + <div v-else-if="unitobj.content_type == 'radio' && !unitobj.dictionary_id"> + <el-radio-group :disabled="formAttr.disabled" v-model="unitobj.criteria_value"> + <el-radio label="T">鏄�</el-radio> + <el-radio label="F">鍚�</el-radio> + </el-radio-group> + </div> + <div v-else-if="unitobj.content_type == 'radio' && unitobj.dictionary_id"> + <el-radio-group v-model="unitobj.criteria_value"> + <el-radio :disabled="formAttr.disabled" v-for="(r, k) in unitobj.options" :key="unitobj.id + k" :label="r.code">{{r.value}}</el-radio> + </el-radio-group> + </div> + <div v-else-if="unitobj.content_type == 'input'"> + <el-input :disabled="formAttr.disabled" style="width:100%" + v-model="unitobj.criteria_value"> + </el-input> + </div> + <div v-else-if="unitobj.content_type == 'date'"> + <el-date-picker + :disabled="formAttr.disabled" + style="width:100%" type="date" value-format="yyyy-MM-dd" + v-model="unitobj.criteria_value"> + </el-date-picker> + </div> + <div v-else-if="unitobj.content_type == 'upload'"> + <table> + <tr> + <td align="left" style="width: 100%; padding: 0px; overflow: hidden; border-bottom: 1px solid #DCDFE6;"> + <span class="h_cellclick" @click="buttonArrayClick(unitobj, {code:'showfile'})">{{unitobj.criteria_value}}</span> + </td> + <td > + <template v-if="isBusiness && unitobj.criteria_value"> + <el-button :disabled="formAttr.disabled" type="primary" style="padding: 5px;" @click="buttonArrayClick(unitobj, {code:'delfile'})" icon="el-icon-delete" class="form_delfile">鍒犻櫎闄勪欢</el-button> + </template > + + <template v-else-if="isBusiness && !unitobj.criteria_value"> + <el-button :disabled="formAttr.disabled" type="primary" style="padding: 5px;" @click="buttonArrayClick(unitobj, {code:'upload'})" icon="el-icon-upload" class="form_uploadfile">闄勪欢涓婁紶</el-button> + </template > + </td> + </tr> + </table> + </div> + </el-col> + </el-row> + </div> + </div> + <div style="width: 100%;height: 5px;margin-top: 25px;background-color: gainsboro;opacity: 40%"></div> + </template > + </div> + </div> + </div> + + <el-dialog title="濉啓鍘熷洜" :visible.sync="reasonvisible" height="50%"> + <el-input + type="textarea" + :autosize="{ minRows: 2, maxRows: 10}" + placeholder="璇疯緭鍏ュ師鍥�" + v-model="approveremark"> + </el-input> + + <div slot="footer" class="dialog-footer" > + <el-button size="small" type="default" @click="reasonvisible = false">鍙� 娑�</el-button> + <el-button size="small" type="primary" :loading="loading_pass" @click="saveReason">纭� 瀹�</el-button> + </div> + </el-dialog> + + <div class="el-dialog__footer"> + <el-button-group style="margin-right: 80px;" > + <el-button size="small" v-if="isapproval" type="warning" plain @click="onShowApproval('gohome')">閫�鍥炲埌鐢宠浜�</el-button> + <el-button size="small" v-if="isapproval" type="danger" plain @click="onShowApproval('goback')">閫�鍥炲埌涓婁竴姝�</el-button> + </el-button-group> + <el-button size="small" type="default" @click="closeDialog">鍙� 娑�</el-button> + <el-button size="small" v-if="!isChange && isedit" type="success" @click="submitRowTable":icon="buttonsconfig.submit.icon">{{buttonsconfig.submit.name}}</el-button> + + <el-button size="small" v-if="isChange" type="success" @click="submitRowTable":icon="buttonsconfig.submit.icon">{{buttonsconfig.submit.name}}</el-button> + + <el-button size="small" v-if="isrefuseedit" type="success" @click="">鍐嶆鎻愪氦</el-button> + + <el-button size="small" v-if="isapproval" type="success" @click="onShowApproval('approve')">閫� 杩�</el-button> + <!-- <el-button size="small" v-if="isapproval" type="danger" @click="onShowApproval('goback')">鎷� 缁�</el-button> --> + <!-- <el-button size="small" v-if="isapproval" type="primary" @click="">杞� 鍔�</el-button> --> + <!-- <el-button size="small" v-if="isapproval" type="success" @click="onShowApproval('gohome')">閫� 鍥�</el-button> --> + </div> + </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/md/page/customer/page/customer_basic_acct.html b/module/md/page/customer/page/customer_basic_acct.html index ec53615..14ea082 100644 --- a/module/md/page/customer/page/customer_basic_acct.html +++ b/module/md/page/customer/page/customer_basic_acct.html @@ -487,6 +487,8 @@ // formdata_rule_group:[{group_name:'瀹㈣璇勫垎',group_code:'Objective',children:[]},{group_name:'涓昏璇勫垎',group_code:'Subjective',children:[]}], obj['group_code'] = e.group_code obj['group_name'] = e.group_name + obj['type_code'] = e.type_code + obj['type_name'] = e.type_name obj['children'] = [] // obj.children.push(e) me.formdata_rule_group.push(obj) @@ -1537,7 +1539,7 @@ } let param = { - dataname: this.dataname, + dataname: 'md_org_account', data: {}, } if (me.formData.id) { @@ -1553,25 +1555,50 @@ } } - me.formdata_rule_group.map(group => {// - group.children.map(unitobj => { - if (!unitobj.criteria_value) { - Root.message({ - type: 'warning', - message: '璇峰厛娣诲姞鏄庣粏鏁版嵁' - }); - me.iscommit = false - return - } - var row_ = { - parent_id: me.formData.id, - criteria_id: unitobj.id, - criteria_value: unitobj.criteria_value, - remark: unitobj.remark ? unitobj.remark : '', - } - md_org_account_criteria_.push(row_); + if (me.formData_criteria && me.formData_criteria.length > 0) { //涓嶆槸鏂板 + me.formdata_rule_group.map(group => {// + group.children.map(unitobj => { + if (!unitobj.criteria_value) { + Root.message({ + type: 'warning', + message: '璇峰厛娣诲姞鏄庣粏鏁版嵁' + }); + me.iscommit = false + return + } + var row_ = { + id: unitobj.id, + parent_id: me.formData.id, + criteria_id: unitobj.criteria_id, + criteria_value: unitobj.criteria_value, + remark: unitobj.remark ? unitobj.remark : '', + } + md_org_account_criteria_.push(row_); + }) }) - }) + } + else { + me.formdata_rule_group.map(group => {// + group.children.map(unitobj => { + if (!unitobj.criteria_value) { + Root.message({ + type: 'warning', + message: '璇峰厛娣诲姞鏄庣粏鏁版嵁' + }); + me.iscommit = false + return + } + var row_ = { + parent_id: me.formData.id, + criteria_id: unitobj.id, + criteria_value: unitobj.criteria_value, + remark: unitobj.remark ? unitobj.remark : '', + } + md_org_account_criteria_.push(row_); + }) + }) + } + param.data["md_org_account_criteria"] = md_org_account_criteria_.length ? md_org_account_criteria_ : null; param.data[this.dataname] = entity; @@ -1891,16 +1918,16 @@ </div> - <div v-if='formFields.length>0' class="el-dialog__body" style="width: 100%; float: right; "> - <div> - <div class="h_table_title"><i class="iconfont icon-fuzhushuxian" style="color: rgb(2, 112, 193);"></i><span style="font-size: 16px;">鎺ㄥ箍鍟嗚瘎鍒�</span></div> + <div class="el-dialog__body" style="width: 100%; float: right; " > + <div v-if="formFields.length>0" > + <div class="h_table_title"><i class="iconfont icon-fuzhushuxian" style="color: rgb(2, 112, 193);"></i><span style="font-size: 16px;">閬撮�夋潯浠�</span></div> </i> <!-- <el-row style="display: flex;flex-direction: row;justify-content:space-between;padding-left: 91px;padding-top: 10px;" > <el-col :span="16"><div class="itemgroup_field"><span>璇勫垎椤�</span></div></el-col> <el-col :span="8"><div class="itemgroup_field"><span>璇勫垎</span></div></el-col> </el-row> --> <div style="width: 100%;height: 5px;margin: 10px 0px 25px 0px;background-color: gainsboro; opacity: 40%;"></div> - <template v-for="(formgroup, k) in formdata_rule_group"> + <template v-for="(formgroup, k) in formdata_rule_group.filter(e=>e.type_code == 'Selection')" > <div style="display: flex;justify-content: space-between;padding: 5px;"> <div style="width: 7%; display: flex; align-items: center; justify-content: center; text-align: center;font-weight: bold;border-right: 3px solid gainsboro;"> <div style="display: flex;justify-content: center;align-items: center;margin-right: 15px;"> @@ -1921,28 +1948,30 @@ </el-col> <el-col :span="18" > <div v-if="unitobj.content_type == 'textarea'"> - <el-input style="width:100%" type="textarea" + <el-input :disabled="formAttr.disabled" style="width:100%" type="textarea" v-model="unitobj.criteria_value"> </el-input> </div> <div v-else-if="unitobj.content_type == 'radio' && !unitobj.dictionary_id"> - <el-radio-group v-model="unitobj.criteria_value"> + <el-radio-group :disabled="formAttr.disabled" v-model="unitobj.criteria_value"> <el-radio label="T">鏄�</el-radio> <el-radio label="F">鍚�</el-radio> </el-radio-group> </div> <div v-else-if="unitobj.content_type == 'radio' && unitobj.dictionary_id"> <el-radio-group v-model="unitobj.criteria_value"> - <el-radio v-for="(r, k) in unitobj.options" :key="unitobj.id + k" :label="r.code">{{r.value}}</el-radio> + <el-radio :disabled="formAttr.disabled" v-for="(r, k) in unitobj.options" :key="unitobj.id + k" :label="r.code">{{r.value}}</el-radio> </el-radio-group> </div> <div v-else-if="unitobj.content_type == 'input'"> - <el-input style="width:100%" + <el-input :disabled="formAttr.disabled" style="width:100%" v-model="unitobj.criteria_value"> </el-input> </div> <div v-else-if="unitobj.content_type == 'date'"> - <el-date-picker style="width:100%" type="date" value-format="yyyy-MM-dd" + <el-date-picker + :disabled="formAttr.disabled" + style="width:100%" type="date" value-format="yyyy-MM-dd" v-model="unitobj.criteria_value"> </el-date-picker> </div> @@ -1954,11 +1983,11 @@ </td> <td > <template v-if="isBusiness && unitobj.criteria_value"> - <el-button type="primary" style="padding: 5px;" @click="buttonArrayClick(unitobj, {code:'delfile'})" icon="el-icon-delete" class="form_delfile">鍒犻櫎闄勪欢</el-button> + <el-button :disabled="formAttr.disabled" type="primary" style="padding: 5px;" @click="buttonArrayClick(unitobj, {code:'delfile'})" icon="el-icon-delete" class="form_delfile">鍒犻櫎闄勪欢</el-button> </template > <template v-else-if="isBusiness && !unitobj.criteria_value"> - <el-button type="primary" style="padding: 5px;" @click="buttonArrayClick(unitobj, {code:'upload'})" icon="el-icon-upload" class="form_uploadfile">闄勪欢涓婁紶</el-button> + <el-button :disabled="formAttr.disabled" type="primary" style="padding: 5px;" @click="buttonArrayClick(unitobj, {code:'upload'})" icon="el-icon-upload" class="form_uploadfile">闄勪欢涓婁紶</el-button> </template > </td> </tr> @@ -1968,7 +1997,90 @@ </el-row> </div> </div> - <div style="width: 100%;height: 5px;margin: 25px 0px;background-color: gainsboro;opacity: 40%"></div> + <div style="width: 100%;height: 5px;margin-top: 25px;background-color: gainsboro;opacity: 40%"></div> + </template > + </div> + </div> + <div class="el-dialog__body" style="width: 100%; float: right; " > + <div v-if="formFields.length>0 " > + <div class="h_table_title"><i class="iconfont icon-fuzhushuxian" style="color: rgb(2, 112, 193);"></i><span style="font-size: 16px;">璇勪及琛�</span></div> + </i> + <!-- <el-row style="display: flex;flex-direction: row;justify-content:space-between;padding-left: 91px;padding-top: 10px;" > + <el-col :span="16"><div class="itemgroup_field"><span>璇勫垎椤�</span></div></el-col> + <el-col :span="8"><div class="itemgroup_field"><span>璇勫垎</span></div></el-col> + </el-row> --> + <div style="width: 100%;height: 5px;margin: 10px 0px 25px 0px;background-color: gainsboro; opacity: 40%;"></div> + <template v-for="(formgroup, k) in formdata_rule_group.filter(e=>e.type_code == 'Evaluation')"> + <div style="display: flex;justify-content: space-between;padding: 5px;"> + <div style="width: 7%; display: flex; align-items: center; justify-content: center; text-align: center;font-weight: bold;border-right: 3px solid gainsboro;"> + <div style="display: flex;justify-content: center;align-items: center;margin-right: 15px;"> + <!-- {{formgroup.groupname}} --> + {{formgroup.group_name}} + </div> + </div> + <div style="width: 93%;padding: 0 10px;"> + + <el-row v-for="(unitobj, kc) in formgroup.children" :key="'YWNL' + k + kc" class="me_h_itemgroup_row"> + <el-col :span="6" class="itemgroup_row_item"> + <div> + <span :class="[unitobj.required_no ? 'me_h_nounitlabel' : 'me_h_unitlabel']" style="font-size: 12px;"> + <!-- {{unitobj.content_before}} --> + {{unitobj.content_before}} + </span> + </div> + </el-col> + <el-col :span="18" > + <div v-if="unitobj.content_type == 'textarea'"> + <el-input :disabled="formAttr.disabled" style="width:100%" type="textarea" + v-model="unitobj.criteria_value"> + </el-input> + </div> + <div v-else-if="unitobj.content_type == 'radio' && !unitobj.dictionary_id"> + <el-radio-group :disabled="formAttr.disabled" v-model="unitobj.criteria_value"> + <el-radio label="T">鏄�</el-radio> + <el-radio label="F">鍚�</el-radio> + </el-radio-group> + </div> + <div v-else-if="unitobj.content_type == 'radio' && unitobj.dictionary_id"> + <el-radio-group v-model="unitobj.criteria_value"> + <el-radio :disabled="formAttr.disabled" v-for="(r, k) in unitobj.options" :key="unitobj.id + k" :label="r.code">{{r.value}}</el-radio> + </el-radio-group> + </div> + <div v-else-if="unitobj.content_type == 'input'"> + <el-input :disabled="formAttr.disabled" style="width:100%" + v-model="unitobj.criteria_value"> + </el-input> + </div> + <div v-else-if="unitobj.content_type == 'date'"> + <el-date-picker + :disabled="formAttr.disabled" + style="width:100%" type="date" value-format="yyyy-MM-dd" + v-model="unitobj.criteria_value"> + </el-date-picker> + </div> + <div v-else-if="unitobj.content_type == 'upload'"> + <table> + <tr> + <td align="left" style="width: 100%; padding: 0px; overflow: hidden; border-bottom: 1px solid #DCDFE6;"> + <span class="h_cellclick" @click="buttonArrayClick(unitobj, {code:'showfile'})">{{unitobj.criteria_value}}</span> + </td> + <td > + <template v-if="isBusiness && unitobj.criteria_value"> + <el-button :disabled="formAttr.disabled" type="primary" style="padding: 5px;" @click="buttonArrayClick(unitobj, {code:'delfile'})" icon="el-icon-delete" class="form_delfile">鍒犻櫎闄勪欢</el-button> + </template > + + <template v-else-if="isBusiness && !unitobj.criteria_value"> + <el-button :disabled="formAttr.disabled" type="primary" style="padding: 5px;" @click="buttonArrayClick(unitobj, {code:'upload'})" icon="el-icon-upload" class="form_uploadfile">闄勪欢涓婁紶</el-button> + </template > + </td> + </tr> + </table> + </div> + </el-col> + </el-row> + </div> + </div> + <div style="width: 100%;height: 5px;margin-top: 25px;background-color: gainsboro;opacity: 40%"></div> </template > </div> </div> @@ -1994,10 +2106,8 @@ <el-button size="small" v-if="isapproval" type="danger" plain @click="onShowApproval('goback')">閫�鍥炲埌涓婁竴姝�</el-button> </el-button-group> <el-button size="small" type="default" @click="closeDialog">鍙� 娑�</el-button> - <el-button size="small" v-if="!isChange && (isedit || isrefuseedit)" type="primary" @click="saveRowTable":icon="buttonsconfig.save.icon">{{buttonsconfig.save.name}}</el-button> <el-button size="small" v-if="!isChange && isedit" type="success" @click="submitRowTable":icon="buttonsconfig.submit.icon">{{buttonsconfig.submit.name}}</el-button> - <el-button size="small" v-if="isChange" type="primary" @click="saveChangeRowTable":icon="buttonsconfig.save.icon">{{buttonsconfig.save.name}}</el-button> <el-button size="small" v-if="isChange" type="success" @click="submitRowTable":icon="buttonsconfig.submit.icon">{{buttonsconfig.submit.name}}</el-button> <el-button size="small" v-if="isrefuseedit" type="success" @click="">鍐嶆鎻愪氦</el-button> diff --git a/module/md/page/customer/page/customer_list_account.html b/module/md/page/customer/page/customer_list_account.html index a820d5f..169c84e 100644 --- a/module/md/page/customer/page/customer_list_account.html +++ b/module/md/page/customer/page/customer_list_account.html @@ -22,8 +22,8 @@ {code: "orglist", name: "鍌ㄥ", dataname: "md_org_customer", filterTxt: "", orderby: "md_org.update_time desc, md_org.code"}, // {code: "distributorlist", name: "閰嶉�佸晢鍒楄〃", dataname: "md_org_customer", filterTxt: "md_org.source='DMS' and md_org.state_code='Open'", orderby: "md_org.update_time desc, md_org.code"}, // {code: "nccsy", name: "NCC棣栬惀", dataname: "md_org_account_ncc", filterTxt: "1=1", orderby: "md_org_account_ncc.update_time desc, code"}, - {code: "WaitOpen", name: "棰勫悎浣�", dataname: "md_org_account", filterTxt: "(md_org_account.state_code='Input' or md_org_account.state_code='OpeningApproval')", orderby: "md_org_account.update_time desc, md_org_account.code"}, - {code: "Open", name: "鍚堜綔涓�", dataname: "md_org_account", filterTxt: "md_org_account.state_code='Open'", orderby: "md_org_account.update_time desc, md_org_account.code"}, + {code: "WaitOpen", name: "棰勫悎浣�", dataname: "md_org_account", filterTxt: "(md_org_account.state_code='OpeningApproval' or md_org_account.state_code='Open')", orderby: "md_org_account.update_time desc, md_org_account.code"}, + {code: "Open", name: "鍚堜綔涓�", dataname: "md_org_partnership", filterTxt: "md_org_account.state_code='Incooperation'", orderby: "md_org_account.update_time desc, md_org_account.code"}, {code: "Close", name: "宸查��鍑�", dataname: "md_org_account", filterTxt: "md_org_account.state_code='Close'", orderby: "md_org_account.update_time desc, md_org_account.code"}, {code: "All", name: "鍏ㄩ儴", dataname: "md_org_account", filterTxt: "1=1", orderby: "md_org_account.update_time desc, md_org_account.code"}, {code: "Change", name: "鍙樻洿璁板綍", dataname: "md_org_account_change", orderby: "update_time desc"}, @@ -744,7 +744,7 @@ code: "account",isselected: true,classname: "", disabled: function(selectRowList) { var bo_ = true; - if (selectRowList[0] && selectRowList[0].state_code == "Prepared") { + if (selectRowList[0] && selectRowList[0].state_code == "Open") { bo_ = false; } return bo_ @@ -858,7 +858,7 @@ code: "account",isselected: true,classname: "", disabled: function(selectRowList) { var bo_ = true; - if (selectRowList[0] && selectRowList[0].state_code == 'Open') { + if (selectRowList[0] && selectRowList[0].state_code == 'InCooperation') { bo_ = false; } return bo_ @@ -873,7 +873,7 @@ code: "change",isselected: true,classname: "", disabled: function(selectRowList) { var bo_ = true; - if (selectRowList[0] && selectRowList[0].state_code == 'Open') { + if (selectRowList[0] && selectRowList[0].state_code == 'InCooperation') { bo_ = false; } return bo_ @@ -935,7 +935,7 @@ code: "submit", isselected: true, classname: "", disabled: function(selectRowList) { var bo_ = true ; - if (selectRowList[0] && selectRowList[0].state_code == 'Input') { + if (selectRowList[0] && selectRowList[0].state_code == 'Open') { bo_ = false } return bo_; @@ -945,7 +945,7 @@ // obj.selectedList // me.closeData('browse', obj.selectedList[0]); // me.commitData(obj.selectedList[0]); - me.openCustomerUser('edit', obj.selectedList[0]); + me.commitnCustomerUser('edit', obj.selectedList[0]); } }, @@ -1444,7 +1444,35 @@ }; me.doPopupByPublic(config); }, - + commitnCustomerUser(sceneCode, row) { + var me = this; + Root.confirm('鏄惁纭鎻愪氦', '鎻愪氦鎻愮ず', { + confirmButtonText: '纭� 璁�', + cancelButtonText: '鍙� 娑�', + type: 'warning' + }).then(() => { + let param = { + id: row.id, + dataname: 'md_org_partnership', + // data: {} + } + // param.data['md_org_partnership'] = row + + Server.call("root/data/commit", param, function(result) { + console.log(result); + Root.message({ + type: 'success', + message: '宸叉彁浜�' + }); + me.onQuery(); + }); + }).catch(() => { + Root.message({ + type: 'info', + message: '宸插彇娑堟彁浜�' + }); + }); + }, openCustomerUser(sceneCode, obj) { let me = this; var delta_ = {}; diff --git a/module/md/page/customer/page/evaluation_management.html b/module/md/page/customer/page/evaluation_management.html index f218514..6e996d3 100644 --- a/module/md/page/customer/page/evaluation_management.html +++ b/module/md/page/customer/page/evaluation_management.html @@ -25,7 +25,7 @@ // // {code: "Closed", name: "澶辨晥", dataname:"so_implant", filterTxt: "state_code='Open'",}, // {code: "All", name: "鍏ㄩ儴", dataname: "md_target_dealer", filterTxt: "1 = 1", orderby: "update_time desc"}, - {code: "Current", name: "褰撳墠璇勪及", dataname: "md_org_account", filterTxt: "1=1", orderby: "update_time desc"}, + {code: "Current", name: "褰撳墠璇勪及", dataname: "md_org_account", filterTxt: "1=1 and md_org_account.state_code <> 'Input'", orderby: "update_time desc"}, {code: "History", name: "鍘嗗彶璇勪及", dataname: "md_org_account", filterTxt: "1=1", orderby: ""}, // {code: "Apply", name: "鎸囨爣鐢宠", dataname: "md_target_apply", filterTxt: "1 = 1", orderby: "update_time desc"}, ], @@ -244,7 +244,7 @@ return bo_ }, onclick: function(obj) { - me.openCustomer('browse',obj.selectedList[0]) + me.openCustomerHistory('browse',obj.selectedList[0]) } } ] @@ -284,6 +284,40 @@ }; me.doPopupByPublic(config); }, + openCustomerHistory(sceneCode, obj) { + let me = this; + var row = {} + if (sceneCode == "edit" || sceneCode == "browse") { + row = me.selectTabObj.selectedrow; + if(!row){ + Root.message({ + type: 'warning', + message: '璇烽�夋嫨涓�鏉℃暟鎹�' + }); + return; + } + } + + var config = { + totab: false, //true: 浠ab瀵艰埅鐨勬柟寮忔墦寮� + width: "1100px", + height: "520px", + icon: "icon-product", + text: "鎺ㄥ箍鍟嗚瘎浼拌褰�" + (row.customer_code ? ("-" + row.customer_code) : ""), + id: "evaluation_management_edit" + row.id + sceneCode, + url: "module/md/page/customer/page/evaluation_history.html", + data: row, + delta: {}, + sceneCode: sceneCode,//"refuseedit",//"approval", //"add"//"browse", + callback: function(obj, callback) { + me.onQuery(); + if (callback) { + callback(); + } + } + }; + me.doPopupByPublic(config); + }, } }); diff --git a/module/md/page/customer/page/evaluation_management_edit.html b/module/md/page/customer/page/evaluation_management_edit.html index da88915..0a79b73 100644 --- a/module/md/page/customer/page/evaluation_management_edit.html +++ b/module/md/page/customer/page/evaluation_management_edit.html @@ -357,6 +357,8 @@ // formdata_rule_group:[{group_name:'瀹㈣璇勫垎',group_code:'Objective',children:[]},{group_name:'涓昏璇勫垎',group_code:'Subjective',children:[]}], obj['group_code'] = e.group_code obj['group_name'] = e.group_name + obj['type_code'] = e.type_code + obj['type_name'] = e.type_name obj['children'] = [] // obj.children.push(e) me.formdata_rule_group.push(obj) @@ -482,6 +484,9 @@ }) }, + // change(e){ + // this.$forceUpdate(); + // }, tableFieldClick() { var me = this; @@ -489,68 +494,7 @@ this.tablefieldClick = {}; //琛ㄥ崟瀛楁浜嬩欢璁剧疆 - this.formfieldClick = { - province: {//瀛楁浜嬩欢璁剧疆 - select: { - onchange: function(obj, refreshCallback) {//涓嬫媺灞曞紑浜嬩欢 - obj.data.province = obj.selectoption.value || ""; - obj.data.city = ""; - obj.data.county = ""; - refreshCallback(); - // me.$set(me.tabsobj.DDWL, "formData", me.tabsobj.DDWL.formData); - // var formData_ = clone(me.tabsobj.DDWL.formData); - // me.tabsobj.DDWL.formData = formData_; - }, - }, - }, - city: {//瀛楁浜嬩欢璁剧疆 - visible: { - onchange: function(obj,row,callback) {//涓嬫媺灞曞紑浜嬩欢 - if (me.formData.province) { - var formFields_ = clone(me.formFields); - formFields_.map(f=>{ - if (f.field == "city") { - if (me.md_geo_city_obj[me.formData.province] && me.md_geo_city_obj[me.formData.province].length) { - f.options = clone(me.md_geo_city_obj[me.formData.province]) - } - } - }) - me.formFields = clone(formFields_); - } - } - }, - select: { - onchange: function(obj,refreshCallback) {//涓嬫媺灞曞紑浜嬩欢 - obj.data.city = obj.selectoption.value || ""; - obj.data.county = ""; - refreshCallback() - }, - }, - }, - county: { - visible: { - onchange: function(fieldObj, row, callback) {//涓嬫媺灞曞紑浜嬩欢 - if (me.formData.city) { - var formFields_ = clone(me.formFields); - formFields_.map(f=>{ - if (f.field == "county") { - if (me.md_geo_county_obj[me.formData.city] && me.md_geo_county_obj[me.formData.city].length) { - f.options = clone(me.md_geo_county_obj[me.formData.city]) - } - } - }) - me.formFields = clone(formFields_); - } - }, - }, - select: { - onchange: function(obj,refreshCallback) {//涓嬫媺灞曞紑浜嬩欢 - obj.data.county = obj.selectoption.value - refreshCallback() - } - } - }, - }; + this.formfieldClick = {}; }, open_customerlist(obj) { @@ -674,7 +618,7 @@ var formData_criteria_ = [] var formData_criteria_new = [] var criteria_ = {} - + me.formdata_rule_group.map(g=>{ formData_criteria_ = formData_criteria_.concat(g.children) }) //缂栬緫椤甸潰鐨勮瘎鍒嗘暟鎹拰棰樼洰 @@ -691,7 +635,11 @@ } }) }) - + let formData_criteria_history = clone(me.formData_criteria) + formData_criteria_history.map(e =>{ + e['data_id'] = e.id + delete e.id + }) // me.formdata_rule_group.map(g=>{ // }) @@ -834,97 +782,177 @@ <div class="dialog-title"> <i class="iconfont icon-customermanagement"></i> <span> {{title}}</span> - <el-button style="float: right;right: 10%;" @click="openDocument()">閬撮�夎烦杞�</el-button> </div> </div> <div :style="{height: dheight + 'px', 'overflow-y': 'auto'}"> <!-- <div style="position: absolute; top:40px; bottom: 50px; left: 0px; right: 0px; overflow-y: auto;"> --> - <div class="el-dialog__body"> - <!-- <div v-if="showtab.SYPG && activeTabName=='SYPG' && activeTabName_detail=='YWNL'"> --> + <div class="el-dialog__body" style="width: 100%; " > <div> - <div style=" border: 1px solid #C0C4CC ;padding: 5px"> - <div > - <el-row style="display: flex;flex-direction: row;justify-content:space-between;padding-left: 91px;" > - <el-col :span="6"><div class="itemgroup_field" style="font-size: 14px;font-weight: bold;margin-right: 10px;"><span>璇勫垎椤�</span></div></el-col> - <el-col :span="18"><div class="itemgroup_field" style="font-size: 14px;font-weight: bold;"><span>璇勫垎</span></div></el-col> - - </el-row> - <div style="width: 100%;height: 5px;margin: 10px 0px 25px 0px;background-color: gainsboro; opacity: 40%;"></div> - <template v-for="(formgroup, k) in formdata_rule_group"> - <div style="display: flex;justify-content: space-between;padding: 5px;"> - <div style="width: 7%; display: flex; align-items: center; justify-content: center; text-align: center;font-weight: bold;border-right: 3px solid gainsboro;"> - <div style="display: flex;justify-content: center;align-items: center;margin-right: 15px;"> - <!-- {{formgroup.groupname}} --> - {{formgroup.group_name}} - </div> - </div> - <div style="width: 93%;padding: 0 10px;"> - - <el-row v-for="(unitobj, kc) in formgroup.children" :key="'YWNL' + k + kc" class="me_h_itemgroup_row"> - <el-col :span="6" class="itemgroup_row_item"> - <div> - <span :class="[unitobj.required_no ? 'me_h_nounitlabel' : 'me_h_unitlabel']" style="font-size: 13px;"> - <!-- {{unitobj.content_before}} --> - {{unitobj.content_before}} - </span> - </div> - </el-col> - <el-col :span="18" > - <div v-if="unitobj.content_type == 'textarea'"> - <el-input style="width:100%" type="textarea" - v-model="unitobj.criteria_value"> - </el-input> - </div> - <div v-else-if="unitobj.content_type == 'radio' && !unitobj.dictionary_id"> - <el-radio-group v-model="unitobj.criteria_value"> - <el-radio label="T">鏄�</el-radio> - <el-radio label="F">鍚�</el-radio> - </el-radio-group> - </div> - <div v-else-if="unitobj.content_type == 'radio' && unitobj.dictionary_id"> - <el-radio-group v-model="unitobj.criteria_value"> - <el-radio v-for="(r, k) in unitobj.options" :key="unitobj.id + k" :label="r.code">{{r.value}}</el-radio> - </el-radio-group> - </div> - <div v-else-if="unitobj.content_type == 'input'"> - <el-input style="width:100%" - v-model="unitobj.criteria_value"> - </el-input> - </div> - <div v-else-if="unitobj.content_type == 'date'"> - <el-date-picker style="width:100%" type="date" value-format="yyyy-MM-dd" - v-model="unitobj.criteria_value"> - </el-date-picker> - </div> - <div v-else-if="unitobj.content_type == 'upload'"> - <table> - <tr> - <td align="left" style="width: 100%; padding: 0px; overflow: hidden; border-bottom: 1px solid #DCDFE6;"> - <span class="h_cellclick" @click="buttonArrayClick(unitobj, {code:'showfile'})">{{unitobj.criteria_value}}</span> - </td> - <td > - <template v-if="isBusiness && unitobj.criteria_value"> - <el-button type="primary" style="padding: 5px;" @click="buttonArrayClick(unitobj, {code:'delfile'})" icon="el-icon-delete" class="form_delfile">鍒犻櫎闄勪欢</el-button> - </template > - - <template v-else-if="isBusiness && !unitobj.criteria_value"> - <el-button type="primary" style="padding: 5px;" @click="buttonArrayClick(unitobj, {code:'upload'})" icon="el-icon-upload" class="form_uploadfile">闄勪欢涓婁紶</el-button> - </template > - </td> - </tr> - </table> - </div> - </el-col> - </el-row> - </div> + <div class="h_table_title"><i class="iconfont icon-fuzhushuxian" style="color: rgb(2, 112, 193);"></i><span style="font-size: 16px;">閬撮�夋潯浠�</span></div> + </i> + <!-- <el-row style="display: flex;flex-direction: row;justify-content:space-between;padding-left: 91px;padding-top: 10px;" > + <el-col :span="16"><div class="itemgroup_field"><span>璇勫垎椤�</span></div></el-col> + <el-col :span="8"><div class="itemgroup_field"><span>璇勫垎</span></div></el-col> + </el-row> --> + <div style="width: 100%;height: 5px;margin: 10px 0px 25px 0px;background-color: gainsboro; opacity: 40%;"></div> + <template v-for="(formgroup, k) in formdata_rule_group.filter(e=>e.type_code == 'Selection')" > + <div style="display: flex;justify-content: space-between;padding: 5px;"> + <div style="width: 7%; display: flex; align-items: center; justify-content: center; text-align: center;font-weight: bold;border-right: 3px solid gainsboro;"> + <div style="display: flex;justify-content: center;align-items: center;margin-right: 15px;"> + <!-- {{formgroup.groupname}} --> + {{formgroup.group_name}} </div> - <div style="width: 100%;height: 5px;margin: 25px 0px;background-color: gainsboro;opacity: 40%"></div> - </template > + </div> + <div style="width: 93%;padding: 0 10px;"> + + <el-row v-for="(unitobj, kc) in formgroup.children" :key="'YWNL' + k + kc" class="me_h_itemgroup_row"> + <el-col :span="6" class="itemgroup_row_item"> + <div> + <span :class="[unitobj.required_no ? 'me_h_nounitlabel' : 'me_h_unitlabel']" style="font-size: 12px;"> + <!-- {{unitobj.content_before}} --> + {{unitobj.content_before}} + </span> + </div> + </el-col> + <el-col :span="18" > + <div v-if="unitobj.content_type == 'textarea'"> + <el-input :disabled="formAttr.disabled" style="width:100%" type="textarea" + v-model="unitobj.criteria_value"> + </el-input> + </div> + <div v-else-if="unitobj.content_type == 'radio' && !unitobj.dictionary_id"> + <el-radio-group :disabled="formAttr.disabled" v-model="unitobj.criteria_value"> + <el-radio label="T">鏄�</el-radio> + <el-radio label="F">鍚�</el-radio> + </el-radio-group> + </div> + <div v-else-if="unitobj.content_type == 'radio' && unitobj.dictionary_id"> + <el-radio-group v-model="unitobj.criteria_value"> + <el-radio :disabled="formAttr.disabled" v-for="(r, k) in unitobj.options" :key="unitobj.id + k" :label="r.code">{{r.value}}</el-radio> + </el-radio-group> + </div> + <div v-else-if="unitobj.content_type == 'input'"> + <el-input :disabled="formAttr.disabled" style="width:100%" + v-model="unitobj.criteria_value"> + </el-input> + </div> + <div v-else-if="unitobj.content_type == 'date'"> + <el-date-picker + :disabled="formAttr.disabled" + style="width:100%" type="date" value-format="yyyy-MM-dd" + v-model="unitobj.criteria_value"> + </el-date-picker> + </div> + <div v-else-if="unitobj.content_type == 'upload'"> + <table> + <tr> + <td align="left" style="width: 100%; padding: 0px; overflow: hidden; border-bottom: 1px solid #DCDFE6;"> + <span class="h_cellclick" @click="buttonArrayClick(unitobj, {code:'showfile'})">{{unitobj.criteria_value}}</span> + </td> + <td > + <template v-if="isBusiness && unitobj.criteria_value"> + <el-button :disabled="formAttr.disabled" type="primary" style="padding: 5px;" @click="buttonArrayClick(unitobj, {code:'delfile'})" icon="el-icon-delete" class="form_delfile">鍒犻櫎闄勪欢</el-button> + </template > + + <template v-else-if="isBusiness && !unitobj.criteria_value"> + <el-button :disabled="formAttr.disabled" type="primary" style="padding: 5px;" @click="buttonArrayClick(unitobj, {code:'upload'})" icon="el-icon-upload" class="form_uploadfile">闄勪欢涓婁紶</el-button> + </template > + </td> + </tr> + </table> + </div> + </el-col> + </el-row> + </div> </div> - </div> + <div style="width: 100%;height: 5px;margin-top: 25px;background-color: gainsboro;opacity: 40%"></div> + </template > </div> </div> - <el-row> + <div class="el-dialog__body" style="width: 100%; " > + <div> + <div class="h_table_title"><i class="iconfont icon-fuzhushuxian" style="color: rgb(2, 112, 193);"></i><span style="font-size: 16px;">璇勪及琛�</span></div> + </i> + <!-- <el-row style="display: flex;flex-direction: row;justify-content:space-between;padding-left: 91px;padding-top: 10px;" > + <el-col :span="16"><div class="itemgroup_field"><span>璇勫垎椤�</span></div></el-col> + <el-col :span="8"><div class="itemgroup_field"><span>璇勫垎</span></div></el-col> + </el-row> --> + <div style="width: 100%;height: 5px;margin: 10px 0px 25px 0px;background-color: gainsboro; opacity: 40%;"></div> + <template v-for="(formgroup, k) in formdata_rule_group.filter(e=>e.type_code == 'Evaluation')" > + <div style="display: flex;justify-content: space-between;padding: 5px;"> + <div style="width: 7%; display: flex; align-items: center; justify-content: center; text-align: center;font-weight: bold;border-right: 3px solid gainsboro;"> + <div style="display: flex;justify-content: center;align-items: center;margin-right: 15px;"> + <!-- {{formgroup.groupname}} --> + {{formgroup.group_name}} + </div> + </div> + <div style="width: 93%;padding: 0 10px;"> + + <el-row v-for="(unitobj, kc) in formgroup.children" :key="'YWNL' + k + kc" class="me_h_itemgroup_row"> + <el-col :span="6" class="itemgroup_row_item"> + <div> + <span :class="[unitobj.required_no ? 'me_h_nounitlabel' : 'me_h_unitlabel']" style="font-size: 12px;"> + <!-- {{unitobj.content_before}} --> + {{unitobj.content_before}} + </span> + </div> + </el-col> + <el-col :span="18" > + <div v-if="unitobj.content_type == 'textarea'"> + <el-input :disabled="formAttr.disabled" style="width:100%" type="textarea" + v-model="unitobj.criteria_value"> + </el-input> + </div> + <div v-else-if="unitobj.content_type == 'radio' && !unitobj.dictionary_id"> + <el-radio-group :disabled="formAttr.disabled" v-model="unitobj.criteria_value"> + <el-radio label="T">鏄�</el-radio> + <el-radio label="F">鍚�</el-radio> + </el-radio-group> + </div> + <div v-else-if="unitobj.content_type == 'radio' && unitobj.dictionary_id"> + <el-radio-group v-model="unitobj.criteria_value"> + <el-radio :disabled="formAttr.disabled" v-for="(r, k) in unitobj.options" :key="unitobj.id + k" :label="r.code">{{r.value}}</el-radio> + </el-radio-group> + </div> + <div v-else-if="unitobj.content_type == 'input'"> + <el-input :disabled="formAttr.disabled" style="width:100% " + v-model="unitobj.criteria_value"> + </el-input> + </div> + <div v-else-if="unitobj.content_type == 'date'"> + <el-date-picker + :disabled="formAttr.disabled" + style="width:100%" type="date" value-format="yyyy-MM-dd" + v-model="unitobj.criteria_value"> + </el-date-picker> + </div> + <div v-else-if="unitobj.content_type == 'upload'"> + <table> + <tr> + <td align="left" style="width: 100%; padding: 0px; overflow: hidden; border-bottom: 1px solid #DCDFE6;"> + <span class="h_cellclick" @click="buttonArrayClick(unitobj, {code:'showfile'})">{{unitobj.criteria_value}}</span> + </td> + <td > + <template v-if="isBusiness && unitobj.criteria_value"> + <el-button :disabled="formAttr.disabled" type="primary" style="padding: 5px;" @click="buttonArrayClick(unitobj, {code:'delfile'})" icon="el-icon-delete" class="form_delfile">鍒犻櫎闄勪欢</el-button> + </template > + + <template v-else-if="isBusiness && !unitobj.criteria_value"> + <el-button :disabled="formAttr.disabled" type="primary" style="padding: 5px;" @click="buttonArrayClick(unitobj, {code:'upload'})" icon="el-icon-upload" class="form_uploadfile">闄勪欢涓婁紶</el-button> + </template > + </td> + </tr> + </table> + </div> + </el-col> + </el-row> + </div> + </div> + <div style="width: 100%;height: 5px;margin-top: 25px;background-color: gainsboro;opacity: 40%"></div> + </template > + </div> + </div> + <el-row v-if="formFields_criteria && formFields_criteria.length>0" > <el-col :span="12" style="padding-right: 10px;" > <el-card class="box-card" style="height: 408px;overflow: auto;"> <div slot="header" class="clearfix"> diff --git a/module/visit/page/popup/visit_log_detail.html b/module/visit/page/popup/visit_log_detail.html index 13c0a71..dd9c15c 100644 --- a/module/visit/page/popup/visit_log_detail.html +++ b/module/visit/page/popup/visit_log_detail.html @@ -16,7 +16,7 @@ el: "#vbody", data: { dataname: "md_terminal_visition", - table_dataname: "wm_transfer_detail", + table_dataname: "md_terminal_visition_detail", title: "鎷滆璇︽儏", dataRequest: [ { @@ -42,7 +42,7 @@ formAttr: { istitle: false, title: "琛ㄥ崟鍚嶇О", - columnnumber: 2, + columnnumber: 4, labelwidth: "120px", labelposition: "left",//"left",// right//top size: "mini", @@ -286,34 +286,36 @@ var tableFields_ = []; metas.map(f=>{ f.isshow = "T"; - if(f.field == "from_warehouse_name") { - f.options = me.options_wm_warehouse + if(f.field == "is_clinical" || f.field == "is_clinical_purchase" || f.field == "is_formal_purchase" ) { + f.inputtype = 'ischeckbox' + // f.isshow = 'F' + // if (result.data[me.dataname][f.field]) { + // var promotion_process = { + // field_name: "promotion_process", + // input_type: "span", + // label_chinese: "鎺ㄥ箍杩囩▼", + // label_english: "promotion_process", + // form_order_no: 10, + // options: {} + // } + // } } - if(f.field == "to_warehouse_name") { - f.options = me.options_wm_warehouse - } - if (f.field == "org_name" && me.iscustomer) { - f.inputtype = "span" - } - if(f.field == "doc_date") { - f.disabled = true - } + // if(f.field == "to_warehouse_name") { + // f.options = me.options_wm_warehouse + // } + // if (f.field == "org_name" && me.iscustomer) { + // f.inputtype = "span" + // } + // if(f.field == "doc_date") { + // f.disabled = true + // } formFields_.push(clone(f)); }) table_metas.map(f=>{ f.isshow = "T"; - if (f.field == "stock_type_code") { - f.options = me.dataRequestObj.wm_stock_type - var formatterjson_ = {}; - me.dataRequestObj.wm_stock_type.map(r=>{ - formatterjson_[r.code] = r.name; - }) - f.formatterjson = formatterjson_ - - } - if (f.field == "qty") { - f.inputkeys = "number";//鎸夐敭姝f暣鏁� + if (f.field == 'longitude' || f.field == 'latitude' ) { + f.isshow = 'F' } tableFields_.push(clone(f)); }) @@ -329,21 +331,10 @@ } if (me.rowData[me.table_dataname]) { me.tableData = me.rowData[me.table_dataname]; + // me.tableData.is_distance_include = me.tableData.is_distance_include == 'true' ? '宸插畬鎴�' : '鏈畬鎴�' + } - // 璋冩嫧闄勪欢鐨勮祴鍊� - if (me.rowData["wm_transfer_file"] && me.rowData["wm_transfer_file"].length) { - var comeback_attachment_name_ = [] - me.rowData["wm_transfer_file"].map(f=>{ - var f_ = { - id: f.id, - file_name: f.file_name - } - comeback_attachment_name_.push(f_); - - }) - me.$set(me.formData, "transfer_file", comeback_attachment_name_); - } }) @@ -741,222 +732,6 @@ }, - tablepopup_productlist(sceneCode, obj , callback) { - var me = this; - var data_ = {}; - var selectmap_ = {}; - console.log(obj); - - //鎺掗櫎宸查�夌墿鏂� - me.tableData.map(row=>{ - if (row.batch_sn) { - var key_ = row.from_warehouse_id + "_" + row.product_code + "_" + row.batch_no + "_" + row.batch_sn - selectmap_[key_] = true - } - else if (row.product_code) { - var key_ = row.from_warehouse_id + "_" + row.product_code + "_" + row.batch_no - selectmap_[key_] = true - } - }) - - var config = { - totab: false, //true: 浠ab瀵艰埅鐨勬柟寮忔墦寮� - width: "1100px", - height: "520px", - icon: "icon-product", - text: "鏄庣粏閫夋嫨", - id: "popup_book_detail",//totab: true鏃堕渶璁剧疆锛岀敤浜庡垽鏂槸鍚﹀凡鎵撳紑姝ら〉闈� - url: "module/md/page/popup/page/popup_bookDetail_upload_transfer.html", - data: data_, - delta: {isinputqty: true, selectmap: selectmap_, customer_id: this.formData.account_id}, - // filter: "org_id='"+ me.selectedrow.org_id + "' and bu_id='" + me.selectedrow.bu_id + "'", - // filter: "warehouse_name='" + me.formData.from_warehouse_name +"'" , - filter: "qty_available > 0 and wm_book_detail.account_id='" + me.formData.account_id +"'" , - sceneCode: sceneCode,//"refuseedit",//"approval", //"add"//"browse", - callback: function(popupobj, popupcallback) { - callback(popupobj); - if (popupcallback) { - popupcallback(); - } - } - }; - me.doPopupByPublic(config); - }, - deleteDataById(id, dataname, confirm_txt, callback){ - var me = this; - var formData_ = clone(me.formData); - Root.confirm('纭畾鍒犻櫎璇�' + confirm_txt + '鍚楋紵', '鍒犻櫎鎻愮ず', { - confirmButtonText: '鍒犻櫎', - cancelButtonText: '鍙栨秷', - type: 'warning' - }).then(() => { - if (id) { - let param = { - dataname: dataname, - id: id - } - Server.call("root/data/deleteEntity", param, function(result) { - console.log(result); - if (result && result.data) { - callback(); - } - }); - } - else { - callback(); - } - - }).catch(() => { - Root.message({ - type: 'info', - message: '宸插彇娑堝垹闄�' - }); - }); - - }, - - showFileImgByFileId_n(filenamefield, fileobj, objformdata){ - let me = this; - var formData_ = clone(me.formData); - var file_id = fileobj.id - var file_name = fileobj.file_name - var dataname_ = this.dataname - - this.zzimg = {}; - this.zzimgList = []; - this.file_txt = false; - if(file_id) { - var fileid = file_id; - let fileName = clone(file_name); - let index1 = fileName.lastIndexOf("."); - let index2 = fileName.length; - let suffix = fileName.substring(index1, index2).toLowerCase(); //鍚庣紑鍚� - if (suffix == ".png" || suffix == ".jpg" || suffix == ".jpeg" || suffix == ".pdf") { - var row = { - fileid: fileid, - dataname: dataname_, - filename: fileName - } - var config = { - totab: false, - width: "1200px", - height: 800, - icon: "icon-product", - text: "闄勪欢棰勮", - id: "pdf_" + fileid, - url: "module/tool/page/popup_file_pdf.html", - data: row, - delta: {}, - callback: function(obj, callback) { - if (callback) { - callback(); - } - } - }; - this.doPopupByPublic(config); - - } - else {//鍙彲涓嬭浇锛屼笉鍙瑙� - // handleDownloadUrl(fileid,false); - handleDownload(fileid, dataname_); - } - } - }, - onPopupByUploadFile_n(filenamefield, fileidfield, dataname, objformdata) { - var me = this; - var analysistype_ = ""; - var sender_id_ = ""; // 涓氬姟鏁版嵁id; - if (objformdata.id) { - sender_id_ = objformdata.id; - } - - // var analysistype = "invoiceIdentify"; // 鍙戠エ楠岀湡 - // if (me.formData.implant_evidence_code == "deliver") { // 鍑哄簱鍗� - // analysistype = ""; - // } - var delta_ = {filetypelist: [".png", ".jpg", ".jpeg",".pdf"]}; //, ".pdf" - var config = { - totab: false, - width: "500px", - icon: "icon-product", - text: "闄勪欢涓婁紶", - id: "popupByUploadFile", - url: "module/tool/page/popup_uploadFile.html", - data: { - dataName: dataname, - fileidfieldName: fileidfield, - id: sender_id_, - fileNamefieldName: filenamefield - }, - delta: delta_, - callback: function(obj, callback) { - var f_ = { - id: obj.row[0].id, - file_name: decodeURI(obj.row[0].name) - } - if (!objformdata[filenamefield]) { - objformdata[filenamefield] = [] - } - me.$message({ - showClose: true, - message: '涓婁紶鎴愬姛锛�', - type: 'success' - }); - - objformdata[filenamefield].push(f_); - if (!objformdata.id) { - objformdata.id = obj.row[0].sender_id; - } - - if (callback) { - callback(); - } - } - }; - this.doPopupByPublic(config); - }, - - deleteByFileId_n(filenamefield, fileobj, objformdata){ - var me = this; - var formData_ = clone(me.formData); - Root.confirm('纭畾鍒犻櫎闄勪欢銆�' + fileobj.file_name + '銆戝悧锛�', '鍒犻櫎鎻愮ず', { - confirmButtonText: '鍒犻櫎', - cancelButtonText: '鍙栨秷', - type: 'warning' - }).then(() => { - if (fileobj.id) { - let param = { - dataname: "wm_transfer_file", - id: fileobj.id - } - - Server.call("root/data/deleteEntity", param, function(result) { - console.log(result); - if (result && result.data) { - objformdata[filenamefield].remove(fileobj); - // me.formData[filenamefield].remove(fileobj); - - // me.formData = formData_; - Root.message({ - type: 'success', - message: '鍒犻櫎鎴愬姛!' - }); - } - }); - } - }).catch(() => { - Root.message({ - type: 'info', - message: '宸插彇娑堝垹闄�' - }); - }); - - }, - - dddd(obj){ - var me = this; - me.checkarr = obj; - }, openOrg(obj,callback){ var me = this; @@ -1026,120 +801,6 @@ // }); // }, - - - - - GFG_Fun() { //鏍囪瘑鍥� - var suiji = Math.random().toString(36).slice(2); - return suiji; - }, - - - - rowChange(row, type, tablename) { - var me = this; - if (type == "add") { - this.tableData.unshift(row); - } - else if (type == "del") { - if (row.id) { - let param = { - dataname: tablename, - id: row.id - } - - Server.call("root/data/deleteEntity", param, function(result) { - console.log(result); - if (result && result.data) { - me.tableData.remove(row); - - Root.message({ - type: 'success', - message: '鍒犻櫎鎴愬姛!' - }); - } - }); - } - else { - this.tableData.remove(row); - } - } - else { - - } - }, - - //鎻愪氦 - // submitRowTable() { - // this.iscommit = true; - // this.saveRowTable(); - // }, - - //淇濆瓨 - // saveRowTable() { - // var me = this; - // var operator_ = "save";//淇濆瓨 - // if(me.iscommit) { - // operator_ = "commit";//鎻愪氦 - // } - - // var entity_ = clone(this.formData); - // var entity = {}; - // for (var r in entity_) { - // if (entity_[r] || entity_[r] == "" || entity_[r] == false || entity_[r] == 0) { - // entity[r] = entity_[r]; - // } - // } - - // var tableData_ = []; - // this.tableData.map(r=>{ - // var row_ = {}; - // for (var k in r) { - // if (r[k]) { - // row_[k] = r[k]; - // } - // } - // tableData_.push(row_); - // }) - - // if (tableData_.length == 0) { - // Root.message({ - // type: 'warning', - // message: '璇峰厛娣诲姞鏄庣粏鏁版嵁' - // }); - // return - // } - - // let param = { - // dataname: this.dataname, - // // operator: operator_, - // data: {}, - // } - // param.data[this.dataname] = entity; - // param.data[this.table_dataname] = tableData_; - - // Server.call("root/data/saveEntity", param, function(result) { - // console.log(result); - // if (result.success) { - // if(me.iscommit){ - // me.iscommit = false; - // Root.message({ - // type: 'success', - // message: '鎻愪氦鎴愬姛' - // }); - // me.saveAfter(); - // } - // else { - // Root.message({ - // type: 'success', - // message: '淇濆瓨鎴愬姛' - // }); - // me.saveAfter(); - // } - // } - // }); - // }, submitRowTable() { var me = this; @@ -1515,7 +1176,6 @@ :istablebuttons="false" :isbasicfilterfields="false" :isdraggableorder="false" - :show-summary="true" v-on:get-data="getData" v-on:del-data="delData" -- Gitblit v1.8.0