Explorar o código

Merge branch '1.0.0_online' of http://smartcost.f3322.net:3000/SmartCost/ConstructionOperation into 1.0.0_online

zhongzewei %!s(int64=7) %!d(string=hai) anos
pai
achega
f940bd55c9

+ 1 - 0
modules/all_models/stdRation_coe.js

@@ -25,6 +25,7 @@ const coeListSchema = new Schema({
     content: String,                    // 说明
     original_code:String,               //原人材机编码
     option_codes:String,                //可选人材机编码
+    option_list:[Schema.Types.Mixed],//下拉列表选项
     coes: [coeSchema]
 }, {versionKey: false});
 

+ 4 - 1
modules/users/models/manager_model.js

@@ -165,6 +165,9 @@ class ManagerModel extends BaseModel {
         // 如果不是超级管理员登录则走CLD接口登录流程
         if (managerData === null || managerData._id === undefined || username !== this.adminUsername) {
             let CLDLoginInfo = await this.CLDLogin(username, password, managerData);
+            if (CLDLoginInfo.can_login !== 1) {
+                throw {code: 44002, err: '账号被停用'};
+            }
             managerData = CLDLoginInfo;
         } else {
             // 加密密码
@@ -227,7 +230,7 @@ class ManagerModel extends BaseModel {
             office: responseData.office,
             position: responseData.position,
             permission: '',
-            can_login: 1
+            can_login: 0
         };
         result = this.db.create(insertData);
 

+ 17 - 3
web/maintain/ration_repository/js/coe.js

@@ -293,6 +293,7 @@ let coeOprObj = {
                     }
                     else {
                         updateObj[dataCode] = inputT;
+                        me.setOptionList(dataCode,inputT,updateObj);
                         updateArr.push(updateObj);
                         me.save([], updateArr, [], true);
                     }
@@ -323,6 +324,7 @@ let coeOprObj = {
                 else{
                     newCoe.serialNo = ++me.currentMaxNo;
                     newCoe[dataCode] = inputT;
+                    me.setOptionList(dataCode,inputT,newCoe);
                     addArr.push(newCoe);
                     me.save(addArr, [], [], true, function (result) {
                         me.updateCurrentCoeList(result);
@@ -331,6 +333,18 @@ let coeOprObj = {
             }
         }
     },
+    setOptionList:function (dataCode,inputT,obj) {
+        if(dataCode == "option_codes"){//所选人材的情况,要获取人材机下拉列表
+            inputT = inputT.replace(/[\s\r\n]/g, "")//去掉空格换行等字符
+            let optionList = [];
+            let options = inputT.split("|");
+            for(let code of options){
+                let name = gljAdjOprObj.getGljName(code,gljAdjOprObj.gljList,true);
+                if(name) optionList.push({text:name,value:code});
+            }
+            obj.option_list = optionList;
+        }
+    },
     onClipboardPasting: function (sender, info) {
         let me = coeOprObj, maxCol = info.cellRange.col + info.cellRange.colCount - 1;
         if(maxCol > me.setting.header.length){
@@ -798,11 +812,11 @@ let gljAdjOprObj = {
         workBook.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.del, false, false, false, false);
         workBook.commandManager().setShortcutKey('gljAdjDel', GC.Spread.Commands.Key.del, false, false, false, false);
     },
-    getGljName: function (gljCode, gljList) {
+    getGljName: function (gljCode, gljList,withSpecs) {//withSpecs 是否带上规格型号
         let rst = null;
         for(let i = 0, len = gljList.length; i < len; i++){
             if(gljCode === gljList[i].code){
-                rst = gljList[i].name;
+                rst = withSpecs == true ?gljList[i].name +" - "+gljList[i].specs :gljList[i].name;
                 break;
             }
         }
@@ -817,7 +831,7 @@ let gljAdjOprObj = {
         $.ajax({
             type: 'post',
             url: '/stdGljRepository/api/getGljItemsOccupied',
-            data: {repId: pageObj.gljLibID, occupation: '-_id code name'},
+            data: {repId: pageObj.gljLibID, occupation: '-_id code name specs'},
             dataType: 'json',
             timeout: 5000,
             success:function(result){