wangting
2023-08-03 3572b62c00628d51db091f90287fa2f186b5d2eb
Source/UBCS-WEB/src/components/template/SetPersonnel.vue
@@ -10,7 +10,7 @@
                <el-input placeholder="流程模板" v-model="saveParam.modelName" disabled></el-input>
            </el-form-item>
            <el-form-item label="流程名称" prop="processName">
                <el-input placeholder="流程名称" v-model="saveParam.processName">
                <el-input placeholder="流程名称" v-model="saveParam.template">
                </el-input>
            </el-form-item>
            <el-form-item label="流程描述">
@@ -66,7 +66,8 @@
                    ids: 'ids',
                    flowTemplate: 'flowTemplate',
                    code: 'code',
                    type: 'type'
                    type: 'type',
                    btmtype:'btmtype'
                }
            }
        }
@@ -76,7 +77,6 @@
        visible(n) {
            this.dialogVisible = n;
            if (n) {
              this.saveParam=this.setSaveParam();
                this.apiInit()
                this.apiDict()
            }
@@ -86,7 +86,6 @@
        },
        users:{
            handler(val){
                console.log('监听users',val)
                this.collectParam.flowTaskUsers = val
            },
            deep:true,
@@ -94,8 +93,10 @@
        },
      parameter:{
          handler(newval,oldval){
            console.log('子',newval)
          }
               this.saveParam=newval;
          },
        deep:true,
          immediate:true
      }
    },
    data() {
@@ -106,7 +107,7 @@
            tags: [],
            typeName: [],
            collectParam: {},
            saveParam: this.setSaveParam(),
            saveParam: {},
            users: [],
            rules: {
                processName: [
@@ -119,7 +120,7 @@
    mounted() {
    },
    created() {
  created() {
  },
  methods: {
        setSaveParam() {
@@ -127,6 +128,8 @@
                processName: this.parameter[this.parameterKeys.flowTemplate],
                topName: this.title,
                ids: this.parameter[this.parameterKeys.ids],
                oids: this.parameter[this.parameterKeys.ids],
                btmtype:this.parameter[this.parameterKeys.btmtype],
                vars:this.parameter['vars']
            }
        },
@@ -136,7 +139,6 @@
        async apiInit() {
            const response = await personnelInit({ type: this.parameter[this.parameterKeys.type], templateId: this.parameter[this.parameterKeys.code]})
            if (response.status === 200) {
                console.log(response)
                this.initFrom = response.data.data.user
                this.tags = response.data.data.collect
                const { modelKey, templateId, modelName } = response.data.data.flow
@@ -144,7 +146,9 @@
                this.collectParam = { modelKey, templateId, flowTaskUsers: flowTaskUsers }
                this.users = response.data.data.user
                console.log(this.collectParam)
            console.log('this.saveParam.before',this.saveParam)
                this.saveParam = { ...this.saveParam, modelKey, templateId, modelName }
            console.log('this.saveParam',this.saveParam)
                if (this.tags.length !== 0) this.handleClickTag(this.tags[0])
            }
        },
@@ -200,6 +204,7 @@
                console.log(this.collectParam.flowTaskUsers)
                console.log(len == 0)
                console.log(len != this.initFrom.length)
            console.log('saveParam',this.saveParam)
                if (len == 0 && len != this.initFrom.length) {
                    this.$message({
                        type: "error",
@@ -208,6 +213,7 @@
                } else {
                    const {modelKey,modelName,processDesc,processName,templateId,topName,vars,ids} = this.saveParam
                    const vals= {modelKey,modelName,processDesc,processName,templateId,topName,ids,...vars}
               console.log('vals',vals);
                    const response = await personnelSave({ variables:vals, flowTaskUsers: this.collectParam.flowTaskUsers, })
                    if (response.status === 200) {
                        console.log(response)
@@ -215,6 +221,7 @@
                            type: 'success',
                            message: response.data.msg
                        });
                        this.$emit('onLoad')
                        this.done()
                    }
                }