田源
2023-08-02 153ce2c62bed20d3875bbadfc98bf0ad4aeeff46
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="流程描述">
@@ -85,12 +85,18 @@
        },
        users:{
            handler(val){
                console.log('监听users',val)
                this.collectParam.flowTaskUsers = val
            },
            deep:true,
            immediate:true
        }
        },
      parameter:{
          handler(newval,oldval){
               this.saveParam=newval;
          },
        deep:true,
          immediate:true
      }
    },
    data() {
        return {
@@ -100,7 +106,7 @@
            tags: [],
            typeName: [],
            collectParam: {},
            saveParam: this.saveParam(),
            saveParam: {},
            users: [],
            rules: {
                processName: [
@@ -112,11 +118,11 @@
    },
    mounted() {
        // this.apiInit()
        // this.apiDict()
    },
    methods: {
        saveParam() {
  created() {
  },
  methods: {
        setSaveParam() {
            return {
                processName: this.parameter[this.parameterKeys.flowTemplate],
                topName: this.title,
@@ -128,9 +134,8 @@
            return this.initFrom.findIndex(i => i.taskId === arr1)
        },
        async apiInit() {
            const response = await personnelInit({ type: this.parameter[this.parameterKeys.type], templateId: this.parameter[this.parameterKeys.code] })
            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
@@ -138,7 +143,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])
            }
        },
@@ -194,14 +201,16 @@
                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",
                        message: "请选择节点!"
                    });
                } else {
                    const {modelKey,modelName,processDesc,processName,templateId,topName,vars} = this.saveParam
                    const vals= {modelKey,modelName,processDesc,processName,templateId,topName,...vars}
                    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)
@@ -209,6 +218,7 @@
                            type: 'success',
                            message: response.data.msg
                        });
                        this.$emit('onLoad')
                        this.done()
                    }
                }