lex-xin 3 年 前
コミット
f5802da88c

+ 13 - 3
src/components/VueFormMaking/components/GenerateForm.vue

@@ -33,6 +33,7 @@
                   :widget="citem"
                   :data="data"
                   :prop-value="citem.model"
+                  :cooperation-list="cooperationList"
                   @input-change="onInputChange"
                 />
               </template>
@@ -93,6 +94,8 @@
                         :organ-list="itemOrganList"
                         :subform-index="scope.$index"
                         :subform-model="item.model"
+                        :cooperation-list="cooperationList"
+                        @input-change="onInputChange"
                       />
                     </template>
                   </el-table-column>
@@ -113,6 +116,7 @@
             :data="data"
             :organ-list="itemOrganList"
             :disabled="disabled"
+            :cooperation-list="cooperationList"
             @input-change="onInputChange"
           />
         </template>
@@ -124,7 +128,9 @@
 
 <script>
 import GenetateFormItem from './GenerateFormItem'
-
+import {
+  getOrganCooperation
+} from '@/api/process/work-order'
 export default {
   name: 'FmGenerateForm',
   components: {
@@ -139,6 +145,8 @@ export default {
       rules: {},
       subformFields: {},
       itemOrganList: [],
+      selectOrganId: [],
+      cooperationList: [], // 合作单位列表
     }
   },
   watch: {
@@ -249,8 +257,10 @@ export default {
     reset() {
       this.$refs.generateForm.resetFields()
     },
-    onInputChange(value, field) {
-      // this.$emit('on-change', field, value, this.models)
+    async onInputChange(value) {
+      if(!value || this.selectOrganId.includes(value)) { return }
+      let res = await getOrganCooperation({ organId: value })
+      this.cooperationList.push(...res.data)
     },
     refresh() {
 

+ 34 - 5
src/components/VueFormMaking/components/GenerateFormItem.vue

@@ -75,7 +75,12 @@
       </template>
       <template v-else>
         <div v-if="dataModel && dataModel.length > 0">
-          {{ dataModel }}
+          <template v-if="widget.type == 'organ' || widget.type == 'school'">
+            {{ dataModelStr }}
+          </template>
+          <template v-else>
+            {{ dataModel }}
+          </template>
         </div>
       </template>
     </template>
@@ -363,7 +368,7 @@ export default {
     FileUpload
   },
   /* eslint-disable */
-  props: ['widget', 'models', 'propValue', 'remote', 'data', 'disabled', 'preview', 'isLabel', 'subformIndex', 'subformModel', 'organList'],
+  props: ['widget', 'models', 'propValue', 'remote', 'data', 'disabled', 'preview', 'isLabel', 'subformIndex', 'subformModel', 'organList', 'cooperationList'],
   data() {
     return {
       showStatus: true,
@@ -371,6 +376,7 @@ export default {
       dataModel: this.subformIndex===undefined?
         this.models[this.widget.model]:
         this.models[this.subformModel][this.subformIndex][this.widget.model],
+      dataModelStr: null,
       tableData: []
     }
   },
@@ -410,21 +416,44 @@ export default {
         delete this.models.status
         this.handleDisplayVerifiy()
       }
+    },
+    cooperationList: {
+      deep: true,
+      handler(val) {
+        if(this.widget.type == 'school' && this.preview) {
+          let tempStr = null
+          val.forEach(item => {
+            if(item.id == this.dataModel) {
+              tempStr = item.name
+            }
+          });
+          this.dataModelStr = tempStr
+        }
+      }
     }
   },
   created() {
-    // console.log(this.widget, this.models,this.propValue)
     // 判断当前元素是否是分部表单()
     if(this.widget.type == 'organ' && this.preview) {
-      console.log(this.dataModel, this.organList)
+      this.$emit('input-change', this.dataModel)
       let tempStr = null
       this.organList.forEach(item => {
         if(item.id == this.dataModel) {
           tempStr = item.name
         }
       });
-      this.dataModel = tempStr
+      this.dataModelStr = tempStr
     }
+    // if(this.widget.type == 'school' && this.preview) {
+    //   let tempStr = null
+    //   this.cooperationList.forEach(item => {
+    //     if(item.id == this.dataModel) {
+    //       tempStr = item.name
+    //     }
+    //   });
+    //   console.log(tempStr, this.dataModel)
+    //   // this.dataModel = tempStr
+    // }
     if (this.widget.options.remote && this.remote[this.widget.options.remoteFunc]) {
       this.remote[this.widget.options.remoteFunc]((data) => {
         this.widget.options.remoteOptions = data.map(item => {

+ 1 - 1
src/utils/request.js

@@ -5,7 +5,7 @@ import { getToken } from '@/utils/auth'
 
 // create an axios instance
 //
-console.log(process.env.VUE_APP_BASE_API)
+// console.log(process.env.VUE_APP_BASE_API)
 const service = axios.create({
   baseURL: '', // url = base url + request url
   // withCredentials: true, // send cookies when cross-domain requests

+ 2 - 2
src/views/process/list/create.vue

@@ -43,7 +43,7 @@
           />
         </template>
       </div>
-      <hr style="background-color: #d9d9d9; border:0; height:1px;">
+      <!-- <hr style="background-color: #d9d9d9; border:0; height:1px;">
       <div class="text item" style="text-align: center;margin-top:18px">
         <el-button
           v-for="(item, index) in processStructureValue.edges"
@@ -55,7 +55,7 @@
         >
           {{ item.label }}
         </el-button>
-      </div>
+      </div> -->
     </el-card>
   </div>
 </template>

ファイルの差分が大きいため隠しています
+ 0 - 0
web/index.html


+ 0 - 0
web/static/web/css/chunk-83a352d8.1e8e846b.css → web/static/web/css/chunk-3d60f5e0.c2ac2790.css


ファイルの差分が大きいため隠しています
+ 0 - 0
web/static/web/js/app.bc2c81da.js


ファイルの差分が大きいため隠しています
+ 0 - 0
web/static/web/js/chunk-3d60f5e0.528f6c09.js


ファイルの差分が大きいため隠しています
+ 0 - 0
web/static/web/js/chunk-83a352d8.0367eec5.js


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません