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