whj 11 달 전
부모
커밋
2868a7499d

+ 13 - 0
src/api/custom/form.js

@@ -166,4 +166,17 @@ export function addCustomData (parameter) {
     method: 'post',
     data: parameter
   })
+}
+/**
+ * export file
+ * parameter: { }
+ * @param parameter :
+ * @returns {*}
+ */
+export function changeStatus (parameter) {
+  return axios({
+    url: `/custom/form/enable/${parameter.id}/${parameter.status}`,
+    method: 'put',
+    data: parameter
+  })
 }

+ 12 - 1
src/views/custom/form/CustomForm.vue

@@ -44,11 +44,15 @@
       </div>
 
       <s-table ref="table" size="default" rowKey="id" :columns="columns" :data="loadData" showPagination="auto">
+        <template #status="text,record">
+          <a-switch checked-children="启用" un-checked-children="废弃" :checked="Boolean(text)" @change="changeStatus(record)" />
+        </template>
         <span slot="action" slot-scope="record">
           <template>
             <a @click="handleView(record)">查看</a>
             <!-- <operation-button @click="handleEdit(record)">修改</operation-button> -->
             <operation-button @click="handleSubmit(record)">填报</operation-button>
+            <operation-button @click="handleSubmit(record)">填报</operation-button>
             <operation-button :type="2" title="是否要删除该条数据?" @confirm="batchDelete(record.id)">删除</operation-button>
           </template>
         </span>
@@ -65,7 +69,7 @@ import { STable, Ellipsis } from '@/components'
 import BaseForm from './modules/BaseForm'
 import SubmitForm from './modules/SubmitForm'
 import Detail from './modules/Detail'
-import { getCustomFormPage, deleteCustomForms, fetchCustomForm, getCustomTree } from '@/api/custom/form'
+import { getCustomFormPage, deleteCustomForms, fetchCustomForm, getCustomTree, changeStatus } from '@/api/custom/form'
 
 export default {
   name: 'CustomFormList',
@@ -127,6 +131,7 @@ export default {
           title: '状态',
           fixed: 'right',
           dataIndex: 'status',
+          scopedSlots: { customRender: 'status' },
         },
         {
           title: '操作',
@@ -212,6 +217,12 @@ export default {
         this.optionAlertShow = false
       }
     },
+    changeStatus(record) {
+      changeStatus({ id: record.id, status: record.status ? 0 : 1 }).then((res) => {
+        this.$message.info('操作成功')
+        this.handleOk()
+      })
+    },
     setTree(list) {
       return list.map((item) => {
         return {

+ 6 - 7
src/views/custom/form/modules/BaseForm.vue

@@ -4,8 +4,8 @@
       <a-col :md="48" :sm="48">
         <a-space class="table-page-search-submitButtons">
           <a-button v-show="current!==0" :loading="confirmLoading" type="primary" @click="current--">上一步</a-button>
-          <a-button v-show="current!==3" :loading="confirmLoading" type="primary" @click="next">下一步</a-button>
-          <a-button v-show="current===3" :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+          <a-button v-show="current!==2" :loading="confirmLoading" type="primary" @click="next">下一步</a-button>
+          <a-button v-show="current===2" :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
           <a-button type="default" @click="handleCancel()">返回</a-button>
         </a-space>
       </a-col>
@@ -13,7 +13,7 @@
     <a-steps :current="current">
       <a-step title="模板分类" />
       <a-step title="表单配置" />
-      <a-step title="表单查询字段设置" />
+      <!-- <a-step title="表单查询字段设置" /> -->
       <a-step title="关联流程" />
     </a-steps>
     <br>
@@ -46,7 +46,7 @@
 
     </a-form>
     <FormComponent v-show="current===1" ref="formComponent" />
-    <a-form v-show="current===2">
+    <!-- <a-form v-show="current===2">
       <a-form-item label="查询字段" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
         <a-checkbox-group v-model="queryFields" @change="handleQueryFieldsChange">
           <a-row>
@@ -58,8 +58,8 @@
           </a-row>
         </a-checkbox-group>
       </a-form-item>
-    </a-form>
-    <a-form v-show="current===3">
+    </a-form> -->
+    <a-form v-show="current===2">
       <a-form-item label="绑定流程" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
         <a-select v-model="formValue.flowId">
           <a-select-option v-for="{name,id} in workFlowList" :value="id" :key="id">
@@ -183,7 +183,6 @@ export default {
           break
         default:
           this.current++
-
           break
       }
     },

+ 24 - 25
src/views/custom/form/modules/Detail.vue

@@ -10,25 +10,18 @@
     <title-divider title="基础信息" width="90px"></title-divider>
     <detail-list :col="2">
       <detail-list-item term="表单名称">{{ model.name }}</detail-list-item>
-      <detail-list-item term="表单类型">{{ this.typeMap[model.type ] }}</detail-list-item>
-      <detail-list-item term="模板分类">{{ this.categoryMap[model.category ] }}</detail-list-item>
-      <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
+      <detail-list-item term="模板分类">{{ categoryMap[model.category ] }}</detail-list-item>
+      <detail-list-item term="表单类型">{{childrenMaps[model.category ][model.type ]}}</detail-list-item>
+      <detail-list-item term="关联流程">{{ workFlowList.find(item => item.id === model.flowId).name}}</detail-list-item>
       <detail-list-item term="创建人">{{ model.createdUserName }}</detail-list-item>
       <detail-list-item term="创建时间">{{ model.createdTime }}</detail-list-item>
+      <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
     </detail-list>
     <title-divider title="表单配置" width="90px"></title-divider>
     <a-card>
-      <a-form
-        :labelCol="BaseTool.Constant.labelCol"
-        :wrapperCol="BaseTool.Constant.wrapperCol">
+      <a-form :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
         <a-row>
-          <MComponent
-            class="hover"
-            v-for="item in formComponentConfig.components"
-            :key="item.id"
-            :config="formComponentConfig.config"
-            :detail="item"
-          />
+          <MComponent class="hover" v-for="item in formComponentConfig.components" :key="item.id" :config="formComponentConfig.config" :detail="item" />
         </a-row>
       </a-form>
     </a-card>
@@ -39,45 +32,51 @@
 import DetailList from '@/components/tools/DetailList'
 import MComponent from './component/modules/Component.vue'
 const DetailListItem = DetailList.Item
+import { queryWorkflow } from '@/api/workflow/workflow'
 
 export default {
   name: 'CustomFormDetail',
   components: {
     DetailList,
     DetailListItem,
-    MComponent
+    MComponent,
   },
-  data () {
+  data() {
     return {
       confirmLoading: false,
       mdl: {},
       modalTitle: null,
       visible: false,
       // 下拉框map
-      model: {
-      },
+      model: {},
       categoryMap: {},
-      typeMap: {},
-      formComponentConfig: {}
+      childrenMaps: [],
+      formComponentConfig: {},
+      workFlowList: [],
     }
   },
-  created () {
+  created() {
     // 下拉框map
-    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CUSTOM_FORM_TYPE)
     this.categoryMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CATEGORY_TYPE)
+    this.DictCache.getChildrenList(this.DictCache.TYPE.CATEGORY_TYPE).forEach((item) => {
+      this.childrenMaps[item.value] = this.DictCache.getLabelByValueMapByType(item.code)
+    })
+    queryWorkflow().then((res) => {
+      this.workFlowList = res.data
+    })
   },
   methods: {
-    base (record) {
+    base(record) {
       this.visible = true
       this.modalTitle = '详情'
       this.model = record
       this.formComponentConfig = JSON.parse(record.jsonString)
     },
-    handleCancel () {
+    handleCancel() {
       this.visible = false
       this.confirmLoading = false
       this.$emit('ok')
-    }
-  }
+    },
+  },
 }
 </script>

+ 0 - 1
src/views/custom/form/modules/SubmitForm.vue

@@ -43,7 +43,6 @@ export default {
       this.record = record
       this.components = JSON.parse(record.jsonString).components
       this.config = JSON.parse(record.jsonString).config
-      console.log(this.components)
     },
     handleCancel() {
       this.visible = false