ソースを参照

SAI开项申请流程:新增/修改页面直接提交申请

wangggziwen 2 年 前
コミット
5dac8f3a78

+ 16 - 0
master/src/main/java/com/ruoyi/project/production/controller/TSaiApplyController.java

@@ -309,6 +309,22 @@ public class TSaiApplyController extends BaseController
         return AjaxResult.success();
     }
 
+    /**
+     * 保存并提交申请
+     */
+    @PreAuthorize("@ss.hasPermi('production:apply:add')")
+    @Log(title = "SAI开项管理申请", businessType = BusinessType.INSERT)
+    @PostMapping("/saveAndSubmitApply")
+    public AjaxResult saveAndSubmitApply(@RequestBody TSaiApply tSaiApply)
+    {
+        if (tSaiApply.getSaiApplyId() != null) {
+            this.edit(tSaiApply);
+        } else {
+            this.add(tSaiApply);
+        }
+        return AjaxResult.success(this.submit(tSaiApply.getSaiApplyId()));
+    }
+
     /**
      * SAI开项管理提交申请
      */

+ 9 - 0
ui/src/api/production/apply.js

@@ -1,5 +1,14 @@
 import request from '@/utils/request'
 
+// 保存并提交申请
+export function saveAndSubmitApply(data) {
+  return request({
+    url: '/production/apply/saveAndSubmitApply',
+    method: 'post',
+    data: data
+  })
+}
+
 // 提交申请
 export function submitApply(saiApplyId) {
   return request({

+ 21 - 2
ui/src/views/production/apply/all/index.vue

@@ -557,7 +557,7 @@
 </template>
 
 <script>
-import { submitApply, listApply, getApply, delApply, addApply, updateApply, exportApply, importTemplate} from "@/api/production/apply";
+import { saveAndSubmitApply, submitApply, listApply, getApply, delApply, addApply, updateApply, exportApply, importTemplate} from "@/api/production/apply";
 import { addSai } from "@/api/production/sai";
 import { treeselect, listDept } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
@@ -1304,7 +1304,26 @@ export default {
       });
     },
     /** 新增/修改提交按钮 */
-    handleSaveAndSubmit() {},
+    handleSaveAndSubmit() {
+      this.form.files = []
+      if (this.fileList.length > 0) {
+        for (let i = 0; i < this.fileList.length; i++) {
+          let obj = {}
+          obj.fileName = this.fileList[i].name
+          obj.fileUrl = this.fileList[i].response.msg
+          this.form.files.push(obj)
+        }
+      }
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          saveAndSubmitApply(this.form).then(response => {
+            this.msgSuccess("提交成功");
+            this.open = false;
+            this.getList();
+          });
+        }
+      });
+    },
     /** 统计至SAI检查台账提交按钮 */
     submitSaiForm() {
       for (let i = 0; i < this.saiList.length; i++) {