瀏覽代碼

提交代码

朱鑫波 4 年之前
父節點
當前提交
845d4bde30

文件差異過大導致無法顯示
+ 589 - 484
src/views/activiti/ProcessModelList.vue


+ 218 - 147
src/views/activiti/applyHome.vue

@@ -1,30 +1,39 @@
 <template>
   <a-card :bordered="false">
     <!--流程申请选择-->
-    <a-input-search style="margin-bottom: 10px;margin-right:10px;width: 200px" v-model="searchProcessKey"
-      placeholder="输入流程名称" @search="onSearchProcess" />
+    <a-input-search
+      style="margin-bottom: 10px;margin-right:10px;width: 200px"
+      v-model="searchProcessKey"
+      placeholder="输入流程名称"
+      @search="onSearchProcess"
+    />
     <a-button @click="onSearchProcess(searchProcessKey)" type="primary">查询</a-button>
     <a-button @click="onSearchProcess('')">重置</a-button>
     <a-button @click="handleToApplyList" type="primary" style="float: right;">前往我的申请列表</a-button>
     <a-empty description="无流程可供选择" v-if="activeKeyAll.length==0" />
     <div v-else>
       <a-collapse v-model="activeKey">
-        <a-collapse-panel v-for="(value, index)  in activeKeyAll" :header="filterDictText(dictOptions,value)||'未分类'"
-          :key="value">
+        <a-collapse-panel
+          v-for="(value, index)  in activeKeyAll"
+          :header="filterDictText(dictOptions,value)||'未分类'"
+          :key="value"
+        >
           <a-list :grid="{ gutter: 10,column:4}" :dataSource="processDataMap[value]">
             <a-list-item slot="renderItem" slot-scope="item">
               <a-card>
                 <div slot="title">
                   <a-row>
-                    <a-col span="12" :title="item.name">{{item.name}} </a-col>
+                    <a-col span="12" :title="item.name">{{item.name}}</a-col>
                     <a-col span="12" style="text-align: right;">
                       <a href="javascript:void (0)" @click="chooseProcess(item)">发起申请</a>
                     </a-col>
                   </a-row>
                 </div>
-                <b>版本:</b>v.{{item.version}}
+                <b>版本:</b>
+                v.{{item.version}}
                 <br />
-                <b>说明:</b>{{item.description}}
+                <b>说明:</b>
+                {{item.description}}
               </a-card>
             </a-list-item>
           </a-list>
@@ -32,171 +41,233 @@
       </a-collapse>
     </div>
     <!--流程表单-->
-    <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="80%">
-      <component :disabled="lcModa.disabled" v-if="lcModa.visible" :is="lcModa.formComponent"
-        :processData="lcModa.processData" :isNew="lcModa.isNew" @afterSubmit="afterSub"
-        @close="lcModa.visible=false,lcModa.disabled = false"></component>
+    <a-modal :title="lcModa.title" v-model="lcModa.visible" :maskClosable="false" width="80%">
+      <!-- <component
+        :disabled="lcModa.disabled"
+        v-if="lcModa.visible"
+        :is="lcModa.formComponent"
+        :processData="lcModa.processData"
+        :isNew="lcModa.isNew"
+        @afterSubmit="afterSub"
+        @close="lcModa.visible=false,lcModa.disabled = false"
+      ></component>-->
+      <template slot="footer">
+        <a-button @click="lcModa.visible=false">关闭</a-button>
+        <a-button key="back" @click="close">重置</a-button>
+        <a-button key="submit" type="primary" @click="handleOkAll" :loading="loading">提交</a-button>
+      </template>
+      <k-form-build v-if="lcModa.visible" :defaultValue="defaultValue" :value="jsonData" ref="kfb" />
     </a-modal>
   </a-card>
-
 </template>
 
 <script>
-  import {
-    activitiMixin
-  } from '@/views/activiti/mixins/activitiMixin'
-  import JEllipsis from '@/components/jeecg/JEllipsis'
-  import JTreeSelect from '@/components/jeecg/JTreeSelect'
-  import {
-    initDictOptions,
-    filterDictText
-  } from '@/components/dict/JDictSelectUtil'
-  import historicDetail from '@/views/activiti/historicDetail'
-  export default {
-    name: "applyHome",
-    mixins: [activitiMixin],
-    components: {
-      JEllipsis,
-      JTreeSelect,
-      historicDetail
-    },
-    data() {
-      return {
-        typeList: ["input", "textarea", "number", "select", "checkbox", "radio", "date", "time", "rate", "slider",
-          "uploadFile", "uploadImg", "switch", "button",  "text",  "card", "grid", "table"
-        ],//"alert","html", "divider",
-        description: '所有',
-        dictOptions: [],
-        url: {
-          getProcessDataList: "/activiti_process/listData",
-          getFirstNode: '/actProcessIns/getFirstNode',
-          applyBusiness: '/actBusiness/apply',
-        },
-        // 查询条件
-        queryParam: {
-          createTimeRange: [],
-          keyWord: '',
+import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
+import JEllipsis from '@/components/jeecg/JEllipsis'
+import JTreeSelect from '@/components/jeecg/JTreeSelect'
+import { initDictOptions, filterDictText } from '@/components/dict/JDictSelectUtil'
+import historicDetail from '@/views/activiti/historicDetail'
+import { deleteAction, getAction, downFile,postAction } from '@/api/manage'
+export default {
+  name: 'applyHome',
+  mixins: [activitiMixin],
+  components: {
+    JEllipsis,
+    JTreeSelect,
+    historicDetail,
+  },
+  data() {
+    return {
+      loading: false,
+      typeList: [
+        'input',
+        'textarea',
+        'number',
+        'select',
+        'checkbox',
+        'radio',
+        'date',
+        'time',
+        'rate',
+        'slider',
+        'uploadFile',
+        'uploadImg',
+        'switch',
+        'button',
+        'text',
+        'card',
+        'grid',
+        'table',
+      ], //"alert","html", "divider",
+      description: '所有',
+      dictOptions: [],
+      url: {
+        getProcessDataList: '/activiti_process/listData',
+        getFirstNode: '/actProcessIns/getFirstNode',
+        applyBusiness: '/actBusiness/apply',
+      },
+      // 查询条件
+      queryParam: {
+        createTimeRange: [],
+        keyWord: '',
+      },
+      // 表头
+      labelCol: {
+        xs: {
+          span: 4,
         },
-        // 表头
-        labelCol: {
-          xs: {
-            span: 4
-          },
-          sm: {
-            span: 4
-          },
+        sm: {
+          span: 4,
         },
-        wrapperCol: {
-          xs: {
-            span: 20
-          },
-          sm: {
-            span: 20
-          },
+      },
+      wrapperCol: {
+        xs: {
+          span: 20,
         },
-        processModalVisible: null,
-        activeKeyAll: [],
-        activeKey: [],
-        processDataMap: {},
-        searchProcessKey: null,
-        addApplyLoading: false,
-        lcModa: {
-          title: '',
-          disabled: false,
-          visible: false,
-          formComponent: null,
-          isNew: false
+        sm: {
+          span: 20,
         },
-      }
-    },
-    computed: {},
-    mounted() {
-      this.initDictConfig()
-      this.getProcessList()
-    },
-    methods: {
-      saveJson(json) {
-        console.log(json)
       },
-      initDictConfig() {
-        //初始化字典 - 流程分类
-        initDictOptions('bpm_process_type').then((res) => {
-          if (res.success) {
-            this.dictOptions = res.result;
-          }
-        });
+      processModalVisible: null,
+      activeKeyAll: [],
+      activeKey: [],
+      processDataMap: {},
+      searchProcessKey: null,
+      addApplyLoading: false,
+      lcModa: {
+        title: '',
+        disabled: false,
+        visible: false,
+        formComponent: null,
+        isNew: false,
       },
-      filterDictText(dictOptions, text) {
-        if (dictOptions instanceof Array) {
-          for (let dictItem of dictOptions) {
-            if (text === dictItem.value) {
-              return dictItem.text
-            }
+      jsonData: {},
+      defaultValue: {},
+    }
+  },
+  computed: {},
+  mounted() {
+    this.initDictConfig()
+    this.getProcessList()
+  },
+  methods: {
+    handleOkAll() {
+      this.loading = true
+      var that = this
+      this.$refs.kfb
+        .getData()
+        .then((values) => {
+          console.log('验证通过', values,this.lcModa.processData)
+          var formData = {}
+          formData.procDefId = this.lcModa.processData.id
+          formData.procDeTitle = this.lcModa.processData.name
+          formData.formText = JSON.stringify(values)
+          postAction('/actBusiness/add', formData)
+            .then((res) => {
+              if (res.success) {
+                that.lcModa.visible=false
+                that.$message.success('保存成功!')
+                that.loading = false
+              } else {
+                that.$message.error(res.message)
+                that.loading = false
+              }
+            })
+            .finally(() => {
+              that.loading = true
+            })
+        })
+    },
+    close() {
+      this.$refs.kfb.reset()
+    },
+    saveJson(json) {
+      console.log(json)
+    },
+    initDictConfig() {
+      //初始化字典 - 流程分类
+      initDictOptions('bpm_process_type').then((res) => {
+        if (res.success) {
+          this.dictOptions = res.result
+        }
+      })
+    },
+    filterDictText(dictOptions, text) {
+      if (dictOptions instanceof Array) {
+        for (let dictItem of dictOptions) {
+          if (text === dictItem.value) {
+            return dictItem.text
           }
         }
-        return text || text == 'null' ? '' : text
-      },
-      /*加载流程列表*/
-      getProcessList() {
-        this.addApplyLoading = true;
-        this.getAction(this.url.getProcessDataList, {
-          status: 1,
-          roles: true
-        }).then(res => {
-          this.activeKeyAll = [];
+      }
+      return text || text == 'null' ? '' : text
+    },
+    /*加载流程列表*/
+    getProcessList() {
+      this.addApplyLoading = true
+      this.getAction(this.url.getProcessDataList, {
+        status: 1,
+        roles: true,
+      })
+        .then((res) => {
+          this.activeKeyAll = []
           if (res.success) {
-            var result = res.result || [];
+            var result = res.result || []
             if (result.length > 0) {
-              let searchProcessKey = this.searchProcessKey;
-              if (searchProcessKey) { //过滤条件
+              let searchProcessKey = this.searchProcessKey
+              if (searchProcessKey) {
+                //过滤条件
                 result = _.filter(result, function (o) {
-                  return o.name.indexOf(searchProcessKey) > -1;
-                });
+                  return o.name.indexOf(searchProcessKey) > -1
+                })
               }
-              this.processDataMap = _.groupBy(result, 'categoryId');
+              this.processDataMap = _.groupBy(result, 'categoryId')
               for (const categoryId in this.processDataMap) {
                 this.activeKeyAll.push(categoryId)
               }
-              this.activeKey = this.activeKeyAll;
+              this.activeKey = this.activeKeyAll
             }
-            this.processModalVisible = true;
+            this.processModalVisible = true
           } else {
             this.$message.warning(res.message)
           }
-        }).finally(() => this.addApplyLoading = false);
-      },
-      onSearchProcess(value) {
-        this.searchProcessKey = value;
-        this.getProcessList()
-      },
-      chooseProcess(v) {
-        if (!v.routeName) {
-          this.$message.warning(
-            "该流程信息未配置表单,请联系开发人员!"
-          );
-          return;
-        }
-        this.lcModa.formComponent = this.getFormComponent(v.routeName).component;
-        this.lcModa.title = '发起流程:' + v.name;
-        this.lcModa.isNew = true;
-        this.lcModa.processData = v;
-        this.lcModa.visible = true;
-        console.log("发起", v)
-      },
-      /*提交成功申请后*/
-      afterSub(formData) {
-        this.lcModa.visible = false;
-        this.$message("请前往我的申请列表提交审批!")
-      },
-      /*前往我的申请页面*/
-      handleToApplyList() {
-        this.$router.push({
-          path: '/activiti/applyList'
         })
-      }
-    }
-  }
+        .finally(() => (this.addApplyLoading = false))
+    },
+    onSearchProcess(value) {
+      this.searchProcessKey = value
+      this.getProcessList()
+    },
+    chooseProcess(v) {
+      getAction('/ctop/actCustomForm/queryById', { id: v.customTableId }).then((res) => {
+        if (res.success) {
+          this.jsonData = JSON.parse(res.result.text)
+        } else {
+          this.$message.warning('该流程信息未配置表单,请联系开发人员!')
+          return
+        }
+      })
+      // this.lcModa.formComponent = this.getFormComponent(v.routeName).component
+      this.lcModa.title = '发起流程:' + v.name
+      this.lcModa.isNew = true
+      this.lcModa.processData = v
+      this.lcModa.visible = true
+      console.log('发起', v)
+    },
+    /*提交成功申请后*/
+    afterSub(formData) {
+      this.lcModa.visible = false
+      this.$message('请前往我的申请列表提交审批!')
+    },
+    /*前往我的申请页面*/
+    handleToApplyList() {
+      this.$router.push({
+        path: '/activiti/applyList',
+      })
+    },
+  },
+}
 </script>
 <style scoped>
-  @import '~@assets/less/common.less';
+@import '~@assets/less/common.less';
 </style>

文件差異過大導致無法顯示
+ 504 - 387
src/views/activiti/applyList.vue


+ 143 - 110
src/views/activiti/doneManage.vue

@@ -1,5 +1,5 @@
 <style lang="less">
-  @import '~@assets/less/common.less';
+@import '~@assets/less/common.less';
 </style>
 <template>
   <div class="search">
@@ -9,26 +9,23 @@
           <a-row :gutter="24">
             <a-col :md="6" :sm="8">
               <a-form-item label="任务名称" prop="name">
-                <a-input
-                  type="text"
-                  v-model="searchForm.name"
-                  placeholder="请输入"
-                  clearable
-                />
+                <a-input type="text" v-model="searchForm.name" placeholder="请输入" clearable />
               </a-form-item>
             </a-col>
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-            <a-col :md="6" :sm="12" >
+              <a-col :md="6" :sm="12">
                 <a-button @click="handleSearch" type="primary" icon="search">搜索</a-button>
                 <a-button @click="handleReset" style="margin-left: 10px;">重置</a-button>
-            </a-col>
-          </span>
+              </a-col>
+            </span>
           </a-row>
         </a-form>
       </div>
 
       <a-row>
-        <a-table :scroll="scroll" bordered
+        <a-table
+          :scroll="scroll"
+          bordered
           :loading="loading"
           rowKey="id"
           :dataSource="data"
@@ -36,68 +33,78 @@
           @change="handleTableChange"
           ref="table"
         >
-          <a-table-column title="#"  :width="50">
-            <template slot-scope="t,r,i" >
-              <span> {{i+1}} </span>
+          <a-table-column title="#" :width="50">
+            <template slot-scope="t,r,i">
+              <span>{{i+1}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="任务名称" dataIndex="name"  :width="150" align="center">
+          <a-table-column title="任务名称" data-index="name" :width="150" align="center">
             <template slot-scope="t,r,i">
-              <span> {{t}} </span>
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="所属流程" dataIndex="processName"  :width="150" align="center">
+          <a-table-column title="所属流程" data-index="processName" :width="150" align="center">
             <template slot-scope="t,r,i">
-              <span> {{t}} </span>
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="委托代办人" dataIndex="owner"  :width="130" align="center">
+          <a-table-column title="委托代办人" data-index="owner" :width="130" align="center">
             <template slot-scope="t,r,i">
-              <span> {{t}} </span>
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="流程发起人" dataIndex="applyer"  :width="130" align="center">
+          <a-table-column title="流程发起人" data-index="applyer" :width="130" align="center">
             <template slot-scope="t,r,i">
-              <span> {{t}} </span>
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="优先级" dataIndex="priority"  :width="100" align="center"
-                          key="priority" :sorter="(a,b)=>a.priority - b.priority"
+          <a-table-column
+            title="优先级"
+            data-index="priority"
+            :width="100"
+            align="center"
+            key="priority"
+            :sorter="(a,b)=>a.priority - b.priority"
           >
             <template slot-scope="t">
-              <span v-if="t==0" style="color: green;"> 普通 </span>
-              <span v-else-if="t==1" style="color: orange;"> 重要 </span>
-              <span v-else-if="t==2" style="color: red;"> 紧急 </span>
-              <span v-else style="color: #999;">  </span>
+              <span v-if="t==0" style="color: green;">普通</span>
+              <span v-else-if="t==1" style="color: orange;">重要</span>
+              <span v-else-if="t==2" style="color: red;">紧急</span>
+              <span v-else style="color: #999;">无</span>
             </template>
           </a-table-column>
-          <a-table-column title="审批操作" dataIndex="deleteReason"  :width="100" align="center">
+          <a-table-column title="审批操作" data-index="deleteReason" :width="100" align="center">
             <template slot-scope="t">
-              <span> {{t}} </span>
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="审批意见" dataIndex="comment"  :width="100" align="center">
+          <a-table-column title="审批意见" data-index="comment" :width="100" align="center">
             <template slot-scope="t">
-              <j-ellipsis :value="t" :length="10"/>
+              <j-ellipsis :value="t" :length="10" />
             </template>
           </a-table-column>
-          <a-table-column title="耗时" dataIndex="duration"  :width="100" align="center"
-                          key="duration" :sorter="(a,b)=>a.duration - b.duration"
-                          >
+          <a-table-column
+            title="耗时"
+            data-index="duration"
+            :width="100"
+            align="center"
+            key="duration"
+            :sorter="(a,b)=>a.duration - b.duration"
+          >
             <template slot-scope="t">
-              <span> {{millsToTime(t)}} </span>
+              <span>{{millsToTime(t)}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="创建时间" dataIndex="createTime"  :width="150" align="center">
+          <a-table-column title="创建时间" data-index="createTime" :width="150" align="center">
             <template slot-scope="t">
-              <span> {{t}} </span>
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="操作" dataIndex="action"   align="center">
+          <a-table-column title="操作" data-index="action" align="center">
             <template slot-scope="t,r,i">
-              <a href="javascript:void(0);" @click="detail(r)" >表单数据</a>
+              <a href="javascript:void(0);" @click="detail(r)">表单数据</a>
               <a-divider type="vertical" />
-              <a href="javascript:void(0);" @click="history(r)" >审批历史</a>
+              <a href="javascript:void(0);" @click="history(r)">审批历史</a>
               <a-divider type="vertical" />
               <a-popconfirm title="确定删除吗?" @confirm="() => remove(r)">
                 <a style="color: red;">删除</a>
@@ -108,28 +115,46 @@
       </a-row>
     </a-card>
     <!---->
-    <a-modal title="审批历史" v-model="modalLsVisible" :mask-closable="false" :width="'80%'" :footer="null">
+    <a-modal
+      title="审批历史"
+      v-model="modalLsVisible"
+      :mask-closable="false"
+      :width="'80%'"
+      :footer="null"
+    >
       <div v-if="modalLsVisible">
         <component :is="historicDetail" :procInstId="procInstId"></component>
       </div>
     </a-modal>
     <!--流程表单-->
-    <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="80%">
-      <component :disabled="lcModa.disabled" v-if="lcModa.visible" :is="lcModa.formComponent"
-                 :processData="lcModa.processData" :isNew = "lcModa.isNew"
-                 @close="lcModa.visible=false,lcModa.disabled = false"></component>
+    <a-modal
+      :title="lcModa.title"
+      v-model="lcModa.visible"
+      :footer="null"
+      :maskClosable="false"
+      width="80%"
+    >
+      <k-form-build
+        v-if="lcModa.visible"
+        :defaultValue="defaultValue"
+        :value="jsonData"
+        ref="kfb"
+        disabled
+      />
     </a-modal>
   </div>
 </template>
 
 <script>
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-  import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
 export default {
-  name: "done-manage",
-  mixins:[activitiMixin,JeecgListMixin],
+  name: 'done-manage',
+  mixins: [activitiMixin, JeecgListMixin],
   data() {
     return {
+      jsonData: {},
+      defaultValue: {},
       openSearch: true,
       openTip: true,
       loading: true, // 表单加载状态
@@ -137,18 +162,18 @@ export default {
       selectList: [], // 多选数据
       searchForm: {
         // 搜索框对应data对象
-        name: "",
+        name: '',
         pageNumber: 1, // 当前页数
         pageSize: 10, // 页面大小
-        sort: "createTime", // 默认排序字段
-        order: "desc" // 默认排序方式
+        sort: 'createTime', // 默认排序字段
+        order: 'desc', // 默认排序方式
       },
       modalType: 0, // 添加或编辑标识
       modalVisible: false, // 添加或编辑显示
-      modalTitle: "", // 添加或编辑标题
+      modalTitle: '', // 添加或编辑标题
       form: {
         // 添加或编辑表单对象初始化数据
-        reason: ""
+        reason: '',
       },
       formValidate: {
         // 表单验证规则
@@ -156,100 +181,108 @@ export default {
       submitLoading: false, // 添加或编辑提交状态
       data: [], // 表数据
       total: 0, // 表数据总数
-      deleteId: "",
-      url:{
-        doneList:'/actTask/doneList',
-        deleteHistoricTask:'/actTask/deleteHistoric/'
+      deleteId: '',
+      url: {
+        doneList: '/actTask/doneList',
+        deleteHistoricTask: '/actTask/deleteHistoric/',
       },
       modalLsVisible: false,
       procInstId: '',
       lcModa: {
-        title:'',
-        disabled:false,
-        visible:false,
-        formComponent : null,
-        isNew : false
+        title: '',
+        disabled: false,
+        visible: false,
+        formComponent: null,
+        isNew: false,
       },
-    };
+    }
   },
   mounted() {
-    this.init();
+    this.init()
   },
   methods: {
-    loadData(){},
+    loadData() {},
     init() {
-      this.getDataList();
+      this.getDataList()
     },
     getDataList() {
-      this.loading = true;
-      this.postFormAction(this.url.doneList,this.searchForm).then(res => {
-        this.loading = false;
+      this.loading = true
+      this.postFormAction(this.url.doneList, this.searchForm).then((res) => {
+        this.loading = false
         if (res.success) {
-          this.data = res.result||[];
-        }else {
+          this.data = res.result || []
+        } else {
           this.$message.error(res.message)
         }
-      });
+      })
     },
     handleSearch() {
-      this.searchForm.pageNumber = 1;
-      this.searchForm.pageSize = 10;
-      this.getDataList();
+      this.searchForm.pageNumber = 1
+      this.searchForm.pageSize = 10
+      this.getDataList()
     },
     handleReset() {
-      this.searchForm={};
-      this.searchForm.pageNumber = 1;
-      this.searchForm.pageSize = 10;
+      this.searchForm = {}
+      this.searchForm.pageNumber = 1
+      this.searchForm.pageSize = 10
       // 重新加载数据
-      this.getDataList();
+      this.getDataList()
     },
     handelCancel() {
-      this.modalVisible = false;
+      this.modalVisible = false
     },
     detail(r) {
-      if (!r.routeName) {
-        this.$message.warning(
-          "该流程信息未配置表单,请联系开发人员!"
-        );
-        return;
-      }
-      this.lcModa.disabled = true;
-      this.lcModa.title = '查看流程业务信息:'+r.processName;
-      this.lcModa.formComponent = this.getFormComponent(r.routeName).component;
-      this.lcModa.processData = r;
-      this.lcModa.isNew = false;
-      this.lcModa.visible = true;
+      this.getAction('/ctop/actCustomForm/queryById', { id: r.tableId }).then((res) => {
+        if (res.success) {
+          this.jsonData = JSON.parse(res.result.text)
+          if (this.jsonData) {
+            this.$nextTick(() => {
+              this.defaultValue = JSON.parse(r.tableName)
+              this.$refs.kfb.setData(this.defaultValue)
+            })
+          }
+        } else {
+          this.jsonData = {}
+          this.$message.warning('该流程信息未配置表单,请联系开发人员!')
+          return
+        }
+      })
+      this.lcModa.disabled = true
+      this.lcModa.title = '查看流程业务信息:' + r.processName
+      this.lcModa.formComponent = this.getFormComponent(r.routeName).component
+      this.lcModa.processData = r
+      this.lcModa.isNew = false
+      this.lcModa.visible = true
     },
     history(v) {
       if (!v.procInstId) {
-        this.$message.error("流程实例ID不存在");
-        return;
+        this.$message.error('流程实例ID不存在')
+        return
       }
-      this.procInstId = v.procInstId;
-      this.modalLsVisible = true;
+      this.procInstId = v.procInstId
+      this.modalLsVisible = true
     },
     remove(v) {
-      this.postFormAction(this.url.deleteHistoricTask+v.id).then(res => {
+      this.postFormAction(this.url.deleteHistoricTask + v.id).then((res) => {
         if (res.success) {
-          this.$message.success("操作成功");
-          this.getDataList();
-        }else {
-          this.$message.error(res.message);
+          this.$message.success('操作成功')
+          this.getDataList()
+        } else {
+          this.$message.error(res.message)
         }
-      });
+      })
     },
     handleTableChange(pagination, filters, sorter) {
       //分页、排序、筛选变化时触发
       //TODO 筛选
       if (Object.keys(sorter).length > 0) {
-        this.isorter.column = sorter.field;
-        this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
+        this.isorter.column = sorter.field
+        this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
       }
-      this.ipagination = pagination;
+      this.ipagination = pagination
       // this.loadData();
     },
   },
-  watch: {
-  }
-};
+  watch: {},
+}
 </script>

+ 169 - 133
src/views/activiti/processFinishManage.vue

@@ -1,6 +1,5 @@
 <style lang="less">
-  @import '~@assets/less/common.less';
-
+@import '~@assets/less/common.less';
 </style>
 <template>
   <div class="search">
@@ -10,22 +9,12 @@
           <a-row :gutter="24">
             <a-col :md="6" :sm="8">
               <a-form-item label="流程名称" prop="name">
-                <a-input
-                  type="text"
-                  v-model="searchForm.name"
-                  placeholder="请输入"
-                  clearable
-                />
+                <a-input type="text" v-model="searchForm.name" placeholder="请输入" clearable />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="8">
               <a-form-item label="标识Key" prop="name">
-                <a-input
-                  type="text"
-                  v-model="searchForm.key"
-                  placeholder="请输入"
-                  clearable
-                />
+                <a-input type="text" v-model="searchForm.key" placeholder="请输入" clearable />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="8">
@@ -39,16 +28,18 @@
               </a-form-item>
             </a-col>
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-            <a-col :md="6" :sm="12" >
-              <a-button @click="handleSearch" type="primary" icon="search">搜索</a-button>
-              <a-button @click="handleReset" style="margin-left: 10px;">重置</a-button>
-            </a-col>
-          </span>
+              <a-col :md="6" :sm="12">
+                <a-button @click="handleSearch" type="primary" icon="search">搜索</a-button>
+                <a-button @click="handleReset" style="margin-left: 10px;">重置</a-button>
+              </a-col>
+            </span>
           </a-row>
         </a-form>
       </div>
       <a-row>
-        <a-table :scroll="{x:1680,y:innerHeight/2}" bordered
+        <a-table
+          :scroll="{x:1680}"
+          bordered
           :loading="loading"
           rowKey="id"
           :dataSource="data"
@@ -56,74 +47,88 @@
           @change="handleTableChange"
           ref="table"
         >
-          <a-table-column title="#"  :width="50" fixed="left">
-            <template slot-scope="t,r,i" >
-              <span> {{i+1}} </span>
+          <a-table-column title="#" :width="50" fixed="left">
+            <template slot-scope="t,r,i">
+              <span>{{i+1}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="流程实例ID" dataIndex="id" :width="150" fixed="left">
-            <template slot-scope="t,r,i" >
-              <span> {{t}} </span>
+          <a-table-column title="流程实例ID" data-index="id" :width="150" fixed="left">
+            <template slot-scope="t,r,i">
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="流程名称" dataIndex="name" :width="150" fixed="left">
-            <template slot-scope="t,r,i" >
-              <span> {{t}} </span>
+          <a-table-column title="流程名称" data-index="name" :width="150" fixed="left">
+            <template slot-scope="t,r,i">
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="申请人" dataIndex="applyer"  :ellipsis= "true" :width="150" fixed="left">
-            <template slot-scope="t,r,i" >
-              <span> {{t}} </span>
+          <a-table-column
+            title="申请人"
+            data-index="applyer"
+            :ellipsis="true"
+            :width="150"
+            fixed="left"
+          >
+            <template slot-scope="t,r,i">
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="标识Key" dataIndex="key" :width="150" >
-            <template slot-scope="t,r,i" >
-              <span> {{t}} </span>
+          <a-table-column title="标识Key" data-index="key" :width="150">
+            <template slot-scope="t,r,i">
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="版本" dataIndex="version" :width="80">
-            <template slot-scope="t,r,i" >
-              <span> v.{{t}} </span>
+          <a-table-column title="版本" data-index="version" :width="80">
+            <template slot-scope="t,r,i">
+              <span>v.{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="审批结果" dataIndex="result" :width="150"
-                          key="result" :sorter="(a,b)=>a.result - b.result"
+          <a-table-column
+            title="审批结果"
+            data-index="result"
+            :width="150"
+            key="result"
+            :sorter="(a,b)=>a.result - b.result"
           >
-            <template slot-scope="t,r,i" >
-              <span v-if="t==4" style="color: #999999"> 发起人撤回 </span>
-              <span v-else-if="t==5" style="color: orange"> 已删除 </span>
-              <span v-else-if="t==2" style="color: green"> 已通过 </span>
-              <span v-else-if="t==3" style="color: red"> 已驳回 </span>
-              <span v-else > 未知 </span>
+            <template slot-scope="t,r,i">
+              <span v-if="t==4" style="color: #999999">发起人撤回</span>
+              <span v-else-if="t==5" style="color: orange">已删除</span>
+              <span v-else-if="t==2" style="color: green">已通过</span>
+              <span v-else-if="t==3" style="color: red">已驳回</span>
+              <span v-else>未知</span>
             </template>
           </a-table-column>
-          <a-table-column title="原因详情" dataIndex="deleteReason" :width="150">
-            <template slot-scope="t,r,i" >
-             <j-ellipsis :value="t" :length="10"></j-ellipsis>
+          <a-table-column title="原因详情" data-index="deleteReason" :width="150">
+            <template slot-scope="t,r,i">
+              <j-ellipsis :value="t" :length="10"></j-ellipsis>
             </template>
           </a-table-column>
-          <a-table-column title="总耗时" dataIndex="duration" :width="100"
-                          key="duration" :sorter="(a,b)=>a.duration - b.duration"
+          <a-table-column
+            title="总耗时"
+            data-index="duration"
+            :width="100"
+            key="duration"
+            :sorter="(a,b)=>a.duration - b.duration"
           >
-            <template slot-scope="t,r,i" >
-              <span > {{millsToTime(t)}} </span>
+            <template slot-scope="t,r,i">
+              <span>{{millsToTime(t)}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="开始时间" dataIndex="startTime" :width="150">
-            <template slot-scope="t,r,i" >
-              <span > {{t}} </span>
+          <a-table-column title="开始时间" data-index="startTime" :width="150">
+            <template slot-scope="t,r,i">
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="结束时间" dataIndex="endTime" :width="150">
-            <template slot-scope="t,r,i" >
-              <span > {{t}} </span>
+          <a-table-column title="结束时间" data-index="endTime" :width="150">
+            <template slot-scope="t,r,i">
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="操作" dataIndex="" :width="250" fixed="right">
-            <template slot-scope="t,r,i" >
-              <a href="javascript:void(0);" style="color: green;" @click="history(r)" >审批历史</a>
+          <a-table-column title="操作" data-index :width="250" fixed="right">
+            <template slot-scope="t,r,i">
+              <a href="javascript:void(0);" style="color: green;" @click="history(r)">审批历史</a>
               <a-divider type="vertical" />
-              <a href="javascript:void(0);" style="color: blue;" @click="detail(r)" >表单数据</a>
+              <a href="javascript:void(0);" style="color: blue;" @click="detail(r)">表单数据</a>
               <a-divider type="vertical" />
               <a-popconfirm title="确定删除吗?" @confirm="() => remove(r)">
                 <a style="color: red;">删除</a>
@@ -134,37 +139,55 @@
       </a-row>
     </a-card>
     <!---->
-    <a-modal title="审批历史" v-model="modalLsVisible" :mask-closable="false" :width="'80%'" :footer="null">
+    <a-modal
+      title="审批历史"
+      v-model="modalLsVisible"
+      :mask-closable="false"
+      :width="'80%'"
+      :footer="null"
+    >
       <div v-if="modalLsVisible">
         <component :is="historicDetail" :procInstId="procInstId"></component>
       </div>
     </a-modal>
     <!--流程表单-->
-    <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="80%">
-      <component :disabled="lcModa.disabled" v-if="lcModa.visible" :is="lcModa.formComponent"
-                 :processData="lcModa.processData" :isNew = "lcModa.isNew"
-                 @close="lcModa.visible=false,lcModa.disabled = false"></component>
+    <a-modal
+      :title="lcModa.title"
+      v-model="lcModa.visible"
+      :footer="null"
+      :maskClosable="false"
+      width="80%"
+    >
+      <k-form-build
+        v-if="lcModa.visible"
+        :defaultValue="defaultValue"
+        :value="jsonData"
+        ref="kfb"
+        disabled
+      />
     </a-modal>
   </div>
 </template>
 
 <script>
-
-import {activitiMixin} from "./mixins/activitiMixin";
-import {JeecgListMixin} from "../../mixins/JeecgListMixin";
+import { activitiMixin } from './mixins/activitiMixin'
+import { JeecgListMixin } from '../../mixins/JeecgListMixin'
+import { deleteAction, getAction, downFile, postAction } from '@/api/manage'
 export default {
-  mixins:[JeecgListMixin,activitiMixin],
-  name: "process-finish-manage",
+  mixins: [JeecgListMixin, activitiMixin],
+  name: 'process-finish-manage',
   data() {
     return {
+      jsonData: {},
+      defaultValue: {},
       modalLsVisible: false,
       procInstId: '',
       lcModa: {
-        title:'',
-        disabled:false,
-        visible:false,
-        formComponent : null,
-        isNew : false
+        title: '',
+        disabled: false,
+        visible: false,
+        formComponent: null,
+        isNew: false,
       },
       openSearch: true,
       openTip: true,
@@ -174,99 +197,112 @@ export default {
       selectDate: null, // 选择日期绑定modal
       searchForm: {
         // 搜索框对应data对象
-        name: "",
-        key: "",
+        name: '',
+        key: '',
         pageNumber: 1, // 当前页数
-        pageSize: 10 // 页面大小
+        pageSize: 10, // 页面大小
       },
       data: [], // 表单数据
       total: 0, // 表单数据总数
-      deleteId: "",
+      deleteId: '',
       url: {
-        getFinishedProcess:'/actProcessIns/getFinishedProcess',
-        delHistoricIns:'/actProcessIns/delHistoricInsByIds/'
-      }
-    };
+        getFinishedProcess: '/actProcessIns/getFinishedProcess',
+        delHistoricIns: '/actProcessIns/delHistoricInsByIds/',
+      },
+    }
   },
   methods: {
-    loadData(){},
+    loadData() {},
     init() {
-      this.getDataList();
+      this.getDataList()
     },
     selectDateRange(v) {
-      this.searchForm.startDate = null;
-      this.searchForm.endDate = null;
+      this.searchForm.startDate = null
+      this.searchForm.endDate = null
       if (v[0]) {
-        this.searchForm.startDate = v[0].format("YYYY-MM-DD");
+        this.searchForm.startDate = v[0].format('YYYY-MM-DD')
       }
       if (v[1]) {
-        this.searchForm.endDate = v[1].format("YYYY-MM-DD");
+        this.searchForm.endDate = v[1].format('YYYY-MM-DD')
       }
     },
     getDataList() {
-      this.loading = true;
-      this.getAction(this.url.getFinishedProcess,this.searchForm).then(res => {
-        this.loading = false;
+      this.loading = true
+      this.getAction(this.url.getFinishedProcess, this.searchForm).then((res) => {
+        this.loading = false
         if (res.success) {
-          this.data = res.result;
-        }else {
+          this.data = res.result
+        } else {
           this.$message.error(res.message)
         }
-      });
+      })
     },
     handleSearch() {
-      this.searchForm.pageNumber = 1;
-      this.searchForm.pageSize = 10;
-      this.getDataList();
+      this.searchForm.pageNumber = 1
+      this.searchForm.pageSize = 10
+      this.getDataList()
     },
     handleReset() {
-      this.selectDate = null;
-      this.searchForm={};
-      this.searchForm.pageNumber = 1;
-      this.searchForm.pageSize = 10;
+      this.selectDate = null
+      this.searchForm = {}
+      this.searchForm.pageNumber = 1
+      this.searchForm.pageSize = 10
       // 重新加载数据
-      this.getDataList();
+      this.getDataList()
     },
     handelCancel() {
-      this.modalVisible = false;
+      this.modalVisible = false
     },
     detail(r) {
-      if (!r.routeName) {
-        this.$message.warning(
-          "该流程信息未配置表单,请联系开发人员!"
-        );
-        return;
-      }
-      this.lcModa.disabled = true;
-      this.lcModa.title = '查看流程业务信息:'+r.name;
-      this.lcModa.formComponent = this.getFormComponent(r.routeName).component;
-      this.lcModa.processData = r;
-      this.lcModa.isNew = false;
-      this.lcModa.visible = true;
+      // if (!r.routeName) {
+      //   this.$message.warning('该流程信息未配置表单,请联系开发人员!')
+      //   return
+      // }
+
+      getAction('/ctop/actCustomForm/queryById', { id: r.tableId }).then((res) => {
+        if (res.success) {
+          this.jsonData = JSON.parse(res.result.text)
+          if (this.jsonData) {
+            this.$nextTick(() => {
+              this.defaultValue = JSON.parse(r.tableName)
+              this.$refs.kfb.setData(this.defaultValue)
+            })
+          }
+        } else {
+          this.jsonData = {}
+          this.$message.warning('该流程信息未配置表单,请联系开发人员!')
+          return
+        }
+      })
+      this.lcModa.disabled = true
+      this.lcModa.title = '查看流程业务信息:' + r.name
+      this.lcModa.formComponent = this.getFormComponent(r.routeName).component
+      this.lcModa.processData = r
+      this.lcModa.isNew = false
+      this.lcModa.visible = true
     },
     history(v) {
       if (!v.id) {
-        this.$message.error("流程实例ID不存在");
-        return;
+        this.$message.error('流程实例ID不存在')
+        return
       }
-      this.procInstId = v.id;
-      this.modalLsVisible = true;
+      this.procInstId = v.id
+      this.modalLsVisible = true
     },
     remove(v) {
-      this.postFormAction(this.url.delHistoricIns+v.id).then(res => {
+      this.postFormAction(this.url.delHistoricIns + v.id).then((res) => {
         if (res.success) {
-          this.$message.success("操作成功");
-          this.getDataList();
-        }else {
-          this.$message.error(res.message);
+          this.$message.success('操作成功')
+          this.getDataList()
+        } else {
+          this.$message.error(res.message)
         }
-      });
+      })
     },
   },
   mounted() {
-    this.init();
+    this.init()
   },
-  watch: {
-  }
-};
+  watch: {},
+}
 </script>

+ 164 - 142
src/views/activiti/processInsManage.vue

@@ -1,5 +1,5 @@
 <style lang="less">
-  @import '~@assets/less/common.less';
+@import '~@assets/less/common.less';
 </style>
 <template>
   <div class="search">
@@ -9,35 +9,27 @@
           <a-row :gutter="24">
             <a-col :md="6" :sm="8">
               <a-form-item label="流程名称" prop="name">
-                <a-input
-                  type="text"
-                  v-model="searchForm.name"
-                  placeholder="请输入"
-                  clearable
-                />
+                <a-input type="text" v-model="searchForm.name" placeholder="请输入" clearable />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="8">
               <a-form-item label="标识Key" prop="name">
-                <a-input
-                  type="text"
-                  v-model="searchForm.key"
-                  placeholder="请输入"
-                  clearable
-                />
+                <a-input type="text" v-model="searchForm.key" placeholder="请输入" clearable />
               </a-form-item>
             </a-col>
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-            <a-col :md="6" :sm="12" >
-              <a-button @click="handleSearch" type="primary" icon="search">搜索</a-button>
-              <a-button @click="handleReset" style="margin-left: 10px;">重置</a-button>
-            </a-col>
-          </span>
+              <a-col :md="6" :sm="12">
+                <a-button @click="handleSearch" type="primary" icon="search">搜索</a-button>
+                <a-button @click="handleReset" style="margin-left: 10px;">重置</a-button>
+              </a-col>
+            </span>
           </a-row>
         </a-form>
       </div>
       <a-row>
-        <a-table :scroll="scroll" bordered
+        <a-table
+          :scroll="scroll"
+          bordered
           :loading="loading"
           rowKey="id"
           :dataSource="data"
@@ -45,62 +37,66 @@
           @change="handleTableChange"
           ref="table"
         >
-          <a-table-column title="#"  :width="50">
-            <template slot-scope="t,r,i" >
-              <span> {{i+1}} </span>
+          <a-table-column title="#" :width="50">
+            <template slot-scope="t,r,i">
+              <span>{{i+1}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="流程实例ID" dataIndex="id" :width="150">
-            <template slot-scope="t,r,i" >
-              <span> {{t}} </span>
+          <a-table-column title="流程实例ID" data-index="id" :width="150">
+            <template slot-scope="t,r,i">
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="流程名称" dataIndex="name" :width="150">
-            <template slot-scope="t,r,i" >
-              <span> {{t}} </span>
+          <a-table-column title="流程名称" data-index="name" :width="150">
+            <template slot-scope="t,r,i">
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="申请人" dataIndex="applyer" :width="100">
-            <template slot-scope="t,r,i" >
-              <span> {{t}} </span>
+          <a-table-column title="申请人" data-index="applyer" :width="100">
+            <template slot-scope="t,r,i">
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="标识Key" dataIndex="key" :width="150">
-            <template slot-scope="t,r,i" >
-              <span> {{t}} </span>
+          <a-table-column title="标识Key" data-index="key" :width="150">
+            <template slot-scope="t,r,i">
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="版本" dataIndex="version" :width="150">
-            <template slot-scope="t,r,i" >
-              <span> v.{{t}} </span>
+          <a-table-column title="版本" data-index="version" :width="150">
+            <template slot-scope="t,r,i">
+              <span>v.{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="当前环节" dataIndex="currTaskName" :width="150">
-            <template slot-scope="t,r,i" >
-              <span> {{t}} </span>
+          <a-table-column title="当前环节" data-index="currTaskName" :width="150">
+            <template slot-scope="t,r,i">
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="状态" dataIndex="isSuspended" :width="110"
-                    key="isSuspended" :sorter="(a,b)=>Boolean(a.isSuspended)?0:1 - Boolean(b.isSuspended)?0:1"
+          <a-table-column
+            title="状态"
+            data-index="isSuspended"
+            :width="110"
+            key="isSuspended"
+            :sorter="(a,b)=>Boolean(a.isSuspended)?0:1 - Boolean(b.isSuspended)?0:1"
           >
-            <template slot-scope="t,r,i" >
-              <span v-if="t" style="color: red"> 已挂起 </span>
-              <span v-else style="color: #2f54eb"> 已激活 </span>
+            <template slot-scope="t,r,i">
+              <span v-if="t" style="color: red">已挂起</span>
+              <span v-else style="color: #2f54eb">已激活</span>
             </template>
           </a-table-column>
-          <a-table-column title="操作" dataIndex="action"  >
-            <template slot-scope="t,r,i" >
+          <a-table-column title="操作" data-index="action">
+            <template slot-scope="t,r,i">
               <template v-if="r.isSuspended">
-                <a href="javascript:void(0);" style="color: green;" @click="editStatus(1,r)" >激活</a>
+                <a href="javascript:void(0);" style="color: green;" @click="editStatus(1,r)">激活</a>
                 <a-divider type="vertical" />
               </template>
               <template v-else>
-                <a href="javascript:void(0);" style="color: orange;" @click="editStatus(0,r)" >挂起</a>
+                <a href="javascript:void(0);" style="color: orange;" @click="editStatus(0,r)">挂起</a>
                 <a-divider type="vertical" />
               </template>
-              <a href="javascript:void(0);" style="color: blue;" @click="history(r)" >审批详情</a>
+              <a href="javascript:void(0);" style="color: blue;" @click="history(r)">审批详情</a>
               <a-divider type="vertical" />
-              <a href="javascript:void(0);" style="color: #999;" @click="detail(r)" >表单数据</a>
+              <a href="javascript:void(0);" style="color: #999;" @click="detail(r)">表单数据</a>
               <a-divider type="vertical" />
               <a-popconfirm title="确定删除吗?" @confirm="() => remove(r)">
                 <a style="color: red;">删除</a>
@@ -129,28 +125,46 @@
       </div>
     </a-modal>
     <!---->
-    <a-modal title="审批历史" v-model="modalLsVisible" :mask-closable="false" :width="'80%'" :footer="null">
+    <a-modal
+      title="审批历史"
+      v-model="modalLsVisible"
+      :mask-closable="false"
+      :width="'80%'"
+      :footer="null"
+    >
       <div v-if="modalLsVisible">
         <component :is="historicDetail" :procInstId="procInstId"></component>
       </div>
     </a-modal>
     <!--流程表单-->
-    <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="80%">
-      <component :disabled="lcModa.disabled" v-if="lcModa.visible" :is="lcModa.formComponent"
-                 :processData="lcModa.processData" :isNew = "lcModa.isNew"
-                 @close="lcModa.visible=false,lcModa.disabled = false"></component>
+    <a-modal
+      :title="lcModa.title"
+      v-model="lcModa.visible"
+      :footer="null"
+      :maskClosable="false"
+      width="80%"
+    >
+      <k-form-build
+        v-if="lcModa.visible"
+        :defaultValue="defaultValue"
+        :value="jsonData"
+        ref="kfb"
+        disabled
+      />
     </a-modal>
   </div>
 </template>
 
 <script>
-import {activitiMixin} from "./mixins/activitiMixin";
-import {JeecgListMixin} from "../../mixins/JeecgListMixin";
+import { activitiMixin } from './mixins/activitiMixin'
+import { JeecgListMixin } from '../../mixins/JeecgListMixin'
 export default {
-  mixins:[activitiMixin,JeecgListMixin],
-  name: "process-ins-manage",
+  mixins: [activitiMixin, JeecgListMixin],
+  name: 'process-ins-manage',
   data() {
     return {
+      jsonData: {},
+      defaultValue: {},
       openSearch: true,
       openTip: true,
       loading: true, // 表单加载状态
@@ -158,17 +172,17 @@ export default {
       selectList: [], // 多选数据
       searchForm: {
         // 搜索框对应data对象
-        name: "",
-        key: "",
+        name: '',
+        key: '',
         pageNumber: 1, // 当前页数
-        pageSize: 10 // 页面大小
+        pageSize: 10, // 页面大小
       },
       modalType: 0, // 添加或编辑标识
       modalVisible: false, // 添加或编辑显示
-      modalTitle: "", // 添加或编辑标题
+      modalTitle: '', // 添加或编辑标题
       form: {
         // 添加或编辑表单对象初始化数据
-        reason: ""
+        reason: '',
       },
       formValidate: {
         // 表单验证规则
@@ -176,138 +190,146 @@ export default {
       submitLoading: false, // 添加或编辑提交状态
       data: [], // 表单数据
       total: 0, // 表单数据总数
-      deleteId: "",
+      deleteId: '',
       url: {
-        getRunningProcess:'/actProcessIns/getRunningProcess',
-        deleteProcessIns:'/actProcessIns/delInsByIds/',
-        updateInsStatus:'/actProcessIns/updateInsStatus/',
+        getRunningProcess: '/actProcessIns/getRunningProcess',
+        deleteProcessIns: '/actProcessIns/delInsByIds/',
+        updateInsStatus: '/actProcessIns/updateInsStatus/',
       },
       modalLsVisible: false,
       procInstId: '',
       lcModa: {
-        title:'',
-        disabled:false,
-        visible:false,
-        formComponent : null,
-        isNew : false
+        title: '',
+        disabled: false,
+        visible: false,
+        formComponent: null,
+        isNew: false,
       },
-    };
+    }
   },
   methods: {
-    loadData(){},
+    loadData() {},
     init() {
-      this.getDataList();
+      this.getDataList()
     },
     getDataList() {
-      this.loading = true;
-      this.getAction(this.url.getRunningProcess,this.searchForm).then(res => {
-        this.loading = false;
+      this.loading = true
+      this.getAction(this.url.getRunningProcess, this.searchForm).then((res) => {
+        this.loading = false
         if (res.success) {
-          this.data = res.result;
-        }else {
+          this.data = res.result
+        } else {
           this.$message.error(res.message)
         }
-      });
+      })
     },
     handleSearch() {
-      this.searchForm.pageNumber = 1;
-      this.searchForm.pageSize = 10;
-      this.getDataList();
+      this.searchForm.pageNumber = 1
+      this.searchForm.pageSize = 10
+      this.getDataList()
     },
     handleReset() {
-      this.searchForm= {};
-      this.searchForm.pageNumber = 1;
-      this.searchForm.pageSize = 10;
+      this.searchForm = {}
+      this.searchForm.pageNumber = 1
+      this.searchForm.pageSize = 10
       // 重新加载数据
-      this.getDataList();
+      this.getDataList()
     },
     handelCancel() {
-      this.modalVisible = false;
+      this.modalVisible = false
     },
     handelSubmit() {
-      this.submitLoading = true;
-      this.postFormAction(this.url.deleteProcessIns+this.deleteId, this.form).then(res => {
-        this.submitLoading = false;
+      this.submitLoading = true
+      this.postFormAction(this.url.deleteProcessIns + this.deleteId, this.form).then((res) => {
+        this.submitLoading = false
         if (res.success) {
-          this.$message.success("操作成功");
-          this.modalVisible = false;
-          this.getDataList();
-        }else {
-          this.$message.error(res.message);
+          this.$message.success('操作成功')
+          this.modalVisible = false
+          this.getDataList()
+        } else {
+          this.$message.error(res.message)
         }
-      });
+      })
     },
     editStatus(status, v) {
-      let operation = "";
+      let operation = ''
       if (status == 0) {
-        operation = "暂停挂起";
+        operation = '暂停挂起'
       } else {
-        operation = "激活运行";
+        operation = '激活运行'
       }
       this.$confirm({
-        title: "确认" + operation,
+        title: '确认' + operation,
         content: `您确认要${operation}流程实例${v.name}?`,
         loading: true,
         onOk: () => {
           let params = {
             status: status,
-            id: v.id
-          };
-          this.postFormAction(this.url.updateInsStatus,params).then(res => {
+            id: v.id,
+          }
+          this.postFormAction(this.url.updateInsStatus, params).then((res) => {
             if (res.success) {
-              this.$message.success("操作成功");
-              this.getDataList();
-            }else {
-              this.$message.error(res.message);
+              this.$message.success('操作成功')
+              this.getDataList()
+            } else {
+              this.$message.error(res.message)
             }
-          });
-        }
-      });
+          })
+        },
+      })
     },
     detail(r) {
-      if (!r.routeName) {
-        this.$message.warning(
-          "该流程信息未配置表单,请联系开发人员!"
-        );
-        return;
-      }
-      this.lcModa.disabled = true;
-      this.lcModa.title = '查看流程业务信息:'+r.name;
-      this.lcModa.formComponent = this.getFormComponent(r.routeName).component;
-      this.lcModa.processData = r;
-      this.lcModa.isNew = false;
-      this.lcModa.visible = true;
+      this.getAction('/ctop/actCustomForm/queryById', { id: r.tableId }).then((res) => {
+        if (res.success) {
+          this.jsonData = JSON.parse(res.result.text)
+          if (this.jsonData) {
+            this.$nextTick(() => {
+              this.defaultValue = JSON.parse(r.tableName)
+              this.$refs.kfb.setData(this.defaultValue)
+            })
+          }
+        } else {
+          this.jsonData = {}
+          this.$message.warning('该流程信息未配置表单,请联系开发人员!')
+          return
+        }
+      })
+      this.lcModa.disabled = true
+      this.lcModa.title = '查看流程业务信息:' + r.name
+      this.lcModa.formComponent = this.getFormComponent(r.routeName).component
+      this.lcModa.processData = r
+      this.lcModa.isNew = false
+      this.lcModa.visible = true
     },
     history(v) {
       if (!v.procInstId) {
-        this.$message.error("流程实例ID不存在");
-        return;
+        this.$message.error('流程实例ID不存在')
+        return
       }
-      this.procInstId = v.procInstId;
-      this.modalLsVisible = true;
+      this.procInstId = v.procInstId
+      this.modalLsVisible = true
     },
     remove(v) {
-      this.modalTitle = `确认删除流程 ${v.name}`;
+      this.modalTitle = `确认删除流程 ${v.name}`
       // 单个删除
-      this.deleteId = v.id;
-      this.modalType = 0;
-      this.modalVisible = true;
+      this.deleteId = v.id
+      this.modalType = 0
+      this.modalVisible = true
     },
     handleTableChange(pagination, filters, sorter) {
       //分页、排序、筛选变化时触发
       //TODO 筛选
       if (Object.keys(sorter).length > 0) {
-        this.isorter.column = sorter.field;
-        this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
+        this.isorter.column = sorter.field
+        this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
       }
-      this.ipagination = pagination;
+      this.ipagination = pagination
       // this.loadData();
-    }
+    },
   },
   mounted() {
-    this.init();
+    this.init()
   },
-  watch: {
-  }
-};
+  watch: {},
+}
 </script>

+ 326 - 276
src/views/activiti/todoManage.vue

@@ -1,28 +1,28 @@
 <style lang="less">
-  @import '~@assets/less/common.less';
+@import '~@assets/less/common.less';
 </style>
 <template>
   <div class="search">
-
     <a-card>
       <div class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="handleSearch">
           <a-row :gutter="24">
             <a-col :md="6" :sm="8">
-              <a-form-item label="任务名称" prop="name" >
-                <a-input
-                  type="text" allowClear
-                  v-model="searchForm.name"
-                  placeholder="请输入"
-                />
+              <a-form-item label="任务名称" prop="name">
+                <a-input type="text" allowClear v-model="searchForm.name" placeholder="请输入" />
               </a-form-item>
             </a-col>
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-            <a-col :md="6" :sm="12" >
-                <a-button type="primary"  style="left: 10px" @click="handleSearch" icon="search">查询</a-button>
-                <a-button type="primary"  @click="handleReset" icon="reload" style="margin-left: 8px;left: 10px">重置</a-button>
-            </a-col>
-          </span>
+              <a-col :md="6" :sm="12">
+                <a-button type="primary" style="left: 10px" @click="handleSearch" icon="search">查询</a-button>
+                <a-button
+                  type="primary"
+                  @click="handleReset"
+                  icon="reload"
+                  style="margin-left: 8px;left: 10px"
+                >重置</a-button>
+              </a-col>
+            </span>
           </a-row>
         </a-form>
       </div>
@@ -32,68 +32,86 @@
         <a-button @click="getDataList" icon="md-refresh">刷新</a-button>
       </a-row>-->
       <a-row>
-        <a-table :scroll="scroll" bordered
-          :loading="loading" rowKey="id"
+        <a-table
+          bordered
+          :loading="loading"
+          rowKey="id"
           :dataSource="data"
-          :pagination="ipagination" @change="handleTableChange"
+          :pagination="ipagination"
+          @change="handleTableChange"
           ref="table"
         >
-          <a-table-column title="#"  :width="50">
-            <template slot-scope="t,r,i" >
-              <span> {{i+1}} </span>
+          <a-table-column title="#" :width="50">
+            <template slot-scope="t,r,i">
+              <span>{{i+1}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="任务名称" dataIndex="name"  :width="150" align="center">
+          <a-table-column title="任务名称" data-index="name" :width="150" align="center">
             <template slot-scope="t">
-              <span> {{t}} </span>
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="所属流程" dataIndex="processName"  :width="150" align="center">
+          <a-table-column title="所属流程" data-index="processName" :width="150" align="center">
             <template slot-scope="t">
-              <span> {{t}} </span>
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="委托代办人" dataIndex="owner"  align="center" :width="150">
+          <a-table-column title="委托代办人" data-index="owner" align="center" :width="150">
             <template slot-scope="t">
-              <span> {{t}} </span>
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="流程发起人" dataIndex="applyer" :width="150" align="center">
+          <a-table-column title="流程发起人" data-index="applyer" :width="150" align="center">
             <template slot-scope="t">
-              <span> {{t}} </span>
+              <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="优先级" dataIndex="priority" :width="110" align="center"
-            key="so" :sorter="(a,b)=>a.priority - b.priority"
+          <a-table-column
+            title="优先级"
+            data-index="priority"
+            :width="110"
+            align="center"
+            key="so"
+            :sorter="(a,b)=>a.priority - b.priority"
           >
             <template slot-scope="t">
-              <span v-if="t==0" style="color: green;"> 普通 </span>
-              <span v-else-if="t==1" style="color: orange;"> 重要 </span>
-              <span v-else-if="t==2" style="color: red;"> 紧急 </span>
-              <span v-else style="color: #999;">  </span>
+              <span v-if="t==0" style="color: green;">普通</span>
+              <span v-else-if="t==1" style="color: orange;">重要</span>
+              <span v-else-if="t==2" style="color: red;">紧急</span>
+              <span v-else style="color: #999;">无</span>
             </template>
           </a-table-column>
-          <a-table-column title="状态" dataIndex="isSuspended" :width="100" align="center"
-                          key="z" :sorter="(a,b)=>Boolean(a.isSuspended)?0:1 - Boolean(b.isSuspended)?0:1"
+          <a-table-column
+            title="状态"
+            data-index="isSuspended"
+            :width="100"
+            align="center"
+            key="z"
+            :sorter="(a,b)=>Boolean(a.isSuspended)?0:1 - Boolean(b.isSuspended)?0:1"
           >
             <template slot-scope="t">
-              <span v-if="!Boolean(t)" style="color: green;"> 已激活 </span>
-              <span v-if="Boolean(t)" style="color: orange;"> 已挂起 </span>
+              <span v-if="!Boolean(t)" style="color: green;">已激活</span>
+              <span v-if="Boolean(t)" style="color: orange;">已挂起</span>
             </template>
           </a-table-column>
-          <a-table-column title="创建时间" dataIndex="createTime" :width="200" align="center">
+          <a-table-column title="创建时间" data-index="createTime" :width="200" align="center">
             <template slot-scope="t">
               <span>{{t}}</span>
             </template>
           </a-table-column>
-          <a-table-column title="操作" dataIndex=""  align="center">
+          <a-table-column title="操作" data-index align="center">
             <template slot-scope="t,r,i">
               <a href="javascript:void(0);" @click="detail(r)" style="color: blue">申请详情</a>
               <a-divider type="vertical" />
-              <span v-if="Boolean(r.isSuspended)" style="cursor: no-drop;color: #999999;" title="流程已被挂起,无法操作!">
-                通过 <a-divider type="vertical" />
-                驳回 <a-divider type="vertical" />
-                委托 <a-divider type="vertical" />
+              <span
+                v-if="Boolean(r.isSuspended)"
+                style="cursor: no-drop;color: #999999;"
+                title="流程已被挂起,无法操作!"
+              >
+                通过
+                <a-divider type="vertical" />驳回
+                <a-divider type="vertical" />委托
+                <a-divider type="vertical" />
               </span>
               <span v-else>
                 <a href="javascript:void(0);" @click="passTask(r)" style="color: green">通过</a>
@@ -110,21 +128,36 @@
       </a-row>
     </a-card>
     <!---->
-    <a-modal title="审批历史" v-model="modalLsVisible" :mask-closable="false" :width="'80%'" :footer="null">
+    <a-modal
+      title="审批历史"
+      v-model="modalLsVisible"
+      :mask-closable="false"
+      :width="'80%'"
+      :footer="null"
+    >
       <div v-if="modalLsVisible">
         <component :is="historicDetail" :procInstId="procInstId"></component>
       </div>
     </a-modal>
     <!--流程表单-->
-    <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="80%">
-      <component :disabled="lcModa.disabled" v-if="lcModa.visible" :is="lcModa.formComponent"
-                 :processData="lcModa.processData" :isNew = "lcModa.isNew"
-                 @close="lcModa.visible=false,lcModa.disabled = false"></component>
+    <a-modal
+      :title="lcModa.title"
+      v-model="lcModa.visible"
+      :footer="null"
+      :maskClosable="false"
+      width="80%"
+    >
+      <k-form-build
+        v-if="lcModa.visible"
+        :defaultValue="defaultValue"
+        :value="jsonData"
+        ref="kfb"
+        disabled
+      />
     </a-modal>
     <!-- 审批操作 -->
     <a-modal :title="modalTaskTitle" v-model="modalTaskVisible" :mask-closable="false" :width="500">
-
-      <div  v-if="modalTaskVisible">
+      <div v-if="modalTaskVisible">
         <a-form ref="form" :model="form" :label-width="85" :rules="formValidate">
           <a-form-item label="审批意见" prop="reason">
             <a-input type="textarea" v-model="form.comment" :rows="4" />
@@ -137,7 +170,11 @@
               mode="multiple"
               :loading="userLoading"
             >
-              <a-select-option v-for="(item, i) in assigneeList" :key="i" :value="item.id">{{item.username}}</a-select-option>
+              <a-select-option
+                v-for="(item, i) in assigneeList"
+                :key="i"
+                :value="item.id"
+              >{{item.username}}</a-select-option>
             </a-select>
           </a-form-item>
           <a-form-item label="下一审批人" v-show="isGateway">
@@ -145,15 +182,20 @@
           </a-form-item>
           <div v-show="form.type==1">
             <a-form-item label="驳回至">
-              <a-select
-                v-model="form.backTaskKey"
-                :loading="backLoading"
-                @change="changeBackTask"
-              >
-                <a-select-option v-for="(item, i) in backList" :key="i" :value="item.key">{{item.name}}</a-select-option>
+              <a-select v-model="form.backTaskKey" :loading="backLoading" @change="changeBackTask">
+                <a-select-option
+                  v-for="(item, i) in backList"
+                  :key="i"
+                  :value="item.key"
+                >{{item.name}}</a-select-option>
               </a-select>
             </a-form-item>
-            <a-form-item label="指定原节点审批人" prop="assignees" v-show="form.backTaskKey!=-1" :error="error">
+            <a-form-item
+              label="指定原节点审批人"
+              prop="assignees"
+              v-show="form.backTaskKey!=-1"
+              :error="error"
+            >
               <a-select
                 v-model="form.assignees"
                 placeholder="请选择"
@@ -161,7 +203,11 @@
                 mode="multiple"
                 :loading="userLoading"
               >
-                <a-select-option v-for="(item, i) in assigneeList" :key="i" :value="item.id">{{item.username}}</a-select-option>
+                <a-select-option
+                  v-for="(item, i) in assigneeList"
+                  :key="i"
+                  :value="item.id"
+                >{{item.username}}</a-select-option>
               </a-select>
             </a-form-item>
           </div>
@@ -188,11 +234,13 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
 import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
 export default {
-  name: "todo-manage",
-  mixins:[activitiMixin,JeecgListMixin],
-  components:{JSelectUserByDep},
+  name: 'todo-manage',
+  mixins: [activitiMixin, JeecgListMixin],
+  components: { JSelectUserByDep },
   data() {
     return {
+      jsonData: {},
+      defaultValue: {},
       openSearch: true,
       openTip: true,
       loading: true, // 表单加载状态
@@ -204,29 +252,29 @@ export default {
       assigneeList: [],
       backList: [
         {
-          key: "-1",
-          name: "发起人"
-        }
+          key: '-1',
+          name: '发起人',
+        },
       ],
-      error: "",
+      error: '',
       showAssign: false,
       searchForm: {
         // 搜索框对应data对象
-        name: "",
+        name: '',
       },
-      modalTaskTitle: "",
-      modalTitle: "", // 添加或编辑标题
+      modalTaskTitle: '',
+      modalTitle: '', // 添加或编辑标题
       form: {
-        id: "",
-        userId: "",
-        procInstId: "",
-        comment: "",
+        id: '',
+        userId: '',
+        procInstId: '',
+        comment: '',
         type: 0,
         assignees: [],
-        backTaskKey: "-1",
+        backTaskKey: '-1',
         sendMessage: true,
         sendSms: false,
-        sendEmail: false
+        sendEmail: false,
       },
       formValidate: {
         // 表单验证规则
@@ -237,317 +285,319 @@ export default {
       dictPriority: [],
       isGateway: false,
       lcModa: {
-        title:'',
-        disabled:false,
-        visible:false,
-        formComponent : null,
-        isNew : false
+        title: '',
+        disabled: false,
+        visible: false,
+        formComponent: null,
+        isNew: false,
       },
-      url:{
-        todoList:'/actTask/todoList',
-        pass:'/actTask/pass',
-        back:'/actTask/back',
-        backToTask:'/actTask/backToTask',
-        delegate:'/actTask/delegate',
-        getNextNode:'/activiti_process/getNextNode',
-        getNode:'/activiti_process/getNode/',
-        getBackList:'/actTask/getBackList/',
-        passAll:'/actTask/passAll/',
-        backAll:'/actTask/backAll/',
+      url: {
+        todoList: '/actTask/todoList',
+        pass: '/actTask/pass',
+        back: '/actTask/back',
+        backToTask: '/actTask/backToTask',
+        delegate: '/actTask/delegate',
+        getNextNode: '/activiti_process/getNextNode',
+        getNode: '/activiti_process/getNode/',
+        getBackList: '/actTask/getBackList/',
+        passAll: '/actTask/passAll/',
+        backAll: '/actTask/backAll/',
       },
       /*历史*/
       modalLsVisible: false,
-      procInstId:''
-    };
+      procInstId: '',
+    }
   },
   mounted() {
-    this.init();
+    this.init()
   },
   methods: {
     init() {
-      this.getDataList();
+      this.getDataList()
     },
-    loadData(){},
+    loadData() {},
     getDataList() {
-      this.loading = true;
-      this.postFormAction(this.url.todoList,this.searchForm).then(res => {
-        this.loading = false;
+      this.loading = true
+      this.postFormAction(this.url.todoList, this.searchForm).then((res) => {
+        this.loading = false
         if (res.success) {
-          this.data = res.result||[];
-          this.total = this.data.leading;
+          this.data = res.result || []
+          this.total = this.data.leading
         }
-      });
+      })
     },
     handleTableChange(pagination, filters, sorter) {
       //分页、排序、筛选变化时触发
       if (Object.keys(sorter).length > 0) {
-        this.isorter.column = sorter.field;
-        this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
+        this.isorter.column = sorter.field
+        this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
       }
-      this.ipagination = pagination;
+      this.ipagination = pagination
       // this.loadData();
     },
     handleSearch() {
-      this.getDataList();
+      this.getDataList()
     },
     handleReset() {
-      this.searchForm={};
+      this.searchForm = {}
       // 重新加载数据
-      this.getDataList();
+      this.getDataList()
     },
     showSelect(e) {
-      this.selectList = e;
-      this.selectCount = e.length;
+      this.selectList = e
+      this.selectCount = e.length
     },
     clearSelectAll() {
-      this.$refs.table.selectAll(false);
+      this.$refs.table.selectAll(false)
     },
     handelSubmit() {
       // console.log("提交")
-      this.submitLoading = true;
-      var formData = Object.assign({},this.form);
-      formData.assignees = formData.assignees.join(",");
+      this.submitLoading = true
+      var formData = Object.assign({}, this.form)
+      formData.assignees = formData.assignees.join(',')
       if (formData.type == 0) {
         // 通过
         if (this.showAssign && formData.assignees.length < 1) {
-          this.$message.error("请至少选择一个审批人")
-          this.submitLoading = false;
-          return;
+          this.$message.error('请至少选择一个审批人')
+          this.submitLoading = false
+          return
         } else {
-          this.error = "";
+          this.error = ''
         }
-        this.postFormAction(this.url.pass,formData).then(res => {
-          this.submitLoading = false;
+        this.postFormAction(this.url.pass, formData).then((res) => {
+          this.submitLoading = false
           if (res.success) {
-            this.$message.success("操作成功");
-            this.modalTaskVisible = false;
-            this.getDataList();
+            this.$message.success('操作成功')
+            this.modalTaskVisible = false
+            this.getDataList()
           }
-        });
+        })
       } else if (formData.type == 1) {
         // 驳回
-        if (formData.backTaskKey == "-1") {
+        if (formData.backTaskKey == '-1') {
           // 驳回至发起人
-          this.postFormAction(this.url.back,formData).then(res => {
-            this.submitLoading = false;
+          this.postFormAction(this.url.back, formData).then((res) => {
+            this.submitLoading = false
             if (res.success) {
-              this.$message.success("操作成功");
-              this.modalTaskVisible = false;
-              this.getDataList();
+              this.$message.success('操作成功')
+              this.modalTaskVisible = false
+              this.getDataList()
             }
-          });
+          })
         } else {
           // 自定义驳回
-          if (formData.backTaskKey != "-1" && formData.assignees.length < 1) {
-            this.$message.error("请至少选择一个审批人")
-            this.submitLoading = false;
-            return;
+          if (formData.backTaskKey != '-1' && formData.assignees.length < 1) {
+            this.$message.error('请至少选择一个审批人')
+            this.submitLoading = false
+            return
           } else {
-            this.error = "";
+            this.error = ''
           }
-          this.postFormAction(this.url.backToTask,formData).then(res => {
-            this.submitLoading = false;
+          this.postFormAction(this.url.backToTask, formData).then((res) => {
+            this.submitLoading = false
             if (res.success) {
-              this.$message.success("操作成功");
-              this.modalTaskVisible = false;
-              this.getDataList();
+              this.$message.success('操作成功')
+              this.modalTaskVisible = false
+              this.getDataList()
             }
-          });
+          })
         }
       } else if (formData.type == 2) {
         // 委托
         if (!formData.userId) {
-          this.$message.error("请选择一委托人")
-          this.submitLoading = false;
-          return;
+          this.$message.error('请选择一委托人')
+          this.submitLoading = false
+          return
         } else {
-          this.error = "";
+          this.error = ''
         }
-        this.postFormAction(this.url.delegate,formData).then(res => {
-          this.submitLoading = false;
+        this.postFormAction(this.url.delegate, formData).then((res) => {
+          this.submitLoading = false
           if (res.success) {
-            this.$message.success("操作成功");
-            this.modalTaskVisible = false;
-            this.getDataList();
+            this.$message.success('操作成功')
+            this.modalTaskVisible = false
+            this.getDataList()
           }
-        });
+        })
       }
     },
     detail(r) {
-      if (!r.routeName) {
-        this.$message.warning(
-          "该流程信息未配置表单,请联系开发人员!"
-        );
-        return;
-      }
-      this.lcModa.disabled = true;
-      this.lcModa.title = '查看流程业务信息:'+r.processName;
-      this.lcModa.formComponent = this.getFormComponent(r.routeName).component;
-      this.lcModa.processData = r;
-      this.lcModa.isNew = false;
-      this.lcModa.visible = true;
+      this.getAction('/ctop/actCustomForm/queryById', { id: r.tableId }).then((res) => {
+        if (res.success) {
+          this.jsonData = JSON.parse(res.result.text)
+          if (this.jsonData) {
+            this.$nextTick(() => {
+              this.defaultValue = JSON.parse(r.tableName)
+              this.$refs.kfb.setData(this.defaultValue)
+            })
+          }
+        } else {
+          this.jsonData = {}
+          this.$message.warning('该流程信息未配置表单,请联系开发人员!')
+          return
+        }
+      })
+      this.lcModa.disabled = true
+      this.lcModa.title = '查看流程业务信息:' + r.processName
+      this.lcModa.formComponent = this.getFormComponent(r.routeName).component
+      this.lcModa.processData = r
+      this.lcModa.isNew = false
+      this.lcModa.visible = true
     },
     passTask(v) {
-      this.modalTaskTitle = "审批通过";
-      this.form.id = v.id;
-      this.form.procInstId = v.procInstId;
-      this.form.priority = v.priority;
-      this.form.type = 0;
-      this.modalTaskVisible = true;
-      this.userLoading = true;
-      this.getAction(this.url.getNextNode,{procDefId:v.procDefId, currActId:v.key}).then(res => {
-        this.userLoading = false;
+      this.modalTaskTitle = '审批通过'
+      this.form.id = v.id
+      this.form.procInstId = v.procInstId
+      this.form.priority = v.priority
+      this.form.type = 0
+      this.modalTaskVisible = true
+      this.userLoading = true
+      this.getAction(this.url.getNextNode, { procDefId: v.procDefId, currActId: v.key }).then((res) => {
+        this.userLoading = false
         if (res.success) {
           if (res.result.type == 3 || res.result.type == 4) {
-            this.isGateway = true;
-            this.showAssign = false;
-            this.error = "";
-            return;
+            this.isGateway = true
+            this.showAssign = false
+            this.error = ''
+            return
           }
-          this.isGateway = false;
+          this.isGateway = false
           if (res.result.users && res.result.users.length > 0) {
-            this.error = "";
-            this.assigneeList = res.result.users;
+            this.error = ''
+            this.assigneeList = res.result.users
             // 默认勾选
-            let ids = [];
-            res.result.users.forEach(e => {
-              ids.push(e.username);
-            });
-            this.form.assignees = ids;
-            this.showAssign = true;
+            let ids = []
+            res.result.users.forEach((e) => {
+              ids.push(e.username)
+            })
+            this.form.assignees = ids
+            this.showAssign = true
           } else {
-            this.form.assignees = [];
-            this.showAssign = false;
+            this.form.assignees = []
+            this.showAssign = false
           }
         }
-      });
+      })
     },
     changeBackTask(v) {
-      if (v == "-1") {
-        return;
+      if (v == '-1') {
+        return
       }
-      this.userLoading = true;
-      this.getAction(this.url.getNode+v).then(res => {
-        this.userLoading = false;
+      this.userLoading = true
+      this.getAction(this.url.getNode + v).then((res) => {
+        this.userLoading = false
         if (res.success) {
           if (res.result.users && res.result.users.length > 0) {
-            this.assigneeList = res.result.users;
+            this.assigneeList = res.result.users
             // 默认勾选
-            let ids = [];
-            res.result.users.forEach(e => {
-              ids.push(e.username);
-            });
-            this.form.assignees = ids;
+            let ids = []
+            res.result.users.forEach((e) => {
+              ids.push(e.username)
+            })
+            this.form.assignees = ids
           }
         }
-      });
+      })
     },
     backTask(v) {
-      this.modalTaskTitle = "审批驳回";
-      this.form.id = v.id;
-      this.form.procInstId = v.procInstId;
-      this.form.procDefId = v.procDefId;
-      this.form.priority = v.priority;
-      this.form.type = 1;
-      this.showAssign = false;
-      this.modalTaskVisible = true;
+      this.modalTaskTitle = '审批驳回'
+      this.form.id = v.id
+      this.form.procInstId = v.procInstId
+      this.form.procDefId = v.procDefId
+      this.form.priority = v.priority
+      this.form.type = 1
+      this.showAssign = false
+      this.modalTaskVisible = true
       // 获取可驳回节点
       this.backList = [
         {
-          key: "-1",
-          name: "发起人"
-        }
-      ];
-      this.form.backTaskKey = "-1";
-      this.backLoading = true;
-      this.getAction(this.url.getBackList+v.procInstId).then(res => {
-        this.backLoading = false;
+          key: '-1',
+          name: '发起人',
+        },
+      ]
+      this.form.backTaskKey = '-1'
+      this.backLoading = true
+      this.getAction(this.url.getBackList + v.procInstId).then((res) => {
+        this.backLoading = false
         if (res.success) {
-          res.result.forEach(e => {
-            this.backList.push(e);
-          });
+          res.result.forEach((e) => {
+            this.backList.push(e)
+          })
         }
-      });
+      })
     },
     delegateTask(v) {
-      this.modalTaskTitle = "委托他人代办";
-      this.form.id = v.id;
-      this.form.procInstId = v.procInstId;
-      this.form.type = 2;
-      this.showAssign = false;
-      this.modalTaskVisible = true;
+      this.modalTaskTitle = '委托他人代办'
+      this.form.id = v.id
+      this.form.procInstId = v.procInstId
+      this.form.type = 2
+      this.showAssign = false
+      this.modalTaskVisible = true
     },
     history(v) {
       if (!v.procInstId) {
-        this.$message.error("流程实例ID不存在");
-        return;
+        this.$message.error('流程实例ID不存在')
+        return
       }
-      this.procInstId = v.procInstId;
-      this.modalLsVisible = true;
+      this.procInstId = v.procInstId
+      this.modalLsVisible = true
     },
     passAll() {
       if (this.selectCount <= 0) {
-        this.$message.warning("您还未选择要通过的数据");
-        return;
+        this.$message.warning('您还未选择要通过的数据')
+        return
       }
       // 批量通过
-      this.modalVisible = true;
+      this.modalVisible = true
       this.$confirm({
-        title: "确认通过",
-        content:
-          "您确认要通过所选的 " +
-          this.selectCount +
-          " 条数据? 注意:将默认分配给节点设定的所有可审批用户",
+        title: '确认通过',
+        content: '您确认要通过所选的 ' + this.selectCount + ' 条数据? 注意:将默认分配给节点设定的所有可审批用户',
         loading: true,
         onOk: () => {
-          let ids = "";
-          this.selectList.forEach(function(e) {
-            ids += e.id + ",";
-          });
-          ids = ids.substring(0, ids.length - 1);
-          this.postFormAction(this.url.passAll,{ids:ids}).then(res => {
+          let ids = ''
+          this.selectList.forEach(function (e) {
+            ids += e.id + ','
+          })
+          ids = ids.substring(0, ids.length - 1)
+          this.postFormAction(this.url.passAll, { ids: ids }).then((res) => {
             if (res.success) {
-              this.$message.success("操作成功");
-              this.modalVisible = false;
-              this.clearSelectAll();
-              this.getDataList();
+              this.$message.success('操作成功')
+              this.modalVisible = false
+              this.clearSelectAll()
+              this.getDataList()
             }
-          });
-        }
-      });
+          })
+        },
+      })
     },
     backAll() {
       if (this.selectCount <= 0) {
-        this.$message.warning("您还未选择要驳回的数据");
-        return;
+        this.$message.warning('您还未选择要驳回的数据')
+        return
       }
       // 批量驳回
-      this.modalVisible = true;
+      this.modalVisible = true
       this.$confirm({
-        title: "确认驳回",
-        content:
-          "您确认要驳回所选的 " +
-          this.selectCount +
-          " 条数据? 注意:所有流程将驳回至发起人",
+        title: '确认驳回',
+        content: '您确认要驳回所选的 ' + this.selectCount + ' 条数据? 注意:所有流程将驳回至发起人',
         loading: true,
         onOk: () => {
-          let procInstIds = "";
-          this.selectList.forEach(function(e) {
-            procInstIds += e.procInstId + ",";
-          });
-          procInstIds = procInstIds.substring(0, procInstIds.length - 1);
-          this.postFormAction(this.url.backAll,{procInstIds:procInstIds}).then(res => {
+          let procInstIds = ''
+          this.selectList.forEach(function (e) {
+            procInstIds += e.procInstId + ','
+          })
+          procInstIds = procInstIds.substring(0, procInstIds.length - 1)
+          this.postFormAction(this.url.backAll, { procInstIds: procInstIds }).then((res) => {
             if (res.success) {
-              this.$message.success("操作成功");
-              this.modalVisible = false;
-              this.clearSelectAll();
-              this.getDataList();
+              this.$message.success('操作成功')
+              this.modalVisible = false
+              this.clearSelectAll()
+              this.getDataList()
             }
-          });
-        }
-      });
-    }
+          })
+        },
+      })
+    },
   },
-
-};
+}
 </script>

+ 37 - 4
src/views/modules/advertiser/ProjectList.vue

@@ -12,7 +12,21 @@
 
           <a-col :md="6" :sm="8">
             <a-form-item label="广告主名称">
-              <a-input placeholder="请输入广告主名称" v-model="queryParam.advertiserName"></a-input>
+              <!-- <a-input placeholder="请输入广告主名称" v-model="queryParam.advertiserName"></a-input> -->
+
+              <a-select
+                optionFilterProp="children"
+                showSearch
+                :filterOption="filterOption"
+                v-model="queryParam.advertiserId"
+                placeholder="请选择广告主名称"
+              >
+                <a-select-option :value="item.id" v-for="(item, index) of list" :key="index">
+                  {{
+                  item.name
+                  }}
+                </a-select-option>
+              </a-select>
             </a-form-item>
           </a-col>
           <template>
@@ -93,9 +107,9 @@
     </div>
 
     <!-- 操作按钮区域 -->
-    <div class="table-operator">
+    <!-- <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-    </div>
+    </div>-->
 
     <!-- table区域-begin -->
     <!-- 供应商 -->
@@ -133,7 +147,7 @@
 </template>
 
 <script>
-import ProjectModal from './modules/ProjectModal'
+import ProjectModal from './modules/projectListModal'
 import JTreeSelect from '@/components/jeecg/JTreeSelect'
 import { httpAction, getAction } from '@/api/manage'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
@@ -217,6 +231,7 @@ export default {
         exportXlsUrl: 'ctop/project/exportXls',
         importExcelUrl: 'ctop/project/importExcel',
       },
+      list: [],
       options: [],
     }
   },
@@ -226,6 +241,23 @@ export default {
     },
   },
   methods: {
+    getList() {
+      var params = {}
+      // params.userId = this.userInfo().id
+      params.pageSize = 1000
+      params.pageNo = 1
+      console.log(params)
+      getAction('/ctop/advertiser/list', params)
+        .then((res) => {
+          if (res.success) {
+            console.log(res)
+            this.list = res.result.records
+          } else {
+            this.$message.warning(res.message)
+          }
+        })
+        .finally(() => {})
+    },
     filterOption(input, option) {
       return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
     },
@@ -253,6 +285,7 @@ export default {
   },
   mounted() {
     this.getAllUserList()
+    this.getList()
     // getAction('/sys/user/getAllUserList', { pageSize: 50, pageNo: 1, userName: '' }).then((res) => {
     //   if (res.success) {
     //     this.options = res.result.list

+ 2 - 2
src/views/modules/advertiser/UserAllocationList.vue

@@ -311,12 +311,12 @@ export default {
         {
           title: '广告主名称',
           align: 'center',
-          dataIndex: 'advertiserName',
+          dataIndex: 'advertiserId_dictText',
         },
         {
           title: '项目名称',
           align: 'center',
-          dataIndex: 'projectName',
+          dataIndex: 'projectId_dictText',
         },
         //    {
         //     title: '输入账号  --登陆',

+ 409 - 0
src/views/modules/advertiser/modules/projectListModal.vue

@@ -0,0 +1,409 @@
+<template>
+  <a-modal
+    :title="title"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    @ok="handleOk"
+    @cancel="handleCancel"
+    cancelText="关闭"
+  >
+    <a-spin :spinning="confirmLoading">
+      <a-form :form="form">
+        <!-- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="媒体类型">
+          <a-radio-group @change="onChange" v-model="model.mediaId">
+            <a-radio-button value="1">头条</a-radio-button>
+            <a-radio-button value="2">快手</a-radio-button>
+            <a-radio-button value="3">头条内广</a-radio-button>
+            <a-radio-button value="4">快手内广</a-radio-button>
+          </a-radio-group>
+        </a-form-item> -->
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="项目名称" >
+          <a-input placeholder="请输入项目名称" v-decorator="['projectName', validatorRules.projectName]" disabled/>
+        </a-form-item>
+        <!-- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="行业">
+          <j-tree-select ref="treeSelect" placeholder="请选择行业" v-decorator="['industryId']"
+            dict="sys_category,name,id" pidField="pid" pidValue="f5cb2d2d28417b3b65a6dd744bcb9a76">
+          </j-tree-select>
+        </a-form-item>-->
+        <a-form-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          label="供应商"
+          v-if="model.mediaId=='2'||model.mediaId=='4'"
+        >
+          <a-select
+            optionFilterProp="children"
+            showSearch
+            :filterOption="filterOption"
+            v-decorator="['supplierCode', validatorRules.supplierCode]"
+          >
+            <a-select-option
+              :value="item.supplierCode"
+              v-for="(item, index) of supplierList"
+              :key="index"
+            >
+              {{
+              item.supplierName
+              }}
+            </a-select-option>
+          </a-select>
+        </a-form-item>
+
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="广告主名称">
+          <a-select
+            @change="handleChange"
+            optionFilterProp="children"
+            showSearch
+            :filterOption="filterOption"
+            v-decorator="['advertiserId', validatorRules.advertiserId]"
+            disabled
+          >
+            <a-select-option :value="item.id" v-for="(item, index) of list" :key="index">
+              {{
+              item.name
+              }}
+            </a-select-option>
+          </a-select>
+        </a-form-item>
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="产品名称">
+          <a-select
+            optionFilterProp="children"
+            showSearch
+            :filterOption="filterOption"
+            v-decorator="['productId', validatorRules.productId]"
+            disabled
+          >
+            <a-select-option :value="item.id" v-for="(item, index) of listProduct" :key="index">
+              {{
+              item.productName
+              }}
+            </a-select-option>
+          </a-select>
+        </a-form-item>
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="最高出价">
+          <a-input
+            placeholder="请输入最高出价"
+            v-decorator="['maxBid', validatorRules.maxBid]"
+            addonAfter="元"
+          />
+        </a-form-item>
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="最高转化出价">
+          <a-input placeholder="最高转化出价" v-decorator="['maxDeepCpaBid']" addonAfter="元" />
+        </a-form-item>
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售">
+          <a-select
+            showSearch
+            optionFilterProp="children"
+            style="width: 100%"
+            :filterOption="filterOption"
+            v-decorator="['saleId', { rules: [{  required: true,message: '请选择销售' }] }]"
+          >
+            <a-select-option
+              v-for="appModel in optionsElse"
+              :key="appModel.userId + new Date().getTime()"
+              :value="appModel.userId"
+            >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option>
+          </a-select>
+        </a-form-item>
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="运营负责人">
+          <a-select
+            showSearch
+            optionFilterProp="children"
+            style="width: 100%"
+            @focus="handleFocus"
+            @blur="handleBlur"
+            :filterOption="filterOption"
+            v-decorator="['responsibleId', { rules: [{ required: true, message: '请选择运营负责人' }] }]"
+          >
+            <a-select-option
+              v-for="appModel in options"
+              :key="appModel.userId + new Date().getTime()"
+              :value="appModel.userId"
+            >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option>
+          </a-select>
+        </a-form-item>
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="设计负责人">
+          <a-select
+            showSearch
+            optionFilterProp="children"
+            style="width: 100%"
+            @focus="handleFocus"
+            @blur="handleBlur"
+            :filterOption="filterOption"
+            v-decorator="['designResponsibleId', { rules: [{ required: true, message: '请选择运营负责人' }] }]"
+          >
+            <a-select-option
+              v-for="appModel in options"
+              :key="appModel.userId + new Date().getTime()"
+              :value="appModel.userId"
+            >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option>
+          </a-select>
+        </a-form-item>
+      </a-form>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { httpAction, getAction } from '@/api/manage'
+import pick from 'lodash.pick'
+import moment from 'moment'
+import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
+import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
+import JTreeSelect from '@/components/jeecg/JTreeSelect'
+import { mapGetters } from 'vuex'
+export default {
+  name: 'ProjectModal',
+  components: {
+    JSelectUserByDep,
+    JSelectDepart,
+    JTreeSelect,
+  },
+  data() {
+    return {
+      title: '操作',
+      visible: false,
+      model: {},
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      industryId: '',
+      confirmLoading: false,
+      form: this.$form.createForm(this),
+      validatorRules: {
+        projectName: { rules: [{ required: true, message: '请输入项目名称!' }] },
+        industryId: { rules: [{ required: true, message: '请选择行业!' }] },
+        advertiserId: { rules: [{ required: true, message: '请选择广告主!' }] },
+        productId: { rules: [{ required: true, message: '请选择产品!' }] },
+        supplierCode: { rules: [{ required: true, message: '请选择供应商!' }], initialValue: 'kuaishou_001' },
+        responsibleName: { rules: [{ required: true, message: '请选择负责人!' }] },
+        maxBid: { rules: [{ required: true, message: '请输入最高出价!' }, { validator: this.validateInputCode }] },
+      },
+      url: {
+        add: '/ctop/project/add',
+        edit: '/ctop/project/edit',
+        getList: '/ctop/advertiser/list',
+      },
+      list: [],
+      listProduct: [],
+      resId: '',
+      shejiId: '',
+      options: [],
+      optionsElse: [],
+      supplierList: [],
+      editAll: false,
+    }
+  },
+  created() {
+    this.getSupplierList()
+  },
+  methods: {
+    validateInputCode(rule, value, callback) {
+      if (!value || value > 0) {
+        callback()
+      } else {
+        callback('请输入大于0的最高报价!')
+      }
+    },
+    ...mapGetters(['nickname', 'avatar', 'userInfo']),
+    onChange(e) {
+      console.log(`checked = ${e.target.value}`)
+    },
+    handleChange(value) {
+      console.log(value)
+      getAction('/ctop/product/list', { advertiserId: value, pageSize: 1000 }).then((res) => {
+        if (res.success) {
+          this.listProduct = res.result.records
+        }
+      })
+    },
+    handleBlur() {
+      console.log('blur')
+    },
+    handleFocus() {
+      console.log('focus')
+    },
+    filterOption(input, option) {
+      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+    },
+    getList() {
+      var params = {}
+      // params.userId = this.userInfo().id
+      params.pageSize = 1000
+      params.pageNo = 1
+      console.log(params)
+      getAction(this.url.getList,params)
+        .then((res) => {
+          if (res.success) {
+            console.log(res)
+            this.list = res.result.records
+          } else {
+            this.$message.warning(res.message)
+          }
+        })
+        .finally(() => {})
+    },
+    getSupplierList() {
+      var params = {}
+      getAction('/ctop/supplierList/list').then((res) => {
+        if (res.success) {
+          this.supplierList = res.result.records
+        } else {
+          this.$message.warning(res.message)
+        }
+      })
+    },
+    add(item) {
+      this.editAll = false
+      this.edit({
+        responsibleId: this.userInfo().id, //用户Id
+        mediaId: '2',
+        ...item,
+      })
+    },
+    edit(record) {
+      this.getSupplierList()
+      this.getList()
+      if (record.advertiserId) {
+        this.editAll = true
+        getAction('/ctop/product/list', { advertiserId: record.advertiserId, pageSize: 1000 }).then((res) => {
+          if (res.success) {
+            this.listProduct = res.result.records
+          }
+        })
+      }
+      var params = { ...record }
+
+      console.log(record)
+      this.form.resetFields()
+      this.model = Object.assign({}, params)
+      this.model.maxBid = this.model.maxBid ? this.model.maxBid / 1000 : 0
+      this.model.maxDeepCpaBid = this.model.maxDeepCpaBid ? this.model.maxDeepCpaBid / 1000 : 0
+      this.visible = true
+      this.$nextTick(() => {
+        console.log(this.model)
+        if (record.advertiserId) {
+          this.form.setFieldsValue(
+            pick(
+              this.model,
+              'projectName',
+              'industryId',
+              'advertiserId',
+              'productId',
+              'responsibleName',
+              'maxBid',
+              'maxDeepCpaBid',
+              'userId',
+              'designResponsibleId',
+              'responsibleId',
+              'industryCode',
+              'supplierCode',
+              // 'advertiserType',
+              'saleId'
+            )
+          )
+        } else {
+          this.form.setFieldsValue(
+            pick(
+              this.model,
+              'projectName',
+              'industryId',
+              'advertiserId',
+              'responsibleName',
+              'maxBid',
+              'maxDeepCpaBid',
+              'userId',
+              'designResponsibleId',
+              'responsibleId',
+              'industryCode',
+              'supplierCode',
+              // 'advertiserType',
+              'saleId'
+            )
+          )
+        }
+
+        // this.resId = record.responsibleId
+        // this.shejiId = record.designResponsibleId
+        getAction('/sys/user/getAllUserListV1', '').then((res) => {
+          console.log(res)
+          if (res.success) {
+            this.options = res.result
+          }
+        })
+        getAction('/sys/user/getAllSaleList', '').then((res) => {
+          console.log(res)
+          if (res.success) {
+            this.optionsElse = res.result
+          }
+        })
+        //时间格式化
+      })
+    },
+    close() {
+      this.$emit('close')
+      this.visible = false
+    },
+    handleOk() {
+      const that = this
+      // 触发表单验证
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          that.confirmLoading = true
+          let httpurl = ''
+          let method = ''
+          if (!this.model.id) {
+            httpurl += this.url.add
+            method = 'post'
+          } else {
+            httpurl += this.url.edit
+            method = 'put'
+          }
+          var data = values.advertiserId
+          let formData = Object.assign(this.model, values)
+          //   if(this.model.mediaId)
+          formData.maxBid = formData.maxBid * 1000
+          formData.maxDeepCpaBid = formData.maxDeepCpaBid * 1000
+          //时间格式化
+          // formData.advertiserId = data.key
+          // formData.advertiserName = data.label
+          formData.responsibleId = values.responsibleId
+          formData.designResponsibleId = values.designResponsibleId
+          formData.userId = formData.userId ? formData.userId : that.userInfo().id
+          httpAction(httpurl, formData, method)
+            .then((res) => {
+              if (res.success) {
+                that.$message.success(res.message)
+                that.$emit('ok')
+              } else {
+                that.$message.warning(res.message)
+              }
+            })
+            .finally(() => {
+              that.confirmLoading = false
+              that.close()
+            })
+        }
+      })
+    },
+    handleCancel() {
+      this.close()
+    },
+    getFormFieldValue(field) {
+      return this.form.getFieldValue(field)
+    },
+    get(valueName, key) {
+      console.log(valueName, key)
+      this.resId = key
+    },
+  },
+}
+</script>
+
+<style lang="less" scoped></style>

+ 2 - 2
vue.config.js

@@ -58,9 +58,9 @@ module.exports = {
     open : true,
     proxy: {
       '/jeecg-boot': {
-         target: 'http://192.168.1.90:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
+        //  target: 'http://192.168.1.8:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
         // target: 'http://192.168.0.59:8088', //请求本地 需要jeecg-boot后台项目  英豪
-        // target: 'http://192.168.1.72:8088', //请求本地 需要jeecg-boot后台项目  英豪
+        target: 'http://192.168.1.72:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
         // target: 'http://192.168.1.94:8088', //请求本地 需要jeecg-boot后台项目  孙震
         // target: 'http://192.168.0.230:8088', //请求本地 需要jeecg-boot后台项目  孙震