|
|
|
<template>
|
|
|
|
<div class="app-container">
|
|
|
|
<div v-show="viewState == 1">
|
|
|
|
<div class="tab-header webtop">
|
|
|
|
<div>{{ viewTitle }}</div>
|
|
|
|
<div>
|
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="download()">导入</el-button>
|
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存</el-button>
|
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="submit()">提交</el-button>
|
|
|
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="listconadd">
|
|
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
|
|
|
<el-row style="border-top: 1px solid #e0e3eb">
|
|
|
|
<el-col :span="8">
|
|
|
|
<div class="span-sty">申请部门</div>
|
|
|
|
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="8">
|
|
|
|
<div class="span-sty">申请人</div>
|
|
|
|
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="8">
|
|
|
|
<div class="span-sty">申请日期</div>
|
|
|
|
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="8">
|
|
|
|
<div class="span-sty">开票名称</div>
|
|
|
|
<el-form-item>
|
|
|
|
<el-select class="addinputInfo" v-model="formobj.invoiceSid" placeholder="请选择" @change="supplierChange" clearable filterable>
|
|
|
|
<el-option v-for="item in supplier_list" :key="item.sid" :label="item.billingCompanyName" :value="item.sid"></el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="8">
|
|
|
|
<div class="span-sty">开票类型</div>
|
|
|
|
<el-form-item><span class="addinputInfo">{{ formobj.invoiceValue }}</span></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="8">
|
|
|
|
<div class="span-sty">开票金额</div>
|
|
|
|
<el-form-item><span class="addinputInfo">{{ kpjeTtotal }}</span></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="24">
|
|
|
|
<div class="span-sty">备注</div>
|
|
|
|
<el-form-item><el-input class="addinputInfo" style="width: 80%" v-model="formobj.remarks" clearable placeholder="" /></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="24">
|
|
|
|
<div class="span-sty">附件</div>
|
|
|
|
<el-form-item>
|
|
|
|
<uploadImg ref="uploadImg" class="addinputInfo" v-model="formobj.fileList" :limit="50" bucket="map" :upload-data="{ type: '0001' }"/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<div class="title">开票索赔单列表</div>
|
|
|
|
<el-table :key="tableKey" :data="formobj.detailList" :index="index" border style="width: 100%" :cell-style="cellStyle">
|
|
|
|
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
|
|
|
|
<el-table-column prop="claimBillNo" label="索赔单号" align="center" width="170" />
|
|
|
|
<el-table-column prop="repairBillNo" label="维修单号" align="center" width="170" />
|
|
|
|
<el-table-column prop="vehMark" label="车牌号" align="center" width="100" />
|
|
|
|
<el-table-column prop="vinNo" label="车架号" align="center" width="100" />
|
|
|
|
<el-table-column prop="claimManufacturer" label="索赔厂家" align="center" width="120" />
|
|
|
|
<el-table-column prop="claimHourAmount" label="索赔工时费" align="center" width="120" />
|
|
|
|
<el-table-column prop="claimGoodsAmount" label="索赔材料费" align="center" width="120" />
|
|
|
|
<el-table-column prop="claimOutAmount" label="外出费" align="center" width="120" />
|
|
|
|
<el-table-column prop="claimSubsidyAmount" label="厂家补助" align="center" width="120" />
|
|
|
|
<el-table-column prop="claimRescueAmount" label="施救费" align="center" width="120" />
|
|
|
|
<el-table-column prop="claimOtherAmount" label="其他费用" align="center" width="120" />
|
|
|
|
<el-table-column label="备注" align="center" min-width="200">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<el-input v-model="scope.row.remarks" clearable placeholder="" />
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<el-dialog :visible.sync="dialogVisible" width="70%" :show-close="false">
|
|
|
|
<div>
|
|
|
|
<el-button style="font-weight: bold" size="small" type="text" @click="downLoad">下载厂家索赔单开票明细模板</el-button>
|
|
|
|
</div>
|
|
|
|
<el-card class="box-card">
|
|
|
|
<div>
|
|
|
|
<el-upload
|
|
|
|
ref="upload"
|
|
|
|
class="upload-demo"
|
|
|
|
accept=".xls"
|
|
|
|
name="file"
|
|
|
|
:action="updateAction"
|
|
|
|
:on-success="handleSuccess"
|
|
|
|
:on-remove="handleRemove"
|
|
|
|
:file-list="fileList"
|
|
|
|
:auto-upload="false"
|
|
|
|
:multiple="false"
|
|
|
|
:limit="1"
|
|
|
|
:data="uploadData"
|
|
|
|
:headers="headers"
|
|
|
|
>
|
|
|
|
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
|
|
|
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传</el-button>
|
|
|
|
</el-upload>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<h3>文件上传结果</h3>
|
|
|
|
<el-card class="box-card">
|
|
|
|
<div>{{ uploadResultMesssage }}</div>
|
|
|
|
</el-card>
|
|
|
|
</div>
|
|
|
|
</el-card>
|
|
|
|
<div slot="footer" class="dialog-footer" style="text-align: center">
|
|
|
|
<el-button type="primary" size="small" @click="handleConfirm">确定</el-button>
|
|
|
|
<el-button size="small" @click="dialogVisible = false">取消</el-button>
|
|
|
|
</div>
|
|
|
|
</el-dialog>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import req from '@/api/operation/claimbilling'
|
|
|
|
import uploadImg from '@/components/uploadFile/uploadImg'
|
|
|
|
import { choiceSupplierInfo, getOrgSidByPath } from '@/api/Common/dictcommons'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'ClaimBillingAdd',
|
|
|
|
components: {
|
|
|
|
uploadImg
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
viewTitle: '',
|
|
|
|
viewState: 1,
|
|
|
|
submitdisabled: false,
|
|
|
|
tableKey: 1,
|
|
|
|
index: 0,
|
|
|
|
supplier_list: [],
|
|
|
|
formobj: {
|
|
|
|
billNo: '',
|
|
|
|
createByName: '',
|
|
|
|
createBySid: '',
|
|
|
|
deptName: '',
|
|
|
|
deptSid: '',
|
|
|
|
createOrgSid: '',
|
|
|
|
createTime: '',
|
|
|
|
detailList: [],
|
|
|
|
fileList: [],
|
|
|
|
invoiceKey: '',
|
|
|
|
invoiceMoney: '',
|
|
|
|
invoiceName: '',
|
|
|
|
invoiceSid: '',
|
|
|
|
invoiceValue: '',
|
|
|
|
nodeState: '',
|
|
|
|
procDefId: '',
|
|
|
|
procInstId: '',
|
|
|
|
remarks: '',
|
|
|
|
sid: '',
|
|
|
|
taskDefKey: '',
|
|
|
|
taskId: '',
|
|
|
|
useOrgName: '',
|
|
|
|
useOrgSid: ''
|
|
|
|
},
|
|
|
|
rules: {},
|
|
|
|
dialogVisible: false,
|
|
|
|
updateAction: process.env.VUE_APP_BASE_API + '/as/v1/AsBusclaimInvoiceBill/getExcelInfo',
|
|
|
|
fileList: [],
|
|
|
|
upload_list: [],
|
|
|
|
uploadResultMesssage: '',
|
|
|
|
uploadData: {
|
|
|
|
sid: ''
|
|
|
|
},
|
|
|
|
headers: {
|
|
|
|
token: window.sessionStorage.getItem('token')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
kpjeTtotal() {
|
|
|
|
let kpje = '0'
|
|
|
|
if (this.formobj.detailList.length > 0) {
|
|
|
|
this.formobj.detailList.forEach((e) => {
|
|
|
|
kpje = Math.round((parseFloat(kpje) + parseFloat(e.claimHourAmount) + parseFloat(e.claimGoodsAmount) + parseFloat(e.claimOutAmount) + parseFloat(e.claimSubsidyAmount) + parseFloat(e.claimOtherAmount)) * 100) / 100
|
|
|
|
})
|
|
|
|
}
|
|
|
|
return kpje
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
init() {
|
|
|
|
getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => {
|
|
|
|
if (res.success) {
|
|
|
|
this.formobj.createOrgSid = res.data
|
|
|
|
this.formobj.useOrgSid = res.data
|
|
|
|
}
|
|
|
|
})
|
|
|
|
choiceSupplierInfo({ deptSid: window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1) }).then((resp) => {
|
|
|
|
if (resp.success) {
|
|
|
|
this.supplier_list = resp.data
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
showAdd() {
|
|
|
|
this.viewTitle = '【新增】索赔单开票申请'
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$refs['form_obj'].clearValidate()
|
|
|
|
})
|
|
|
|
this.init()
|
|
|
|
req.init({ deptSid: window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1) }).then((res) => {
|
|
|
|
if (res.success && res.data !== null) {
|
|
|
|
this.formobj.invoiceName = res.data.invoiceName
|
|
|
|
this.formobj.invoiceSid = res.data.invoiceSid
|
|
|
|
this.formobj.invoiceValue = res.data.invoiceValue
|
|
|
|
this.formobj.invoiceKey = res.data.invoiceKey
|
|
|
|
}
|
|
|
|
})
|
|
|
|
this.formobj.createByName = window.sessionStorage.getItem('name')
|
|
|
|
this.formobj.createBySid = window.sessionStorage.getItem('userSid')
|
|
|
|
this.formobj.deptName = window.sessionStorage.getItem('defaultOrgPathName').substring(window.sessionStorage.getItem('defaultOrgPathName').lastIndexOf('/') + 1)
|
|
|
|
this.formobj.deptSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1)
|
|
|
|
var nowDate = new Date()
|
|
|
|
var date = {
|
|
|
|
year: nowDate.getFullYear(),
|
|
|
|
month: nowDate.getMonth() + 1,
|
|
|
|
day: nowDate.getDate()
|
|
|
|
}
|
|
|
|
this.formobj.createTime = date.year + '-' + (date.month >= 10 ? date.month : '0' + date.month) + '-' + (date.day >= 10 ? date.day : '0' + date.day)
|
|
|
|
},
|
|
|
|
showEdit(row) {
|
|
|
|
this.viewTitle = '【编辑】索赔单开票申请'
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$refs['form_obj'].clearValidate()
|
|
|
|
})
|
|
|
|
this.init()
|
|
|
|
req.fetchDetailsBySid({ sid: row.sid }).then((res) => {
|
|
|
|
if (res.success) {
|
|
|
|
this.formobj = res.data
|
|
|
|
this.formobj.instanceId = res.data.procInstId
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
supplierChange(value) {
|
|
|
|
const choose = this.supplier_list.filter((item) => item.sid === value)
|
|
|
|
if (choose !== null && choose.length > 0) {
|
|
|
|
this.formobj.invoiceName = choose[0].billingCompanyName
|
|
|
|
this.formobj.invoiceValue = choose[0].billingTypeValue
|
|
|
|
this.formobj.invoiceKey = choose[0].billingTypeKey
|
|
|
|
} else {
|
|
|
|
this.formobj.invoiceName = ''
|
|
|
|
this.formobj.invoiceValue = ''
|
|
|
|
this.formobj.invoiceKey = ''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
download() {
|
|
|
|
this.dialogVisible = true
|
|
|
|
this.fileList = []
|
|
|
|
this.upload_list = []
|
|
|
|
this.uploadResultMesssage = ''
|
|
|
|
},
|
|
|
|
downLoad() {
|
|
|
|
const loading = this.$loading({
|
|
|
|
lock: true,
|
|
|
|
text: 'Loading',
|
|
|
|
spinner: 'el-icon-loading',
|
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
})
|
|
|
|
req.downloadExcel().then((resp) => {
|
|
|
|
loading.close()
|
|
|
|
const blob = new Blob([resp], {
|
|
|
|
type: 'application/vnd.ms-excel'
|
|
|
|
})
|
|
|
|
const fileName = '厂家索赔单开票明细模板' + '.xls'
|
|
|
|
const elink = document.createElement('a')
|
|
|
|
elink.download = fileName
|
|
|
|
elink.style.display = 'nonde'
|
|
|
|
elink.href = URL.createObjectURL(blob)
|
|
|
|
document.body.appendChild(elink)
|
|
|
|
elink.click()
|
|
|
|
URL.revokeObjectURL(elink.href)
|
|
|
|
document.body.removeChild(elink)
|
|
|
|
}).catch(() => {
|
|
|
|
loading.close()
|
|
|
|
})
|
|
|
|
},
|
|
|
|
handleRemove() {
|
|
|
|
this.uploadResultMesssage = ''
|
|
|
|
},
|
|
|
|
submitUpload() {
|
|
|
|
this.$refs.upload.submit()
|
|
|
|
},
|
|
|
|
handleSuccess(resp, file, fileList) {
|
|
|
|
const _this = this
|
|
|
|
if (resp.success) {
|
|
|
|
_this.uploadResultMesssage = resp.msg
|
|
|
|
// 上传文件数据成功后立即保存数据
|
|
|
|
if (resp.data.length > 0 && resp.data !== null) {
|
|
|
|
this.upload_list = resp.data
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
_this.uploadResultMesssage = resp.msg
|
|
|
|
}
|
|
|
|
},
|
|
|
|
handleConfirm() {
|
|
|
|
if (this.upload_list.length === 0) {
|
|
|
|
this.$message({ showClose: true, type: 'error', message: '请先上传厂家索赔单开票明细' })
|
|
|
|
return
|
|
|
|
} else {
|
|
|
|
this.formobj.detailList = []
|
|
|
|
this.upload_list.forEach((e) => {
|
|
|
|
this.formobj.detailList.push({
|
|
|
|
claimBillNo: e.claimBillNo,
|
|
|
|
repairBillNo: e.billNo,
|
|
|
|
vehMark: e.vehMark,
|
|
|
|
vinNo: e.vinNo,
|
|
|
|
claimManufacturer: e.claimManufacturer,
|
|
|
|
claimHourAmount: e.claimHourAmount,
|
|
|
|
claimGoodsAmount: e.claimGoodsAmount,
|
|
|
|
claimOutAmount: e.claimOutAmount,
|
|
|
|
claimSubsidyAmount: e.claimSubsidyAmount,
|
|
|
|
claimRescueAmount: e.claimRescueAmount,
|
|
|
|
claimOtherAmount: e.claimOtherAmount,
|
|
|
|
remarks: '',
|
|
|
|
isUnanimous: e.isUnanimous
|
|
|
|
})
|
|
|
|
})
|
|
|
|
this.dialogVisible = false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
cellStyle({ row, column, rowIndex, columnIndex }) {
|
|
|
|
// 定义样式变量
|
|
|
|
let cell = ''
|
|
|
|
if (!row.isUnanimous) {
|
|
|
|
cell = 'color: #ff6961;'
|
|
|
|
return cell
|
|
|
|
}
|
|
|
|
},
|
|
|
|
saveOrUpdate() {
|
|
|
|
this.$refs['form_obj'].validate((valid) => {
|
|
|
|
if (valid) {
|
|
|
|
this.submitdisabled = true
|
|
|
|
this.formobj.invoiceMoney = this.kpjeTtotal
|
|
|
|
req.saveOrUpdate(this.formobj).then((res) => {
|
|
|
|
if (res.success) {
|
|
|
|
this.$message({ showClose: true, type: 'success', message: '保存成功' })
|
|
|
|
this.handleReturn('true')
|
|
|
|
} else {
|
|
|
|
this.submitdisabled = false
|
|
|
|
}
|
|
|
|
}).catch(() => {
|
|
|
|
this.submitdisabled = false
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
submit() {
|
|
|
|
this.$refs['form_obj'].validate((valid) => {
|
|
|
|
if (valid) {
|
|
|
|
this.submitdisabled = true
|
|
|
|
this.formobj.invoiceMoney = this.kpjeTtotal
|
|
|
|
req.submit(this.formobj).then((res) => {
|
|
|
|
if (res.success) {
|
|
|
|
this.$message({ showClose: true, type: 'success', message: '提交成功' })
|
|
|
|
this.handleReturn('true')
|
|
|
|
} else {
|
|
|
|
this.submitdisabled = false
|
|
|
|
}
|
|
|
|
}).catch(() => {
|
|
|
|
this.submitdisabled = false
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
handleReturn(isreload) {
|
|
|
|
if (isreload === 'true') this.$emit('reloadlist')
|
|
|
|
this.formobj = {
|
|
|
|
billNo: '',
|
|
|
|
createByName: '',
|
|
|
|
createBySid: '',
|
|
|
|
deptName: '',
|
|
|
|
deptSid: '',
|
|
|
|
createOrgSid: '',
|
|
|
|
createTime: '',
|
|
|
|
detailList: [],
|
|
|
|
fileList: [],
|
|
|
|
invoiceKey: '',
|
|
|
|
invoiceMoney: '',
|
|
|
|
invoiceName: '',
|
|
|
|
invoiceSid: '',
|
|
|
|
invoiceValue: '',
|
|
|
|
nodeState: '',
|
|
|
|
procDefId: '',
|
|
|
|
procInstId: '',
|
|
|
|
remarks: '',
|
|
|
|
sid: '',
|
|
|
|
taskDefKey: '',
|
|
|
|
taskId: '',
|
|
|
|
useOrgName: '',
|
|
|
|
useOrgSid: ''
|
|
|
|
}
|
|
|
|
this.submitdisabled = false
|
|
|
|
this.$emit('doback')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.span-sty {
|
|
|
|
width: 130px !important;
|
|
|
|
}
|
|
|
|
.addinputInfo {
|
|
|
|
margin-left: 120px !important;
|
|
|
|
}
|
|
|
|
/deep/ .el-form-item__error {
|
|
|
|
margin-left: 120px !important;
|
|
|
|
}
|
|
|
|
</style>
|