增加流程配置
This commit is contained in:
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false"
|
||||
:visible="visible"
|
||||
:title="title"
|
||||
@close="closeDialog"
|
||||
width="400px"
|
||||
>
|
||||
<div>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
class="label-input-form"
|
||||
label-width="100px"
|
||||
inline
|
||||
>
|
||||
<el-form-item label="流程类型" prop="category" class="add-form-item">
|
||||
<el-select v-model="formData.category" placeholder="请选择流程类型" clearable>
|
||||
<el-option v-for="opt in typeList" :value="opt.value" :key="opt.value" :label="opt.label">{{ opt.label}}</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
<el-button round class="common-button-default" icon="el-icon-close" @click="closeDialog">{{$t('m.cancel')}}</el-button>
|
||||
<el-button round class="common-button-primary" icon="el-icon-check" type="primary" @click="confirmDialog">{{$t('m.confirm')}}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const formData = {
|
||||
category: '',
|
||||
}
|
||||
export default {
|
||||
name: 'EditProcessClassification',
|
||||
props: ['data', 'visible'],
|
||||
data() {
|
||||
return {
|
||||
formData: {},
|
||||
formRules: {},
|
||||
typeList: [] // 类型下拉框
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
title() {
|
||||
return !!this.data ? '编辑' : '新增'
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
data(newValue) {
|
||||
this.formData = newValue || {...formData}
|
||||
},
|
||||
visible(newValue) {
|
||||
this.formData = this.data || {...formData}
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.formData = this.data || {...formData}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.queryTablePage()
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
// 查询、加载表格
|
||||
queryTablePage () {
|
||||
const formData = {
|
||||
// page: this.pageNo,
|
||||
// pageSize: this.$store.getters.userInfo.configContent,
|
||||
// standNumber: this.searchForm.standardKey
|
||||
}
|
||||
this.$http.get('lawss/activiti/categoryList',
|
||||
formData,
|
||||
{
|
||||
_this: this,
|
||||
loading: 'tableDataLoading'
|
||||
},
|
||||
res => {
|
||||
this.typeList = res.result.map(item => {
|
||||
return {
|
||||
label: item.type,
|
||||
value: item.objectId
|
||||
}
|
||||
})
|
||||
// this.total = res.data.count
|
||||
}, e => {})
|
||||
},
|
||||
|
||||
closeDialog() {
|
||||
// this.visible = false
|
||||
this.$emit('close')
|
||||
this.formData = {}
|
||||
},
|
||||
|
||||
confirmDialog() {
|
||||
const url = !this.data ? 'lawss/activiti/addCategory' : 'lawss/activiti/updatModel'
|
||||
const formData = {
|
||||
modelId: this.formData.id,
|
||||
categoryId: this.formData.category
|
||||
}
|
||||
this.$http.get(url, formData, {
|
||||
_this: this
|
||||
}, res => {
|
||||
if (res.success) {
|
||||
console.log('新增/编辑成功')
|
||||
this.$emit('success')
|
||||
this.$emit('close')
|
||||
}
|
||||
|
||||
}, e => {
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="" scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user