From ac3d1a3d5ce0805796f94a5db6c2ad598faccdb5 Mon Sep 17 00:00:00 2001
From: nickchange <126672920+nickchange@users.noreply.github.com>
Date: 星期三, 11 十月 2023 16:00:34 +0800
Subject: [PATCH] 10.12

---
 cloud-server-management/src/main/webapp/static/modular/system/tShop/tShop_info.js |  172 +++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 149 insertions(+), 23 deletions(-)

diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShop_info.js b/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShop_info.js
index e1438f3..b85b9b0 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShop_info.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShop_info.js
@@ -3,6 +3,7 @@
  */
 var language=1;
 var TCarInfoDlg = {
+    goodsPicArray: [],
     tCarInfoData : {},
     validateFields: {
     }
@@ -165,22 +166,36 @@
         return ;
     }
 
+    var OBJradio= $("input[name='type']:checked").val();
+    if(OBJradio==2){
+        let account = $("#account").val()
+        if(account==''){
+            Feng.info("请选择所属运营商")
+            return;
+        }
+    }
     let pCode = $("#pCode").val()
     let cCode = $("#cCode").val()
-    let account = $("#account").val()
-    if(account==''){
-        Feng.info("请选择所属账号")
-        return;
-    }
+    let pCode1 = $("#pCode1").val()
+    let cCode1 = $("#cCode1").val()
+
 
     let name = $("#name").val()
     let phone = $("#phone").val()
 
-    if(pCode=='' && $("#role")=="1"){
+    if(pCode=='' && $("#role")=="1" && OBJradio==2){
         Feng.info("请选择省")
         return;
     }
-    if(cCode=='' && $("#role")=="1"){
+    if(cCode=='' && $("#role")=="1" && OBJradio==2){
+        Feng.info("请选择市")
+        return;
+    }
+    if(pCode1=='' && $("#role")=="1" && OBJradio==1){
+        Feng.info("请选择省")
+        return;
+    }
+    if(cCode1=='' && $("#role")=="1" && OBJradio==12){
         Feng.info("请选择市")
         return;
     }
@@ -229,14 +244,20 @@
         Feng.info("请上传门店封面")
         return;
     }
-
-    let imgOne = $("#imgOne").val()
-
-    if(imgOne==''){
+    var goodImgs = this.goodsPicArray;
+    if(goodImgs.length==0){
         Feng.info("请上传实景图")
         return;
     }
+    var imgOne ="";
+    for (let i = 0; i <goodImgs.length; i++) {
+        if(i==goodImgs.length-1){
+            imgOne += (goodImgs[i].response)
+        }else {
+            imgOne+=(goodImgs[i].response+",")
+        }
 
+    }
     //提交信息
     var ajax = new $ax(Feng.ctxPath + "/tShop/add", function(data){
         if(data=="5001"){
@@ -264,7 +285,7 @@
     ajax.set("cityCode",cCode);
     ajax.set("name",name);
     ajax.set("phone",phone);
-    ajax.set("cityManagerId",account);
+    ajax.set("cityManagerId",null);
     ajax.set("address",address);
     ajax.set("time",time);
     ajax.set("introduce",intro);
@@ -272,6 +293,13 @@
     ajax.set("userPhone",userPhone);
     ajax.set("coverDrawing",img);
     ajax.set("realPicture",imgOne);
+    ajax.set("lat",$("#latitude").val());
+    ajax.set("lon",$("#longitude").val());
+    ajax.set("ids",$("#ids").val());
+    ajax.set("type",OBJradio);
+    ajax.set("yyId",$("#account").val());
+    ajax.set("pCode1",pCode1);
+    ajax.set("cCode1",cCode1);
     ajax.start();
 }
 var  map = new AMap.Map('container', {
@@ -300,6 +328,8 @@
                 // 经纬度
                 var lng = result.geocodes[0].location.lng;
                 var lat = result.geocodes[0].location.lat;
+                $("#longitude").val(lng)
+                $("#latitude").val(lat)
                 // 地图实例
                 map = new AMap.Map('container', {
                     resizeEnable: true, // 允许缩放
@@ -382,22 +412,35 @@
 
     let pCode = $("#pCode").val()
     let cCode = $("#cCode").val()
+    let cCode1 = $("#cCode1").val()
+    let pCode1 = $("#pCode1").val()
     let account = $("#account").val()
-    if(account==''){
-        Feng.info("请选择所属账号")
-        return;
+    var OBJradio= $("input[name='type']:checked").val();
+    if(OBJradio==2){
+        let account = $("#account").val()
+        if(account==''){
+            Feng.info("请选择所属运营商")
+            return;
+        }
     }
 
     let name = $("#name").val()
     let phone = $("#phone").val()
 
-    if(pCode=='' && $("#role")=="1"){
+    if(pCode=='' && $("#role")=="1" && OBJradio==2){
         Feng.info("请选择省")
         return;
     }
-    if(cCode=='' && $("#role")=="1"){
+    if(cCode=='' && $("#role")=="1" && OBJradio==2){
         Feng.info("请选择市")
         return;
+    }
+    if(pCode1=='' && $("#role")=="1" && OBJradio==1){
+        Feng.info("请选择省")
+        return;
+    }
+    if(cCode1=='' && $("#role")=="1" && OBJradio==12) {
+        Feng.info("请选择市")
     }
     if(name==''){
         Feng.info("门店名称不能为空")
@@ -441,18 +484,25 @@
     let img = $("#img").val()
 
 
-    let imgOne = $("#imgOne").val()
-
-    if(imgOne==''){
+    var goodImgs = this.goodsPicArray;
+    if(goodImgs.length==0){
         Feng.info("请上传实景图")
         return;
+    }
+    var imgOne ="";
+    for (let i = 0; i <goodImgs.length; i++) {
+        if(i==goodImgs.length-1){
+            imgOne += (goodImgs[i].response)
+        }else {
+            imgOne+=(goodImgs[i].response+",")
+        }
+
     }
     //提交信息
     var ajax = new $ax(Feng.ctxPath + "/tShop/update", function(data){
         if(data=="5001"){
             Feng.error("该店长手机号已经存在!")
-        }else
-        if(data.code == 200){
+        }else if(data.code == 200){
             if(language==1){
                 Feng.success("修改成功!");
             }else if(language==2){
@@ -468,6 +518,7 @@
     },function(data){
         Feng.error("修改失败!" + data.responseJSON.message + "!");
     });
+
     ajax.set("provinceCode",pCode);
     ajax.set("cityCode",cCode);
     ajax.set("name",name);
@@ -480,7 +531,14 @@
     ajax.set("userPhone",userPhone);
     ajax.set("coverDrawing",img);
     ajax.set("realPicture",imgOne);
+    ajax.set("lat",$("#latitude").val());
+    ajax.set("lon",$("#longitude").val());
     ajax.set("id",$("#id").val());
+    ajax.set("ids",$("#ids").val());
+    ajax.set("type",OBJradio);
+    ajax.set("yyId",$("#account").val());
+    ajax.set("pCode1",pCode1);
+    ajax.set("cCode1",cCode1);
     ajax.start();
 }
 
@@ -514,6 +572,9 @@
     var carPhoto = new $WebUpload("img");
     carPhoto.setUploadBarId("progressBar");
     carPhoto.init();
+    var carPhoto = new $WebUpload("welfarePicture");
+    carPhoto.setUploadBarId("progressBar");
+    carPhoto.init();
     var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto");
     drivingLicensePhoto.setUploadBarId("progressBar");
     drivingLicensePhoto.init();
@@ -539,7 +600,7 @@
             $.each(data, function(k,v) {
                 content += "<option value='"+v.code+"'>"+v.name+"</option>";
             });
-            $("#cCode").empty().append(content);
+            $("#cCode1").empty().append(content);
         }
     });
     ajax.set("oneId",oneId);
@@ -689,3 +750,68 @@
         $("#kcModelDiv").hide();
     }
 }
+
+
+TCarInfoDlg.oneChange1 = function (e) {
+    console.log(111)
+    var oneId=$(e).val();
+    var ajax = new $ax(Feng.ctxPath + "/tShop/onChange1", function(data){
+        if(data!=null){
+            if(language==1){
+                var content='<option value="">选择省</option>';
+            }else if(language==2){
+                var content='<option value="">Choose your franchisee</option>';
+            }else {
+                var content='<option value="">Pilih franchisee Anda</option>';
+            }
+            $.each(data, function(k,v) {
+                content += "<option value='"+v.id+"'>"+v.name+"</option>";
+            });
+            $("#pCode").empty().append(content);
+        }
+    });
+    ajax.set("oneId",oneId);
+    ajax.start();
+}
+TCarInfoDlg.oneChange1Next = function (e) {
+    console.log(111)
+    var oneId=$(e).val();
+    var ajax = new $ax(Feng.ctxPath + "/tShop/onChange1", function(data){
+        if(data!=null){
+            if(language==1){
+                var content='<option value="">选择省</option>';
+            }else if(language==2){
+                var content='<option value="">Choose your franchisee</option>';
+            }else {
+                var content='<option value="">Pilih franchisee Anda</option>';
+            }
+            $.each(data, function(k,v) {
+                content += "<option value='"+v.id+"'>"+v.name+"</option>";
+            });
+            $("#pCode").empty().append(content);
+        }
+    });
+    ajax.set("oneId",e);
+    ajax.start();
+}
+TCarInfoDlg.oneChange2 = function (e) {
+    console.log(111)
+    var oneId=$(e).val();
+    var ajax = new $ax(Feng.ctxPath + "/tShop/onChange2", function(data){
+        if(data!=null){
+            if(language==1){
+                var content='<option value="">选择市</option>';
+            }else if(language==2){
+                var content='<option value="">Choose your franchisee</option>';
+            }else {
+                var content='<option value="">Pilih franchisee Anda</option>';
+            }
+            $.each(data, function(k,v) {
+                content += "<option value='"+v.id+"'>"+v.name+"</option>";
+            });
+            $("#cCode").empty().append(content);
+        }
+    });
+    ajax.set("oneId",oneId);
+    ajax.start();
+}

--
Gitblit v1.7.1