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