|
|
|
@ -6,13 +6,14 @@ const props = defineProps({
|
|
|
|
required: true,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
row: [Object],
|
|
|
|
row: [Object],
|
|
|
|
|
|
|
|
templateList: [Array],
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['closed', 'onSuccess'])
|
|
|
|
const emit = defineEmits(['closed', 'onSuccess'])
|
|
|
|
|
|
|
|
|
|
|
|
const dialogVisible = ref(false)
|
|
|
|
const dialogVisible = ref(false)
|
|
|
|
|
|
|
|
|
|
|
|
const isAdd = computed(() => props.type === 'add')
|
|
|
|
const isCancel = computed(() => props.type === 'cancel')
|
|
|
|
const isApprove = computed(() => props.type === 'approve')
|
|
|
|
const isApprove = computed(() => props.type === 'approve')
|
|
|
|
const isReject = computed(() => props.type === 'reject')
|
|
|
|
const isReject = computed(() => props.type === 'reject')
|
|
|
|
const isApproval = computed(() => isApprove.value || isReject.value)
|
|
|
|
const isApproval = computed(() => isApprove.value || isReject.value)
|
|
|
|
@ -22,10 +23,8 @@ onMounted(() => {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const formRef = ref(null)
|
|
|
|
const formRef = ref(null)
|
|
|
|
const formField = ref({ enabled: true, params: [], remark: '' })
|
|
|
|
const formField = ref({ remark: '' })
|
|
|
|
const formRules = reactive({
|
|
|
|
const formRules = reactive({
|
|
|
|
name: [{ required: true, message: '不可为空', trigger: 'change' }],
|
|
|
|
|
|
|
|
code: [{ required: true, message: '不可为空', trigger: 'change' }],
|
|
|
|
|
|
|
|
remark: [{ required: true, message: '备注不可为空', trigger: 'change' }],
|
|
|
|
remark: [{ required: true, message: '备注不可为空', trigger: 'change' }],
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
@ -43,7 +42,7 @@ const submitForm = async () => {
|
|
|
|
const params = {
|
|
|
|
const params = {
|
|
|
|
application_id: props.row.id,
|
|
|
|
application_id: props.row.id,
|
|
|
|
action: isApprove.value ? 'approve' : 'reject',
|
|
|
|
action: isApprove.value ? 'approve' : 'reject',
|
|
|
|
remark: formField.value.remark
|
|
|
|
remark: formField.value.remark,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
loading.value = true
|
|
|
|
loading.value = true
|
|
|
|
RPC.post('/template_access_review', params)
|
|
|
|
RPC.post('/template_access_review', params)
|
|
|
|
@ -56,14 +55,13 @@ const submitForm = async () => {
|
|
|
|
loading.value = false
|
|
|
|
loading.value = false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// 原有的增删改逻辑
|
|
|
|
|
|
|
|
const api = isAdd.value ? '/vendor/create' : '/vendor/update'
|
|
|
|
|
|
|
|
const params = {
|
|
|
|
const params = {
|
|
|
|
...formField.value,
|
|
|
|
template_id: props.row.template_id,
|
|
|
|
id: isAdd.value ? null : props.row.id,
|
|
|
|
user_id: props.row.user_id,
|
|
|
|
|
|
|
|
remark: formField.value.remark,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
loading.value = true
|
|
|
|
loading.value = true
|
|
|
|
RPC.post(api, params)
|
|
|
|
RPC.post('/template_access_revoke', params)
|
|
|
|
.then((res) => {
|
|
|
|
.then((res) => {
|
|
|
|
ElMessage.success('操作成功')
|
|
|
|
ElMessage.success('操作成功')
|
|
|
|
emit('onSuccess')
|
|
|
|
emit('onSuccess')
|
|
|
|
@ -74,18 +72,12 @@ const submitForm = async () => {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!isAdd.value && !isApproval.value) {
|
|
|
|
|
|
|
|
formField.value = {
|
|
|
|
|
|
|
|
...props.row,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<el-dialog
|
|
|
|
<el-dialog
|
|
|
|
align-center
|
|
|
|
align-center
|
|
|
|
:title="isApprove ? '同意申请' : isReject ? '拒绝申请' : isAdd ? '新增' : '修改'"
|
|
|
|
:title="isApprove ? '同意申请' : isReject ? '拒绝申请' : isCancel ? '撤回权限' : ''"
|
|
|
|
:width="isApproval ? '500px' : '80%'"
|
|
|
|
:width="isApproval ? '500px' : '80%'"
|
|
|
|
v-model="dialogVisible"
|
|
|
|
v-model="dialogVisible"
|
|
|
|
@closed="closed"
|
|
|
|
@closed="closed"
|
|
|
|
@ -109,23 +101,29 @@ if (!isAdd.value && !isApproval.value) {
|
|
|
|
<span>{{ row?.reason }}</span>
|
|
|
|
<span>{{ row?.reason }}</span>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item prop="remark" label="备注">
|
|
|
|
<el-form-item prop="remark" label="备注">
|
|
|
|
<el-input
|
|
|
|
<el-input type="textarea" :rows="4" placeholder="请输入备注" v-model="formField.remark" />
|
|
|
|
type="textarea"
|
|
|
|
</el-form-item>
|
|
|
|
:rows="4"
|
|
|
|
</template>
|
|
|
|
placeholder="请输入备注"
|
|
|
|
<template v-else="isApproval">
|
|
|
|
v-model="formField.remark"
|
|
|
|
<el-form-item label="撤回用户">
|
|
|
|
/>
|
|
|
|
<span>{{ row?.nickname || row?.user_id }}</span>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="撤回模板">
|
|
|
|
|
|
|
|
<span>
|
|
|
|
|
|
|
|
{{
|
|
|
|
|
|
|
|
templateList?.find((item) => item.id === row.template_id)?.name || row.template_id
|
|
|
|
|
|
|
|
}}</span
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item prop="remark" label="备注">
|
|
|
|
|
|
|
|
<el-input type="textarea" :rows="4" placeholder="请输入备注" v-model="formField.remark" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
<template #footer>
|
|
|
|
<template #footer>
|
|
|
|
<div class="dialog-footer">
|
|
|
|
<div class="dialog-footer">
|
|
|
|
<el-button @click="closed"> 取 消 </el-button>
|
|
|
|
<el-button @click="closed"> 取 消 </el-button>
|
|
|
|
<el-button
|
|
|
|
<el-button :type="isReject ? 'danger' : 'primary'" :loading="loading" @click="submitForm">
|
|
|
|
:type="isReject ? 'danger' : 'primary'"
|
|
|
|
|
|
|
|
:loading="loading"
|
|
|
|
|
|
|
|
@click="submitForm"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{{ isApprove ? '同意' : isReject ? '拒绝' : '确定' }}
|
|
|
|
{{ isApprove ? '同意' : isReject ? '拒绝' : '确定' }}
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|