|
@@ -2,16 +2,16 @@
|
|
|
* 初始化企业标签审核配置详情对话框
|
|
|
*/
|
|
|
var EnterprisetypePropertiesInfoDlg = {
|
|
|
- enterprisetypePropertiesInfoData : {},
|
|
|
+ enterprisetypePropertiesInfoData: {},
|
|
|
validateFields: {
|
|
|
- talentType: {
|
|
|
+ enterpriseTag: {
|
|
|
validators: {
|
|
|
notEmpty: {
|
|
|
- message: '企业标签不能为空'
|
|
|
+ message: '单位标签不能为空'
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- companyIds:{
|
|
|
+ companyId: {
|
|
|
validators: {
|
|
|
notEmpty: {
|
|
|
message: '审核单位不能为空'
|
|
@@ -24,7 +24,7 @@ var EnterprisetypePropertiesInfoDlg = {
|
|
|
/**
|
|
|
* 清除数据
|
|
|
*/
|
|
|
-EnterprisetypePropertiesInfoDlg.clearData = function() {
|
|
|
+EnterprisetypePropertiesInfoDlg.clearData = function () {
|
|
|
this.enterprisetypePropertiesInfoData = {};
|
|
|
}
|
|
|
|
|
@@ -34,7 +34,7 @@ EnterprisetypePropertiesInfoDlg.clearData = function() {
|
|
|
* @param key 数据的名称
|
|
|
* @param val 数据的具体值
|
|
|
*/
|
|
|
-EnterprisetypePropertiesInfoDlg.set = function(key, val) {
|
|
|
+EnterprisetypePropertiesInfoDlg.set = function (key, val) {
|
|
|
this.enterprisetypePropertiesInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
|
|
|
return this;
|
|
|
}
|
|
@@ -45,57 +45,58 @@ EnterprisetypePropertiesInfoDlg.set = function(key, val) {
|
|
|
* @param key 数据的名称
|
|
|
* @param val 数据的具体值
|
|
|
*/
|
|
|
-EnterprisetypePropertiesInfoDlg.get = function(key) {
|
|
|
+EnterprisetypePropertiesInfoDlg.get = function (key) {
|
|
|
return $("#" + key).val();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 关闭此对话框
|
|
|
*/
|
|
|
-EnterprisetypePropertiesInfoDlg.close = function() {
|
|
|
+EnterprisetypePropertiesInfoDlg.close = function () {
|
|
|
parent.layer.close(window.parent.EnterprisetypeProperties.layerIndex);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 收集数据
|
|
|
*/
|
|
|
-EnterprisetypePropertiesInfoDlg.collectData = function() {
|
|
|
+EnterprisetypePropertiesInfoDlg.collectData = function () {
|
|
|
this
|
|
|
- .set('id')
|
|
|
- .set('talentType')
|
|
|
- .set('description');
|
|
|
- var companys = $("#companyIds").val();
|
|
|
- var ids = "";
|
|
|
- for(var key in companys){
|
|
|
- if(companys[key]!=null && companys[key]!=''){
|
|
|
- ids = ids + companys[key]+",";
|
|
|
- }
|
|
|
- }
|
|
|
- this.enterprisetypePropertiesInfoData['companyIds'] = ids;
|
|
|
+ .set('id')
|
|
|
+ .set('enterpriseTag')
|
|
|
+ .set('description');
|
|
|
+ var companys = $("#companyId").val();
|
|
|
+ /*var ids = "";
|
|
|
+ for (var key in companys) {
|
|
|
+ if (companys[key] != null && companys[key] != '') {
|
|
|
+ ids = ids + companys[key] + ",";
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+ this.enterprisetypePropertiesInfoData['companyId'] = companys;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 提交添加
|
|
|
*/
|
|
|
-EnterprisetypePropertiesInfoDlg.addSubmit = function() {
|
|
|
+EnterprisetypePropertiesInfoDlg.addSubmit = function () {
|
|
|
this.clearData();
|
|
|
this.collectData();
|
|
|
if (!this.validate()) {
|
|
|
return;
|
|
|
}
|
|
|
- if(this.enterprisetypePropertiesInfoData.companyIds==null||this.enterprisetypePropertiesInfoData.companyIds==''){
|
|
|
- Feng.error("审核单位不能为空");return ;
|
|
|
+ if (this.enterprisetypePropertiesInfoData.companyId == null || this.enterprisetypePropertiesInfoData.companyId == '') {
|
|
|
+ Feng.error("审核单位不能为空");
|
|
|
+ return;
|
|
|
}
|
|
|
//提交信息
|
|
|
- var ajax = new $ax(Feng.ctxPath + "/enterprisetypeProperties/add", function(data){
|
|
|
- if(data.code=="200"){
|
|
|
+ var ajax = new $ax(Feng.ctxPath + "/admin/enterprise_verify_mgr/add", function (data) {
|
|
|
+ if (data.code == "200") {
|
|
|
Feng.success(data.msg);
|
|
|
window.parent.EnterprisetypeProperties.table.refresh();
|
|
|
EnterprisetypePropertiesInfoDlg.close();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
Feng.error(data.msg);
|
|
|
}
|
|
|
- },function(data){
|
|
|
+ }, function (data) {
|
|
|
Feng.error("添加失败!" + data.responseJSON.message + "!");
|
|
|
});
|
|
|
ajax.set(this.enterprisetypePropertiesInfoData);
|
|
@@ -105,25 +106,26 @@ EnterprisetypePropertiesInfoDlg.addSubmit = function() {
|
|
|
/**
|
|
|
* 提交修改
|
|
|
*/
|
|
|
-EnterprisetypePropertiesInfoDlg.editSubmit = function() {
|
|
|
+EnterprisetypePropertiesInfoDlg.editSubmit = function () {
|
|
|
this.clearData();
|
|
|
this.collectData();
|
|
|
if (!this.validate()) {
|
|
|
return;
|
|
|
}
|
|
|
- if(this.enterprisetypePropertiesInfoData.companyIds==null||this.enterprisetypePropertiesInfoData.companyIds==''){
|
|
|
- Feng.error("审核单位不能为空");return ;
|
|
|
+ if (this.enterprisetypePropertiesInfoData.companyId == null || this.enterprisetypePropertiesInfoData.companyId == '') {
|
|
|
+ Feng.error("审核单位不能为空");
|
|
|
+ return;
|
|
|
}
|
|
|
//提交信息
|
|
|
- var ajax = new $ax(Feng.ctxPath + "/enterprisetypeProperties/update", function(data){
|
|
|
- if(data.code=="200"){
|
|
|
+ var ajax = new $ax(Feng.ctxPath + "/admin/enterprise_verify_mgr/edit", function (data) {
|
|
|
+ if (data.code == "200") {
|
|
|
Feng.success(data.msg);
|
|
|
window.parent.EnterprisetypeProperties.table.refresh();
|
|
|
EnterprisetypePropertiesInfoDlg.close();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
Feng.error(data.msg);
|
|
|
}
|
|
|
- },function(data){
|
|
|
+ }, function (data) {
|
|
|
Feng.error("修改失败!" + data.responseJSON.message + "!");
|
|
|
});
|
|
|
ajax.set(this.enterprisetypePropertiesInfoData);
|
|
@@ -139,30 +141,25 @@ EnterprisetypePropertiesInfoDlg.validate = function () {
|
|
|
return $("#enterpriseTypeInfoForm").data('bootstrapValidator').isValid();
|
|
|
}
|
|
|
|
|
|
-$(function() {
|
|
|
+$(function () {
|
|
|
Feng.initValidator("enterpriseTypeInfoForm", EnterprisetypePropertiesInfoDlg.validateFields);
|
|
|
//下拉框数据动态加载
|
|
|
Feng.addAjaxSelect({
|
|
|
- "id": "talentType",
|
|
|
+ "id": "enterpriseTag",
|
|
|
"displayCode": "code",
|
|
|
"displayName": "name",
|
|
|
"type": "GET",
|
|
|
- "url": Feng.ctxPath + "/dict/findChildDictByCode?code=un_enterprise_talentType"
|
|
|
+ "url": "/admin/dict/findChildDictByCode?code=enterprise_tag"
|
|
|
});
|
|
|
Feng.addAjaxSelect({
|
|
|
- "id": "companyIds",
|
|
|
+ "id": "companyId",
|
|
|
"displayCode": "id",
|
|
|
"displayName": "name",
|
|
|
"type": "GET",
|
|
|
- "url": Feng.ctxPath + "/company/selectAll"
|
|
|
- });
|
|
|
- $('#companyIds').chosen({
|
|
|
- // search_contains:false,
|
|
|
- // enable_split_word_search: true
|
|
|
+ "url": Feng.ctxPath + "/common/api/getCompanyKvs"
|
|
|
});
|
|
|
//下拉框数据回显
|
|
|
$("select").each(function () {
|
|
|
$(this).val($(this).attr("selectVal"));
|
|
|
});
|
|
|
- $("#companyIds").val($("#companyIds").attr("selectVal")).trigger("chosen:updated");
|
|
|
});
|