Browse Source

完善开票申请增加生成合同、下载合同功能

master
yunuo970428 1 year ago
parent
commit
674cccb3c3
  1. 12
      anrui-buscenter/anrui-finmanage-ui/src/api/anruifinmanagement/finwaitinvoiceapply.js
  2. 75
      anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/finginvoiceapply/backups/finginvoiceapplyAdd.vue
  3. 76
      anrui-buscenter/anrui-finmanage-ui/src/views/workFlow/kaipiaoguanliFlow/finginvoiceapplyEdit.vue

12
anrui-buscenter/anrui-finmanage-ui/src/api/anruifinmanagement/finwaitinvoiceapply.js

@ -205,3 +205,15 @@ export function deliveredFinSelect(data) {
}) })
} }
// 生成合同
export function saveInvoicedApplyInfoPdf(data) {
return request({
url: '/fin/v1/finbillapplication/saveInvoicedApplyInfoPdf',
method: 'get',
params: data,
headers: {
'Content-Type': 'application/json'
}
})
}

75
anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/finginvoiceapply/backups/finginvoiceapplyAdd.vue

@ -171,6 +171,13 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div style="padding-bottom: 1px;border: 1px solid #E0E3EB" class="titleOne">
<div style="color: red;font-weight: bold">:若开票信息需要修改时请在修改后点击生成合同按钮重新生成相关附件</div>
<div>
<el-button type="primary" size="mini" class="btntopblueline" style="padding-right: 10px" @click="handleCreate()">生成合同</el-button>
<el-button type="primary" size="mini" class="btntopblueline" @click="handleDownLoad(formobj.allDownloadUrl)">下载合同</el-button>
</div>
</div>
<div class="title">证件(营业执照或身份证)</div> <div class="title">证件(营业执照或身份证)</div>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
@ -201,7 +208,7 @@
</template> </template>
<script> <script>
import { fetchDetailsBySid, saveOrUpdate, submit, fetchByContractNo } from '@/api/anruifinmanagement/finwaitinvoiceapply' import { fetchDetailsBySid, saveOrUpdate, submit, fetchByContractNo, saveInvoicedApplyInfoPdf } from '@/api/anruifinmanagement/finwaitinvoiceapply'
import { selectAllDisList2, typeValues } from '@/api/jichuxinxi/dictcommons' import { selectAllDisList2, typeValues } from '@/api/jichuxinxi/dictcommons'
import upload from '@/components/uploadFile/upload' import upload from '@/components/uploadFile/upload'
import salesOrder from '@/components/publicPage/salesOrder' import salesOrder from '@/components/publicPage/salesOrder'
@ -232,6 +239,7 @@ export default {
image_list2: [], image_list2: [],
image_list4: [], image_list4: [],
formobj: { formobj: {
allDownloadUrl: '',
applyDate: '', applyDate: '',
arrearsMoney: '', arrearsMoney: '',
arrearsOpenYYKey: '', arrearsOpenYYKey: '',
@ -526,23 +534,76 @@ export default {
this.viewState = 3 this.viewState = 3
this.$refs['divAdd'].showEdit(this.formobj.openTickName, this.formobj.useOrgSid, this.openTick_list, '开票申请') this.$refs['divAdd'].showEdit(this.formobj.openTickName, this.formobj.useOrgSid, this.openTick_list, '开票申请')
}, },
handleCreate() {
if (this.formobj.oneBillMoney === '') {
this.$message({ showClose: true, type: 'error', message: '单台开票金额不能为空' })
return
}
for (var i = 0; i < this.formobj.finBillVehicles.length; i++) {
if (this.formobj.finBillVehicles[i].openTickName === '') {
this.$message({ showClose: true, type: 'error', message: this.formobj.finBillVehicles[i].vinNo + '的开票名称不能为空' })
return
}
}
const loading = this.$loading({
lock: true,
text: '附件信息正在生成中,请稍等',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
saveInvoicedApplyInfoPdf(this.formobj).then((res) => {
if (res.success) {
loading.close()
this.formobj.sid = res.data.sid
this.formobj.allDownloadUrl = res.data.allDownloadUrl
this.$message({ showClose: true, type: 'success', message: res.msg })
}
})
},
handleDownLoad(val) {
if (val !== null && val !== '' && val !== undefined) {
window.open(val, '_blank')
} else {
this.$message({ showClose: true, type: 'error', message: '请生成附件后再下载' })
return
}
},
handleSave() { handleSave() {
if (this.formobj.oneBillMoney === '') { if (this.formobj.oneBillMoney === '') {
this.$message({ showClose: true, type: 'error', message: '单条开票金额不能为空' }) this.$message({ showClose: true, type: 'error', message: '单开票金额不能为空' })
return return
} }
for (var i = 0; i < this.formobj.finBillVehicles.length; i++) {
if (this.formobj.finBillVehicles[i].openTickName === '') {
this.$message({ showClose: true, type: 'error', message: this.formobj.finBillVehicles[i].vinNo + '的开票名称不能为空' })
return
}
if (this.formobj.finBillVehicles[i].openTickRemarks === '') {
this.$message({ showClose: true, type: 'error', message: this.formobj.finBillVehicles[i].vinNo + '的开票信息为空,请完善经销商信息或客户信息' })
return
}
}
this.$refs['form_obj'].validate((valid) => { this.$refs['form_obj'].validate((valid) => {
if (valid) { if (valid) {
this.getUrl() this.getUrl()
this.submitdisabled = true this.submitdisabled = true
const loading = this.$loading({
lock: true,
text: '附件信息正在生成中,请稍等',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
saveOrUpdate(this.formobj).then((res) => { saveOrUpdate(this.formobj).then((res) => {
if (res.success) { if (res.success) {
loading.close()
this.$message({ showClose: true, type: 'success', message: '保存成功' }) this.$message({ showClose: true, type: 'success', message: '保存成功' })
this.handleReturn('true') this.handleReturn('true')
} else { } else {
loading.close()
this.submitdisabled = false this.submitdisabled = false
} }
}).catch(() => { }).catch(() => {
loading.close()
this.submitdisabled = false this.submitdisabled = false
}) })
} }
@ -567,14 +628,23 @@ export default {
if (valid) { if (valid) {
this.getUrl() this.getUrl()
this.submitdisabled = true this.submitdisabled = true
const loading = this.$loading({
lock: true,
text: '附件信息正在生成中,请稍等',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
submit(this.formobj).then((res) => { submit(this.formobj).then((res) => {
if (res.success) { if (res.success) {
loading.close()
this.$message({ showClose: true, type: 'success', message: '提交成功' }) this.$message({ showClose: true, type: 'success', message: '提交成功' })
this.handleReturn('true') this.handleReturn('true')
} else { } else {
loading.close()
this.submitdisabled = false this.submitdisabled = false
} }
}).catch(() => { }).catch(() => {
loading.close()
this.submitdisabled = false this.submitdisabled = false
}) })
} }
@ -650,6 +720,7 @@ export default {
handleReturn(isreload) { handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist') if (isreload === 'true') this.$emit('reloadlist')
this.formobj = { this.formobj = {
allDownloadUrl: '',
applyDate: '', applyDate: '',
arrearsMoney: '', arrearsMoney: '',
arrearsOpenYYKey: '', arrearsOpenYYKey: '',

76
anrui-buscenter/anrui-finmanage-ui/src/views/workFlow/kaipiaoguanliFlow/finginvoiceapplyEdit.vue

@ -170,6 +170,13 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div style="padding-bottom: 1px;border: 1px solid #E0E3EB" class="titleOne">
<div style="color: red;font-weight: bold">:若开票信息需要修改时请在修改后点击生成合同按钮重新生成相关附件</div>
<div>
<el-button type="primary" size="mini" class="btntopblueline" style="padding-right: 10px" @click="handleCreate()">生成合同</el-button>
<el-button type="primary" size="mini" class="btntopblueline" @click="handleDownLoad(formobj.allDownloadUrl)">下载合同</el-button>
</div>
</div>
<div class="title">证件(营业执照或身份证)</div> <div class="title">证件(营业执照或身份证)</div>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
@ -201,7 +208,7 @@
</template> </template>
<script> <script>
import { fetchDetailsBySid, saveOrUpdate, submit, fetchByContractNo } from '@/api/anruifinmanagement/finwaitinvoiceapply' import { fetchDetailsBySid, saveOrUpdate, submit, fetchByContractNo, saveInvoicedApplyInfoPdf } from '@/api/anruifinmanagement/finwaitinvoiceapply'
import { selectAllDisList2, typeValues } from '@/api/jichuxinxi/dictcommons' import { selectAllDisList2, typeValues } from '@/api/jichuxinxi/dictcommons'
import upload from '@/components/uploadFile/upload' import upload from '@/components/uploadFile/upload'
import salesOrder from '../publicPage/salesOrder' import salesOrder from '../publicPage/salesOrder'
@ -232,6 +239,7 @@ export default {
image_list2: [], image_list2: [],
image_list4: [], image_list4: [],
formobj: { formobj: {
allDownloadUrl: '',
applyDate: '', applyDate: '',
arrearsMoney: '', arrearsMoney: '',
arrearsOpenYYKey: '', arrearsOpenYYKey: '',
@ -543,17 +551,72 @@ export default {
this.viewState = 3 this.viewState = 3
this.$refs['divAdd'].showEdit(this.formobj.openTickName, this.formobj.useOrgSid, this.openTick_list, '开票申请') this.$refs['divAdd'].showEdit(this.formobj.openTickName, this.formobj.useOrgSid, this.openTick_list, '开票申请')
}, },
handleCreate() {
if (this.formobj.oneBillMoney === '') {
this.$message({ showClose: true, type: 'error', message: '单台开票金额不能为空' })
return
}
for (var i = 0; i < this.formobj.finBillVehicles.length; i++) {
if (this.formobj.finBillVehicles[i].openTickName === '') {
this.$message({ showClose: true, type: 'error', message: this.formobj.finBillVehicles[i].vinNo + '的开票名称不能为空' })
return
}
}
const loading = this.$loading({
lock: true,
text: '附件信息正在生成中,请稍等',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
saveInvoicedApplyInfoPdf(this.formobj).then((res) => {
if (res.success) {
loading.close()
this.formobj.sid = res.data.sid
this.formobj.allDownloadUrl = res.data.allDownloadUrl
this.$message({ showClose: true, type: 'success', message: res.msg })
}
})
},
handleDownLoad(val) {
if (val !== null && val !== '' && val !== undefined) {
window.open(val, '_blank')
} else {
this.$message({ showClose: true, type: 'error', message: '请生成附件后再下载' })
return
}
},
handleSave() { handleSave() {
if (this.formobj.oneBillMoney === '') { if (this.formobj.oneBillMoney === '') {
this.$message({ showClose: true, type: 'error', message: '单条开票金额不能为空' }) this.$message({ showClose: true, type: 'error', message: '单条开票金额不能为空' })
return return
} }
for (var i = 0; i < this.formobj.finBillVehicles.length; i++) {
if (this.formobj.finBillVehicles[i].openTickName === '') {
this.$message({showClose: true, type: 'error', message: this.formobj.finBillVehicles[i].vinNo + '的开票名称不能为空'})
return
}
if (this.formobj.finBillVehicles[i].openTickRemarks === '') {
this.$message({
showClose: true,
type: 'error',
message: this.formobj.finBillVehicles[i].vinNo + '的开票信息为空,请完善经销商信息或客户信息'
})
return
}
}
this.$refs['form_obj'].validate((valid) => { this.$refs['form_obj'].validate((valid) => {
if (valid) { if (valid) {
this.getUrl() this.getUrl()
this.submitdisabled = true this.submitdisabled = true
const loading = this.$loading({
lock: true,
text: '附件信息正在生成中,请稍等',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
saveOrUpdate(this.formobj).then((res) => { saveOrUpdate(this.formobj).then((res) => {
if (res.success) { if (res.success) {
loading.close()
this.$message({ showClose: true, type: 'success', message: '保存成功' }) this.$message({ showClose: true, type: 'success', message: '保存成功' })
// () // ()
window.parent.postMessage({ window.parent.postMessage({
@ -564,9 +627,11 @@ export default {
} }
}, '*') }, '*')
} else { } else {
loading.close()
this.submitdisabled = false this.submitdisabled = false
} }
}).catch(() => { }).catch(() => {
loading.close()
this.submitdisabled = false this.submitdisabled = false
}) })
} }
@ -591,8 +656,15 @@ export default {
if (valid) { if (valid) {
this.getUrl() this.getUrl()
this.submitdisabled = true this.submitdisabled = true
const loading = this.$loading({
lock: true,
text: '附件信息正在生成中,请稍等',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
submit(this.formobj).then((res) => { submit(this.formobj).then((res) => {
if (res.success) { if (res.success) {
loading.close()
this.$message({ showClose: true, type: 'success', message: '提交成功' }) this.$message({ showClose: true, type: 'success', message: '提交成功' })
// () // ()
window.parent.postMessage({ window.parent.postMessage({
@ -603,9 +675,11 @@ export default {
} }
}, '*') }, '*')
} else { } else {
loading.close()
this.submitdisabled = false this.submitdisabled = false
} }
}).catch(() => { }).catch(() => {
loading.close()
this.submitdisabled = false this.submitdisabled = false
}) })
} }

Loading…
Cancel
Save