|
@@ -0,0 +1,102 @@
|
|
|
+<template>
|
|
|
+ <el-row style="margin-bottom: 20px">
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
|
|
|
+ <el-row class="my-row">
|
|
|
+ <el-form-item label="处理意见" prop="remark">
|
|
|
+ <el-input type="textarea" v-model="dataForm.remark" placeholder="处理意见"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="my-row">
|
|
|
+ <upload-component :title="'审批附件'" :accept="'*'" :file-obj-list="fileList" @uploadSuccess="uploadSuccess"/>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-button style="margin-left: 20px" @click="dataFormSubmit(2)">不同意</el-button>
|
|
|
+ <el-button type="primary" @click="dataFormSubmit(1)">同意</el-button>
|
|
|
+ <el-button type="danger" @click="dataFormSubmit(3)">驳回</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import UploadComponent from '../common/upload-component'
|
|
|
+ export default {
|
|
|
+ name: 'approve-component',
|
|
|
+ components: {UploadComponent},
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ dataForm: {},
|
|
|
+ fileList: [],
|
|
|
+ dataRule: {
|
|
|
+ remark: [{ required: true, message: '处理意见不能为空', trigger: 'blur' }]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async init (businessType, businessIds) {
|
|
|
+ // console.log('[approve-component]businessType = ' + businessType)
|
|
|
+ // console.log('[approve-component]businessId = ' + businessId)
|
|
|
+ this.visible = true
|
|
|
+ this.dataForm = {
|
|
|
+ busiType: businessType || '',
|
|
|
+ busiIds: businessIds || []
|
|
|
+ }
|
|
|
+ this.fileList = []
|
|
|
+ },
|
|
|
+ // 表单提交
|
|
|
+ dataFormSubmit (val) {
|
|
|
+ this.$refs['dataForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ // 添加附件
|
|
|
+ let fList = this.fileList
|
|
|
+ if (fList.length > 0) {
|
|
|
+ this.dataForm.attachList = []
|
|
|
+ for (let i = 0; i < fList.length; i++) {
|
|
|
+ this.dataForm.attachList.push({
|
|
|
+ fileName: fList[i].name,
|
|
|
+ url: fList[i].url
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl(`/biz-service/business/batch/approval`),
|
|
|
+ method: 'post',
|
|
|
+ data: this.$http.adornData(
|
|
|
+ {...this.dataForm,
|
|
|
+ approvalType: val,
|
|
|
+ userName: this.$store.state.user.name,
|
|
|
+ orgId: this.$store.state.user.orgId
|
|
|
+ })
|
|
|
+ }).then(({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.$message({
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1500,
|
|
|
+ onClose: () => {
|
|
|
+ this.visible = false
|
|
|
+ this.$emit('approveFinished')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ validateField (type) {
|
|
|
+ this.$refs.dataForm.validateField(type)
|
|
|
+ },
|
|
|
+ uploadSuccess (fileList) {
|
|
|
+ this.fileList = fileList
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|