| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- var setting
- // 树形下拉开始
- function bindtree() {
- $.getJSON(
- huayi.config.callcenter_url + treeInputParam.treeApi, {
- token: $.cookie("token")
- },
- function(result) {
- if(result.state.toLowerCase() == "success") {
- $.fn.zTree.init($(treeInputParam.treeId), setting, result.data);
- }
- }
- );
- }
- $(document).ready(function () {
- $(treeInputParam.classInps).focus(function() {
- $(this).siblings(treeInputParam.classAddTree).css("display", "block");
- });
-
- $(treeInputParam.classXl).click(function() {
- var xl = $(this).siblings(treeInputParam.classXl);
- if(xl.css("display") == "block") {
- xl.css("display", "none");
- } else {
- xl.css("display", "block");
- }
- });
- $(treeInputParam.classAddTree).mouseleave(function() {
- $(this).css("display", "none");
- });
- //获取所属部门
- setting = {
- data: {
- key: {
- name: treeInputParam.treeObj.name,
- },
- simpleData: {
- enable: true,
- idKey: treeInputParam.treeObj.id,
- pIdKey: treeInputParam.treeObj.pid,
- rootPId: -1,
- },
- },
- callback: {
- onClick: treeInputParam.treeObj.onclick,
- },
- };
-
- })
- function zTreeOnClick(event, treeId, treeNode) {
- $(treeInputParam.classInps).val(treeNode[treeInputParam.treeObj.name]);
- $(treeInputParam.classId).val(treeNode[treeInputParam.treeObj.id]);
- }
- // 树形下拉结束
- // 下拉框
- function selectCommon(obj) {
- var resultParam
- var dataParam = {
- token: $.cookie("token")
- }
- if(obj.dataParam) {
- resultParam = Object.assign(dataParam, obj.dataParam)
- } else {
- resultParam = dataParam
- }
- $(obj.id).empty();
- $(obj.id).append(
- '<option selected="selected" value="">请选择</option>'
- );
- $.getJSON(
- huayi.config.callcenter_url +
- obj.apiUrl, resultParam,
- function(data) {
- if(data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function(i, n) {
- $(
- "<option value='" +
- n.F_ValueId +
- "'>" +
- n.F_Value +
- "</option>"
- ).appendTo($(obj.id));
- });
- }
- }
- );
- }
- //下拉框结束
- // 导出列表
- function exportFileFun(api, params) {
- var url = huayi.config.callcenter_url + api;
- if(typeof(params) !== "object") {
- return
- }
- delete params.page
- delete params.pagesize
- delete params.pageindex
- Object.keys(params).forEach(function(key, index) {
- if(!params[key]) {
- params[key] = ""
- }
- if(index === 0) {
- url += `?${key}=${params[key]}`
- } else {
- url += `&${key}=${params[key]}`
- }
- })
- window.location.href = url;
- }
- //导出列表结束
|