ソースを参照

服务标准提交接口添加基础类型字段

gaoyognxing 4 年 前
コミット
590926fa7e

+ 8 - 1
client/pages/customer/servantedit/servantedit.js

@@ -8,20 +8,26 @@ Page({
   data: {
     tips:true,
     servanteditlist:[],
+    newSubTypeNo:''
   },
   onLoad(subtypeNo) {
     this.loadpage(subtypeNo);
   },
   loadpage(subtypeNo){
+    console.log("subtypeNo=" + subtypeNo.subtypeNo);
     let employRelationNo = app.globalData.employRelationNo;
     let params = {employRelationNo:employRelationNo}
     request.httpServiceGet(apiUrl.getEmployerSubjectWhenEdit, params).then(data => {
+      console.log("data=" + data)
       if (data.length > 0) {
         //加载全部的类别
         let subjectList={};
         for(let i=0;i<data.length;i++){
           if(data[i].subtypeNo==subtypeNo.subtypeNo){
               subjectList=data[i];
+              this.setData({
+                  newSubTypeNo:data[i].subtypeNo
+              })
               console.log(subjectList);
           }
         }
@@ -56,7 +62,8 @@ Page({
       }
     }
       //console.log(servantselectedlist);
-      request.httpServicePost(apiUrl.updateEmployerLove,{employRelationNo:employRelationNo,subjectList:servantselectedlist,subjectType:"SN000001"}).then(data=>{
+      console.log("dddddddd" + this.data.newSubTypeNo);
+      request.httpServicePost(apiUrl.updateEmployerLove,{employRelationNo:employRelationNo,subjectList:servantselectedlist,subjectType:"SN000001",subtypeNo:this.data.newSubTypeNo}).then(data=>{
         my.alert({
           title: '提示',
           content: '设置完成',

+ 5 - 1
client/pages/servant/servantedit/servantedit.js

@@ -8,6 +8,7 @@ Page({
   data: {
     tips:true,
     servanteditlist:[],
+    newSubTypeNo:''
   },
   onLoad(subtypeNo) {
     this.loadpage(subtypeNo);
@@ -22,6 +23,9 @@ Page({
         for(let i=0;i<data.length;i++){
           if(data[i].subtypeNo==subtypeNo.subtypeNo){
               subjectList=data[i];
+              this.setData({
+                  newSubTypeNo:data[i].subtypeNo
+              })
               console.log(subjectList);
           }
         }
@@ -55,7 +59,7 @@ Page({
       }
     }
       //console.log(servantselectedlist);
-      request.httpServicePost(apiUrl.updateServantLove,{employRelationNo:employRelationNo,subjectList:servantselectedlist,subjectType:"SN000002"}).then(data=>{
+      request.httpServicePost(apiUrl.updateServantLove,{employRelationNo:employRelationNo,subjectList:servantselectedlist,subjectType:"SN000002",subtypeNo:this.data.newSubTypeNo}).then(data=>{
         my.alert({
           title: '提示',
           content: '设置完成',