Sfoglia il codice sorgente

流程增加是否生成快照设置

cfort 2 anni fa
parent
commit
845d204234

+ 2 - 4
src/business/platform/bpmn/form/action.js

@@ -664,13 +664,11 @@ export default {
                 // 等待一段时间后再次查询
                 await new Promise(resolve => setTimeout(resolve, intervalTime))
             }
-            // if (!(await this.isFinish(proId || proInstId))) {
-            //     return
-            // }
-            const sql = `select * from t_lcidglbdbb where shi_fou_zi_biao_ = 't_${key}'`
+            const sql = `select * from t_lcidglbdbb where shi_fou_zi_biao_ = 't_${key}' and ti_jiao_kuai_zhao = '是'`
             this.$common.request('sql', sql).then(res => {
                 const { data = [] } = res.variables || {}
                 if (!data.length) {
+                    this.updateState(id, key, '已完成', null)
                     return
                 }
                 const path = data[0].bao_biao_lu_jing_

+ 24 - 9
src/business/platform/bpmn/setting/bpmn-setting/mixins/addRecord.js

@@ -3,6 +3,12 @@ import request from '@/utils/request'
 import ActionUtils from '@/utils/action'
 
 export default {
+    data () {
+        return {
+            // 标识是否初次创建
+            flag: false
+        }
+    },
     methods: {
         getRecord (id) {
             const sql = `select * from t_lcidglbdbb where liu_cheng_xuan_ze = '${id}'`
@@ -11,15 +17,20 @@ export default {
                 if (!data.length) {
                     return
                 }
-                this.bao_biao_lu_jing_ = data[0].bao_biao_lu_jing_
-                this.fu_jian_nei_rong_ = data[0].fu_jian_nei_rong_
-                this.shi_fou_zi_biao_ = data[0].shi_fou_zi_biao_
-                this.guan_lian_zi_duan = data[0].guan_lian_zi_duan
-                this.liu_cheng_xuan_ze = id
+                const { bao_biao_lu_jing_, fu_jian_nei_rong_, shi_fou_zi_biao_, guan_lian_zi_duan, ti_jiao_kuai_zhao, bo_hui_kuai_zhao_ } = data[0]
+                Object.assign(this, {
+                    bao_biao_lu_jing_,
+                    fu_jian_nei_rong_,
+                    shi_fou_zi_biao_,
+                    guan_lian_zi_duan,
+                    liu_cheng_xuan_ze: id,
+                    ti_jiao_kuai_zhao,
+                    bo_hui_kuai_zhao_
+                })
             })
         },
         addRecord () {
-            if (this.liu_cheng_xuan_ze) return this.updateRecord()
+            if (this.flag || this.liu_cheng_xuan_ze) return this.updateRecord()
             this.add()
         },
         add () {
@@ -30,10 +41,13 @@ export default {
                     fu_jian_nei_rong_: this.fu_jian_nei_rong_,
                     liu_cheng_xuan_ze: this.data.id,
                     guan_lian_zi_duan: this.guan_lian_zi_duan,
-                    shi_fou_zi_biao_: this.shi_fou_zi_biao_
+                    shi_fou_zi_biao_: this.shi_fou_zi_biao_,
+                    ti_jiao_kuai_zhao: this.ti_jiao_kuai_zhao,
+                    bo_hui_kuai_zhao_: this.bo_hui_kuai_zhao_
                 }]
             }
             curdPost('add', params).then(() => {
+                this.flag = true
                 this.$message({
                     message: '添加成功',
                     type: 'success'
@@ -51,9 +65,10 @@ export default {
                         param: {
                             bao_biao_lu_jing_: this.bao_biao_lu_jing_,
                             fu_jian_nei_rong_: this.fu_jian_nei_rong_,
-                            liu_cheng_xuan_ze: this.liu_cheng_xuan_ze,
                             guan_lian_zi_duan: this.guan_lian_zi_duan,
-                            shi_fou_zi_biao_: this.shi_fou_zi_biao_
+                            shi_fou_zi_biao_: this.shi_fou_zi_biao_,
+                            ti_jiao_kuai_zhao: this.ti_jiao_kuai_zhao,
+                            bo_hui_kuai_zhao_: this.bo_hui_kuai_zhao_
                         }
                     }
                 ]

+ 161 - 147
src/business/platform/bpmn/setting/bpmn-setting/types/global.vue

@@ -1,164 +1,178 @@
 <template>
-  <div>
-    <div v-sticky class="setting-title" @click="onTitle">
-      全局设置 <i class=" el-icon-caret-bottom"></i>
-    </div>
-    <el-collapse v-model="activeNames">
-      <el-collapse-item title="业务对象绑定" name="boSetting">
-        <bo-setting
-          :data="boData"
-          :has-call-activity="hasCallActivity"
-          :parent-def-key="parentDefKey"
-          @clean="cleanFormData"
-        />
-      </el-collapse-item>
-      <el-collapse-item title="表单设置" name="formSeting">
-        <form-setting
-          :data="formData"
-          :attributes="attributes"
-          :bo-data="boData"
-          :def-key="defKey"
-          :node-id="nodeId"
-          :parent-def-key="parentDefKey"
-          :form-opinions.sync="formOpinions"
-          form-type="flow"
-          @change-form="changeForm"
-        />
-      </el-collapse-item>
-      <el-collapse-item title="实例表单设置" name="instFormSetting">
-        <form-setting
-          :data="instFormData"
-          :def-key="defKey"
-          :bo-data="boData"
-          :node-id="nodeId"
-          :parent-def-key="parentDefKey"
-          form-type="inst"
-        />
-      </el-collapse-item>
-
-      <!-- <el-collapse-item title="流程变量设置" name="varSetting">
-        <variable-setting
-          :data="variables"
-        />
-      </el-collapse-item> -->
-     <el-collapse-item title="记录保存" name="varSetting">
-    <div style="margin-left:5%;">
-       报表路径以半角","分割: <el-input placeholder="报表路径" type="textarea" rows="5" v-model="bao_biao_lu_jing_"> </el-input>
-       附件字段名以半角","分割 (多个数据表以'.'分割):<el-input placeholder="附件字段"  v-model="fu_jian_nei_rong_"></el-input>
-       附件所在数据库 (多个数据表以'.'分割):<el-input placeholder="附件数据库"  v-model="shi_fou_zi_biao_"></el-input>
-       [ 当前表默认id主键 ] 附件子表的外键字段[选填] (多个数据表以'.'分割):<el-input placeholder="关联字段"  v-model="guan_lian_zi_duan"></el-input>
-    </div>
+    <div>
+        <div v-sticky class="setting-title" @click="onTitle">
+            全局设置 <i class=" el-icon-caret-bottom" />
+        </div>
+        <el-collapse v-model="activeNames">
+            <el-collapse-item title="业务对象绑定" name="boSetting">
+                <bo-setting
+                    :data="boData"
+                    :has-call-activity="hasCallActivity"
+                    :parent-def-key="parentDefKey"
+                    @clean="cleanFormData"
+                />
+            </el-collapse-item>
+            <el-collapse-item title="表单设置" name="formSeting">
+                <form-setting
+                    :data="formData"
+                    :attributes="attributes"
+                    :bo-data="boData"
+                    :def-key="defKey"
+                    :node-id="nodeId"
+                    :parent-def-key="parentDefKey"
+                    :form-opinions.sync="formOpinions"
+                    form-type="flow"
+                    @change-form="changeForm"
+                />
+            </el-collapse-item>
+            <el-collapse-item title="实例表单设置" name="instFormSetting">
+                <form-setting
+                    :data="instFormData"
+                    :def-key="defKey"
+                    :bo-data="boData"
+                    :node-id="nodeId"
+                    :parent-def-key="parentDefKey"
+                    form-type="inst"
+                />
+            </el-collapse-item>
 
-       <el-button type="success" plain style="margin: 5px; float: right;"  @click="addRecord">保存 / 修改</el-button>
-     </el-collapse-item>
+            <!-- <el-collapse-item title="流程变量设置" name="varSetting">
+                <variable-setting
+                    :data="variables"
+                />
+            </el-collapse-item> -->
+            <el-collapse-item title="流程归档设置" name="varSetting">
+                <div style="margin-left:5%;">
+                    报表路径(以半角','分割):<el-input v-model="bao_biao_lu_jing_" placeholder="报表路径" type="textarea" rows="5" />
+                    附件字段名(多字段以半角','分割 多个数据表以'.'分割):<el-input v-model="fu_jian_nei_rong_" placeholder="附件字段" />
+                    附件所在数据库(多个数据表以'.'分割):<el-input v-model="shi_fou_zi_biao_" placeholder="附件数据库" />
+                    附件子表的外键字段(选填,当前表默认id主键,多个数据表以'.'分割):<el-input v-model="guan_lian_zi_duan" placeholder="关联字段" />
+                    是否生成提交快照:
+                    <el-switch
+                        v-model="ti_jiao_kuai_zhao"
+                        active-value="是"
+                        inactive-value="否"
+                        style="margin-right: 80px;"
+                    />
+                    是否生成驳回快照:
+                    <el-switch
+                        v-model="bo_hui_kuai_zhao_"
+                        active-value="是"
+                        inactive-value="否"
+                    />
+                </div>
 
+                <el-button type="success" plain style="margin: 5px; float: right;" @click="addRecord">保存 / 修改</el-button>
+            </el-collapse-item>
 
-      <el-collapse-item name="endNotify">
-        <template slot="title">
-          办结抄送设置
-          <el-tooltip class="item" effect="light" content="进行设置流程结束时抄送给某批人!" placement="bottom">
-            <i class="header-icon el-icon-info" />
-          </el-tooltip>
-        </template>
-        <notify-setting :data="procNotify" />
-      </el-collapse-item>
-      <el-collapse-item title="其他设置" name="otherAttribute">
-        <other-attribute :data="attributes" />
-      </el-collapse-item>
-    </el-collapse>
-  </div>
+            <el-collapse-item name="endNotify">
+                <template slot="title">
+                    办结抄送设置
+                    <el-tooltip class="item" effect="light" content="进行设置流程结束时抄送给某批人!" placement="bottom">
+                        <i class="header-icon el-icon-info" />
+                    </el-tooltip>
+                </template>
+                <notify-setting :data="procNotify" />
+            </el-collapse-item>
+            <el-collapse-item title="其他设置" name="otherAttribute">
+                <other-attribute :data="attributes" />
+            </el-collapse-item>
+        </el-collapse>
+    </div>
 </template>
 <script>
 import mixins from '../mixins/type'
 import addRecord from '../mixins/addRecord.js'
 export default {
-  mixins: [mixins,addRecord],
-  props: {
-    defKey: String,
-    nodeId: String, // 节点ID
-    hasCallActivity: Boolean, // 是否有外部子流程
-    parentDefKey: String ,// 父类key
-  },
-  data() {
-    return {
-      activeNames: ['boSetting', 'formSeting', 'instFormSetting', 'varSetting', 'endNotify', 'otherAttribute'],
-      bao_biao_lu_jing_:'',
-      fu_jian_nei_rong_:'',
-      shi_fou_zi_biao_:'',
-      liu_cheng_xuan_ze:'',
-      guan_lian_zi_duan:''
-    }
-  },
-  created() {
-    setTimeout(() => {
-		if(this.data && this.data.id) this.getRecord(this.getDataId)
-    }, 500)
-  },
-  watch:{
-    data:{
-    handler: function(data,outData) {
-        this.getRecord(this.getDataId)
-        },
-    }
-  },
-  computed: {
-    // 业务对象
-    boData() {
-      return this.data ? this.data.bo || {} : {}
-    },
-     //流程id
-    getDataId() {
-      return this.data ? this.data.id || {} : {}
-    },
-    boCode() {
-      return this.boData ? this.boData.code || '' : ''
+    mixins: [mixins, addRecord],
+    props: {
+        defKey: String,
+        nodeId: String, // 节点ID
+        hasCallActivity: Boolean, // 是否有外部子流程
+        parentDefKey: String // 父类key
     },
-    // 表单
-    formData() {
-      return this.data ? this.data.form || {} : {}
+    data () {
+        return {
+            activeNames: ['boSetting', 'formSeting', 'instFormSetting', 'varSetting', 'endNotify', 'otherAttribute'],
+            bao_biao_lu_jing_: '',
+            fu_jian_nei_rong_: '',
+            shi_fou_zi_biao_: '',
+            liu_cheng_xuan_ze: '',
+            guan_lian_zi_duan: '',
+            ti_jiao_kuai_zhao: '否',
+            bo_hui_kuai_zhao_: '否'
+        }
     },
-    // 实例表单
-    instFormData() {
-      return this.data ? this.data.instForm || {} : {}
-    },
-    // 表单意见
-    formOpinions: {
-      get() {
-        return this.data ? this.data.formOpinions || {} : {}
-      },
-      set(value) {
-        this.data.formOpinions = value || {}
-      }
+    computed: {
+    // 业务对象
+        boData () {
+            return this.data ? this.data.bo || {} : {}
+        },
+        // 流程id
+        getDataId () {
+            return this.data ? this.data.id || {} : {}
+        },
+        boCode () {
+            return this.boData ? this.boData.code || '' : ''
+        },
+        // 表单
+        formData () {
+            return this.data ? this.data.form || {} : {}
+        },
+        // 实例表单
+        instFormData () {
+            return this.data ? this.data.instForm || {} : {}
+        },
+        // 表单意见
+        formOpinions: {
+            get () {
+                return this.data ? this.data.formOpinions || {} : {}
+            },
+            set (value) {
+                this.data.formOpinions = value || {}
+            }
+        },
+        // 流程变量
+        variables () {
+            return this.data ? this.data.variables || [] : []
+        },
+        // 抄送
+        procNotify () {
+            return this.data ? this.data.procNotify || [] : []
+        },
+        // 其它属性
+        attributes () {
+            if (!this.data.attributes) return
+            this.data.attributes.subjectRule = this.data.attributes.subjectRule == '{发起人:startorName}在{发起时间:startTime}发起{流程标题:title}'
+                ? '{发起人:startorName} |启动:{流程标题:title}' : this.data.attributes.subjectRule
+            return this.data ? this.data.attributes || {} : {}
+        }
     },
-    // 流程变量
-    variables() {
-      return this.data ? this.data.variables || [] : []
+    watch: {
+        data: {
+            handler: function (data, outData) {
+                this.getRecord(this.getDataId)
+            }
+        }
     },
-    // 抄送
-    procNotify() {
-      return this.data ? this.data.procNotify || [] : []
+    created () {
+        setTimeout(() => {
+            if (this.data && this.data.id) this.getRecord(this.getDataId)
+        }, 500)
     },
-    // 其它属性
-    attributes() {
-      if(!this.data.attributes) return
-      this.data.attributes.subjectRule =  this.data.attributes.subjectRule == "{发起人:startorName}在{发起时间:startTime}发起{流程标题:title}" ?
-     "{发起人:startorName} |启动:{流程标题:title}" : this.data.attributes.subjectRule
-      return this.data ? this.data.attributes || {} : {}
+    methods: {
+        handleData (key, data) {
+            this.$emit('input', data)
+        },
+        changeForm (key, value) {
+            this.instFormData[key] = value
+        },
+        cleanFormData () {
+            this.$emit('clean-form-data')
+        },
+        saveCont () {
+            this.data.id// 流程id
+        }
     }
-  },
-  methods: {
-    handleData(key, data) {
-      this.$emit('input', data)
-    },
-    changeForm(key, value) {
-      this.instFormData[key] = value
-    },
-    cleanFormData() {
-      this.$emit('clean-form-data')
-    },
-    saveCont(){
-      this.data.id//流程id
-      }
-  }
 }
 </script>