Переглянути джерело

添加系统工程的实现方法

cxd 8 місяців тому
батько
коміт
5ab4e6367a

+ 12 - 0
ui/src/api/worksCategory/worksCategory.js

@@ -0,0 +1,12 @@
+
+import request from '@/utils/request'
+import { parseStrEmpty } from "@/utils/ruoyi";
+
+
+export function addWorkCategory(data) {
+    return request({
+      url: '/work/add',
+      method: 'post',
+      data: data
+    })
+  }

+ 18 - 0
ui/src/views/ProductMent/worksCategory/index.vue

@@ -63,6 +63,10 @@
   </template>
   
   <script>
+
+  import { addWorkCategory } from "@/api/worksCategory/worksCategory";
+
+
   export default {
     name: 'ProjectCategoryManagement',
     data() {
@@ -142,9 +146,23 @@
       },
       submitForm() {
         this.$refs.form.validate((valid) => {
+          debugger;
           if (valid) {
             // 实现表单提交逻辑
             console.log('表单数据:', this.form)
+            if (this.form.userId != undefined) {
+            }else{
+
+              addWorkCategory(this.form).then(response => {
+              debugger;
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+              });
+
+
+            }
+
             this.dialogVisible = false
             this.$message.success('保存成功')
             this.loadData()