|
@@ -104,6 +104,16 @@ UnCommonFiletypeInfoDlg.collectData = function () {
|
|
|
.set('createTime')
|
|
|
.set('updateUser')
|
|
|
.set('updateTime');
|
|
|
+ var relationIds = $("#relationIds").val();
|
|
|
+ var enterpriseIds = $("#enterpriseIds").val();
|
|
|
+ if (relationIds) {
|
|
|
+ relationIds = relationIds.join(",");
|
|
|
+ this.unCommonFiletypeInfoData["relationIds"] = relationIds;
|
|
|
+ $("#relationIds_hidden").val(relationIds);
|
|
|
+ enterpriseIds = enterpriseIds.join(",");
|
|
|
+ this.unCommonFiletypeInfoData["enterpriseIds"] = enterpriseIds;
|
|
|
+ $("#enterpriseIds_hidden").val(enterpriseIds);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -176,6 +186,40 @@ UnCommonFiletypeInfoDlg.projectChange = function () {
|
|
|
UnCommonFiletypeInfoDlg.typeAndProjectChange();
|
|
|
}
|
|
|
|
|
|
+UnCommonFiletypeInfoDlg.changeJBTType = function (val) {
|
|
|
+ if (val === "0") {
|
|
|
+ Feng.addAjaxSelect({
|
|
|
+ "id": "relationIds",
|
|
|
+ "displayCode": "id",
|
|
|
+ "displayName": "name",
|
|
|
+ "type": "GET",
|
|
|
+ "url": Feng.ctxPath + "/common/api/getJbtFiletypesExceptCommon"
|
|
|
+ });
|
|
|
+ Feng.addAjaxSelect({
|
|
|
+ "id": "enterpriseIds",
|
|
|
+ "displayCode": "id",
|
|
|
+ "displayName": "name",
|
|
|
+ "type": "GET",
|
|
|
+ "url": Feng.ctxPath + "/common/api/getEnterpriseKvs"
|
|
|
+ });
|
|
|
+ $(".project2_isConditionFile0").css("display", "");
|
|
|
+ $('#relationIds').chosen({
|
|
|
+ search_contains: true,
|
|
|
+ disable_search: false,
|
|
|
+ width: "100%",
|
|
|
+ enable_split_word_search: true
|
|
|
+ });
|
|
|
+ $('#enterpriseIds').chosen({
|
|
|
+ search_contains: true,
|
|
|
+ disable_search: false,
|
|
|
+ width: "100%",
|
|
|
+ enable_split_word_search: true
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ $(".project2_isConditionFile0").css("display", "none");
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
UnCommonFiletypeInfoDlg.typeAndProjectChange = function () {
|
|
|
var type = $("#type").val();
|
|
|
var project = $("#project").val();
|
|
@@ -198,6 +242,19 @@ UnCommonFiletypeInfoDlg.fileChange = function (context) {
|
|
|
|
|
|
$(function () {
|
|
|
Feng.initValidator("unCommonFiletypeForm", UnCommonFiletypeInfoDlg.validateFields);
|
|
|
+ var project = $("#project").val();
|
|
|
+ var isConditionFile = $("#isConditionFile").val();
|
|
|
+ if (project == 2 && isConditionFile === "0") {
|
|
|
+ UnCommonFiletypeInfoDlg.changeJBTType(isConditionFile);
|
|
|
+ var relationIds = $("#relationIds").attr("selectVal");
|
|
|
+ if (Feng.isNotEmptyStr(relationIds)) {
|
|
|
+ $("#relationIds").val(relationIds.split(",")).trigger("chosen:updated");
|
|
|
+ }
|
|
|
+ var enterpriseIds = $("#enterpriseIds").attr("selectVal");
|
|
|
+ if (Feng.isNotEmptyStr(enterpriseIds)) {
|
|
|
+ $("#enterpriseIds").val(enterpriseIds.split(",")).trigger("chosen:updated");
|
|
|
+ }
|
|
|
+ }
|
|
|
$("select").each(function () {
|
|
|
$(this).val($(this).attr("selectVal"));
|
|
|
});
|