<template>
|
<div>
|
<invoice-info ref="invoiceInfo">
|
<template slot="aduitInfo" slot-scope="form">
|
<div v-if="form.data.pushStatus === '0'">
|
<p class="formTitle">审核信息</p>
|
<el-form-item prop="auditRemarke" label="备注:">
|
<el-input type="textarea" v-model="form.data.auditRemarke" placeholder="请输入备注"></el-input>
|
</el-form-item>
|
<el-form-item label="图片:">
|
<custom-upload-img
|
:limitNumber="6"
|
@handle-success="handleSuccess"
|
@handle-remove="handleRemove"
|
:fileList="fileList"
|
></custom-upload-img>
|
</el-form-item>
|
</div>
|
<el-row class="buttonPosition">
|
<el-button type="primary" size="mini" @click="submit">提交</el-button>
|
<el-button size="mini" @click="cancel">返回</el-button>
|
</el-row>
|
</template>
|
</invoice-info>
|
</div>
|
</template>
|
|
<script>
|
import invoiceInfo from '@/views/invoice/components/invoiceInfo.vue'
|
import invoiceApi from '@/api/invoice/invoiceapi.js'
|
import uploadFileApi from '@/api/uploadFile'
|
|
export default {
|
components: { invoiceInfo },
|
data () {
|
return {
|
fileList: [],
|
auditFileId: null
|
}
|
},
|
methods: {
|
// 返回
|
cancel () {
|
this.$router.push({ name: 'invoiceList' })
|
},
|
// 提交
|
submit () {
|
this.$refs.invoiceInfo.$refs.form.validate(async (valid) => {
|
if (valid) {
|
const param = {
|
auditFileId: this.auditFileId,
|
auditRemarke: this.$refs.invoiceInfo.form.auditRemarke,
|
orderId: this.$refs.invoiceInfo.form.orderId,
|
auditStatus: '1'
|
}
|
const res = await invoiceApi.auditInfo(param)
|
if (res.code === '0') {
|
this.$message({
|
message: '审核成功',
|
type: 'success'
|
})
|
this.$router.push({ name: 'invoiceList' })
|
}
|
} else {
|
console.log('error submit!!')
|
return false
|
}
|
})
|
},
|
/**
|
* 获取上传成功的图片
|
*/
|
handleSuccess (data) {
|
this.auditFileId = data.businessId
|
this.fileList.push({
|
url: data.url,
|
id: data.id
|
})
|
},
|
/**
|
* 移除图片
|
*/
|
handleRemove (file) {
|
uploadFileApi.removeFile({ key: file.id }).then(res => {
|
this.fileList = this.fileList.filter(v => {
|
return v.id !== file.id
|
})
|
if (!this.fileList.length) {
|
this.auditFileId = null
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style>
|
|
</style>
|