Commit e15a9d5e by 乔延琦

Merge branch 'invoice-20220511' into 'develop'

Invoice 20220511

See merge request GFP/RBC/rbc-frontend!175
parents c79beba4 add12222
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/essential',
'eslint:recommended'
],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-unused-vars': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'vue/no-unused-components': 'off',
'vue/no-side-effects-in-computed-properties': 'off',
// 'vue/require-v-for-key': 'off',
'vue/no-unused-vars': 'off',
'no-prototype-builtins': 'off',
'no-extra-semi': 'off',
}
}
......@@ -102,3 +102,18 @@ export const loadScript = (url) => {
document.head.appendChild(scriptElement)
})
}
export const formatCurrency = (number) => {
const rawNumber = number
try {
number = Number(number).toFixed(2)
return isNaN(number)
? rawNumber
: (number + '').replace(/\d{1,3}(?=(\d{3})+(\.))/g, (match) => {
return match + ',';
})
} catch (error) {
return rawNumber
}
}
......@@ -20,8 +20,13 @@ export default {
`/yxgl/deleteImage`,
[...this.selectedRows],
).then((res) => {
if (res.data && res.data.code != 0) {
this.$Message.error(res.data.msg)
if (res.data) {
if (res.data.code != 0) {
this.$Message.error(res.data.msg)
}
else {
this.$Message.success('删除成功')
}
}
}).catch(() => {
this.$Message.warning('删除失败');
......
......@@ -28,8 +28,13 @@ export default {
`/yxgl/ocr`,
{ ...this.selectedRows[0] }
).then((res) => {
if (res.data && res.data.code != 0) {
this.$Message.error(res.data.msg)
if (res.data) {
if (res.data.code != 0) {
this.$Message.error(res.data.msg)
}
else {
this.$Message.success(res.data.msg)
}
}
}).finally(() => {
this.$emit('after-click')
......
......@@ -4,6 +4,7 @@
:on-change="handleFileChange"
:http-request="handleClick"
:show-file-list="false"
:multiple="true"
>
<Button size="small" type="text" @click="handleClick">票据导入</Button>
</el-upload>
......@@ -24,9 +25,6 @@ export default {
}
},
computed: {
baseUrl() {
return'http://10.2.9.28:8091'
}
},
methods: {
handleFileChange(file) {
......
......@@ -54,6 +54,7 @@
size="small"
v-model="imageInfo[item.key]"
></Input>
<span v-else-if="item.type == 'currency'">{{ formatCurrency(imageInfo[item.key]) }}</span>
<span v-else>{{ imageInfo[item.key] }}</span>
</div>
......@@ -66,6 +67,8 @@
<script>
import moment from 'moment'
import { formatCurrency } from '../../../../@gms/gms-plugin-billexpand/src/utils'
export default {
props: {
isInfoEdit: {
......@@ -166,14 +169,17 @@ export default {
noTaxMoney: {
label: '金额',
key: 'noTaxMoney',
type: 'currency',
},
taxMoney: {
label: '税额',
key: 'taxMoney',
type: 'currency',
},
totalMoney: {
label: '价税合计',
key: 'totalMoney',
type: 'currency',
},
invoiceCheckCode: {
label: '校验码',
......@@ -217,6 +223,7 @@ export default {
trainMoney: {
label: '火车票总金额',
key: 'trainMoney',
type: 'currency',
},
seatType: {
label: '坐位类别',
......@@ -250,11 +257,12 @@ export default {
fareMoney: {
label: '票价',
key: 'fareMoney',
type: 'money',
type: 'currency',
},
fuelsurCharge: {
label: '燃油附加费',
key: 'fuelsurCharge',
type: 'currency',
},
caacDevelopmentFund: {
label: '民航发展基金',
......@@ -263,6 +271,7 @@ export default {
insurance: {
label: '保险费',
key: 'insurance',
type: 'currency',
},
},
itemTypeMap: {
......@@ -409,6 +418,9 @@ export default {
}
},
methods: {
formatCurrency(number) {
return formatCurrency(number)
},
formatDate(date) {
return moment(date).format('YYYY-MM-DD')
},
......@@ -423,7 +435,6 @@ export default {
.invoice-image-info-content {
position: relative;
overflow: hidden;
height: 265px;
overflow-y: scroll;
form {
.ivu-row {
......
......@@ -69,11 +69,16 @@ export default {
`/yxgl/verification`,
{ ...this.imageInfo }
).then((res) => {
if (res.data && res.data.code != 0) {
this.$Message.error(res.data.msg)
if (res.data) {
if (res.data.code != 0) {
this.$Message.error(res.data.msg)
}
else {
this.$Message.success(res.data.msg)
}
}
}).finally(() => {
this.queryImageInfo()
this.queryImageInfo(this.tabKey)
})
},
handleSave() {
......@@ -85,7 +90,7 @@ export default {
this.queryImageInfo()
})
},
queryImageInfo() {
queryImageInfo(tabKey = 0) {
this.loading = true
window.GMS.$http.post(
`/yxgl/selectDetails`,
......@@ -97,7 +102,7 @@ export default {
label: `发票${index + 1}`,
value: index,
}))
this.tabKey = 0
this.tabKey = tabKey
this.imageInfo = { ...(res?.data?.rows?.[this.tabKey] || {}) }
this.$emit('load-info', this.imageInfoList)
})
......@@ -124,7 +129,7 @@ export default {
content: "";
width: 3px;
height: 16px;
background: #4bc0c6;
background: #005791;
}
.title {
margin-left: 12px;
......
......@@ -57,7 +57,7 @@ export default {
font-weight: 400;
line-height: 20px;
font-weight: 500;
color: #03A4AD;
color: #005791;
}
}
}
......
......@@ -17,7 +17,18 @@
{{row.sourceType == 1 ? '移动端' : 'PC端'}}
</template>
<template slot-scope="{ row }" slot="taskType">
{{row.taskType == 0 ? '识别失败' : row.taskType == 1 ? '识别成功' : '未识别'}}
{{
row.taskType == 0
? '识别失败'
: row.taskType == 1
? '识别成功'
: row.taskType == 2
? '无需识别'
: '未识别'
}}
</template>
<template slot-scope="{ row }" slot="createTime">
{{formatTime(row.createTime)}}
</template>
</Table>
<div class="pagination">
......@@ -51,6 +62,7 @@
</template>
<script>
import moment from 'moment'
import ImageTab from './image-tab.vue'
import ImageInfo from './image-info.vue'
import { getImgUrl, verificationTypeList } from '../utils'
......@@ -113,11 +125,11 @@ export default {
},
{
title: '文件名称',
key: 'imageFileName',
key: 'customName',
},
{
title: '上传时间',
key: 'createTime',
slot: 'createTime',
}
],
tableData: [
......@@ -160,6 +172,9 @@ export default {
}
},
methods: {
formatTime(str) {
return moment(str).format('YYYY-MM-DD HH:mm:ss')
},
viewImage() {
const imageId = this.currentSelection[0].id
const yearFlag = this.currentSelection[0].yearFlag
......
<template>
<div class="main">
<Toolbar>
<UploadButton @after-click="queryImageInfo" />
<DeleteButton :selectedRows="currentSelection" @after-click="queryImageInfo" />
<EditDescriptionButton v-if="mode == 0" :selectedRows="currentSelection" @after-click="queryImageInfo" />
......@@ -9,7 +8,7 @@
<TransmitButton v-if="mode == 0" :selectedRows="currentSelection" @after-click="queryImageInfo" />
<TransmitTrackButton v-if="mode == 0" :selectedRows="currentSelection" />
</Toolbar>
<SearchBar @search="handleSearch" />
<SearchBar style="margin-top: 32px" @search="handleSearch" />
<div class="image-table-wrapper">
<ImageTable :mode="mode" :searchParams="searchParams" ref="imageTable" @selectionChange="handleSelectionChange" />
</div>
......@@ -75,14 +74,12 @@ export default {
<style lang="less" scoped>
.main {
width: 100%;
height: 100%;
background-color: white;
display: flex;
flex-direction: column;
position: relative;
.image-table-wrapper {
flex: 1;
width: 100%;
height: 850px;
padding: 12px;
background-color: #F8F8F8;
}
......
......@@ -7,14 +7,20 @@
:value="dateRange"
@on-change="dateRange = $event"
></DatePicker>
<div class="margin-left-5"></div>
<span class="search-bar-label">数据来源:</span>
<Select v-model="searchParam.sourceType" style="width:200px" clearable>
<Option v-for="item in sourceTypeOptions" :value="item.value" :key="item.value">{{ item.label }}</Option>
</Select>
<div class="margin-left-5"></div>
<span class="search-bar-label">识别任务状态:</span>
<Select v-model="searchParam.taskType" style="width:200px" clearable>
<Option v-for="item in taskTypeOptions" :value="item.value" :key="item.value">{{ item.label }}</Option>
</Select>
<div class="margin-left-5"></div>
<Button size="small" ghost type="primary" @click="handleSearch">查询</Button>
<Button size="small" @click="resetSearch">重置</Button>
</div>
......@@ -46,8 +52,8 @@ export default {
label: '识别成功',
},
{
value: 2,
label: '识别',
value: 3,
label: '识别',
},
],
searchParam: {},
......@@ -85,6 +91,9 @@ export default {
button {
margin-right: 10px;
}
.margin-left-5 {
margin-left: 10px;
}
.search-bar-label {
height: 17px;
font-size: 12px;
......@@ -92,15 +101,5 @@ export default {
color: #888888;
line-height: 17px;
}
.ivu-date-picker {
input {
border: none;
}
}
.ivu-select {
.ivu-select-selection {
border: none;
}
}
}
</style>
\ No newline at end of file
......@@ -12,7 +12,11 @@ export default {
}
return h(
'div',
{ attrs: { class: 'toolbar-wrapper' } },
{
attrs: {
class: `toolbar-wrapper ${'toolbar-wrapper-fixed'}`
}
},
children,
)
},
......@@ -23,9 +27,12 @@ export default {
.toolbar-wrapper {
padding: 0 16px;
height: 32px;
width: 100%;
background-color: white;
border-bottom: 1px solid #DDD;
display: flex;
align-items: center;
z-index: 999;
.divider {
margin: 0 16px;
width: 1px;
......@@ -34,4 +41,8 @@ export default {
}
}
.toolbar-wrapper-fixed {
position: fixed;
}
</style>
\ No newline at end of file
......@@ -11,6 +11,7 @@ export const verificationTypeList = [
'00103',
'002',
'00104',
'008',
]
export const getImgUrl = (objId, yearFlag) => {
......
......@@ -252,23 +252,26 @@ export default {
this.loginTitle = obj[0] && obj[0].title || this.loginTitle
bgImgCode
? this.getImgUrl(bgImgCode).then((url) => {
this.loginImageBg = url
this.imgLoading -= 1
})
this.loginImageBg = url
}).finally(() => {
this.imgLoading -= 1
})
: this.imgLoading -= 1
iconCode
? this.getImgUrl(iconCode).then((url) => {
this.loginIcon = url
this.imgLoading -= 1
})
this.loginIcon = url
}).finally(() => {
this.imgLoading -= 1
})
: this.imgLoading -= 1
const boxImgCode = obj[1] && obj[1].icon
this.titleColor = obj[1] && obj[1].ext1 || this.titleColor
boxImgCode
? this.getImgUrl(boxImgCode).then((url) => {
this.boxImgUrl = url
this.imgLoading -= 1
})
this.boxImgUrl = url
}).finally(() => {
this.imgLoading -= 1
})
: this.imgLoading -= 1
}).catch(() => {
this.imgLoading = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment