gm-printer 10.40.0 → 10.41.0
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
|
@@ -57,8 +57,11 @@ const detailSortOptionsForMerchant = [
|
|
|
57
57
|
@observer
|
|
58
58
|
class TableDetailEditor extends React.Component {
|
|
59
59
|
handleDataKeyChange = dataKey => {
|
|
60
|
-
const { editStore } = this.props
|
|
61
|
-
editStore.setPurchaseTableKey(
|
|
60
|
+
const { editStore, addFields } = this.props
|
|
61
|
+
editStore.setPurchaseTableKey(
|
|
62
|
+
dataKey,
|
|
63
|
+
addFields.specialTableConfig
|
|
64
|
+
)
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
handlePurchaseSettingKeyChange = dataKey => {
|
|
@@ -74,7 +77,7 @@ class TableDetailEditor extends React.Component {
|
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
handleDetailAddField = ({ key, value }) => {
|
|
77
|
-
const { editStore, config } = this.props
|
|
80
|
+
const { editStore, config, addFields } = this.props
|
|
78
81
|
if (editStore.computedDataKey === 'purchase_detail_one_row') {
|
|
79
82
|
// 序号 {{列.序号}}
|
|
80
83
|
const transform = str => {
|
|
@@ -86,12 +89,18 @@ class TableDetailEditor extends React.Component {
|
|
|
86
89
|
config.purchaseSettingKey === 'goods' &&
|
|
87
90
|
config.dataKey !== 'purchase_independent_rol_sku'
|
|
88
91
|
) {
|
|
89
|
-
editStore.setPurchaseTableKey(
|
|
92
|
+
editStore.setPurchaseTableKey(
|
|
93
|
+
'purchase_independent_rol_sku',
|
|
94
|
+
addFields.specialTableConfig
|
|
95
|
+
)
|
|
90
96
|
} else if (
|
|
91
97
|
config.purchaseSettingKey === 'merchant' &&
|
|
92
98
|
config.dataKey !== 'purchase_independent_rol_address'
|
|
93
99
|
) {
|
|
94
|
-
editStore.setPurchaseTableKey(
|
|
100
|
+
editStore.setPurchaseTableKey(
|
|
101
|
+
'purchase_independent_rol_address',
|
|
102
|
+
addFields.specialTableConfig
|
|
103
|
+
)
|
|
95
104
|
}
|
|
96
105
|
|
|
97
106
|
editStore.addFieldToTable({ key, value: transform(value) })
|
|
@@ -125,9 +134,11 @@ class TableDetailEditor extends React.Component {
|
|
|
125
134
|
|
|
126
135
|
const title = specialTableConfig.title || i18next.t('设置采购明细')
|
|
127
136
|
const label = specialTableConfig.label || i18next.t('采购明细')
|
|
137
|
+
// 外部可整体覆盖下拉选项(dataKeyList),否则按 hideDataKeys 过滤默认列表
|
|
138
|
+
const baseDataKeyList = specialTableConfig.dataKeyList || dataKeyList
|
|
128
139
|
const hideDataKeys = specialTableConfig.hideDataKeys || []
|
|
129
140
|
const visibleDataKeyList = _.filter(
|
|
130
|
-
|
|
141
|
+
baseDataKeyList,
|
|
131
142
|
v => !hideDataKeys.includes(v.value)
|
|
132
143
|
)
|
|
133
144
|
|
|
@@ -13,7 +13,7 @@ class Store extends EditorStore {
|
|
|
13
13
|
|
|
14
14
|
/* start---------设置采购明细相关--------- */
|
|
15
15
|
@action.bound
|
|
16
|
-
setPurchaseTableKey(dataKey) {
|
|
16
|
+
setPurchaseTableKey(dataKey, specialTableConfig) {
|
|
17
17
|
// 先移除选中项,安全第一
|
|
18
18
|
this.selected = null
|
|
19
19
|
this.setTableDataKey(dataKey)
|
|
@@ -38,9 +38,12 @@ class Store extends EditorStore {
|
|
|
38
38
|
separator: '+',
|
|
39
39
|
// detailsType: 'purchase_last_col',
|
|
40
40
|
specialDetailsKey: '__details',
|
|
41
|
-
text:
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
text:
|
|
42
|
+
specialTableConfig && specialTableConfig.defaultDetailText !== undefined
|
|
43
|
+
? specialTableConfig.defaultDetailText
|
|
44
|
+
: i18next.t(
|
|
45
|
+
'{{采购数量_采购单位}}{{采购单位}}*{{商户名}}*{{商品备注}}'
|
|
46
|
+
)
|
|
44
47
|
})
|
|
45
48
|
// 通过detailsType属性区分单列-总表最后一列的数据是否换行展示
|
|
46
49
|
dataKey === 'purchase_last_col'
|