Commit c9bc889362445135e6f770f8413b362f26b1ace0
1 parent
d68983e7
打印机配置完成
Showing
6 changed files
with
24 additions
and
27 deletions
src/components/machine/printerRuleDiv.vue
| 1 | 1 | <template> |
| 2 | 2 | <el-card class="box-card"> |
| 3 | 3 | <div class="button-group"> |
| 4 | - <el-button type="primary" size="small" @click="openAddModal"> | |
| 4 | + <el-button type="text" size="small" @click="openAddModal"> | |
| 5 | 5 | <i class="el-icon-plus"></i>{{ $t('common.add') }} |
| 6 | 6 | </el-button> |
| 7 | - <el-button type="primary" size="small" @click="openEditModal"> | |
| 7 | + <el-button type="text" size="small" @click="openEditModal"> | |
| 8 | 8 | <i class="el-icon-edit"></i>{{ $t('common.edit') }} |
| 9 | 9 | </el-button> |
| 10 | - <el-button type="primary" size="small" @click="openDeleteModal"> | |
| 10 | + <el-button type="text" size="small" @click="openDeleteModal"> | |
| 11 | 11 | <i class="el-icon-delete"></i>{{ $t('common.delete') }} |
| 12 | 12 | </el-button> |
| 13 | 13 | </div> |
| ... | ... | @@ -49,7 +49,7 @@ export default { |
| 49 | 49 | children: 'children', |
| 50 | 50 | label: 'ruleName' |
| 51 | 51 | }, |
| 52 | - curRule:{}, | |
| 52 | + curRule: {}, | |
| 53 | 53 | communityId: '' |
| 54 | 54 | } |
| 55 | 55 | }, |
| ... | ... | @@ -76,6 +76,7 @@ export default { |
| 76 | 76 | }, |
| 77 | 77 | handleNodeClick(data) { |
| 78 | 78 | this.curRule = data |
| 79 | + this.$emit('switchRule', this.curRule) | |
| 79 | 80 | }, |
| 80 | 81 | openAddModal() { |
| 81 | 82 | this.$refs.addPrinterRule.open() | ... | ... |
src/components/machine/printerRuleFees.vue
| ... | ... | @@ -41,7 +41,7 @@ |
| 41 | 41 | layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" /> |
| 42 | 42 | |
| 43 | 43 | |
| 44 | - <add-printer-rule-fee ref="addPrinterRuleFee" :rule-id="ruleId" @success="handleSuccess" /> | |
| 44 | + <add-printer-rule-fee ref="addPrinterRuleFee" :rule-id="searchForm.ruleId" @success="handleSuccess" /> | |
| 45 | 45 | <delete-printer-rule-fee ref="deletePrinterRuleFee" @success="handleSuccess" /> |
| 46 | 46 | </div> |
| 47 | 47 | </template> |
| ... | ... | @@ -58,12 +58,6 @@ export default { |
| 58 | 58 | AddPrinterRuleFee, |
| 59 | 59 | DeletePrinterRuleFee |
| 60 | 60 | }, |
| 61 | - props: { | |
| 62 | - ruleId: { | |
| 63 | - type: String, | |
| 64 | - required: true | |
| 65 | - } | |
| 66 | - }, | |
| 67 | 61 | data() { |
| 68 | 62 | return { |
| 69 | 63 | searchForm: { |
| ... | ... | @@ -83,10 +77,13 @@ export default { |
| 83 | 77 | }, |
| 84 | 78 | created() { |
| 85 | 79 | this.searchForm.communityId = getCommunityId() |
| 86 | - this.searchForm.ruleId = this.ruleId | |
| 87 | - this.getList() | |
| 80 | + | |
| 88 | 81 | }, |
| 89 | 82 | methods: { |
| 83 | + open(ruleId) { | |
| 84 | + this.searchForm.ruleId = ruleId | |
| 85 | + this.getList() | |
| 86 | + }, | |
| 90 | 87 | async getList() { |
| 91 | 88 | this.loading = true |
| 92 | 89 | try { | ... | ... |
src/components/machine/printerRuleMachine.vue
| ... | ... | @@ -84,11 +84,11 @@ export default { |
| 84 | 84 | }, |
| 85 | 85 | created() { |
| 86 | 86 | this.searchForm.communityId = getCommunityId() |
| 87 | - this.getList() | |
| 88 | 87 | }, |
| 89 | 88 | methods: { |
| 90 | 89 | open(ruleId) { |
| 91 | 90 | this.searchForm.ruleId = ruleId |
| 91 | + this.getList() | |
| 92 | 92 | }, |
| 93 | 93 | async getList() { |
| 94 | 94 | this.loading = true | ... | ... |
src/components/machine/printerRuleRepair.vue
| ... | ... | @@ -42,7 +42,7 @@ |
| 42 | 42 | layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" /> |
| 43 | 43 | |
| 44 | 44 | |
| 45 | - <add-printer-rule-repair ref="addPrinterRuleRepair" :rule-id="ruleId" @success="handleSuccess" /> | |
| 45 | + <add-printer-rule-repair ref="addPrinterRuleRepair" :rule-id="searchForm.ruleId" @success="handleSuccess" /> | |
| 46 | 46 | <delete-printer-rule-repair ref="deletePrinterRuleRepair" @success="handleSuccess" /> |
| 47 | 47 | </div> |
| 48 | 48 | </template> |
| ... | ... | @@ -59,12 +59,6 @@ export default { |
| 59 | 59 | AddPrinterRuleRepair, |
| 60 | 60 | DeletePrinterRuleRepair |
| 61 | 61 | }, |
| 62 | - props: { | |
| 63 | - ruleId: { | |
| 64 | - type: String, | |
| 65 | - required: true | |
| 66 | - } | |
| 67 | - }, | |
| 68 | 62 | data() { |
| 69 | 63 | return { |
| 70 | 64 | searchForm: { |
| ... | ... | @@ -84,10 +78,13 @@ export default { |
| 84 | 78 | }, |
| 85 | 79 | created() { |
| 86 | 80 | this.searchForm.communityId = getCommunityId() |
| 87 | - this.searchForm.ruleId = this.ruleId | |
| 88 | - this.getList() | |
| 81 | + | |
| 89 | 82 | }, |
| 90 | 83 | methods: { |
| 84 | + open(ruleId) { | |
| 85 | + this.searchForm.ruleId = ruleId | |
| 86 | + this.getList() | |
| 87 | + }, | |
| 91 | 88 | async getList() { |
| 92 | 89 | this.loading = true |
| 93 | 90 | try { | ... | ... |
src/i18n/commonLang.js
| ... | ... | @@ -14,6 +14,7 @@ export const messages = { |
| 14 | 14 | back: 'Back', |
| 15 | 15 | warning: 'Warning', |
| 16 | 16 | deleteConfirm: 'Are you sure to delete this record?', |
| 17 | + confirmDelete: 'confirm delete', | |
| 17 | 18 | deleteSuccess: 'Delete successfully', |
| 18 | 19 | selectBtn: 'Select', |
| 19 | 20 | select: 'Select', |
| ... | ... | @@ -64,6 +65,7 @@ export const messages = { |
| 64 | 65 | back: '返回', |
| 65 | 66 | warning: '警告', |
| 66 | 67 | deleteConfirm: '确定要删除这条记录吗?', |
| 68 | + confirmDelete: '确定删除', | |
| 67 | 69 | deleteSuccess: '删除成功', |
| 68 | 70 | selectBtn: '选择', |
| 69 | 71 | select: '选择', | ... | ... |
src/views/machine/printerRuleList.vue
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | <div class="printer-rule-container"> |
| 3 | 3 | <el-row :gutter="20"> |
| 4 | 4 | <el-col :span="4"> |
| 5 | - <printer-rule-div @switch-rule="handleSwitchRule" /> | |
| 5 | + <printer-rule-div @switchRule="handleSwitchRule" /> | |
| 6 | 6 | </el-col> |
| 7 | 7 | <el-col :span="20"> |
| 8 | 8 | <el-card class="box-card"> |
| ... | ... | @@ -26,13 +26,13 @@ |
| 26 | 26 | </div> |
| 27 | 27 | |
| 28 | 28 | <div v-if="printerRuleInfo.tabName === 'printerRuleMachine'"> |
| 29 | - <printer-rule-machine /> | |
| 29 | + <printer-rule-machine ref="printerRuleMachine" /> | |
| 30 | 30 | </div> |
| 31 | 31 | <div v-if="printerRuleInfo.tabName === 'printerRuleFees'"> |
| 32 | - <printer-rule-fees /> | |
| 32 | + <printer-rule-fees ref="printerRuleFees"/> | |
| 33 | 33 | </div> |
| 34 | 34 | <div v-if="printerRuleInfo.tabName === 'printerRuleRepair'"> |
| 35 | - <printer-rule-repair /> | |
| 35 | + <printer-rule-repair ref="printerRuleRepair"/> | |
| 36 | 36 | </div> |
| 37 | 37 | </el-card> |
| 38 | 38 | </el-col> | ... | ... |