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

+ 223 - 0
src/components/wfd/components/DetailPanel/EndEventDetail.vue

@@ -44,12 +44,158 @@
           <el-option v-for="(item, index) in process" :key="index" :label="item.name" :value="item.id" />
         </el-select>
       </div>
+
+      <div class="panelRow">
+        <div>模板关联字段:</div>
+        <el-row style="width: 90%">
+          <el-col :span="7">公司名称</el-col>
+          <el-col :span="17">
+            <el-select
+              v-model="contract.organName"
+              size="small"
+              style="width:100%; font-size:12px"
+              placeholder="选择公司名称"
+              :disabled="readOnly"
+              clearable
+              :filterable="true"
+              @change="onChangeSelectContract"
+            >
+              <el-option-group
+                v-for="group in fieldList"
+                :key="group.label"
+                :label="group.label"
+              >
+                <el-option
+                  v-for="i in group.options"
+                  :key="i.value"
+                  :label="i.label"
+                  :value="i.value"
+                >
+                </el-option>
+              </el-option-group>
+            </el-select>
+          </el-col>
+
+          <el-col :span="7">费用类型</el-col>
+          <el-col :span="17">
+            <el-select
+              v-model="contract.feeType"
+              size="small"
+              style="width:100%; font-size:12px"
+              placeholder="选择费用类型"
+              :disabled="readOnly"
+              clearable
+              :filterable="true"
+              @change="onChangeSelectContract"
+            >
+              <el-option-group
+                v-for="group in fieldList"
+                :key="group.label"
+                :label="group.label"
+              >
+                <el-option
+                  v-for="i in group.options"
+                  :key="i.value"
+                  :label="i.label"
+                  :value="i.value"
+                >
+                </el-option>
+              </el-option-group>
+            </el-select>
+          </el-col>
+
+          <el-col :span="7">报销金额</el-col>
+          <el-col :span="17">
+            <el-select
+              v-model="contract.totalMoney"
+              size="small"
+              style="width:100%; font-size:12px"
+              placeholder="选择报销金额"
+              :disabled="readOnly"
+              clearable
+              :filterable="true"
+              @change="onChangeSelectContract"
+            >
+              <el-option-group
+                v-for="group in fieldList"
+                :key="group.label"
+                :label="group.label"
+              >
+                <el-option
+                  v-for="i in group.options"
+                  :key="i.value"
+                  :label="i.label"
+                  :value="i.value"
+                >
+                </el-option>
+              </el-option-group>
+            </el-select>
+          </el-col>
+
+          <el-col :span="7">是否有借款</el-col>
+          <el-col :span="17">
+            <el-select
+              v-model="contract.hasLoan"
+              size="small"
+              style="width:100%; font-size:12px"
+              placeholder="选择是否有借款"
+              :disabled="readOnly"
+              clearable
+              :filterable="true"
+              @change="onChangeSelectContract"
+            >
+              <el-option-group
+                v-for="group in fieldList"
+                :key="group.label"
+                :label="group.label"
+              >
+                <el-option
+                  v-for="i in group.options"
+                  :key="i.value"
+                  :label="i.label"
+                  :value="i.value"
+                >
+                </el-option>
+              </el-option-group>
+            </el-select>
+          </el-col>
+
+          <el-col :span="7">情况说明</el-col>
+          <el-col :span="17">
+            <el-select
+              v-model="contract.memo"
+              size="small"
+              style="width:100%; font-size:12px"
+              placeholder="选择情况说明"
+              :disabled="readOnly"
+              clearable
+              :filterable="true"
+              @change="onChangeSelectContract"
+            >
+              <el-option-group
+                v-for="group in fieldList"
+                :key="group.label"
+                :label="group.label"
+              >
+                <el-option
+                  v-for="i in group.options"
+                  :key="i.value"
+                  :label="i.label"
+                  :value="i.value"
+                >
+                </el-option>
+              </el-option-group>
+            </el-select>
+          </el-col>
+        </el-row>
+      </div>
     </div>
   </div>
 </template>
 <script>
 import DefaultDetail from './DefaultDetail'
 import NodeDetail from './NodeDetail'
+import { templateDetails } from '@/api/process/admin/template'
 export default {
   inject: ['i18n'],
   components: {
@@ -85,6 +231,83 @@ export default {
       type: Array,
       default: () => ([])
     }
+  },
+  data() {
+    return {
+      fieldList: [],
+      contract: {
+        organName: '',
+        feeType: '',
+        hasLoan: '',
+        totalMoney: '',
+        memo: ''
+      }
+    }
+  },
+  async mounted() {
+    await this.__init()
+  },
+  methods: {
+    async __init() {
+      const templateList = []
+      this.templates.forEach((item) => {
+        templateList.push(this.getFieldList(item))
+      })
+
+      Promise.all(templateList).then(values => {
+        this.formatTemplateData(values)
+        // 反显数据
+        let conditionExpression = this.model.conditionExpression
+        conditionExpression = conditionExpression ? JSON.parse(conditionExpression) : null
+        if (conditionExpression) {
+          this.conditionList = conditionExpression
+          this.onFormatField()
+          this.$forceUpdate()
+        }
+      })
+    },
+    onFormatField() {
+      this.conditionList.forEach((con, index) => {
+        this.fieldType[index] = this.onFormatType(con.key)
+      })
+    },
+    async getFieldList(id) {
+      return new Promise(async(resolve, reject) => {
+        await templateDetails({ template_id: id }).then(res => {
+          resolve(res.data)
+        }).catch(() => {
+          reject()
+        })
+      })
+    },
+    formatTemplateData(template) {
+      this.fieldList = []
+      const templates = template || []
+      const optionList = []
+      templates.forEach(template => {
+        const options = {}
+        options.label = template.name
+        options.options = []
+        const formStructure = template.form_structure.list || []
+        if (formStructure.length > 0) {
+          formStructure.forEach(item => {
+            if (item.type != 'subform') {
+              options.options.push({
+                label: item.name,
+                type: item.type,
+                value: item.model,
+                options: item.options.options || []
+              })
+            }
+          })
+        }
+        optionList.push(options)
+      })
+      this.fieldList = optionList
+    },
+    onChangeSelectContract() {
+      this.onChange('contract', JSON.stringify(this.contract))
+    }
   }
 }
 </script>

+ 8 - 8
src/views/dashboard/admin/index.vue

@@ -3,30 +3,30 @@
     <el-row :gutter="12">
       <el-col :sm="24" :xs="24" :md="6" :xl="6" :lg="6" :style="{ marginBottom: '12px' }">
         <chart-card title="工单总数" :total="dashboardValue.count.all">
-          <el-tooltip slot="action" class="item" effect="dark" content="指标说明" placement="top-start">
+          <!-- <el-tooltip slot="action" class="item" effect="dark" content="指标说明" placement="top-start">
             <i class="el-icon-warning-outline" />
-          </el-tooltip>
+          </el-tooltip> -->
         </chart-card>
       </el-col>
       <el-col :sm="24" :xs="24" :md="6" :xl="6" :lg="6" :style="{ marginBottom: '12px' }">
         <chart-card title="我创建的" :total="dashboardValue.count.my_create">
-          <el-tooltip slot="action" class="item" effect="dark" content="指标说明" placement="top-start">
+          <!-- <el-tooltip slot="action" class="item" effect="dark" content="指标说明" placement="top-start">
             <i class="el-icon-warning-outline" />
-          </el-tooltip>
+          </el-tooltip> -->
         </chart-card>
       </el-col>
       <el-col :sm="24" :xs="24" :md="6" :xl="6" :lg="6" :style="{ marginBottom: '12px' }">
         <chart-card title="我相关的" :total="dashboardValue.count.related">
-          <el-tooltip slot="action" class="item" effect="dark" content="指标说明" placement="top-start">
+          <!-- <el-tooltip slot="action" class="item" effect="dark" content="指标说明" placement="top-start">
             <i class="el-icon-warning-outline" />
-          </el-tooltip>
+          </el-tooltip> -->
         </chart-card>
       </el-col>
       <el-col :sm="24" :xs="24" :md="6" :xl="6" :lg="6" :style="{ marginBottom: '12px' }">
         <chart-card title="我的待办" :total="dashboardValue.count.upcoming">
-          <el-tooltip slot="action" class="item" effect="dark" content="指标说明" placement="top-start">
+          <!-- <el-tooltip slot="action" class="item" effect="dark" content="指标说明" placement="top-start">
             <i class="el-icon-warning-outline" />
-          </el-tooltip>
+          </el-tooltip> -->
         </chart-card>
       </el-col>
     </el-row>

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


文件差异内容过多而无法显示
+ 0 - 0
web/static/web/css/chunk-6bdc8299.d2bdcd7a.css


文件差异内容过多而无法显示
+ 0 - 0
web/static/web/css/chunk-c4c9dd4e.9d7664cb.css


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


文件差异内容过多而无法显示
+ 0 - 0
web/static/web/js/chunk-171662d1.cc198df3.js


文件差异内容过多而无法显示
+ 0 - 0
web/static/web/js/chunk-6238fc07.d1aea56f.js


文件差异内容过多而无法显示
+ 0 - 0
web/static/web/js/chunk-68613749.b8b15ee1.js


文件差异内容过多而无法显示
+ 0 - 0
web/static/web/js/chunk-6bdc8299.68f79486.js


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


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


文件差异内容过多而无法显示
+ 0 - 0
web/static/web/js/chunk-c4c9dd4e.eb892747.js


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