浏览代码

更新优化

lex-xin 3 年之前
父节点
当前提交
e4d6c65916

+ 9 - 0
src/api/process/work-order.js

@@ -18,6 +18,15 @@ export function createWorkOrder(data) {
   })
 }
 
+// 新建工单
+export function checkCourseReturnFee(data) {
+  return request({
+    url: '/api-web/oa/checkCourseReturnFee',
+    method: 'post',
+    data
+  })
+}
+
 // 工单列表
 export function workOrderList(params) {
   return request({

+ 25 - 5
src/components/VueFormMaking/components/GenerateForm.vue

@@ -189,12 +189,31 @@ export default {
     console.log(this.data)
     this.templateData = this.data.list
     this.generateModle(this.templateData);
+
+    // 选项关联不支付子表单
     if (!this.preview) {
       let tempData = this.templateData;
       let hiddenFormList = this.getSelectValueObject(tempData);
       this.formStatus = hiddenFormList;
+      console.log(tempData, hiddenFormList, this.formStatus, '111')
       this.relationFormChange();
-      console.log(this.data);
+    } else {
+      let tempData = this.templateData
+      let ids = this.getSelectValueObject(tempData, true)
+      const values = this.models[ids.model]
+      console.log(ids, 1111111111111, this.models, values)
+      let relationArray = []
+      ids.options && ids.options.options.forEach(item => {
+          if(values == item.value) {
+              let tempRelation = item.relationOptions || []
+              relationArray.push(...tempRelation)
+          }
+      })
+      console.log(relationArray, 'relationArray')
+      if(relationArray.length > 0) {
+          this.relationFormChange(relationArray)
+      }
+      console.log(this.templateData, 'templateData')
     }
   },
   mounted() {},
@@ -235,12 +254,14 @@ export default {
       this.models[item.model].push(subformFields);
       this.models.status = 1;
     },
-    getSelectValueObject(tpls) {
+    getSelectValueObject(tpls, relationStatus) {
       let tempList = tpls || [];
       let status = false;
+      let relationId = ''
       tempList.forEach(list => {
         if (list.type == "select" && list.options.relationStatus) {
           status = true;
+          relationId = list
         }
         if (list.type == "subform") {
           let childList = list.columns || [];
@@ -249,20 +270,19 @@ export default {
             childList.forEach(c => {
               if (c.type == "select" && list.options.relationStatus) {
                 status = true;
+                relationId = list
               }
             });
           });
         }
       });
-      return status;
+      return relationStatus ? relationId : status;
     },
     relationFormChange(value) {
-      console.log(value)
       // false 为显示,true 为隐藏
       let temp = value || [];
       let tempData = JSON.parse(JSON.stringify(this.templateData));
       tempData.forEach(item => {
-        // console.log(!item.options.relationStatus, 'relationStatus')
         if (this.formStatus) {
           if (
             item.type != "text" &&

+ 2 - 1
src/components/VueFormMaking/components/GenerateFormItem.vue

@@ -446,6 +446,7 @@ export default {
   },
   created() {
     // 判断当前元素是否是分部表单()
+    console.log(this.widget, 'widget subform')
     if(this.widget.type == 'organ' && this.preview) {
       let tempStr = null
       this.organList.forEach(item => {
@@ -526,7 +527,7 @@ export default {
       if(this.subformModel) {
         organId = this.models[this.subformModel][this.subformIndex][this.widget.options.displayRelation]
       } else {
-        organId = this.models[this.subformIndex][this.widget.options.displayRelation]
+        organId = this.models[this.widget.options.displayRelation]
       }
       // // 判断是否有选择分部 判断列表已经有数据了
       if(organId) {

+ 13 - 3
src/views/process/list/create.vue

@@ -86,7 +86,7 @@ import { GenerateForm } from "@/components/VueFormMaking";
 import "form-making/dist/FormMaking.css";
 Vue.component(GenerateForm.name, GenerateForm);
 
-import { processStructure, createWorkOrder, queryAllOrgan } from "@/api/process/work-order";
+import { processStructure, createWorkOrder, checkCourseReturnFee, queryAllOrgan } from "@/api/process/work-order";
 import { listUser } from "@/api/system/sysuser";
 export default {
   name: "Create",
@@ -265,12 +265,18 @@ export default {
             promiseList.push(this.$refs["generateForm-" + tpl.id][0].getData());
           }
           Promise.all(promiseList)
-            .then(values => {
+            .then(async (values) => {
               this.ruleForm.source = this.processStructureValue.nodes[
                 this.active
               ].id;
               this.ruleForm.tpls.form_data = values;
-              createWorkOrder(this.ruleForm)
+              const formData = values[0]
+              const tplInfo = this.processStructureValue.tpls[0] // 默认只用第一个模板
+              console.log(this.ruleForm.tpls.form_data)
+              // 校验数据
+              const res = await checkCourseReturnFee({tplInfoId: tplInfo.id, formData })
+              if(res.code == 200){
+                await createWorkOrder(this.ruleForm)
                 .then(response => {
                   if (response.code === 200) {
                     this.$message.success('工单申请成功')
@@ -280,6 +286,10 @@ export default {
                 .catch(() => {
                   this.submitDisabled = false;
                 });
+              }else{
+                this.$message.error(res.message)
+                return
+              }
             })
             .catch(() => {
               this.submitDisabled = false;

+ 1 - 1
src/views/process/list/handle.vue

@@ -358,7 +358,7 @@ export default {
               circulation: item.label,
               flow_properties: item.flowProperties === undefined ? 2 : parseInt(item.flowProperties),
               work_order_id: parseInt(this.$route.query.workOrderId),
-              remarks: this.remarks,
+              remarks: this.dataList.remarks,
               tpls: this.tpls
             }).then(response => {
               if (response.code === 200) {

文件差异内容过多而无法显示
+ 0 - 0
web/index.html


文件差异内容过多而无法显示
+ 0 - 0
web/static/web/css/chunk-1cc2a003.268198bd.css


文件差异内容过多而无法显示
+ 0 - 0
web/static/web/js/app.19e8d72c.js


文件差异内容过多而无法显示
+ 0 - 0
web/static/web/js/chunk-1cc2a003.17c0f049.js


文件差异内容过多而无法显示
+ 0 - 0
web/static/web/js/chunk-6eee5aec.4fd67902.js


部分文件因为文件数量过多而无法显示