Преглед на файлове

Merge branch '机构介绍新增问题' of sckj/mz-cloud into master

Shawn преди 1 година
родител
ревизия
1fecdbae1b

+ 2 - 0
ruoyi-modules/mz-organization-jg/src/main/java/com/ruoyi/organization/mapper/YljgJgjsMapper.java

@@ -13,4 +13,6 @@ import com.ruoyi.common.datascope.utils.BaseMapperPlus;
 public interface YljgJgjsMapper extends BaseMapperPlus<YljgJgjs> {
 
     public YljgJgjs selectByJgid(String id);
+
+    int deleteYljgJgjsByJgIds(String jgid);
 }

+ 2 - 0
ruoyi-modules/mz-organization-jg/src/main/java/com/ruoyi/organization/service/IYljgJgjsService.java

@@ -52,4 +52,6 @@ public interface IYljgJgjsService
     public int deleteYljgJgjsByIds(Long[] ids);
 
     public YljgJgjs selectYljgJgjsByJgid(String id);
+
+    int deleteYljgJgjsByJgIds(String jgid);
 }

+ 5 - 0
ruoyi-modules/mz-organization-jg/src/main/java/com/ruoyi/organization/service/impl/YljgJgjsServiceImpl.java

@@ -86,4 +86,9 @@ public class YljgJgjsServiceImpl implements IYljgJgjsService
         return yljgJgjsMapper.selectByJgid(id);
     }
 
+    @Override
+    public int deleteYljgJgjsByJgIds(String jgid) {
+        return yljgJgjsMapper.deleteYljgJgjsByJgIds(jgid);
+    }
+
 }

+ 3 - 0
ruoyi-modules/mz-organization-jg/src/main/resources/mapper/organization/YljgJgjsMapper.xml

@@ -13,5 +13,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectByJgid" parameterType="YljgJgjs" resultMap="YljgJgjsResult">
         select id,jgid,jgjs from yljg_jgjs where jgid=#{jgid}
     </select>
+    <delete id="deleteYljgJgjsByJgIds" parameterType="String">
+        delete from yljg_jgjs where jgid = #{jgid}
+    </delete>
 
 </mapper>

+ 3 - 3
ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/controller/YljgJgjsController.java

@@ -104,9 +104,9 @@ public class YljgJgjsController extends BaseController
      */
 //    @RequiresPermissions("organization:jgjs:remove")
     @Log(title = "机构介绍", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
+	@DeleteMapping("/{jgid}")
+    public AjaxResult remove(@PathVariable String jgid)
     {
-        return toAjax(yljgJgjsService.deleteYljgJgjsByIds(ids));
+        return toAjax(yljgJgjsService.deleteYljgJgjsByJgIds(jgid));
     }
 }

+ 14 - 10
ruoyi-ui/src/views/organization/jggl/jcxx/index.vue

@@ -71,7 +71,7 @@
                   <el-form-item label="机构介绍" prop="jgjs" class="contenrFlex" >
                     <el-col style="width: 300px">
                       <el-input v-model="form2.jgjs" :rows="12" type="textarea" />
-                      <el-input v-model="form2.id" type="text" />
+                      <el-input v-model="form2.zt" type="text" />
                     </el-col>
                   </el-form-item>
 
@@ -1453,6 +1453,7 @@ export default {
           id:null,
           jgid:null,
           jgjs:null,
+          zt:null,
         }
         this.form = {
           id: null,
@@ -1560,7 +1561,10 @@ export default {
         this.loading = true
         getJgjs(id).then(response => {
             if(response.data!=null) {
-              this.form2 = response.data
+              this.form2 = response.data;
+              this.form2.zt="1";
+            }else{
+              this.form2.zt="0";
             }
         })
         getJcxx(id).then(response => {
@@ -1632,17 +1636,17 @@ export default {
             }
 	          console.log(pamar, 'pamar')
 
-            if(this.form2.id!=null){
-              updateJgjs(this.form2);
+            if(this.form2.zt!="0"){
+              delJgjs(this.form2.jgid).then(response =>{
+                this.form2.jgid=this.form.id;
+                addJgjs(this.form2);
+                this.form2.zt="1";
+              });
+              // updateJgjs(this.form2);
             }else{
               this.form2.jgid=this.form.id;
               addJgjs(this.form2);
-              getJgjs(this.form.id).then(response => {
-                alert("222");
-                if(response.data!=null) {
-                  this.form2 = response.data;
-                }
-              })
+              this.form2.zt="1";
             }
 
             if (this.form.id != null) {