shi'sen'yuan 3 éve
szülő
commit
241e09f037

+ 4 - 1
master/src/main/java/com/ruoyi/project/plant/controller/TStaffmgrController.java

@@ -285,6 +285,7 @@ public class TStaffmgrController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody TStaffmgr tStaffmgr)
     {
+        int insertResult = tStaffmgrService.insertTStaffmgr(tStaffmgr);
         tStaffmgr.setCreaterCode(getUserId().toString());
         if (tStaffmgr.getUnit().equals("10") || tStaffmgr.getUnit().equals("18")) {
             TTrainingrecords tTrainingrecords = new TTrainingrecords();
@@ -303,9 +304,10 @@ public class TStaffmgrController extends BaseController
             tWorklicense.setName(tStaffmgr.getName());
             tWorklicense.setEmployeeid(tStaffmgr.getStaffid());
             tWorklicense.setPost(tStaffmgr.getActualpost());
+            tWorklicense.setDeptId(tStaffmgr.getDeptId());
             tWorklicenseService.insertTWorklicense(tWorklicense);
         }
-        return toAjax(tStaffmgrService.insertTStaffmgr(tStaffmgr));
+        return toAjax(insertResult);
     }
 
     /**
@@ -338,6 +340,7 @@ public class TStaffmgrController extends BaseController
             tWorklicense.setName(tStaffmgr.getName());
             tWorklicense.setEmployeeid(tStaffmgr.getStaffid());
             tWorklicense.setPost(tStaffmgr.getActualpost());
+            tWorklicense.setDeptId(tStaffmgr.getDeptId());
             tWorklicenseService.updateTWorklicense(tWorklicense);
         }
         return toAjax(tStaffmgrService.updateTStaffmgr(tStaffmgr));

+ 1 - 1
master/src/main/resources/mybatis/plant/TStaffmgrMapper.xml

@@ -133,7 +133,7 @@
         where staffid = #{staffid}
     </select>
 
-    <insert id="insertTStaffmgr" parameterType="TStaffmgr">
+    <insert id="insertTStaffmgr" parameterType="TStaffmgr" useGeneratedKeys="true" keyProperty="id">
         <selectKey keyProperty="id" resultType="long" order="BEFORE">
             SELECT seq_t_staffmgr.NEXTVAL as id FROM DUAL
         </selectKey>

+ 7 - 3
ui/src/views/ehs/msds/index.vue

@@ -414,6 +414,9 @@
           <el-checkbox v-model="upload.updateSupport" />{{ $t('是否更新已经存在的用户数据') }}
           <el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden />
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -545,6 +548,9 @@
         reviewStateOptions: [],
         // 用户导入参数
         upload: {
+          downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+          //下载模板类型
+          type: "msds",
           // 是否显示弹出层(用户导入)
           open: false,
           // 弹出层标题(用户导入)
@@ -1019,9 +1025,7 @@
       },
       /** 下载模板操作 */
       importTemplate() {
-        importTemplate().then(response => {
-          this.download(response.msg);
-        });
+        this.$refs['downloadFileForm'].submit()
       },
       // 文件上传中处理
       handleFileUploadProgress(event, file, fileList) {

+ 11 - 9
ui/src/views/plant/targetlist/index.vue

@@ -496,15 +496,17 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          var partner = null;
-          this.form.partners.forEach(function (value,key,arr) {
-            if (key != 0) {
-              partner = partner + "," + value;
-            }else if (key == 0) {
-              partner = value;
-            }
-          })
-          this.form.partners = partner;
+          if (this.form.parentId !== 0) {
+            var partner = null;
+            this.form.partners.forEach(function (value,key,arr) {
+              if (key != 0) {
+                partner = partner + "," + value;
+              }else if (key == 0) {
+                partner = value;
+              }
+            })
+            this.form.partners = partner;
+          }
           if (this.form.id != null) {
             updateTargetlist(this.form).then(response => {
               this.msgSuccess(this.$t('修改成功'));

+ 1 - 0
ui/src/views/plant/targetmeasures/index.vue

@@ -889,6 +889,7 @@
           this.form.item = response.data.item;
           this.form.description = response.data.description;
           this.form.targets = response.data.targets;
+          this.form.targetlistId = response.data.id;
           this.responsibles = [];
           this.open = true;
           this.title = this.$t('添加')+this.$t('目标措施');