t20-common-lib 0.10.4 → 0.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "t20-common-lib",
3
- "version": "0.10.4",
3
+ "version": "0.10.6",
4
4
  "description": "T20",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -164,14 +164,30 @@ export default {
164
164
  }
165
165
  const allStatistics = []
166
166
  const selectedStatistics = []
167
+ let defaultCurrencyName = this.$l('人民币')
168
+ let defaultCurrencyNo = 'CNY'
169
+ if (this.$store && this.$store.state && this.$store.state.user && this.$store.state.user.defaultCurrencyName) {
170
+ defaultCurrencyName = this.$store.state.user.defaultCurrencyName
171
+ defaultCurrencyNo = this.$store.state.user.defaultCurrencyNo
172
+ }
167
173
  this.views.forEach(item => {
174
+ const statisChildList = item.currencyNo !== defaultCurrencyNo ? this.config : this.config.filter(c => !c.currencyType || c.currencyType === 'origin')
168
175
  allStatistics.push({
169
176
  title: item.currencyName,
170
177
  currencyNo: item.currencyNo,
171
178
  statis: [
172
179
  {
173
180
  type: this.$l('全部合计'), //全部合计
174
- list: this.config.map(c => ({label: c.label, value: item[c.code] || '0'}))
181
+ list: statisChildList.map(c => {
182
+ let label = c.label
183
+ if (item.currencyNo !== defaultCurrencyNo && c.key) {
184
+ label = c.currencyType === 'origin' ? `${c.label}(${this.$l('原币')})` : `${c.label}(${this.$l('折')}${this.$l(defaultCurrencyName)})`
185
+ }
186
+ return {
187
+ label,
188
+ value: item[c.code] || '0'
189
+ }
190
+ })
175
191
  }
176
192
  ]
177
193
  })
@@ -181,7 +197,7 @@ export default {
181
197
  statis: [
182
198
  {
183
199
  type: this.$l('已选合计'), //已选合计
184
- list: this.config.map(c => ({label: c.label, value: 0}))
200
+ list: (this.config.filter(c => !c.currencyType || c.currencyType === 'origin')).map(c => ({label: c.label, value: 0}))
185
201
  }
186
202
  ]
187
203
  })