Commit e21d9277 authored by chenwei's avatar chenwei

feat: 字典和翻译 财务2.2相关

parent 696ef223
This diff is collapsed.
<template> <template>
<el-select :clearable="clearable" v-model="valueSync" :multiple="multiple" :disabled="disabled" :filterable="filterable" :placeholder="$t('请选择')"> <el-select :clearable="clearable" v-model="valueSync" :multiple="multiple" :disabled="disabled" :filterable="filterable" :placeholder="$t('请选择')" @change="(val) => $emit('change', val)">
<el-option v-for="item in optionsFormated" :key="item.key" :label="item.label" :value="item.value" /> <el-option v-for="item in optionsFormated" :key="item.key" :label="item.label" :value="item.value" />
</el-select> </el-select>
</template> </template>
<script> <script>
export default { export default {
data(){ data() {
return { return {
valueSync: undefined valueSync: undefined
} }
},
props: {
options: Array,
value: [String, Number, Array, Boolean, Object],
labelField: {
type: [String, Function],
default: "label"
},
valueField: {
type: String,
default: "value"
}, },
props:{ keyField: {
options: Array, type: String,
value: [String, Number, Array, Boolean, Object], default: "value"
labelField: {
type: [String, Function],
default: 'label'
},
valueField: {
type: String,
default: 'value'
},
keyField:{
type: String,
default: 'value'
},
filterable: Boolean,
multiple: Boolean,
clearable: Boolean,
defaultable: Boolean, // 没有值的时候是否选择第一项
disabled: Boolean,
test: String
}, },
computed:{ filterable: Boolean,
optionsFormated(){ multiple: Boolean,
let arr = [] clearable: Boolean,
this.options.forEach((item, index) => { defaultable: Boolean, // 没有值的时候是否选择第一项
arr.push({ disabled: Boolean,
label: typeof this.labelField == 'string' ? item[this.labelField] : (this.labelField)(item, index), test: String
value: item[this.valueField], },
key: item[this.keyField] computed: {
}) optionsFormated() {
}) let arr = []
return arr this.options.forEach((item, index) => {
} arr.push({
label: typeof this.labelField == "string" ? item[this.labelField] : this.labelField(item, index),
value: item[this.valueField],
key: item[this.keyField]
})
})
return arr
}
},
watch: {
valueSync(val) {
console.log("valueSync变化", val, this.value)
this.$emit("input", val)
}, },
watch:{ value(value) {
valueSync(val){ console.log("value传值变化", value, this.valueSync)
console.log('valueSync变化', val, this.value) if (value !== undefined) this.valueSync = value
this.$emit('input', val)
},
value(value){
console.log('value传值变化', value, this.valueSync)
if(value !== undefined)this.valueSync = value
},
optionsFormated(){
this.setDefault()
},
test(val, old){
console.warn('test变化', val, old)
}
}, },
created(){ optionsFormated() {
if(this.test == 'allPriceUnit'){ this.setDefault()
console.log('allPriceUnit selector', this.value, this.defaultable)
}
this.valueSync = this.value
this.setDefault()
}, },
methods:{ test(val, old) {
setDefault(){ console.warn("test变化", val, old)
if(!this.defaultable){ }
return false },
} created() {
if(this.optionsFormated.length && (this.valueSync == null || this.valueSync == '')){ if (this.test == "allPriceUnit") {
this.valueSync = this.optionsFormated[0].value console.log("allPriceUnit selector", this.value, this.defaultable)
} }
} this.valueSync = this.value
this.setDefault()
},
methods: {
setDefault() {
if (!this.defaultable) {
return false
}
if (this.optionsFormated.length && (this.valueSync == null || this.valueSync == "")) {
this.valueSync = this.optionsFormated[0].value
}
} }
}
} }
</script> </script>
...@@ -740,6 +740,7 @@ ...@@ -740,6 +740,7 @@
"请输入邮箱": "please input your email", "请输入邮箱": "please input your email",
"设为默认": "set as Default", "设为默认": "set as Default",
"请输入发票抬头": "Please enter the title of the invoice", "请输入发票抬头": "Please enter the title of the invoice",
"请输入开票品名": "Please enter the invoice name",
"纳税人识别号": "Taxpayer Identification Number", "纳税人识别号": "Taxpayer Identification Number",
"请输入纳税人识别号": "Please enter the taxpayer identification number", "请输入纳税人识别号": "Please enter the taxpayer identification number",
"开户行": "Opening Bank", "开户行": "Opening Bank",
...@@ -4723,5 +4724,102 @@ ...@@ -4723,5 +4724,102 @@
"请输入免泡重量": "请输入免泡重量", "请输入免泡重量": "请输入免泡重量",
"出货撤回": "出货撤回", "出货撤回": "出货撤回",
"启用时间": "Enable Time", "启用时间": "Enable Time",
"等级": "Level" "等级": "Level",
"此操作将修改自动核销比例?": "Will this action modify the automatic write-off ratio?",
"请输入核销比例下界": "Please enter the lower bound of the write-off ratio",
"请输入核销比例上界": "Please enter the upper bound of the write-off ratio",
"银行收款明细对应核销比例设置": "Bank collection details corresponding to the write-off ratio setting",
"单位(%)": "Unit (%)",
"核销比例数值错误": "Error in the value of the write-off ratio",
"未核销金额合计": "Total amount not written off",
"核销金额合计": "Total amount of write-off ",
"金额合计": "Total amount ",
"实际金额": "Actual amount ",
"核销金额": "Write-off amount ",
"未核销金额": "Unwritten amount ",
"箱数/体积/重量": "Carton number/Volume/Weight ",
"关联收款单": "Associated receipt ",
"关联银行收款明细": "Related bank Collection Details ",
"最后修改信息": "Last modified information ",
"最后审批信息": "Final Approval Information",
"已核销本币金额": "Amount written off in local currency",
"未核销本币金额": "Amount not written off in local currency",
"基准币种({currency})汇率": "Base currency ({currency}) exchange rate",
"基准金额({currency})": "Base Amount ({currency})",
"已核销金额({currency})": "Written off Amount ({currency})",
"未核销金额({currency})": "Unwritten amount ({currency})",
"开票编号": "Invoice Number",
"开票状态": "Invoice Status",
"开票资料状态": "Billing Data Status ",
"开票申请信息": "Invoice Application Information",
"应收总{currency}": "Total receivable {currency}",
"已收总{currency}": "Total {currency} received",
"总核销比例({currency})": "Total write-off ratio ({currency})",
"开票资料备注": "Remarks on Billing Information",
"开票品名": "Name of invoicing item",
"开票取消人": "Bill canceller",
"开票取消时间": "Billing and Cancellation time",
"驳回备注": "Remarks on rejection",
"账单信息": "Bill information",
"订单号/提单号": "Order number/Bill of lading number",
"结算币种金额": "Amount of settlement currency",
"收款状态/核销比例": "Collection status/write-off ratio",
"收款编号": "Payment collection number",
"申请人/部门": "Applicant/Department",
"开票抬头": "invoice title",
"开票金额": "invoice amount",
"订单/提单": "Order/bill of lading",
"请输入开票编号": "Please enter the billing number",
"请输入收款编号": "Please enter the collection number",
"驳回资料": "Rejected Information ",
"取消开票": "Cancel billing ",
"提交开票": "Submit invoicing",
"修改开票申请": "Application for Amendment of Billing",
"驳回信息": "Rejection of information",
"确认驳回资料": "Confirm rejection of information",
"取消信息": "Cancel Information",
"取消备注": "Cancellation Remarks",
"确认取消开票": "Confirm cancellation",
"开票信息备注": "Billing Information Remarks",
"开票时间": "Billing Time",
"驳回": "Rejected",
"确认删除开票信息吗?": "Confirm to delete billing information?",
"确认驳回开票资料吗?": "Confirm the rejection of billing information?",
"确认取消开票资料吗?": "Confirm the cancellation information?",
"确认创建开票资料吗?": "Confirm the creation of billing information?",
"确认修改开票申请": "Confirm the application for modification of billing",
"确认更新开票资料吗?": "Confirm to update billing information?",
"请输入发票号码": "Please enter the invoice number",
"请选择开票类型": "Please select billing type",
"请输入开票人": "Please enter the ticket drawer",
"请输入开票金额": "Please enter the invoice amount",
"明细状态": "State of detail",
"删除开票备注": "Delete billing remarks",
"申请开票": "Apply for billing",
"导入银行收款信息": "Import bank collection information",
"环节": "link",
"生成路径": "Generating a path",
"合计金额": "Total amount",
"请注意:汇率已失效": "Please note: The exchange rate has expired",
"审核通过时间": "Approval time",
"基准金额": "Base amount",
"基准币种": "Base currency",
"流水号": "serial number",
"实际金额=含税金额-优惠金额": "Actual amount = tax-inclusive amount - preferential amount",
"核销误差兑额外费用主币种金额": "Write off the error against the amount of additional charge in main currency",
"本次实收基准金额小于上次填写核销金额总额,请注意": "Please note that the actual benchmark amount is less than the total amount of write-off filled in last time",
"填写核销金额总额大于本次实收基准金额,请重新填写": "The total amount of write-off is greater than the benchmark amount received this time, please fill in again",
"未填写核销金额>0 ,请检查": "Unfilled write-off amount >0, please check",
"本次填写核销金额总数大于实收基准金额": "The total amount of write-off filled in this time is greater than the benchmark amount actually received",
"请输入明细核销金额": "Please enter the detailed write-off amount",
"自动填写": "Fill in automatically",
"本次核销金额({currency})": "Amount of this write-off ({currency})",
"剩余核销金额({currency})": "Remaining write-off amount ({currency})",
"未填写核销金额": "The amount of write-off is not filled in",
"已填写核销金额": "The amount of verification has been filled in",
"基准金额{currency}": "Base amount {currency}",
"批量提交审核": "Batch submission for review",
"导入提示信息,请确认是否提交": "Import prompt information, please confirm whether to submit",
"银行收款信息模板": "Template of bank collection information",
"仅允许导入xls、xlsx格式文件。": "Only xls and xlsx format files are allowed to be imported."
} }
import Vue from 'vue' import Vue from "vue"
import Cookies from 'js-cookie' import Cookies from "js-cookie"
import Element from 'element-ui' import Element from "element-ui"
import './assets/styles/element-variables.scss' import "./assets/styles/element-variables.scss"
import '@/assets/styles/index.scss' // global css import "@/assets/styles/index.scss" // global css
import '@/assets/styles/ruoyi.scss' // ruoyi css import "@/assets/styles/ruoyi.scss" // ruoyi css
import App from './App' import App from "./App"
import store from './store' import store from "./store"
import router from './router' import router from "./router"
import directive from './directive' // directive import directive from "./directive" // directive
import plugins from './plugins' // plugins import plugins from "./plugins" // plugins
import Print from 'vue-print-nb' import Print from "vue-print-nb"
import './assets/icons' // icon import "./assets/icons" // icon
import './permission' // permission control import "./permission" // permission control
import './tongji' // 百度统计 import "./tongji" // 百度统计
import { getDicts } from "@/api/system/dict/data"; import { getDicts } from "@/api/system/dict/data"
import { getConfigKey } from "@/api/infra/config"; import { getConfigKey } from "@/api/infra/config"
import { parseTime, resetForm, addDateRange, addBeginAndEndTime, addBeginAndEndTimeNew, handleTree} from "@/utils/ruoyi"; import { parseTime, resetForm, addDateRange, addBeginAndEndTime, addBeginAndEndTimeNew, handleTree } from "@/utils/ruoyi"
import Pagination from "@/components/Pagination"; import { removeEmpty } from "@/utils/index"
import Pagination from "@/components/Pagination"
// 自定义表格工具扩展 // 自定义表格工具扩展
import RightToolbar from "@/components/RightToolbar" import RightToolbar from "@/components/RightToolbar"
import DictSelector from '@/components/DictSelector' import DictSelector from "@/components/DictSelector"
// 代码高亮插件 // 代码高亮插件
// import hljs from 'highlight.js' // import hljs from 'highlight.js'
// import 'highlight.js/styles/github-gist.css' // import 'highlight.js/styles/github-gist.css'
import {DICT_TYPE, getDictDataLabel, getDictDatas, getDictDatas2} from "@/utils/dict"; import { DICT_TYPE, getDictDataLabel, getDictDatas, getDictDatas2 } from "@/utils/dict"
import i18n from './i18n' import i18n from "./i18n"
// 全局方法挂载 // 全局方法挂载
Vue.prototype.getDicts = getDicts Vue.prototype.getDicts = getDicts
...@@ -39,40 +40,40 @@ Vue.prototype.getDictDatas2 = getDictDatas2 ...@@ -39,40 +40,40 @@ Vue.prototype.getDictDatas2 = getDictDatas2
Vue.prototype.getDictDataLabel = getDictDataLabel Vue.prototype.getDictDataLabel = getDictDataLabel
Vue.prototype.DICT_TYPE = DICT_TYPE Vue.prototype.DICT_TYPE = DICT_TYPE
Vue.prototype.handleTree = handleTree Vue.prototype.handleTree = handleTree
Vue.prototype.removeEmpty = removeEmpty
Date.prototype.format = function(format) { Date.prototype.format = function (format) {
var date = { var date = {
"M+": this.getMonth() + 1, "M+": this.getMonth() + 1,
"d+": this.getDate(), "d+": this.getDate(),
"h+": this.getHours(), "h+": this.getHours(),
"m+": this.getMinutes(), "m+": this.getMinutes(),
"s+": this.getSeconds(), "s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3), "q+": Math.floor((this.getMonth() + 3) / 3),
"S+": this.getMilliseconds() "S+": this.getMilliseconds()
}; }
if (/(y+)/i.test(format)) { if (/(y+)/i.test(format)) {
format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)); format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length))
} }
for (var k in date) { for (var k in date) {
if (new RegExp("(" + k + ")").test(format)) { if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length == 1 format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? date[k] : ("00" + date[k]).substr(("" + date[k]).length))
? date[k] : ("00" + date[k]).substr(("" + date[k]).length)); }
}
} }
return format; return format
} }
// 全局组件挂载 // 全局组件挂载
Vue.component('DictTag', DictTag) Vue.component("DictTag", DictTag)
Vue.component('DocAlert', DocAlert) Vue.component("DocAlert", DocAlert)
Vue.component('Pagination', Pagination) Vue.component("Pagination", Pagination)
Vue.component('RightToolbar', RightToolbar) Vue.component("RightToolbar", RightToolbar)
Vue.component('DictSelector', DictSelector) Vue.component("DictSelector", DictSelector)
// 字典标签组件 // 字典标签组件
import DictTag from '@/components/DictTag' import DictTag from "@/components/DictTag"
import DocAlert from '@/components/DocAlert' import DocAlert from "@/components/DocAlert"
// 头部标签插件 // 头部标签插件
import VueMeta from 'vue-meta' import VueMeta from "vue-meta"
Vue.use(directive) Vue.use(directive)
Vue.use(plugins) Vue.use(plugins)
...@@ -81,22 +82,22 @@ Vue.use(Print) ...@@ -81,22 +82,22 @@ Vue.use(Print)
// Vue.use(hljs.vuePlugin); // Vue.use(hljs.vuePlugin);
// bpmnProcessDesigner 需要引入 // bpmnProcessDesigner 需要引入
import MyPD from "@/components/bpmnProcessDesigner/package/index.js"; import MyPD from "@/components/bpmnProcessDesigner/package/index.js"
Vue.use(MyPD); Vue.use(MyPD)
import "@/components/bpmnProcessDesigner/package/theme/index.scss"; import "@/components/bpmnProcessDesigner/package/theme/index.scss"
import "bpmn-js/dist/assets/diagram-js.css"; import "bpmn-js/dist/assets/diagram-js.css"
import "bpmn-js/dist/assets/bpmn-font/css/bpmn.css"; import "bpmn-js/dist/assets/bpmn-font/css/bpmn.css"
import "bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css"; import "bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css"
import "bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css"; import "bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css"
// Form Generator 组件需要使用到 tinymce // Form Generator 组件需要使用到 tinymce
import Tinymce from '@/components/tinymce/index.vue' import Tinymce from "@/components/tinymce/index.vue"
Vue.component('tinymce', Tinymce) Vue.component("tinymce", Tinymce)
import '@/icons' import "@/icons"
import axios from 'axios' import axios from "axios"
Vue.prototype.$axios = axios Vue.prototype.$axios = axios
import '@/styles/index.scss' import "@/styles/index.scss"
import '@/styles/custom.scss' import "@/styles/custom.scss"
/** /**
* If you don't want to use mock-server * If you don't want to use mock-server
...@@ -108,40 +109,46 @@ import '@/styles/custom.scss' ...@@ -108,40 +109,46 @@ import '@/styles/custom.scss'
*/ */
Vue.use(Element, { Vue.use(Element, {
size: Cookies.get('size') || 'medium', // set element-ui default size size: Cookies.get("size") || "medium", // set element-ui default size
i18n: (key, value) => i18n.t(key, value) i18n: (key, value) => i18n.t(key, value)
}) })
// 重定向路由(关闭当前标签) // 重定向路由(关闭当前标签)
Vue.prototype.$redirect = (path) =>{ Vue.prototype.$redirect = (path) => {
let currentView = router.history.current let currentView = router.history.current
router.replace(path) router.replace(path)
store.dispatch("tagsView/delView", currentView) store.dispatch("tagsView/delView", currentView)
} }
window.ElementUI = Element window.ElementUI = Element
// 显示表单错误信息 // 显示表单错误信息
Vue.prototype.$showFormValidateErrors = (errors) => { Vue.prototype.$showFormValidateErrors = (errors) => {
let vm = new Vue() let vm = new Vue()
let createElement = vm.$createElement let createElement = vm.$createElement
let fieldList = Object.values(errors) let fieldList = Object.values(errors)
Element.Notification({ Element.Notification({
title: i18n.$t('表单错误'), title: i18n.$t("表单错误"),
type: 'warning', type: "warning",
duration: 3000, duration: 3000,
message: createElement('div', fieldList.map(function (errorList) { message: createElement(
return createElement('div', errorList.map((item) => { "div",
return createElement('div', item.message) fieldList.map(function (errorList) {
})) return createElement(
})) "div",
}) errorList.map((item) => {
return createElement("div", item.message)
})
)
})
)
})
} }
Vue.config.productionTip = false Vue.config.productionTip = false
new Vue({ new Vue({
el: '#app', el: "#app",
router, router,
store, store,
i18n, i18n,
render: h => h(App) render: (h) => h(App)
}) })
import router from "./router"; import router from "./router"
import store from "./store"; import store from "./store"
import { Message } from "element-ui"; import { Message } from "element-ui"
import NProgress from "nprogress"; import NProgress from "nprogress"
import "nprogress/nprogress.css"; import "nprogress/nprogress.css"
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth"
import { isRelogin } from "@/utils/request"; import { isRelogin } from "@/utils/request"
NProgress.configure({ showSpinner: false }); NProgress.configure({ showSpinner: false })
// 增加三方登陆 update by 芋艿 // 增加三方登陆 update by 芋艿
const whiteList = [ const whiteList = ["/login", "/social-login", "/auth-redirect", "/bind", "/register", "/oauthLogin/gitee"]
"/login",
"/social-login",
"/auth-redirect",
"/bind",
"/register",
"/oauthLogin/gitee",
];
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
NProgress.start(); NProgress.start()
if (to.matched && to.matched.length > 2) { if (to.matched && to.matched.length > 2) {
to.matched.splice(1, to.matched.length - 2); to.matched.splice(1, to.matched.length - 2)
} }
if (getToken()) { if (getToken()) {
to.meta.title && store.dispatch("settings/setTitle", to.meta.title); to.meta.title && store.dispatch("settings/setTitle", to.meta.title)
/* has token*/ /* has token*/
if (to.path === "/login") { if (to.path === "/login") {
next({ path: "/" }); next({ path: "/" })
NProgress.done(); NProgress.done()
} else { } else {
if (store.getters.roles.length === 0) { if (store.getters.roles.length === 0) {
isRelogin.show = true; isRelogin.show = true
// 获取字典数据 add by 芋艿 // 获取字典数据 add by 芋艿
store.dispatch("dict/loadDictDatas"); store.dispatch("dict/loadDictDatas")
//获取货币
store.dispatch("staticData/loadCurrencyList")
// 判断当前用户是否已拉取完user_info信息 // 判断当前用户是否已拉取完user_info信息
store store
.dispatch("GetInfo") .dispatch("GetInfo")
.then(() => { .then(() => {
isRelogin.show = false; isRelogin.show = false
store.dispatch("GenerateRoutes").then((accessRoutes) => { store.dispatch("GenerateRoutes").then((accessRoutes) => {
// 根据roles权限生成可访问的路由表 // 根据roles权限生成可访问的路由表
router.addRoutes(accessRoutes); // 动态添加可访问路由表 router.addRoutes(accessRoutes) // 动态添加可访问路由表
next({ ...to, replace: true }); // hack方法 确保addRoutes已完成 next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
}); })
}) })
.catch((err) => { .catch((err) => {
store.dispatch("LogOut").then(() => { store.dispatch("LogOut").then(() => {
Message.error(err); Message.error(err)
next({ path: "/" }); next({ path: "/" })
}); })
}); })
} else { } else {
next(); next()
} }
} }
} else { } else {
// 没有token // 没有token
if (whiteList.indexOf(to.path) !== -1) { if (whiteList.indexOf(to.path) !== -1) {
// 在免登录白名单,直接进入 // 在免登录白名单,直接进入
next(); next()
} else { } else {
next(`/login?redirect=${to.fullPath}`); // 否则全部重定向到登录页 next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
NProgress.done(); NProgress.done()
} }
} }
}); })
router.afterEach(() => { router.afterEach(() => {
NProgress.done(); NProgress.done()
}); })
import { getCurrency } from "@/api/ecw/currency"
const getters = { const getters = {
sidebar: state => state.app.sidebar, sidebar: (state) => state.app.sidebar,
size: state => state.app.size, size: (state) => state.app.size,
device: state => state.app.device, device: (state) => state.app.device,
visitedViews: state => state.tagsView.visitedViews, visitedViews: (state) => state.tagsView.visitedViews,
cachedViews: state => state.tagsView.cachedViews, cachedViews: (state) => state.tagsView.cachedViews,
userId: state => state.user.id, userId: (state) => state.user.id,
token: state => state.user.token, token: (state) => state.user.token,
avatar: state => state.user.avatar, avatar: (state) => state.user.avatar,
name: state => state.user.name, name: (state) => state.user.name,
introduction: state => state.user.introduction, introduction: (state) => state.user.introduction,
roles: state => state.user.roles, roles: (state) => state.user.roles,
permissions: state => state.user.permissions, permissions: (state) => state.user.permissions,
permission_routes: state => state.permission.routes, permission_routes: (state) => state.permission.routes,
// 工具栏 // 工具栏
topbarRouters:state => state.permission.topbarRouters, topbarRouters: (state) => state.permission.topbarRouters,
defaultRoutes:state => state.permission.defaultRoutes, defaultRoutes: (state) => state.permission.defaultRoutes,
sidebarRouters:state => state.permission.sidebarRouters, sidebarRouters: (state) => state.permission.sidebarRouters,
// 数据字典 // 数据字典
dict_datas: state => state.dict.dictDatas, dict_datas: (state) => state.dict.dictDatas,
// 角标数据 // 角标数据
badgeData: state => state.user.badgeData badgeData: (state) => state.user.badgeData,
//获取货币
getCurrencySymbol: (state) => (id) => {
const label = state.staticData.currencyList.find((currencyItem) => currencyItem.id === id)
return label ? label.fuhao : ""
},
getCurrencyData: (state) => (id) => {
const label = state.staticData.currencyList.find((currencyItem) => currencyItem.id === id)
return label ? label : {}
}
} }
export default getters export default getters
import Vue from 'vue' import Vue from "vue"
import Vuex from 'vuex' import Vuex from "vuex"
import app from './modules/app' import app from "./modules/app"
import user from './modules/user' import user from "./modules/user"
import tagsView from './modules/tagsView' import tagsView from "./modules/tagsView"
import permission from './modules/permission' import permission from "./modules/permission"
import settings from './modules/settings' import settings from "./modules/settings"
import dict from './modules/dict' import dict from "./modules/dict"
import getters from './getters' import getters from "./getters"
import staticData from "./modules/staticData"
Vue.use(Vuex) Vue.use(Vuex)
...@@ -18,6 +19,7 @@ const store = new Vuex.Store({ ...@@ -18,6 +19,7 @@ const store = new Vuex.Store({
permission, permission,
settings, settings,
dict, dict,
staticData
}, },
getters getters
}) })
......
import { getCurrencyList } from "@/api/ecw/currency" //币种列表
const state = {
currencyList: []
}
const mutations = {
SET_CURRENCY_LIST: (state, currencyList) => {
state.currencyList = currencyList
}
}
const actions = {
async loadCurrencyList({ commit }) {
const response = await getCurrencyList()
if (!response || !response.data) {
return
}
commit("SET_CURRENCY_LIST", response.data)
}
}
export default {
namespaced: true,
state,
mutations,
actions
}
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* *
* 数据字典工具类 * 数据字典工具类
*/ */
import store from "@/store"; import store from "@/store"
import i18n from "@/i18n"; import i18n from "@/i18n"
export const DICT_TYPE = { export const DICT_TYPE = {
USER_TYPE: "user_type", USER_TYPE: "user_type",
...@@ -27,9 +27,9 @@ export const DICT_TYPE = { ...@@ -27,9 +27,9 @@ export const DICT_TYPE = {
SYSTEM_SMS_TEMPLATE_TYPE: "system_sms_template_type", SYSTEM_SMS_TEMPLATE_TYPE: "system_sms_template_type",
SYSTEM_SMS_SEND_STATUS: "system_sms_send_status", SYSTEM_SMS_SEND_STATUS: "system_sms_send_status",
SYSTEM_SMS_RECEIVE_STATUS: "system_sms_receive_status", SYSTEM_SMS_RECEIVE_STATUS: "system_sms_receive_status",
SYSTEM_SMS_NODE_NODE: 'system_sms_node_node',//节点 SYSTEM_SMS_NODE_NODE: "system_sms_node_node", //节点
SYSTEM_SMS_TEMPLATE_MESSAGE_TYPE: 'system_sms_template_message_type',//发送类型 SYSTEM_SMS_TEMPLATE_MESSAGE_TYPE: "system_sms_template_message_type", //发送类型
SYSTEM_SMS_TEMPLATE_LANGUAGE: 'system_sms_template_language',//节点 SYSTEM_SMS_TEMPLATE_LANGUAGE: "system_sms_template_language", //节点
SYSTEM_MAIL_SEND_STATUS: "mail_send_status", SYSTEM_MAIL_SEND_STATUS: "mail_send_status",
SYSTEM_ERROR_CODE_TYPE: "system_error_code_type", SYSTEM_ERROR_CODE_TYPE: "system_error_code_type",
INTERNAL_MESSAGE_TYPE: "internal_message_type", INTERNAL_MESSAGE_TYPE: "internal_message_type",
...@@ -158,25 +158,25 @@ export const DICT_TYPE = { ...@@ -158,25 +158,25 @@ export const DICT_TYPE = {
ECW_PORT_TYPE: "port_type", //港口类型 ECW_PORT_TYPE: "port_type", //港口类型
CERTIFICATE_TYPE: "certificate_type", //证件类型 CERTIFICATE_TYPE: "certificate_type", //证件类型
//customer //customer
CUSTOMER_CREDIT_RULE_TYPE: 'customer_credit_rule_type', CUSTOMER_CREDIT_RULE_TYPE: "customer_credit_rule_type",
CUSTOMER_LEVEL_RULE_TYPE: 'customer_level_rule_type', CUSTOMER_LEVEL_RULE_TYPE: "customer_level_rule_type",
CUSTOMER_ESOURCE_TYPE:'customer_resource_type',//客户资源类型 CUSTOMER_ESOURCE_TYPE: "customer_resource_type", //客户资源类型
CUSTOMER_OPERATE_TYPE:'customer_operate_type', CUSTOMER_OPERATE_TYPE: "customer_operate_type",
CUSTOMER_GET_METHOD: 'customer_get_method', //获取方式 CUSTOMER_GET_METHOD: "customer_get_method", //获取方式
CUSTOMER_FROM: 'customer_from', //创建入口 CUSTOMER_FROM: "customer_from", //创建入口
CUSTOMER_ROLE: 'customer_role', //角色 CUSTOMER_ROLE: "customer_role", //角色
PICKUP_POINTS: 'pickup_points', //常用提货网点 PICKUP_POINTS: "pickup_points", //常用提货网点
CUSTOMER_FOLLOWUP_TYPE: 'customer_followup_type', //跟进类型 CUSTOMER_FOLLOWUP_TYPE: "customer_followup_type", //跟进类型
CUSTOMER_FOLLOWUP_METHOD: 'customer_followup_method', //跟进方式 CUSTOMER_FOLLOWUP_METHOD: "customer_followup_method", //跟进方式
CUSTOMER_FOLLOWUP_SALE_STAGE: 'sale_stage', //销售阶段 CUSTOMER_FOLLOWUP_SALE_STAGE: "sale_stage", //销售阶段
CUSTOMER_FOLLOWUP_RESULT_TYPE: 'customer_followup_result_type', //跟进结果 CUSTOMER_FOLLOWUP_RESULT_TYPE: "customer_followup_result_type", //跟进结果
CUSTOMER_FOLLOWUP_STATUS: 'customer_followup_status', //跟进状态 CUSTOMER_FOLLOWUP_STATUS: "customer_followup_status", //跟进状态
CUSTOMER_QUERY_NUMBER_FIELD: "customer_query_number_field", //客户查询数字字段 CUSTOMER_QUERY_NUMBER_FIELD: "customer_query_number_field", //客户查询数字字段
// order // order
ORDER_TYPE: "order_type", // 订单类型 ORDER_TYPE: "order_type", // 订单类型
PRODUCT_RECORD_ATTRIBUTE: "product_record_attribute", //产品备案属性 PRODUCT_RECORD_ATTRIBUTE: "product_record_attribute", //产品备案属性
PROD_QUERY_TITLE_ZH_FIELD: 'prod_query_title_zh_field', // 商品列表商品中文名称查询类型 PROD_QUERY_TITLE_ZH_FIELD: "prod_query_title_zh_field", // 商品列表商品中文名称查询类型
CONTROL_GOODS_STATUS: "control_goods_status", //控货状态 CONTROL_GOODS_STATUS: "control_goods_status", //控货状态
DISBURSEMENT_TYPE: "disbursement_type", //垫付类型 DISBURSEMENT_TYPE: "disbursement_type", //垫付类型
DRAWEE: "drawee", // 付款人 DRAWEE: "drawee", // 付款人
...@@ -188,13 +188,11 @@ export const DICT_TYPE = { ...@@ -188,13 +188,11 @@ export const DICT_TYPE = {
PAYMENT_TYPE: "payment_type", //收款类型 PAYMENT_TYPE: "payment_type", //收款类型
ORDER_WAREHOUSE_IN_STATUS: "order_warehouse_in_diff_status", // 入仓状态 ORDER_WAREHOUSE_IN_STATUS: "order_warehouse_in_diff_status", // 入仓状态
ORDER_NO_QUOTE_EXCEPTION_RESULT: "order_no_quote_exception_result", //未报价异常处理结果 ORDER_NO_QUOTE_EXCEPTION_RESULT: "order_no_quote_exception_result", //未报价异常处理结果
ORDER_SUPERFLUOUS_BOX_EXCEPTION_RESULT: ORDER_SUPERFLUOUS_BOX_EXCEPTION_RESULT: "order_superfluous_box_exception_result", //多箱异常处理结果
"order_superfluous_box_exception_result", //多箱异常处理结果
ORDER_LACI_BOX_EXCEPTION_RESULT: "order_lack_box_exception_result", //少箱异常处理结果 ORDER_LACI_BOX_EXCEPTION_RESULT: "order_lack_box_exception_result", //少箱异常处理结果
ORDER_PAY_EXCEPTION_RESULT: "order_pay_exception_result", //预付异常处理结果 ORDER_PAY_EXCEPTION_RESULT: "order_pay_exception_result", //预付异常处理结果
ORDER_MISS_EXCEPTION_RESULT: "order_miss_exception_result", //货物丢失异常处理结果 ORDER_MISS_EXCEPTION_RESULT: "order_miss_exception_result", //货物丢失异常处理结果
ORDER_SUPERFLUOUS_GOODS_EXCEPTION_RESULT: ORDER_SUPERFLUOUS_GOODS_EXCEPTION_RESULT: "order_superfluous_goods_exception_result", //货物增多异常处理结果
"order_superfluous_goods_exception_result", //货物增多异常处理结果
ORDER_DAMAGE_EXCEPTION_RESULT: "order_damage_exception_result", //货物破损异常处理结果 ORDER_DAMAGE_EXCEPTION_RESULT: "order_damage_exception_result", //货物破损异常处理结果
ORDER_IN_WATER_EXCEPTION_RESULT: "order_in_water_exception_result", //货物浸水异常处理结果 ORDER_IN_WATER_EXCEPTION_RESULT: "order_in_water_exception_result", //货物浸水异常处理结果
ORDER_HEAVY_CARGO_EXCEPTION_RESULT: "order_heavy_cargo_exception_result", //重货异常处理结果 ORDER_HEAVY_CARGO_EXCEPTION_RESULT: "order_heavy_cargo_exception_result", //重货异常处理结果
...@@ -280,7 +278,13 @@ export const DICT_TYPE = { ...@@ -280,7 +278,13 @@ export const DICT_TYPE = {
MEMBERSHIP_LEVELS: "membership_levels", //会员等级 MEMBERSHIP_LEVELS: "membership_levels", //会员等级
ENABLE_STATUS: "enable_status", //会员等级规则开启状态 ENABLE_STATUS: "enable_status", //会员等级规则开启状态
MEMBER_USER_OPERATE_LOG: "member_user_operate_log", //会员等级操作日志 MEMBER_USER_OPERATE_LOG: "member_user_operate_log", //会员等级操作日志
}; INVOICE_DATA_STATUS: "invoice_data_status", // 开票资料状态
INVOICING_STATUS: "invoicing_status", //开票状态
RECEIPT_DETAIL_STATUS: "receipt_detail_status", //明细状态
INVOICEING_LINK: "invoicing_link", //开票环节
RECEIPT_GENERATE_PATH: "receipt_generate_path", //收款单生成路径
RECEIPT_LINK: "receipt_link" //应收款日志环节
}
/** /**
* 获取 dictType 对应的数据字典数组 * 获取 dictType 对应的数据字典数组
...@@ -294,7 +298,7 @@ export function getDictDatas(dictType) { ...@@ -294,7 +298,7 @@ export function getDictDatas(dictType) {
// debugger // debugger
// } // }
// debugger // debugger
return store.getters.dict_datas[dictType] || []; return store.getters.dict_datas[dictType] || []
} }
/** /**
...@@ -306,44 +310,44 @@ export function getDictDatas(dictType) { ...@@ -306,44 +310,44 @@ export function getDictDatas(dictType) {
*/ */
export function getDictDatas2(dictType, values) { export function getDictDatas2(dictType, values) {
if (values === undefined) { if (values === undefined) {
return []; return []
} }
// 如果是单个元素,则转换成数组 // 如果是单个元素,则转换成数组
if (!Array.isArray(values)) { if (!Array.isArray(values)) {
values = [this.value]; values = [this.value]
} }
// 获得字典数据 // 获得字典数据
const results = []; const results = []
for (const value of values) { for (const value of values) {
const dict = getDictData(dictType, value); const dict = getDictData(dictType, value)
if (dict) { if (dict) {
results.push(dict); results.push(dict)
} }
} }
// debugger // debugger
// console.log(results); // console.log(results);
return results; return results
} }
export function getDictData(dictType, value) { export function getDictData(dictType, value) {
// 获取 dictType 对应的数据字典数组 // 获取 dictType 对应的数据字典数组
const dictDatas = getDictDatas(dictType); const dictDatas = getDictDatas(dictType)
if (!dictDatas || dictDatas.length === 0) { if (!dictDatas || dictDatas.length === 0) {
return ""; return ""
} }
// 获取 value 对应的展示名 // 获取 value 对应的展示名
value = value + ""; // 强制转换成字符串,因为 DictData 小类数值,是字符串 value = value + "" // 强制转换成字符串,因为 DictData 小类数值,是字符串
for (const dictData of dictDatas) { for (const dictData of dictDatas) {
if (dictData.value === value) { if (dictData.value === value) {
return dictData; return dictData
} }
} }
return undefined; return undefined
} }
export function getDictDataLabel(dictType, value) { export function getDictDataLabel(dictType, value) {
const dict = getDictData(dictType, value); const dict = getDictData(dictType, value)
return dict ? i18n.l(dict, "label") : ""; return dict ? i18n.l(dict, "label") : ""
} }
export class getDictDataL {} export class getDictDataL {}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<template>
<div class="app-container">
<el-card v-show="showSearch">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px" class="card">
<!-- <el-row :span="24"> -->
<el-form-item :label="$t('开票编号')">
<el-input style="max-width: 188px" v-model="queryParams.invoiceNo" :placeholder="$t('请输入开票编号')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('收款编号')">
<el-input style="max-width: 188px" v-model="queryParams.receiptNo" :placeholder="$t('请输入收款编号')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('提单号')">
<el-input style="max-width: 188px" v-model="queryParams.tidanNo" :placeholder="$t('请输入提单号')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('订单号')">
<el-input style="max-width: 188px" v-model="queryParams.orderNo" :placeholder="$t('请输入订单号')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('开票状态')">
<dict-selector multiple :type="DICT_TYPE.INVOICING_STATUS" v-model="queryParams.invoicingStatus" clearable />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t("搜索") }}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{ $t("重置") }}</el-button>
</el-form-item>
</el-form>
</el-card>
<div class="tableTop">
<el-table v-loading="loading" :data="invoiceList" border>
<el-table-column :label="$t('开票编号')" width="160" align="center" prop="invoiceNo">
<template slot-scope="{ row }">
<router-link
:to="{
path: '/financial/invoiceOperate',
query: {
id: row.id,
key: 'view'
}
}"
class="link-type"
>
{{ row.invoiceNo }}
</router-link>
</template>
</el-table-column>
<el-table-column :label="$t('收款单号')" width="160" align="center" prop="receiptNo">
<template slot-scope="{ row }">
<router-link
:to="{
path: '/financial/receiptDetail',
query: {
id: row.receiptId
}
}"
class="link-type"
>
{{ row.receiptNo }}
</router-link>
</template>
</el-table-column>
<el-table-column :label="$t('申请日期')" width="160" align="center" prop="invoiceInfoSaveTime" />
<el-table-column :label="$t('申请人/部门')" width="200" align="center">
<template slot-scope="{ row }">
<div>{{ row.applyUserName }}/{{ row.departmentName }}</div>
</template>
</el-table-column>
<el-table-column :label="$t('开票抬头')" width="160" align="center" prop="invoiceHeader" />
<el-table-column :label="$t('开票金额')" align="center" prop="invoiceMoney" />
<el-table-column :label="$t('开票品名')" width="160" align="center" prop="invoiceItem" />
<el-table-column :label="$t('税率')" align="center" prop="taxRate" />
<el-table-column :label="$t('开票状态')" align="center" prop="invoicingStatus">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.INVOICING_STATUS" :value="scope.row.invoicingStatus" />
</template>
</el-table-column>
<el-table-column :label="$t('开票资料状态')" width="160" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.INVOICE_DATA_STATUS" :value="scope.row.invoiceDataStatus" />
</template>
</el-table-column>
<el-table-column :label="$t('订单/提单')" width="260" align="center" prop="orderNo">
<template slot-scope="{ row }">
<div v-for="item in row.orderInfoList" :key="item.orderId">
<router-link :to="`/order/detail?orderId=${item.orderId}`" class="link-type"> {{ item.orderNo }}/{{ item.tidanNo }} </router-link>
</div>
</template>
</el-table-column>
<el-table-column :label="$t('收款状态/核销比例')" width="160" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ECW_RECEIPT_STATE" :value="scope.row.receiptState" />
/ {{ scope.row.writeOffProportion }}
</template>
</el-table-column>
<el-table-column :label="$t('操作')" width="200" fixed="right" align="center">
<template slot-scope="{ row }">
<!-- 待开票0已提交0可以驳回 -->
<el-button type="text" v-if="row.invoicingStatus === 0 && row.invoiceDataStatus === 0" @click="handleInvoiceOperate({ id: row.id, key: 'reject' })">{{ $t("驳回资料") }}</el-button>
<!-- 开票状态=待开票 -->
<el-button v-if="row.invoicingStatus === 0" @click="handleInvoiceOperate({ id: row.id, key: 'cancel' })" type="text">{{ $t("取消开票") }}</el-button>
<!-- 开票状态=待开票且开票资料状态=已提交 提交开票提交的是开票信息 -->
<el-button v-if="row.invoicingStatus === 0 && row.invoiceDataStatus === 0" @click="handleInvoiceOperate({ id: row.id, key: 'submitInfo' })" type="text">{{ $t("提交开票") }}</el-button>
<!-- 开票状态=待开票0 -->
<el-button v-if="row.invoicingStatus === 0" @click="handleInvoiceOperate({ id: row.id, key: 'edit' })" type="text">{{ $t("修改开票申请") }}</el-button>
<!--开票状态=已开票1 -->
<el-button v-if="row.invoicingStatus === 1" type="text" @click="handleInvoiceOperate({ id: row.id, key: 'editInfo' })">{{ $t("修改开票信息") }}</el-button>
<!-- 开票状态=已开票 -->
<el-button v-if="row.invoicingStatus === 1" @click="handleInvoiceOperate({ id: row.id, key: 'delInfo' })" type="text">{{ $t("删除开票信息") }}</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows" @pagination="getInvoiceList" />
</div>
</div>
</template>
<script>
import { loadInvApplicationList } from "@/api/ecw/financial"
export default {
data() {
return {
showSearch: true,
loading: false,
invoiceList: [],
total: 0,
queryParams: {
page: 1,
rows: 10,
invoiceNo: "", //开票编号
invoicingStatus: [], //开票状态
orderNo: "", //订单号
receiptNo: "", //收款单号
tidanNo: "" // 提单号
}
}
},
created() {
this.getInvoiceList()
},
activated() {
this.getInvoiceList()
},
methods: {
handleInvoiceOperate({ id, key }) {
this.$router.push("invoiceOperate?id=" + id + "&key=" + key)
},
async getInvoiceList() {
this.loading = true
let params = {
...this.queryParams
}
const { data } = await loadInvApplicationList(params)
this.loading = false
this.total = data.total
this.invoiceList = data.list
},
resetQuery() {
this.queryParams = {
page: 1,
rows: 10,
invoiceNo: "", //开票编号
invoicingStatus: [], //开票状态
orderNo: "", //订单号
receiptNo: "", //收款单号
tidanNo: "" // 提单号
}
this.getInvoiceList()
},
handleQuery() {
this.queryParams.page = 1
this.getInvoiceList()
}
}
}
</script>
<style lang="scss" scoped>
.card {
padding: 20px;
}
.tableTop {
margin-top: 20px;
}
</style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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