Commit d68983e7e59048ea939e40f4a901791d29176adc
1 parent
788477fb
保养功能开发完成
Showing
35 changed files
with
3871 additions
and
31 deletions
src/api/machine/accessControlInoutApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 3 | + | ||
| 4 | +// 获取门禁进出记录列表 | ||
| 5 | +export function listAccessControlInouts(params) { | ||
| 6 | + return new Promise((resolve, reject) => { | ||
| 7 | + request({ | ||
| 8 | + url: '/iot.getOpenApi', | ||
| 9 | + method: 'get', | ||
| 10 | + params: { | ||
| 11 | + ...params, | ||
| 12 | + communityId: getCommunityId() | ||
| 13 | + } | ||
| 14 | + }).then(response => { | ||
| 15 | + const res = response.data | ||
| 16 | + resolve({ | ||
| 17 | + data: res.data, | ||
| 18 | + total: res.total | ||
| 19 | + }) | ||
| 20 | + }).catch(error => { | ||
| 21 | + reject(error) | ||
| 22 | + }) | ||
| 23 | + }) | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +// 获取门禁设备列表 | ||
| 27 | +export function listAccessControls(params) { | ||
| 28 | + return new Promise((resolve, reject) => { | ||
| 29 | + request({ | ||
| 30 | + url: '/iot.getOpenApi', | ||
| 31 | + method: 'get', | ||
| 32 | + params: { | ||
| 33 | + ...params, | ||
| 34 | + communityId: getCommunityId() | ||
| 35 | + } | ||
| 36 | + }).then(response => { | ||
| 37 | + const res = response.data | ||
| 38 | + resolve({ | ||
| 39 | + data: res.data | ||
| 40 | + }) | ||
| 41 | + }).catch(error => { | ||
| 42 | + reject(error) | ||
| 43 | + }) | ||
| 44 | + }) | ||
| 45 | +} | ||
| 0 | \ No newline at end of file | 46 | \ No newline at end of file |
src/api/machine/machinePrinterManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 3 | + | ||
| 4 | +// 获取云打印机列表 | ||
| 5 | +export function listMachinePrinter(params) { | ||
| 6 | + return new Promise((resolve, reject) => { | ||
| 7 | + request({ | ||
| 8 | + url: '/printer.listMachinePrinter', | ||
| 9 | + method: 'get', | ||
| 10 | + params: { | ||
| 11 | + ...params, | ||
| 12 | + communityId: getCommunityId() | ||
| 13 | + } | ||
| 14 | + }).then(response => { | ||
| 15 | + const res = response.data | ||
| 16 | + resolve(res) | ||
| 17 | + }).catch(error => { | ||
| 18 | + reject(error) | ||
| 19 | + }) | ||
| 20 | + }) | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +// 添加云打印机 | ||
| 24 | +export function saveMachinePrinter(data) { | ||
| 25 | + return new Promise((resolve, reject) => { | ||
| 26 | + request({ | ||
| 27 | + url: '/printer.saveMachinePrinter', | ||
| 28 | + method: 'post', | ||
| 29 | + data: { | ||
| 30 | + ...data, | ||
| 31 | + communityId: getCommunityId() | ||
| 32 | + } | ||
| 33 | + }).then(response => { | ||
| 34 | + const res = response.data | ||
| 35 | + resolve(res) | ||
| 36 | + }).catch(error => { | ||
| 37 | + reject(error) | ||
| 38 | + }) | ||
| 39 | + }) | ||
| 40 | +} | ||
| 41 | + | ||
| 42 | +// 修改云打印机 | ||
| 43 | +export function updateMachinePrinter(data) { | ||
| 44 | + return new Promise((resolve, reject) => { | ||
| 45 | + request({ | ||
| 46 | + url: '/printer.updateMachinePrinter', | ||
| 47 | + method: 'post', | ||
| 48 | + data: { | ||
| 49 | + ...data, | ||
| 50 | + communityId: getCommunityId() | ||
| 51 | + } | ||
| 52 | + }).then(response => { | ||
| 53 | + const res = response.data | ||
| 54 | + resolve(res) | ||
| 55 | + }).catch(error => { | ||
| 56 | + reject(error) | ||
| 57 | + }) | ||
| 58 | + }) | ||
| 59 | +} | ||
| 60 | + | ||
| 61 | +// 删除云打印机 | ||
| 62 | +export function deleteMachinePrinter(data) { | ||
| 63 | + return new Promise((resolve, reject) => { | ||
| 64 | + request({ | ||
| 65 | + url: '/printer.deleteMachinePrinter', | ||
| 66 | + method: 'post', | ||
| 67 | + data: { | ||
| 68 | + ...data, | ||
| 69 | + communityId: getCommunityId() | ||
| 70 | + } | ||
| 71 | + }).then(response => { | ||
| 72 | + const res = response.data | ||
| 73 | + resolve(res) | ||
| 74 | + }).catch(error => { | ||
| 75 | + reject(error) | ||
| 76 | + }) | ||
| 77 | + }) | ||
| 78 | +} | ||
| 0 | \ No newline at end of file | 79 | \ No newline at end of file |
src/api/machine/machineTranslateManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 3 | + | ||
| 4 | +// 获取机器翻译列表 | ||
| 5 | +export function listMachineTranslates(params) { | ||
| 6 | + return new Promise((resolve, reject) => { | ||
| 7 | + request({ | ||
| 8 | + url: '/machineTranslate.listMachineTranslates', | ||
| 9 | + method: 'get', | ||
| 10 | + params: { | ||
| 11 | + ...params, | ||
| 12 | + communityId: getCommunityId() | ||
| 13 | + } | ||
| 14 | + }).then(response => { | ||
| 15 | + const res = response.data | ||
| 16 | + resolve(res) | ||
| 17 | + }).catch(error => { | ||
| 18 | + reject(error) | ||
| 19 | + }) | ||
| 20 | + }) | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +// 保存机器翻译 | ||
| 24 | +export function saveMachineTranslate(data) { | ||
| 25 | + return new Promise((resolve, reject) => { | ||
| 26 | + request({ | ||
| 27 | + url: '/machineTranslate.saveMachineTranslate', | ||
| 28 | + method: 'post', | ||
| 29 | + data: { | ||
| 30 | + ...data, | ||
| 31 | + communityId: getCommunityId() | ||
| 32 | + } | ||
| 33 | + }).then(response => { | ||
| 34 | + const res = response.data | ||
| 35 | + resolve(res) | ||
| 36 | + }).catch(error => { | ||
| 37 | + reject(error) | ||
| 38 | + }) | ||
| 39 | + }) | ||
| 40 | +} | ||
| 41 | + | ||
| 42 | +// 重新发送物联网同步 | ||
| 43 | +export function resendIot(data) { | ||
| 44 | + return new Promise((resolve, reject) => { | ||
| 45 | + request({ | ||
| 46 | + url: '/machine/resendIot', | ||
| 47 | + method: 'post', | ||
| 48 | + data: { | ||
| 49 | + ...data, | ||
| 50 | + communityId: getCommunityId() | ||
| 51 | + } | ||
| 52 | + }).then(response => { | ||
| 53 | + const res = response.data | ||
| 54 | + resolve(res) | ||
| 55 | + }).catch(error => { | ||
| 56 | + reject(error) | ||
| 57 | + }) | ||
| 58 | + }) | ||
| 59 | +} | ||
| 0 | \ No newline at end of file | 60 | \ No newline at end of file |
src/api/machine/printerRuleApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 3 | + | ||
| 4 | +// 获取打印机规则列表 | ||
| 5 | +export function listPrinterRules(params) { | ||
| 6 | + return new Promise((resolve, reject) => { | ||
| 7 | + request({ | ||
| 8 | + url: '/printer.listPrinterRule', | ||
| 9 | + method: 'get', | ||
| 10 | + params: { | ||
| 11 | + ...params, | ||
| 12 | + communityId: getCommunityId() | ||
| 13 | + } | ||
| 14 | + }).then(response => { | ||
| 15 | + resolve(response.data) | ||
| 16 | + }).catch(error => { | ||
| 17 | + reject(error) | ||
| 18 | + }) | ||
| 19 | + }) | ||
| 20 | +} | ||
| 21 | + | ||
| 22 | +// 添加打印机规则 | ||
| 23 | +export function savePrinterRule(data) { | ||
| 24 | + return new Promise((resolve, reject) => { | ||
| 25 | + request({ | ||
| 26 | + url: '/printer.savePrinterRule', | ||
| 27 | + method: 'post', | ||
| 28 | + data: { | ||
| 29 | + ...data, | ||
| 30 | + communityId: getCommunityId() | ||
| 31 | + } | ||
| 32 | + }).then(response => { | ||
| 33 | + resolve(response.data) | ||
| 34 | + }).catch(error => { | ||
| 35 | + reject(error) | ||
| 36 | + }) | ||
| 37 | + }) | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +// 修改打印机规则 | ||
| 41 | +export function updatePrinterRule(data) { | ||
| 42 | + return new Promise((resolve, reject) => { | ||
| 43 | + request({ | ||
| 44 | + url: '/printer.updatePrinterRule', | ||
| 45 | + method: 'post', | ||
| 46 | + data: { | ||
| 47 | + ...data, | ||
| 48 | + communityId: getCommunityId() | ||
| 49 | + } | ||
| 50 | + }).then(response => { | ||
| 51 | + resolve(response.data) | ||
| 52 | + }).catch(error => { | ||
| 53 | + reject(error) | ||
| 54 | + }) | ||
| 55 | + }) | ||
| 56 | +} | ||
| 57 | + | ||
| 58 | +// 删除打印机规则 | ||
| 59 | +export function deletePrinterRule(data) { | ||
| 60 | + return new Promise((resolve, reject) => { | ||
| 61 | + request({ | ||
| 62 | + url: '/printer.deletePrinterRule', | ||
| 63 | + method: 'post', | ||
| 64 | + data: { | ||
| 65 | + ...data, | ||
| 66 | + communityId: getCommunityId() | ||
| 67 | + } | ||
| 68 | + }).then(response => { | ||
| 69 | + resolve(response.data) | ||
| 70 | + }).catch(error => { | ||
| 71 | + reject(error) | ||
| 72 | + }) | ||
| 73 | + }) | ||
| 74 | +} | ||
| 75 | + | ||
| 76 | +// 获取打印机规则关联的机器列表 | ||
| 77 | +export function listPrinterRuleMachines(params) { | ||
| 78 | + return new Promise((resolve, reject) => { | ||
| 79 | + request({ | ||
| 80 | + url: '/printer.listPrinterRuleMachine', | ||
| 81 | + method: 'get', | ||
| 82 | + params: { | ||
| 83 | + ...params, | ||
| 84 | + communityId: getCommunityId() | ||
| 85 | + } | ||
| 86 | + }).then(response => { | ||
| 87 | + resolve(response.data) | ||
| 88 | + }).catch(error => { | ||
| 89 | + reject(error) | ||
| 90 | + }) | ||
| 91 | + }) | ||
| 92 | +} | ||
| 93 | + | ||
| 94 | +// 添加打印机规则机器 | ||
| 95 | +export function savePrinterRuleMachine(data) { | ||
| 96 | + return new Promise((resolve, reject) => { | ||
| 97 | + request({ | ||
| 98 | + url: '/printer.savePrinterRuleMachine', | ||
| 99 | + method: 'post', | ||
| 100 | + data: { | ||
| 101 | + ...data, | ||
| 102 | + communityId: getCommunityId() | ||
| 103 | + } | ||
| 104 | + }).then(response => { | ||
| 105 | + resolve(response.data) | ||
| 106 | + }).catch(error => { | ||
| 107 | + reject(error) | ||
| 108 | + }) | ||
| 109 | + }) | ||
| 110 | +} | ||
| 111 | + | ||
| 112 | +// 修改打印机规则机器 | ||
| 113 | +export function updatePrinterRuleMachine(data) { | ||
| 114 | + return new Promise((resolve, reject) => { | ||
| 115 | + request({ | ||
| 116 | + url: '/printer.updatePrinterRuleMachine', | ||
| 117 | + method: 'post', | ||
| 118 | + data: { | ||
| 119 | + ...data, | ||
| 120 | + communityId: getCommunityId() | ||
| 121 | + } | ||
| 122 | + }).then(response => { | ||
| 123 | + resolve(response.data) | ||
| 124 | + }).catch(error => { | ||
| 125 | + reject(error) | ||
| 126 | + }) | ||
| 127 | + }) | ||
| 128 | +} | ||
| 129 | + | ||
| 130 | +// 删除打印机规则机器 | ||
| 131 | +export function deletePrinterRuleMachine(data) { | ||
| 132 | + return new Promise((resolve, reject) => { | ||
| 133 | + request({ | ||
| 134 | + url: '/printer.deletePrinterRuleMachine', | ||
| 135 | + method: 'post', | ||
| 136 | + data: { | ||
| 137 | + ...data, | ||
| 138 | + communityId: getCommunityId() | ||
| 139 | + } | ||
| 140 | + }).then(response => { | ||
| 141 | + resolve(response.data) | ||
| 142 | + }).catch(error => { | ||
| 143 | + reject(error) | ||
| 144 | + }) | ||
| 145 | + }) | ||
| 146 | +} | ||
| 147 | + | ||
| 148 | +// 获取打印机列表 | ||
| 149 | +export function listMachinePrinters(params) { | ||
| 150 | + return new Promise((resolve, reject) => { | ||
| 151 | + request({ | ||
| 152 | + url: '/printer.listMachinePrinter', | ||
| 153 | + method: 'get', | ||
| 154 | + params: { | ||
| 155 | + ...params, | ||
| 156 | + communityId: getCommunityId() | ||
| 157 | + } | ||
| 158 | + }).then(response => { | ||
| 159 | + resolve(response.data) | ||
| 160 | + }).catch(error => { | ||
| 161 | + reject(error) | ||
| 162 | + }) | ||
| 163 | + }) | ||
| 164 | +} | ||
| 165 | + | ||
| 166 | +// 获取打印机规则关联的费用列表 | ||
| 167 | +export function listPrinterRuleFees(params) { | ||
| 168 | + return new Promise((resolve, reject) => { | ||
| 169 | + request({ | ||
| 170 | + url: '/printer.listPrinterRuleFee', | ||
| 171 | + method: 'get', | ||
| 172 | + params: { | ||
| 173 | + ...params, | ||
| 174 | + communityId: getCommunityId() | ||
| 175 | + } | ||
| 176 | + }).then(response => { | ||
| 177 | + resolve(response.data) | ||
| 178 | + }).catch(error => { | ||
| 179 | + reject(error) | ||
| 180 | + }) | ||
| 181 | + }) | ||
| 182 | +} | ||
| 183 | + | ||
| 184 | +// 添加打印机规则费用 | ||
| 185 | +export function savePrinterRuleFee(data) { | ||
| 186 | + return new Promise((resolve, reject) => { | ||
| 187 | + request({ | ||
| 188 | + url: '/printer.savePrinterRuleFee', | ||
| 189 | + method: 'post', | ||
| 190 | + data: { | ||
| 191 | + ...data, | ||
| 192 | + communityId: getCommunityId() | ||
| 193 | + } | ||
| 194 | + }).then(response => { | ||
| 195 | + resolve(response.data) | ||
| 196 | + }).catch(error => { | ||
| 197 | + reject(error) | ||
| 198 | + }) | ||
| 199 | + }) | ||
| 200 | +} | ||
| 201 | + | ||
| 202 | +// 删除打印机规则费用 | ||
| 203 | +export function deletePrinterRuleFee(data) { | ||
| 204 | + return new Promise((resolve, reject) => { | ||
| 205 | + request({ | ||
| 206 | + url: '/printer.deletePrinterRuleFee', | ||
| 207 | + method: 'post', | ||
| 208 | + data: { | ||
| 209 | + ...data, | ||
| 210 | + communityId: getCommunityId() | ||
| 211 | + } | ||
| 212 | + }).then(response => { | ||
| 213 | + resolve(response.data) | ||
| 214 | + }).catch(error => { | ||
| 215 | + reject(error) | ||
| 216 | + }) | ||
| 217 | + }) | ||
| 218 | +} | ||
| 219 | + | ||
| 220 | +// 获取费用配置列表 | ||
| 221 | +export function listFeeConfigs(params) { | ||
| 222 | + return new Promise((resolve, reject) => { | ||
| 223 | + request({ | ||
| 224 | + url: '/feeConfig.listFeeConfigs', | ||
| 225 | + method: 'get', | ||
| 226 | + params: { | ||
| 227 | + ...params, | ||
| 228 | + communityId: getCommunityId() | ||
| 229 | + } | ||
| 230 | + }).then(response => { | ||
| 231 | + resolve(response.data) | ||
| 232 | + }).catch(error => { | ||
| 233 | + reject(error) | ||
| 234 | + }) | ||
| 235 | + }) | ||
| 236 | +} | ||
| 237 | + | ||
| 238 | +// 获取打印机规则关联的报修列表 | ||
| 239 | +export function listPrinterRuleRepairs(params) { | ||
| 240 | + return new Promise((resolve, reject) => { | ||
| 241 | + request({ | ||
| 242 | + url: '/printer.listPrinterRuleRepair', | ||
| 243 | + method: 'get', | ||
| 244 | + params: { | ||
| 245 | + ...params, | ||
| 246 | + communityId: getCommunityId() | ||
| 247 | + } | ||
| 248 | + }).then(response => { | ||
| 249 | + resolve(response.data) | ||
| 250 | + }).catch(error => { | ||
| 251 | + reject(error) | ||
| 252 | + }) | ||
| 253 | + }) | ||
| 254 | +} | ||
| 255 | + | ||
| 256 | +// 添加打印机规则报修 | ||
| 257 | +export function savePrinterRuleRepair(data) { | ||
| 258 | + return new Promise((resolve, reject) => { | ||
| 259 | + request({ | ||
| 260 | + url: '/printer.savePrinterRuleRepair', | ||
| 261 | + method: 'post', | ||
| 262 | + data: { | ||
| 263 | + ...data, | ||
| 264 | + communityId: getCommunityId() | ||
| 265 | + } | ||
| 266 | + }).then(response => { | ||
| 267 | + resolve(response.data) | ||
| 268 | + }).catch(error => { | ||
| 269 | + reject(error) | ||
| 270 | + }) | ||
| 271 | + }) | ||
| 272 | +} | ||
| 273 | + | ||
| 274 | +// 删除打印机规则报修 | ||
| 275 | +export function deletePrinterRuleRepair(data) { | ||
| 276 | + return new Promise((resolve, reject) => { | ||
| 277 | + request({ | ||
| 278 | + url: '/printer.deletePrinterRuleRepair', | ||
| 279 | + method: 'post', | ||
| 280 | + data: { | ||
| 281 | + ...data, | ||
| 282 | + communityId: getCommunityId() | ||
| 283 | + } | ||
| 284 | + }).then(response => { | ||
| 285 | + resolve(response.data) | ||
| 286 | + }).catch(error => { | ||
| 287 | + reject(error) | ||
| 288 | + }) | ||
| 289 | + }) | ||
| 290 | +} | ||
| 291 | + | ||
| 292 | +// 获取报修设置列表 | ||
| 293 | +export function listRepairSettings(params) { | ||
| 294 | + return new Promise((resolve, reject) => { | ||
| 295 | + request({ | ||
| 296 | + url: '/repair.listRepairSettings', | ||
| 297 | + method: 'get', | ||
| 298 | + params: { | ||
| 299 | + ...params, | ||
| 300 | + communityId: getCommunityId() | ||
| 301 | + } | ||
| 302 | + }).then(response => { | ||
| 303 | + resolve(response.data) | ||
| 304 | + }).catch(error => { | ||
| 305 | + reject(error) | ||
| 306 | + }) | ||
| 307 | + }) | ||
| 308 | +} | ||
| 0 | \ No newline at end of file | 309 | \ No newline at end of file |
src/components/machine/addMachinePrinter.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('machinePrinterManage.add.title')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="50%" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <el-form | ||
| 9 | + ref="form" | ||
| 10 | + :model="form" | ||
| 11 | + :rules="rules" | ||
| 12 | + label-width="120px" | ||
| 13 | + > | ||
| 14 | + <el-form-item | ||
| 15 | + :label="$t('machinePrinterManage.form.machineName')" | ||
| 16 | + prop="machineName" | ||
| 17 | + > | ||
| 18 | + <el-input | ||
| 19 | + v-model="form.machineName" | ||
| 20 | + :placeholder="$t('machinePrinterManage.form.machineNamePlaceholder')" | ||
| 21 | + /> | ||
| 22 | + </el-form-item> | ||
| 23 | + <el-form-item | ||
| 24 | + :label="$t('machinePrinterManage.form.machineCode')" | ||
| 25 | + prop="machineCode" | ||
| 26 | + > | ||
| 27 | + <el-input | ||
| 28 | + v-model="form.machineCode" | ||
| 29 | + :placeholder="$t('machinePrinterManage.form.machineCodePlaceholder')" | ||
| 30 | + /> | ||
| 31 | + </el-form-item> | ||
| 32 | + <el-form-item | ||
| 33 | + :label="$t('machinePrinterManage.form.implBean')" | ||
| 34 | + prop="implBean" | ||
| 35 | + > | ||
| 36 | + <el-select | ||
| 37 | + v-model="form.implBean" | ||
| 38 | + :placeholder="$t('machinePrinterManage.form.implBeanPlaceholder')" | ||
| 39 | + style="width: 100%" | ||
| 40 | + > | ||
| 41 | + <el-option | ||
| 42 | + v-for="item in implBeans" | ||
| 43 | + :key="item.statusCd" | ||
| 44 | + :label="item.name" | ||
| 45 | + :value="item.statusCd" | ||
| 46 | + /> | ||
| 47 | + </el-select> | ||
| 48 | + </el-form-item> | ||
| 49 | + </el-form> | ||
| 50 | + <span slot="footer" class="dialog-footer"> | ||
| 51 | + <el-button @click="visible = false"> | ||
| 52 | + {{ $t('common.cancel') }} | ||
| 53 | + </el-button> | ||
| 54 | + <el-button type="primary" @click="handleSubmit"> | ||
| 55 | + {{ $t('common.confirm') }} | ||
| 56 | + </el-button> | ||
| 57 | + </span> | ||
| 58 | + </el-dialog> | ||
| 59 | +</template> | ||
| 60 | + | ||
| 61 | +<script> | ||
| 62 | +import { saveMachinePrinter } from '@/api/machine/machinePrinterManageApi' | ||
| 63 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 64 | +import { getDict } from '@/api/community/communityApi' | ||
| 65 | + | ||
| 66 | +export default { | ||
| 67 | + name: 'AddMachinePrinter', | ||
| 68 | + data() { | ||
| 69 | + return { | ||
| 70 | + visible: false, | ||
| 71 | + form: { | ||
| 72 | + machineName: '', | ||
| 73 | + machineCode: '', | ||
| 74 | + implBean: '', | ||
| 75 | + communityId: getCommunityId() | ||
| 76 | + }, | ||
| 77 | + implBeans: [], | ||
| 78 | + rules: { | ||
| 79 | + machineName: [ | ||
| 80 | + { required: true, message: this.$t('machinePrinterManage.validate.machineNameRequired'), trigger: 'blur' }, | ||
| 81 | + { max: 200, message: this.$t('machinePrinterManage.validate.machineNameMaxLength'), trigger: 'blur' } | ||
| 82 | + ], | ||
| 83 | + machineCode: [ | ||
| 84 | + { required: true, message: this.$t('machinePrinterManage.validate.machineCodeRequired'), trigger: 'blur' }, | ||
| 85 | + { max: 30, message: this.$t('machinePrinterManage.validate.machineCodeMaxLength'), trigger: 'blur' } | ||
| 86 | + ], | ||
| 87 | + implBean: [ | ||
| 88 | + { required: true, message: this.$t('machinePrinterManage.validate.implBeanRequired'), trigger: 'change' }, | ||
| 89 | + { max: 30, message: this.$t('machinePrinterManage.validate.implBeanMaxLength'), trigger: 'blur' } | ||
| 90 | + ] | ||
| 91 | + } | ||
| 92 | + } | ||
| 93 | + }, | ||
| 94 | + methods: { | ||
| 95 | + open() { | ||
| 96 | + this.visible = true | ||
| 97 | + this.getDictData() | ||
| 98 | + }, | ||
| 99 | + async getDictData() { | ||
| 100 | + try { | ||
| 101 | + const data = await getDict('machine_printer', 'impl_bean') | ||
| 102 | + this.implBeans = data | ||
| 103 | + } catch (error) { | ||
| 104 | + console.error('获取字典数据失败:', error) | ||
| 105 | + } | ||
| 106 | + }, | ||
| 107 | + handleClose() { | ||
| 108 | + this.$refs.form.resetFields() | ||
| 109 | + }, | ||
| 110 | + handleSubmit() { | ||
| 111 | + this.$refs.form.validate(async valid => { | ||
| 112 | + if (valid) { | ||
| 113 | + try { | ||
| 114 | + await saveMachinePrinter(this.form) | ||
| 115 | + this.$message.success(this.$t('machinePrinterManage.message.addSuccess')) | ||
| 116 | + this.visible = false | ||
| 117 | + this.$emit('success') | ||
| 118 | + } catch (error) { | ||
| 119 | + console.error('添加失败:', error) | ||
| 120 | + } | ||
| 121 | + } | ||
| 122 | + }) | ||
| 123 | + } | ||
| 124 | + } | ||
| 125 | +} | ||
| 126 | +</script> | ||
| 0 | \ No newline at end of file | 127 | \ No newline at end of file |
src/components/machine/addMachineTranslate.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('machineTranslateManage.add.title')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="50%" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <el-form ref="form" :model="formData" :rules="rules" label-width="120px"> | ||
| 9 | + <el-form-item :label="$t('machineTranslateManage.add.machineCode')" prop="machineCode"> | ||
| 10 | + <el-input | ||
| 11 | + v-model="formData.machineCode" | ||
| 12 | + :placeholder="$t('machineTranslateManage.add.machineCodePlaceholder')" | ||
| 13 | + /> | ||
| 14 | + </el-form-item> | ||
| 15 | + <el-form-item :label="$t('machineTranslateManage.add.machineId')" prop="machineId"> | ||
| 16 | + <el-input | ||
| 17 | + v-model="formData.machineId" | ||
| 18 | + :placeholder="$t('machineTranslateManage.add.machineIdPlaceholder')" | ||
| 19 | + /> | ||
| 20 | + </el-form-item> | ||
| 21 | + <el-form-item :label="$t('machineTranslateManage.add.typeCd')" prop="typeCd"> | ||
| 22 | + <el-select | ||
| 23 | + v-model="formData.typeCd" | ||
| 24 | + :placeholder="$t('machineTranslateManage.add.typeCdPlaceholder')" | ||
| 25 | + style="width: 100%" | ||
| 26 | + > | ||
| 27 | + <el-option | ||
| 28 | + v-for="item in typeOptions" | ||
| 29 | + :key="item.value" | ||
| 30 | + :label="item.label" | ||
| 31 | + :value="item.value" | ||
| 32 | + /> | ||
| 33 | + </el-select> | ||
| 34 | + </el-form-item> | ||
| 35 | + <el-form-item :label="$t('machineTranslateManage.add.objName')" prop="objName"> | ||
| 36 | + <el-input | ||
| 37 | + v-model="formData.objName" | ||
| 38 | + :placeholder="$t('machineTranslateManage.add.objNamePlaceholder')" | ||
| 39 | + /> | ||
| 40 | + </el-form-item> | ||
| 41 | + <el-form-item :label="$t('machineTranslateManage.add.objId')" prop="objId"> | ||
| 42 | + <el-input | ||
| 43 | + v-model="formData.objId" | ||
| 44 | + :placeholder="$t('machineTranslateManage.add.objIdPlaceholder')" | ||
| 45 | + /> | ||
| 46 | + </el-form-item> | ||
| 47 | + <el-form-item :label="$t('machineTranslateManage.add.state')" prop="state"> | ||
| 48 | + <el-select | ||
| 49 | + v-model="formData.state" | ||
| 50 | + :placeholder="$t('machineTranslateManage.add.statePlaceholder')" | ||
| 51 | + style="width: 100%" | ||
| 52 | + > | ||
| 53 | + <el-option | ||
| 54 | + :label="$t('machineTranslateManage.state.notSync')" | ||
| 55 | + value="10000" | ||
| 56 | + /> | ||
| 57 | + <el-option | ||
| 58 | + :label="$t('machineTranslateManage.state.synced')" | ||
| 59 | + value="20000" | ||
| 60 | + /> | ||
| 61 | + </el-select> | ||
| 62 | + </el-form-item> | ||
| 63 | + </el-form> | ||
| 64 | + <span slot="footer" class="dialog-footer"> | ||
| 65 | + <el-button @click="visible = false"> | ||
| 66 | + {{ $t('common.cancel') }} | ||
| 67 | + </el-button> | ||
| 68 | + <el-button type="primary" @click="handleSubmit"> | ||
| 69 | + {{ $t('common.confirm') }} | ||
| 70 | + </el-button> | ||
| 71 | + </span> | ||
| 72 | + </el-dialog> | ||
| 73 | +</template> | ||
| 74 | + | ||
| 75 | +<script> | ||
| 76 | +import { saveMachineTranslate } from '@/api/machine/machineTranslateManageApi' | ||
| 77 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 78 | + | ||
| 79 | +export default { | ||
| 80 | + name: 'AddMachineTranslate', | ||
| 81 | + data() { | ||
| 82 | + return { | ||
| 83 | + visible: false, | ||
| 84 | + formData: { | ||
| 85 | + machineCode: '', | ||
| 86 | + machineId: '', | ||
| 87 | + typeCd: '', | ||
| 88 | + objName: '', | ||
| 89 | + objId: '', | ||
| 90 | + state: '', | ||
| 91 | + communityId: '' | ||
| 92 | + }, | ||
| 93 | + typeOptions: [ | ||
| 94 | + { value: '8899', label: this.$t('machineTranslateManage.type.owner') }, | ||
| 95 | + { value: '9988', label: this.$t('machineTranslateManage.type.community') } | ||
| 96 | + ], | ||
| 97 | + rules: { | ||
| 98 | + machineCode: [ | ||
| 99 | + { required: true, message: this.$t('machineTranslateManage.validate.machineCodeRequired'), trigger: 'blur' }, | ||
| 100 | + { max: 30, message: this.$t('machineTranslateManage.validate.machineCodeMaxLength'), trigger: 'blur' } | ||
| 101 | + ], | ||
| 102 | + machineId: [ | ||
| 103 | + { required: true, message: this.$t('machineTranslateManage.validate.machineIdRequired'), trigger: 'blur' } | ||
| 104 | + ], | ||
| 105 | + typeCd: [ | ||
| 106 | + { required: true, message: this.$t('machineTranslateManage.validate.typeCdRequired'), trigger: 'change' } | ||
| 107 | + ], | ||
| 108 | + objName: [ | ||
| 109 | + { required: true, message: this.$t('machineTranslateManage.validate.objNameRequired'), trigger: 'blur' } | ||
| 110 | + ], | ||
| 111 | + objId: [ | ||
| 112 | + { required: true, message: this.$t('machineTranslateManage.validate.objIdRequired'), trigger: 'blur' }, | ||
| 113 | + { pattern: /^\d+$/, message: this.$t('machineTranslateManage.validate.objIdNumber'), trigger: 'blur' } | ||
| 114 | + ], | ||
| 115 | + state: [ | ||
| 116 | + { required: true, message: this.$t('machineTranslateManage.validate.stateRequired'), trigger: 'change' } | ||
| 117 | + ] | ||
| 118 | + } | ||
| 119 | + } | ||
| 120 | + }, | ||
| 121 | + methods: { | ||
| 122 | + open() { | ||
| 123 | + this.visible = true | ||
| 124 | + this.formData.communityId = getCommunityId() | ||
| 125 | + }, | ||
| 126 | + handleClose() { | ||
| 127 | + this.$refs.form.resetFields() | ||
| 128 | + }, | ||
| 129 | + handleSubmit() { | ||
| 130 | + this.$refs.form.validate(async valid => { | ||
| 131 | + if (valid) { | ||
| 132 | + try { | ||
| 133 | + await saveMachineTranslate(this.formData) | ||
| 134 | + this.$message.success(this.$t('machineTranslateManage.message.addSuccess')) | ||
| 135 | + this.visible = false | ||
| 136 | + this.$emit('success') | ||
| 137 | + } catch (error) { | ||
| 138 | + console.error('保存失败:', error) | ||
| 139 | + } | ||
| 140 | + } | ||
| 141 | + }) | ||
| 142 | + } | ||
| 143 | + } | ||
| 144 | +} | ||
| 145 | +</script> | ||
| 0 | \ No newline at end of file | 146 | \ No newline at end of file |
src/components/machine/addPrinterRule.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog :title="$t('printerRule.addTitle')" :visible.sync="visible" width="50%" @close="handleClose"> | ||
| 3 | + <el-form ref="form" :model="form" :rules="rules" label-width="120px"> | ||
| 4 | + <el-form-item :label="$t('printerRule.ruleName')" prop="ruleName"> | ||
| 5 | + <el-input v-model="form.ruleName" :placeholder="$t('printerRule.ruleNamePlaceholder')"></el-input> | ||
| 6 | + </el-form-item> | ||
| 7 | + <el-form-item :label="$t('printerRule.remark')" prop="remark"> | ||
| 8 | + <el-input type="textarea" v-model="form.remark" :placeholder="$t('printerRule.remarkPlaceholder')"></el-input> | ||
| 9 | + </el-form-item> | ||
| 10 | + <el-form-item :label="$t('printerRule.state')" prop="state"> | ||
| 11 | + <el-select v-model="form.state" style="width:100%"> | ||
| 12 | + <el-option v-for="item in stateOptions" :key="item.value" :label="item.label" :value="item.value"></el-option> | ||
| 13 | + </el-select> | ||
| 14 | + </el-form-item> | ||
| 15 | + </el-form> | ||
| 16 | + | ||
| 17 | + <span slot="footer" class="dialog-footer"> | ||
| 18 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | ||
| 19 | + <el-button type="primary" @click="handleSubmit">{{ $t('common.confirm') }}</el-button> | ||
| 20 | + </span> | ||
| 21 | + </el-dialog> | ||
| 22 | +</template> | ||
| 23 | + | ||
| 24 | +<script> | ||
| 25 | +import { savePrinterRule } from '@/api/machine/printerRuleApi' | ||
| 26 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 27 | +import { getDict } from '@/api/community/communityApi' | ||
| 28 | + | ||
| 29 | +export default { | ||
| 30 | + name: 'AddPrinterRule', | ||
| 31 | + data() { | ||
| 32 | + return { | ||
| 33 | + visible: false, | ||
| 34 | + form: { | ||
| 35 | + ruleName: '', | ||
| 36 | + remark: '', | ||
| 37 | + state: '1001', | ||
| 38 | + communityId: '' | ||
| 39 | + }, | ||
| 40 | + rules: { | ||
| 41 | + ruleName: [ | ||
| 42 | + { required: true, message: this.$t('printerRule.ruleNameRequired'), trigger: 'blur' }, | ||
| 43 | + { max: 64, message: this.$t('printerRule.ruleNameMaxLength'), trigger: 'blur' } | ||
| 44 | + ], | ||
| 45 | + remark: [ | ||
| 46 | + { max: 512, message: this.$t('printerRule.remarkMaxLength'), trigger: 'blur' } | ||
| 47 | + ] | ||
| 48 | + }, | ||
| 49 | + stateOptions: [] | ||
| 50 | + } | ||
| 51 | + }, | ||
| 52 | + created() { | ||
| 53 | + this.form.communityId = getCommunityId() | ||
| 54 | + this.getStateOptions() | ||
| 55 | + }, | ||
| 56 | + methods: { | ||
| 57 | + async getStateOptions() { | ||
| 58 | + try { | ||
| 59 | + const data = await getDict('printer_rule', 'state') | ||
| 60 | + this.stateOptions = data | ||
| 61 | + } catch (error) { | ||
| 62 | + console.error('获取状态字典失败:', error) | ||
| 63 | + } | ||
| 64 | + }, | ||
| 65 | + open() { | ||
| 66 | + this.visible = true | ||
| 67 | + this.resetForm() | ||
| 68 | + }, | ||
| 69 | + handleClose() { | ||
| 70 | + this.resetForm() | ||
| 71 | + }, | ||
| 72 | + resetForm() { | ||
| 73 | + this.$refs.form && this.$refs.form.resetFields() | ||
| 74 | + this.form = { | ||
| 75 | + ruleName: '', | ||
| 76 | + remark: '', | ||
| 77 | + state: '1001', | ||
| 78 | + communityId: getCommunityId() | ||
| 79 | + } | ||
| 80 | + }, | ||
| 81 | + handleSubmit() { | ||
| 82 | + this.$refs.form.validate(async valid => { | ||
| 83 | + if (valid) { | ||
| 84 | + try { | ||
| 85 | + await savePrinterRule(this.form) | ||
| 86 | + this.$message.success(this.$t('common.addSuccess')) | ||
| 87 | + this.visible = false | ||
| 88 | + this.$emit('success') | ||
| 89 | + } catch (error) { | ||
| 90 | + console.error('添加打印机规则失败:', error) | ||
| 91 | + } | ||
| 92 | + } | ||
| 93 | + }) | ||
| 94 | + } | ||
| 95 | + } | ||
| 96 | +} | ||
| 97 | +</script> | ||
| 0 | \ No newline at end of file | 98 | \ No newline at end of file |
src/components/machine/addPrinterRuleFee.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('printerRuleFees.addTitle')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="50%" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <el-form | ||
| 9 | + ref="form" | ||
| 10 | + :model="form" | ||
| 11 | + :rules="rules" | ||
| 12 | + label-width="120px" | ||
| 13 | + > | ||
| 14 | + <el-form-item | ||
| 15 | + :label="$t('printerRuleFees.fee')" | ||
| 16 | + prop="feeId" | ||
| 17 | + > | ||
| 18 | + <el-select | ||
| 19 | + v-model="form.feeId" | ||
| 20 | + :placeholder="$t('printerRuleFees.feePlaceholder')" | ||
| 21 | + style="width:100%" | ||
| 22 | + > | ||
| 23 | + <el-option | ||
| 24 | + v-for="item in feeConfigs" | ||
| 25 | + :key="item.configId" | ||
| 26 | + :label="item.feeName" | ||
| 27 | + :value="item.configId" | ||
| 28 | + /> | ||
| 29 | + </el-select> | ||
| 30 | + </el-form-item> | ||
| 31 | + </el-form> | ||
| 32 | + | ||
| 33 | + <span slot="footer" class="dialog-footer"> | ||
| 34 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | ||
| 35 | + <el-button type="primary" @click="handleSubmit">{{ $t('common.confirm') }}</el-button> | ||
| 36 | + </span> | ||
| 37 | + </el-dialog> | ||
| 38 | +</template> | ||
| 39 | + | ||
| 40 | +<script> | ||
| 41 | +import { savePrinterRuleFee, listFeeConfigs } from '@/api/machine/printerRuleApi' | ||
| 42 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 43 | + | ||
| 44 | +export default { | ||
| 45 | + name: 'AddPrinterRuleFee', | ||
| 46 | + props: { | ||
| 47 | + ruleId: { | ||
| 48 | + type: String, | ||
| 49 | + required: true | ||
| 50 | + } | ||
| 51 | + }, | ||
| 52 | + data() { | ||
| 53 | + return { | ||
| 54 | + visible: false, | ||
| 55 | + form: { | ||
| 56 | + feeId: '', | ||
| 57 | + ruleId: '', | ||
| 58 | + communityId: '' | ||
| 59 | + }, | ||
| 60 | + feeConfigs: [], | ||
| 61 | + rules: { | ||
| 62 | + feeId: [ | ||
| 63 | + { required: true, message: this.$t('printerRuleFees.feeRequired'), trigger: 'change' } | ||
| 64 | + ] | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + }, | ||
| 68 | + created() { | ||
| 69 | + this.form.communityId = getCommunityId() | ||
| 70 | + this.getFeeConfigs() | ||
| 71 | + }, | ||
| 72 | + methods: { | ||
| 73 | + open() { | ||
| 74 | + this.visible = true | ||
| 75 | + this.form.ruleId = this.ruleId | ||
| 76 | + }, | ||
| 77 | + handleClose() { | ||
| 78 | + this.$refs.form.resetFields() | ||
| 79 | + }, | ||
| 80 | + async getFeeConfigs() { | ||
| 81 | + try { | ||
| 82 | + const params = { | ||
| 83 | + page: 1, | ||
| 84 | + row: 100, | ||
| 85 | + communityId: this.form.communityId | ||
| 86 | + } | ||
| 87 | + const { feeConfigs } = await listFeeConfigs(params) | ||
| 88 | + this.feeConfigs = feeConfigs | ||
| 89 | + } catch (error) { | ||
| 90 | + console.error('获取费用配置列表失败:', error) | ||
| 91 | + } | ||
| 92 | + }, | ||
| 93 | + async handleSubmit() { | ||
| 94 | + this.$refs.form.validate(async valid => { | ||
| 95 | + if (valid) { | ||
| 96 | + try { | ||
| 97 | + await savePrinterRuleFee(this.form) | ||
| 98 | + this.$message.success(this.$t('common.addSuccess')) | ||
| 99 | + this.visible = false | ||
| 100 | + this.$emit('success') | ||
| 101 | + } catch (error) { | ||
| 102 | + console.error('添加缴费自动打印失败:', error) | ||
| 103 | + } | ||
| 104 | + } | ||
| 105 | + }) | ||
| 106 | + } | ||
| 107 | + } | ||
| 108 | +} | ||
| 109 | +</script> | ||
| 0 | \ No newline at end of file | 110 | \ No newline at end of file |
src/components/machine/addPrinterRuleMachine.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog :title="$t('printerRuleMachine.addTitle')" :visible.sync="visible" width="50%" @close="handleClose"> | ||
| 3 | + <el-form ref="form" :model="form" :rules="rules" label-width="120px"> | ||
| 4 | + <el-form-item :label="$t('printerRuleMachine.machine')" prop="machineId"> | ||
| 5 | + <el-select v-model="form.machineId" :placeholder="$t('printerRuleMachine.machinePlaceholder')" style="width:100%"> | ||
| 6 | + <el-option v-for="item in machines" :key="item.machineId" :label="`${item.machineName}(${item.machineCode})`" | ||
| 7 | + :value="item.machineId" /> | ||
| 8 | + </el-select> | ||
| 9 | + </el-form-item> | ||
| 10 | + <el-form-item :label="$t('printerRuleMachine.quantity')" prop="quantity"> | ||
| 11 | + <el-input-number v-model="form.quantity" :min="1" :max="100" | ||
| 12 | + :placeholder="$t('printerRuleMachine.quantityPlaceholder')" /> | ||
| 13 | + </el-form-item> | ||
| 14 | + </el-form> | ||
| 15 | + | ||
| 16 | + <span slot="footer" class="dialog-footer"> | ||
| 17 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | ||
| 18 | + <el-button type="primary" @click="handleSubmit">{{ $t('common.confirm') }}</el-button> | ||
| 19 | + </span> | ||
| 20 | + </el-dialog> | ||
| 21 | +</template> | ||
| 22 | + | ||
| 23 | +<script> | ||
| 24 | +import { savePrinterRuleMachine, listMachinePrinters } from '@/api/machine/printerRuleApi' | ||
| 25 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 26 | + | ||
| 27 | +export default { | ||
| 28 | + name: 'AddPrinterRuleMachine', | ||
| 29 | + data() { | ||
| 30 | + return { | ||
| 31 | + visible: false, | ||
| 32 | + form: { | ||
| 33 | + machineId: '', | ||
| 34 | + quantity: 1, | ||
| 35 | + ruleId: '', | ||
| 36 | + communityId: '' | ||
| 37 | + }, | ||
| 38 | + machines: [], | ||
| 39 | + rules: { | ||
| 40 | + machineId: [ | ||
| 41 | + { required: true, message: this.$t('printerRuleMachine.machineRequired'), trigger: 'change' } | ||
| 42 | + ], | ||
| 43 | + quantity: [ | ||
| 44 | + { required: true, message: this.$t('printerRuleMachine.quantityRequired'), trigger: 'blur' } | ||
| 45 | + ] | ||
| 46 | + } | ||
| 47 | + } | ||
| 48 | + }, | ||
| 49 | + created() { | ||
| 50 | + this.form.communityId = getCommunityId() | ||
| 51 | + this.getMachines() | ||
| 52 | + }, | ||
| 53 | + methods: { | ||
| 54 | + open(ruleId) { | ||
| 55 | + this.visible = true | ||
| 56 | + this.form.ruleId = ruleId | ||
| 57 | + }, | ||
| 58 | + handleClose() { | ||
| 59 | + this.$refs.form.resetFields() | ||
| 60 | + this.form.quantity = 1 | ||
| 61 | + }, | ||
| 62 | + async getMachines() { | ||
| 63 | + try { | ||
| 64 | + const params = { | ||
| 65 | + page: 1, | ||
| 66 | + row: 100, | ||
| 67 | + communityId: this.form.communityId | ||
| 68 | + } | ||
| 69 | + const { data } = await listMachinePrinters(params) | ||
| 70 | + this.machines = data | ||
| 71 | + } catch (error) { | ||
| 72 | + console.error('获取打印机列表失败:', error) | ||
| 73 | + } | ||
| 74 | + }, | ||
| 75 | + async handleSubmit() { | ||
| 76 | + this.$refs.form.validate(async valid => { | ||
| 77 | + if (valid) { | ||
| 78 | + try { | ||
| 79 | + await savePrinterRuleMachine(this.form) | ||
| 80 | + this.$message.success(this.$t('common.addSuccess')) | ||
| 81 | + this.visible = false | ||
| 82 | + this.$emit('success') | ||
| 83 | + } catch (error) { | ||
| 84 | + console.error('添加打印机规则机器失败:', error) | ||
| 85 | + } | ||
| 86 | + } | ||
| 87 | + }) | ||
| 88 | + } | ||
| 89 | + } | ||
| 90 | +} | ||
| 91 | +</script> | ||
| 0 | \ No newline at end of file | 92 | \ No newline at end of file |
src/components/machine/addPrinterRuleRepair.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('printerRuleRepair.addTitle')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="50%" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <el-form | ||
| 9 | + ref="form" | ||
| 10 | + :model="form" | ||
| 11 | + :rules="rules" | ||
| 12 | + label-width="120px" | ||
| 13 | + > | ||
| 14 | + <el-form-item | ||
| 15 | + :label="$t('printerRuleRepair.repairType')" | ||
| 16 | + prop="repairType" | ||
| 17 | + > | ||
| 18 | + <el-select | ||
| 19 | + v-model="form.repairType" | ||
| 20 | + :placeholder="$t('printerRuleRepair.repairTypePlaceholder')" | ||
| 21 | + style="width:100%" | ||
| 22 | + > | ||
| 23 | + <el-option | ||
| 24 | + v-for="item in repairSettings" | ||
| 25 | + :key="item.repairType" | ||
| 26 | + :label="item.repairTypeName" | ||
| 27 | + :value="item.repairType" | ||
| 28 | + /> | ||
| 29 | + </el-select> | ||
| 30 | + </el-form-item> | ||
| 31 | + </el-form> | ||
| 32 | + | ||
| 33 | + <span slot="footer" class="dialog-footer"> | ||
| 34 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | ||
| 35 | + <el-button type="primary" @click="handleSubmit">{{ $t('common.confirm') }}</el-button> | ||
| 36 | + </span> | ||
| 37 | + </el-dialog> | ||
| 38 | +</template> | ||
| 39 | + | ||
| 40 | +<script> | ||
| 41 | +import { savePrinterRuleRepair, listRepairSettings } from '@/api/machine/printerRuleApi' | ||
| 42 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 43 | + | ||
| 44 | +export default { | ||
| 45 | + name: 'AddPrinterRuleRepair', | ||
| 46 | + props: { | ||
| 47 | + ruleId: { | ||
| 48 | + type: String, | ||
| 49 | + required: true | ||
| 50 | + } | ||
| 51 | + }, | ||
| 52 | + data() { | ||
| 53 | + return { | ||
| 54 | + visible: false, | ||
| 55 | + form: { | ||
| 56 | + repairType: '', | ||
| 57 | + ruleId: '', | ||
| 58 | + communityId: '' | ||
| 59 | + }, | ||
| 60 | + repairSettings: [], | ||
| 61 | + rules: { | ||
| 62 | + repairType: [ | ||
| 63 | + { required: true, message: this.$t('printerRuleRepair.repairTypeRequired'), trigger: 'change' } | ||
| 64 | + ] | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + }, | ||
| 68 | + created() { | ||
| 69 | + this.form.communityId = getCommunityId() | ||
| 70 | + this.getRepairSettings() | ||
| 71 | + }, | ||
| 72 | + methods: { | ||
| 73 | + open() { | ||
| 74 | + this.visible = true | ||
| 75 | + this.form.ruleId = this.ruleId | ||
| 76 | + }, | ||
| 77 | + handleClose() { | ||
| 78 | + this.$refs.form.resetFields() | ||
| 79 | + }, | ||
| 80 | + async getRepairSettings() { | ||
| 81 | + try { | ||
| 82 | + const params = { | ||
| 83 | + page: 1, | ||
| 84 | + row: 100, | ||
| 85 | + communityId: this.form.communityId | ||
| 86 | + } | ||
| 87 | + const { data } = await listRepairSettings(params) | ||
| 88 | + this.repairSettings = data | ||
| 89 | + } catch (error) { | ||
| 90 | + console.error('获取报修设置列表失败:', error) | ||
| 91 | + } | ||
| 92 | + }, | ||
| 93 | + async handleSubmit() { | ||
| 94 | + this.$refs.form.validate(async valid => { | ||
| 95 | + if (valid) { | ||
| 96 | + try { | ||
| 97 | + await savePrinterRuleRepair(this.form) | ||
| 98 | + this.$message.success(this.$t('common.addSuccess')) | ||
| 99 | + this.visible = false | ||
| 100 | + this.$emit('success') | ||
| 101 | + } catch (error) { | ||
| 102 | + console.error('添加报修自动打印失败:', error) | ||
| 103 | + } | ||
| 104 | + } | ||
| 105 | + }) | ||
| 106 | + } | ||
| 107 | + } | ||
| 108 | +} | ||
| 109 | +</script> | ||
| 0 | \ No newline at end of file | 110 | \ No newline at end of file |
src/components/machine/deleteMachinePrinter.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('machinePrinterManage.delete.title')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="30%" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <div class="delete-content"> | ||
| 9 | + <p>{{ $t('machinePrinterManage.delete.confirmText') }}</p> | ||
| 10 | + </div> | ||
| 11 | + <span slot="footer" class="dialog-footer"> | ||
| 12 | + <el-button @click="visible = false"> | ||
| 13 | + {{ $t('common.cancel') }} | ||
| 14 | + </el-button> | ||
| 15 | + <el-button type="primary" @click="handleConfirm"> | ||
| 16 | + {{ $t('common.confirm') }} | ||
| 17 | + </el-button> | ||
| 18 | + </span> | ||
| 19 | + </el-dialog> | ||
| 20 | +</template> | ||
| 21 | + | ||
| 22 | +<script> | ||
| 23 | +import { deleteMachinePrinter } from '@/api/machine/machinePrinterManageApi' | ||
| 24 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 25 | + | ||
| 26 | +export default { | ||
| 27 | + name: 'DeleteMachinePrinter', | ||
| 28 | + data() { | ||
| 29 | + return { | ||
| 30 | + visible: false, | ||
| 31 | + form: { | ||
| 32 | + machineId: '', | ||
| 33 | + communityId: getCommunityId() | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + }, | ||
| 37 | + methods: { | ||
| 38 | + open(row) { | ||
| 39 | + this.form.machineId = row.machineId | ||
| 40 | + this.visible = true | ||
| 41 | + }, | ||
| 42 | + handleClose() { | ||
| 43 | + this.form.machineId = '' | ||
| 44 | + }, | ||
| 45 | + async handleConfirm() { | ||
| 46 | + try { | ||
| 47 | + await deleteMachinePrinter(this.form) | ||
| 48 | + this.$message.success(this.$t('machinePrinterManage.message.deleteSuccess')) | ||
| 49 | + this.visible = false | ||
| 50 | + this.$emit('success') | ||
| 51 | + } catch (error) { | ||
| 52 | + console.error('删除失败:', error) | ||
| 53 | + } | ||
| 54 | + } | ||
| 55 | + } | ||
| 56 | +} | ||
| 57 | +</script> | ||
| 58 | + | ||
| 59 | +<style scoped> | ||
| 60 | +.delete-content { | ||
| 61 | + text-align: center; | ||
| 62 | + font-size: 16px; | ||
| 63 | + padding: 20px 0; | ||
| 64 | +} | ||
| 65 | +</style> | ||
| 0 | \ No newline at end of file | 66 | \ No newline at end of file |
src/components/machine/deletePrinterRule.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('printerRule.deleteTitle')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="30%" | ||
| 6 | + center | ||
| 7 | + > | ||
| 8 | + <div class="text-center"> | ||
| 9 | + <p>{{ $t('printerRule.deleteConfirm') }}</p> | ||
| 10 | + <p class="delete-item">{{ form.ruleName }}</p> | ||
| 11 | + </div> | ||
| 12 | + <span slot="footer" class="dialog-footer"> | ||
| 13 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | ||
| 14 | + <el-button type="danger" @click="handleDelete">{{ $t('common.confirmDelete') }}</el-button> | ||
| 15 | + </span> | ||
| 16 | + </el-dialog> | ||
| 17 | +</template> | ||
| 18 | + | ||
| 19 | +<script> | ||
| 20 | +import { deletePrinterRule } from '@/api/machine/printerRuleApi' | ||
| 21 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 22 | + | ||
| 23 | +export default { | ||
| 24 | + name: 'DeletePrinterRule', | ||
| 25 | + data() { | ||
| 26 | + return { | ||
| 27 | + visible: false, | ||
| 28 | + form: { | ||
| 29 | + ruleId: '', | ||
| 30 | + ruleName: '', | ||
| 31 | + communityId: '' | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | + }, | ||
| 35 | + created() { | ||
| 36 | + this.form.communityId = getCommunityId() | ||
| 37 | + }, | ||
| 38 | + methods: { | ||
| 39 | + open(data) { | ||
| 40 | + this.visible = true | ||
| 41 | + this.form = { | ||
| 42 | + ruleId: data.ruleId, | ||
| 43 | + ruleName: data.ruleName, | ||
| 44 | + communityId: getCommunityId() | ||
| 45 | + } | ||
| 46 | + }, | ||
| 47 | + async handleDelete() { | ||
| 48 | + try { | ||
| 49 | + await deletePrinterRule(this.form) | ||
| 50 | + this.$message.success(this.$t('common.deleteSuccess')) | ||
| 51 | + this.visible = false | ||
| 52 | + this.$emit('success') | ||
| 53 | + } catch (error) { | ||
| 54 | + console.error('删除打印机规则失败:', error) | ||
| 55 | + } | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | +} | ||
| 59 | +</script> | ||
| 60 | + | ||
| 61 | +<style scoped> | ||
| 62 | +.text-center { | ||
| 63 | + text-align: center; | ||
| 64 | +} | ||
| 65 | +.delete-item { | ||
| 66 | + font-weight: bold; | ||
| 67 | + margin: 10px 0; | ||
| 68 | + color: #f56c6c; | ||
| 69 | +} | ||
| 70 | +</style> | ||
| 0 | \ No newline at end of file | 71 | \ No newline at end of file |
src/components/machine/deletePrinterRuleFee.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('printerRuleFees.deleteTitle')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="30%" | ||
| 6 | + center | ||
| 7 | + > | ||
| 8 | + <div class="text-center"> | ||
| 9 | + <p>{{ $t('printerRuleFees.deleteConfirm') }}</p> | ||
| 10 | + <p class="delete-item">{{ form.feeConfigName }}</p> | ||
| 11 | + </div> | ||
| 12 | + <span slot="footer" class="dialog-footer"> | ||
| 13 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | ||
| 14 | + <el-button type="danger" @click="handleDelete">{{ $t('common.confirmDelete') }}</el-button> | ||
| 15 | + </span> | ||
| 16 | + </el-dialog> | ||
| 17 | +</template> | ||
| 18 | + | ||
| 19 | +<script> | ||
| 20 | +import { deletePrinterRuleFee } from '@/api/machine/printerRuleApi' | ||
| 21 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 22 | + | ||
| 23 | +export default { | ||
| 24 | + name: 'DeletePrinterRuleFee', | ||
| 25 | + data() { | ||
| 26 | + return { | ||
| 27 | + visible: false, | ||
| 28 | + form: { | ||
| 29 | + prfId: '', | ||
| 30 | + feeConfigName: '', | ||
| 31 | + communityId: '' | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | + }, | ||
| 35 | + created() { | ||
| 36 | + this.form.communityId = getCommunityId() | ||
| 37 | + }, | ||
| 38 | + methods: { | ||
| 39 | + open(row) { | ||
| 40 | + this.visible = true | ||
| 41 | + this.form = { | ||
| 42 | + prfId: row.prfId, | ||
| 43 | + feeConfigName: row.feeConfigName, | ||
| 44 | + communityId: getCommunityId() | ||
| 45 | + } | ||
| 46 | + }, | ||
| 47 | + async handleDelete() { | ||
| 48 | + try { | ||
| 49 | + await deletePrinterRuleFee({ | ||
| 50 | + prfId: this.form.prfId, | ||
| 51 | + communityId: this.form.communityId | ||
| 52 | + }) | ||
| 53 | + this.$message.success(this.$t('common.deleteSuccess')) | ||
| 54 | + this.visible = false | ||
| 55 | + this.$emit('success') | ||
| 56 | + } catch (error) { | ||
| 57 | + console.error('删除缴费自动打印失败:', error) | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | +} | ||
| 62 | +</script> | ||
| 63 | + | ||
| 64 | +<style scoped> | ||
| 65 | +.text-center { | ||
| 66 | + text-align: center; | ||
| 67 | +} | ||
| 68 | +.delete-item { | ||
| 69 | + font-weight: bold; | ||
| 70 | + margin: 10px 0; | ||
| 71 | + color: #f56c6c; | ||
| 72 | +} | ||
| 73 | +</style> | ||
| 0 | \ No newline at end of file | 74 | \ No newline at end of file |
src/components/machine/deletePrinterRuleMachine.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('printerRuleMachine.deleteTitle')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="30%" | ||
| 6 | + center | ||
| 7 | + > | ||
| 8 | + <div class="text-center"> | ||
| 9 | + <p>{{ $t('printerRuleMachine.deleteConfirm') }}</p> | ||
| 10 | + <p class="delete-item">{{ form.machineName }}</p> | ||
| 11 | + <p>{{ $t('printerRuleMachine.quantity') }}: {{ form.quantity }}</p> | ||
| 12 | + </div> | ||
| 13 | + <span slot="footer" class="dialog-footer"> | ||
| 14 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | ||
| 15 | + <el-button type="danger" @click="handleDelete">{{ $t('common.confirmDelete') }}</el-button> | ||
| 16 | + </span> | ||
| 17 | + </el-dialog> | ||
| 18 | +</template> | ||
| 19 | + | ||
| 20 | +<script> | ||
| 21 | +import { deletePrinterRuleMachine } from '@/api/machine/printerRuleApi' | ||
| 22 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 23 | + | ||
| 24 | +export default { | ||
| 25 | + name: 'DeletePrinterRuleMachine', | ||
| 26 | + data() { | ||
| 27 | + return { | ||
| 28 | + visible: false, | ||
| 29 | + form: { | ||
| 30 | + prmId: '', | ||
| 31 | + machineName: '', | ||
| 32 | + quantity: 0, | ||
| 33 | + communityId: '' | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + }, | ||
| 37 | + created() { | ||
| 38 | + this.form.communityId = getCommunityId() | ||
| 39 | + }, | ||
| 40 | + methods: { | ||
| 41 | + open(row) { | ||
| 42 | + this.visible = true | ||
| 43 | + this.form = { | ||
| 44 | + prmId: row.prmId, | ||
| 45 | + machineName: row.machineName, | ||
| 46 | + quantity: row.quantity, | ||
| 47 | + communityId: getCommunityId() | ||
| 48 | + } | ||
| 49 | + }, | ||
| 50 | + async handleDelete() { | ||
| 51 | + try { | ||
| 52 | + await deletePrinterRuleMachine({ | ||
| 53 | + prmId: this.form.prmId, | ||
| 54 | + communityId: this.form.communityId | ||
| 55 | + }) | ||
| 56 | + this.$message.success(this.$t('common.deleteSuccess')) | ||
| 57 | + this.visible = false | ||
| 58 | + this.$emit('success') | ||
| 59 | + } catch (error) { | ||
| 60 | + console.error('删除打印机规则机器失败:', error) | ||
| 61 | + } | ||
| 62 | + } | ||
| 63 | + } | ||
| 64 | +} | ||
| 65 | +</script> | ||
| 66 | + | ||
| 67 | +<style scoped> | ||
| 68 | +.text-center { | ||
| 69 | + text-align: center; | ||
| 70 | +} | ||
| 71 | +.delete-item { | ||
| 72 | + font-weight: bold; | ||
| 73 | + margin: 10px 0; | ||
| 74 | + color: #f56c6c; | ||
| 75 | +} | ||
| 76 | +</style> | ||
| 0 | \ No newline at end of file | 77 | \ No newline at end of file |
src/components/machine/deletePrinterRuleRepair.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('printerRuleRepair.deleteTitle')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="30%" | ||
| 6 | + center | ||
| 7 | + > | ||
| 8 | + <div class="text-center"> | ||
| 9 | + <p>{{ $t('printerRuleRepair.deleteConfirm') }}</p> | ||
| 10 | + <p class="delete-item">{{ form.repairTypeName }}</p> | ||
| 11 | + </div> | ||
| 12 | + <span slot="footer" class="dialog-footer"> | ||
| 13 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | ||
| 14 | + <el-button type="danger" @click="handleDelete">{{ $t('common.confirmDelete') }}</el-button> | ||
| 15 | + </span> | ||
| 16 | + </el-dialog> | ||
| 17 | +</template> | ||
| 18 | + | ||
| 19 | +<script> | ||
| 20 | +import { deletePrinterRuleRepair } from '@/api/machine/printerRuleApi' | ||
| 21 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 22 | + | ||
| 23 | +export default { | ||
| 24 | + name: 'DeletePrinterRuleRepair', | ||
| 25 | + data() { | ||
| 26 | + return { | ||
| 27 | + visible: false, | ||
| 28 | + form: { | ||
| 29 | + prrId: '', | ||
| 30 | + repairTypeName: '', | ||
| 31 | + communityId: '' | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | + }, | ||
| 35 | + created() { | ||
| 36 | + this.form.communityId = getCommunityId() | ||
| 37 | + }, | ||
| 38 | + methods: { | ||
| 39 | + open(row) { | ||
| 40 | + this.visible = true | ||
| 41 | + this.form = { | ||
| 42 | + prrId: row.prrId, | ||
| 43 | + repairTypeName: row.repairTypeName, | ||
| 44 | + communityId: getCommunityId() | ||
| 45 | + } | ||
| 46 | + }, | ||
| 47 | + async handleDelete() { | ||
| 48 | + try { | ||
| 49 | + await deletePrinterRuleRepair({ | ||
| 50 | + prrId: this.form.prrId, | ||
| 51 | + communityId: this.form.communityId | ||
| 52 | + }) | ||
| 53 | + this.$message.success(this.$t('common.deleteSuccess')) | ||
| 54 | + this.visible = false | ||
| 55 | + this.$emit('success') | ||
| 56 | + } catch (error) { | ||
| 57 | + console.error('删除报修自动打印失败:', error) | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | +} | ||
| 62 | +</script> | ||
| 63 | + | ||
| 64 | +<style scoped> | ||
| 65 | +.text-center { | ||
| 66 | + text-align: center; | ||
| 67 | +} | ||
| 68 | +.delete-item { | ||
| 69 | + font-weight: bold; | ||
| 70 | + margin: 10px 0; | ||
| 71 | + color: #f56c6c; | ||
| 72 | +} | ||
| 73 | +</style> | ||
| 0 | \ No newline at end of file | 74 | \ No newline at end of file |
src/components/machine/editMachinePrinter.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('machinePrinterManage.edit.title')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="50%" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <el-form | ||
| 9 | + ref="form" | ||
| 10 | + :model="form" | ||
| 11 | + :rules="rules" | ||
| 12 | + label-width="120px" | ||
| 13 | + > | ||
| 14 | + <el-form-item | ||
| 15 | + :label="$t('machinePrinterManage.form.machineName')" | ||
| 16 | + prop="machineName" | ||
| 17 | + > | ||
| 18 | + <el-input | ||
| 19 | + v-model="form.machineName" | ||
| 20 | + :placeholder="$t('machinePrinterManage.form.machineNamePlaceholder')" | ||
| 21 | + /> | ||
| 22 | + </el-form-item> | ||
| 23 | + <el-form-item | ||
| 24 | + :label="$t('machinePrinterManage.form.machineCode')" | ||
| 25 | + prop="machineCode" | ||
| 26 | + > | ||
| 27 | + <el-input | ||
| 28 | + v-model="form.machineCode" | ||
| 29 | + :placeholder="$t('machinePrinterManage.form.machineCodePlaceholder')" | ||
| 30 | + /> | ||
| 31 | + </el-form-item> | ||
| 32 | + <el-form-item | ||
| 33 | + :label="$t('machinePrinterManage.form.implBean')" | ||
| 34 | + prop="implBean" | ||
| 35 | + > | ||
| 36 | + <el-select | ||
| 37 | + v-model="form.implBean" | ||
| 38 | + :placeholder="$t('machinePrinterManage.form.implBeanPlaceholder')" | ||
| 39 | + style="width: 100%" | ||
| 40 | + > | ||
| 41 | + <el-option | ||
| 42 | + v-for="item in implBeans" | ||
| 43 | + :key="item.statusCd" | ||
| 44 | + :label="item.name" | ||
| 45 | + :value="item.statusCd" | ||
| 46 | + /> | ||
| 47 | + </el-select> | ||
| 48 | + </el-form-item> | ||
| 49 | + </el-form> | ||
| 50 | + <span slot="footer" class="dialog-footer"> | ||
| 51 | + <el-button @click="visible = false"> | ||
| 52 | + {{ $t('common.cancel') }} | ||
| 53 | + </el-button> | ||
| 54 | + <el-button type="primary" @click="handleSubmit"> | ||
| 55 | + {{ $t('common.confirm') }} | ||
| 56 | + </el-button> | ||
| 57 | + </span> | ||
| 58 | + </el-dialog> | ||
| 59 | +</template> | ||
| 60 | + | ||
| 61 | +<script> | ||
| 62 | +import { updateMachinePrinter } from '@/api/machine/machinePrinterManageApi' | ||
| 63 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 64 | +import { getDict } from '@/api/community/communityApi' | ||
| 65 | + | ||
| 66 | +export default { | ||
| 67 | + name: 'EditMachinePrinter', | ||
| 68 | + data() { | ||
| 69 | + return { | ||
| 70 | + visible: false, | ||
| 71 | + form: { | ||
| 72 | + machineId: '', | ||
| 73 | + machineName: '', | ||
| 74 | + machineCode: '', | ||
| 75 | + implBean: '', | ||
| 76 | + communityId: getCommunityId() | ||
| 77 | + }, | ||
| 78 | + implBeans: [], | ||
| 79 | + rules: { | ||
| 80 | + machineId: [ | ||
| 81 | + { required: true, message: this.$t('machinePrinterManage.validate.machineIdRequired'), trigger: 'blur' } | ||
| 82 | + ], | ||
| 83 | + machineName: [ | ||
| 84 | + { required: true, message: this.$t('machinePrinterManage.validate.machineNameRequired'), trigger: 'blur' }, | ||
| 85 | + { max: 200, message: this.$t('machinePrinterManage.validate.machineNameMaxLength'), trigger: 'blur' } | ||
| 86 | + ], | ||
| 87 | + machineCode: [ | ||
| 88 | + { required: true, message: this.$t('machinePrinterManage.validate.machineCodeRequired'), trigger: 'blur' }, | ||
| 89 | + { max: 30, message: this.$t('machinePrinterManage.validate.machineCodeMaxLength'), trigger: 'blur' } | ||
| 90 | + ], | ||
| 91 | + implBean: [ | ||
| 92 | + { required: true, message: this.$t('machinePrinterManage.validate.implBeanRequired'), trigger: 'change' }, | ||
| 93 | + { max: 30, message: this.$t('machinePrinterManage.validate.implBeanMaxLength'), trigger: 'blur' } | ||
| 94 | + ] | ||
| 95 | + } | ||
| 96 | + } | ||
| 97 | + }, | ||
| 98 | + methods: { | ||
| 99 | + open(row) { | ||
| 100 | + this.form = { ...row } | ||
| 101 | + this.visible = true | ||
| 102 | + this.getDictData() | ||
| 103 | + }, | ||
| 104 | + async getDictData() { | ||
| 105 | + try { | ||
| 106 | + const data = await getDict('machine_printer', 'impl_bean') | ||
| 107 | + this.implBeans = data | ||
| 108 | + } catch (error) { | ||
| 109 | + console.error('获取字典数据失败:', error) | ||
| 110 | + } | ||
| 111 | + }, | ||
| 112 | + handleClose() { | ||
| 113 | + this.$refs.form.resetFields() | ||
| 114 | + }, | ||
| 115 | + handleSubmit() { | ||
| 116 | + this.$refs.form.validate(async valid => { | ||
| 117 | + if (valid) { | ||
| 118 | + try { | ||
| 119 | + await updateMachinePrinter(this.form) | ||
| 120 | + this.$message.success(this.$t('machinePrinterManage.message.editSuccess')) | ||
| 121 | + this.visible = false | ||
| 122 | + this.$emit('success') | ||
| 123 | + } catch (error) { | ||
| 124 | + console.error('修改失败:', error) | ||
| 125 | + } | ||
| 126 | + } | ||
| 127 | + }) | ||
| 128 | + } | ||
| 129 | + } | ||
| 130 | +} | ||
| 131 | +</script> | ||
| 0 | \ No newline at end of file | 132 | \ No newline at end of file |
src/components/machine/editMachineTranslate.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('machineTranslateManage.edit.title')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="50%" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <el-form ref="form" :model="formData" label-width="120px"> | ||
| 9 | + <el-form-item :label="$t('machineTranslateManage.edit.machineCode')"> | ||
| 10 | + <el-input v-model="formData.machineCode" disabled /> | ||
| 11 | + </el-form-item> | ||
| 12 | + <el-form-item :label="$t('machineTranslateManage.edit.machineId')"> | ||
| 13 | + <el-input v-model="formData.machineId" disabled /> | ||
| 14 | + </el-form-item> | ||
| 15 | + <el-form-item :label="$t('machineTranslateManage.edit.typeCd')"> | ||
| 16 | + <el-select v-model="formData.typeCd" disabled style="width: 100%"> | ||
| 17 | + <el-option | ||
| 18 | + v-for="item in typeOptions" | ||
| 19 | + :key="item.value" | ||
| 20 | + :label="item.label" | ||
| 21 | + :value="item.value" | ||
| 22 | + /> | ||
| 23 | + </el-select> | ||
| 24 | + </el-form-item> | ||
| 25 | + <el-form-item :label="$t('machineTranslateManage.edit.objName')"> | ||
| 26 | + <el-input v-model="formData.objName" disabled /> | ||
| 27 | + </el-form-item> | ||
| 28 | + <el-form-item :label="$t('machineTranslateManage.edit.objId')"> | ||
| 29 | + <el-input v-model="formData.objId" disabled /> | ||
| 30 | + </el-form-item> | ||
| 31 | + </el-form> | ||
| 32 | + <span slot="footer" class="dialog-footer"> | ||
| 33 | + <el-button @click="visible = false"> | ||
| 34 | + {{ $t('common.cancel') }} | ||
| 35 | + </el-button> | ||
| 36 | + <el-button type="primary" @click="handleSubmit"> | ||
| 37 | + {{ $t('machineTranslateManage.button.resync') }} | ||
| 38 | + </el-button> | ||
| 39 | + </span> | ||
| 40 | + </el-dialog> | ||
| 41 | +</template> | ||
| 42 | + | ||
| 43 | +<script> | ||
| 44 | +import { resendIot } from '@/api/machine/machineTranslateManageApi' | ||
| 45 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 46 | + | ||
| 47 | +export default { | ||
| 48 | + name: 'EditMachineTranslate', | ||
| 49 | + data() { | ||
| 50 | + return { | ||
| 51 | + visible: false, | ||
| 52 | + formData: { | ||
| 53 | + machineTranslateId: '', | ||
| 54 | + machineCode: '', | ||
| 55 | + machineId: '', | ||
| 56 | + typeCd: '', | ||
| 57 | + objName: '', | ||
| 58 | + objId: '', | ||
| 59 | + communityId: '' | ||
| 60 | + }, | ||
| 61 | + typeOptions: [ | ||
| 62 | + { value: '8899', label: this.$t('machineTranslateManage.type.owner') }, | ||
| 63 | + { value: '9988', label: this.$t('machineTranslateManage.type.community') }, | ||
| 64 | + { value: '7788', label: this.$t('machineTranslateManage.type.keyInfo') }, | ||
| 65 | + { value: '6677', label: this.$t('machineTranslateManage.type.visitorInfo') }, | ||
| 66 | + { value: '5566', label: this.$t('machineTranslateManage.type.staffFace') }, | ||
| 67 | + { value: '4455', label: this.$t('machineTranslateManage.type.carInfo') }, | ||
| 68 | + { value: '3344', label: this.$t('machineTranslateManage.type.deviceInfo') } | ||
| 69 | + ] | ||
| 70 | + } | ||
| 71 | + }, | ||
| 72 | + methods: { | ||
| 73 | + open(data) { | ||
| 74 | + this.formData = { ...data } | ||
| 75 | + this.formData.communityId = getCommunityId() | ||
| 76 | + this.visible = true | ||
| 77 | + }, | ||
| 78 | + handleClose() { | ||
| 79 | + this.$refs.form.resetFields() | ||
| 80 | + }, | ||
| 81 | + async handleSubmit() { | ||
| 82 | + try { | ||
| 83 | + await resendIot(this.formData) | ||
| 84 | + this.$message.success(this.$t('machineTranslateManage.message.resyncSuccess')) | ||
| 85 | + this.visible = false | ||
| 86 | + this.$emit('success') | ||
| 87 | + } catch (error) { | ||
| 88 | + console.error('重新同步失败:', error) | ||
| 89 | + } | ||
| 90 | + } | ||
| 91 | + } | ||
| 92 | +} | ||
| 93 | +</script> | ||
| 0 | \ No newline at end of file | 94 | \ No newline at end of file |
src/components/machine/editPrinterRule.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('printerRule.editTitle')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="50%" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <el-form ref="form" :model="form" :rules="rules" label-width="120px"> | ||
| 9 | + <el-form-item :label="$t('printerRule.ruleName')" prop="ruleName"> | ||
| 10 | + <el-input | ||
| 11 | + v-model="form.ruleName" | ||
| 12 | + :placeholder="$t('printerRule.ruleNamePlaceholder')" | ||
| 13 | + ></el-input> | ||
| 14 | + </el-form-item> | ||
| 15 | + <el-form-item :label="$t('printerRule.remark')" prop="remark"> | ||
| 16 | + <el-input | ||
| 17 | + type="textarea" | ||
| 18 | + v-model="form.remark" | ||
| 19 | + :placeholder="$t('printerRule.remarkPlaceholder')" | ||
| 20 | + ></el-input> | ||
| 21 | + </el-form-item> | ||
| 22 | + </el-form> | ||
| 23 | + | ||
| 24 | + <span slot="footer" class="dialog-footer"> | ||
| 25 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | ||
| 26 | + <el-button type="primary" @click="handleSubmit">{{ $t('common.confirm') }}</el-button> | ||
| 27 | + </span> | ||
| 28 | + </el-dialog> | ||
| 29 | +</template> | ||
| 30 | + | ||
| 31 | +<script> | ||
| 32 | +import { updatePrinterRule } from '@/api/machine/printerRuleApi' | ||
| 33 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 34 | + | ||
| 35 | +export default { | ||
| 36 | + name: 'EditPrinterRule', | ||
| 37 | + data() { | ||
| 38 | + return { | ||
| 39 | + visible: false, | ||
| 40 | + form: { | ||
| 41 | + ruleId: '', | ||
| 42 | + ruleName: '', | ||
| 43 | + remark: '', | ||
| 44 | + communityId: '' | ||
| 45 | + }, | ||
| 46 | + rules: { | ||
| 47 | + ruleName: [ | ||
| 48 | + { required: true, message: this.$t('printerRule.ruleNameRequired'), trigger: 'blur' }, | ||
| 49 | + { max: 64, message: this.$t('printerRule.ruleNameMaxLength'), trigger: 'blur' } | ||
| 50 | + ], | ||
| 51 | + remark: [ | ||
| 52 | + { max: 512, message: this.$t('printerRule.remarkMaxLength'), trigger: 'blur' } | ||
| 53 | + ] | ||
| 54 | + } | ||
| 55 | + } | ||
| 56 | + }, | ||
| 57 | + created() { | ||
| 58 | + this.form.communityId = getCommunityId() | ||
| 59 | + }, | ||
| 60 | + methods: { | ||
| 61 | + open(data) { | ||
| 62 | + this.visible = true | ||
| 63 | + this.form = { | ||
| 64 | + ruleId: data.ruleId, | ||
| 65 | + ruleName: data.ruleName, | ||
| 66 | + remark: data.remark, | ||
| 67 | + communityId: getCommunityId() | ||
| 68 | + } | ||
| 69 | + }, | ||
| 70 | + handleClose() { | ||
| 71 | + this.$refs.form.resetFields() | ||
| 72 | + }, | ||
| 73 | + async handleSubmit() { | ||
| 74 | + this.$refs.form.validate(async valid => { | ||
| 75 | + if (valid) { | ||
| 76 | + try { | ||
| 77 | + await updatePrinterRule(this.form) | ||
| 78 | + this.$message.success(this.$t('common.editSuccess')) | ||
| 79 | + this.visible = false | ||
| 80 | + this.$emit('success') | ||
| 81 | + } catch (error) { | ||
| 82 | + console.error('修改打印机规则失败:', error) | ||
| 83 | + } | ||
| 84 | + } | ||
| 85 | + }) | ||
| 86 | + } | ||
| 87 | + } | ||
| 88 | +} | ||
| 89 | +</script> | ||
| 0 | \ No newline at end of file | 90 | \ No newline at end of file |
src/components/machine/editPrinterRuleMachine.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('printerRuleMachine.editTitle')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="50%" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <el-form | ||
| 9 | + ref="form" | ||
| 10 | + :model="form" | ||
| 11 | + :rules="rules" | ||
| 12 | + label-width="120px" | ||
| 13 | + > | ||
| 14 | + <el-form-item | ||
| 15 | + :label="$t('printerRuleMachine.machine')" | ||
| 16 | + prop="machineId" | ||
| 17 | + > | ||
| 18 | + <el-select | ||
| 19 | + v-model="form.machineId" | ||
| 20 | + :placeholder="$t('printerRuleMachine.machinePlaceholder')" | ||
| 21 | + style="width:100%" | ||
| 22 | + > | ||
| 23 | + <el-option | ||
| 24 | + v-for="item in machines" | ||
| 25 | + :key="item.machineId" | ||
| 26 | + :label="`${item.machineName}(${item.machineCode})`" | ||
| 27 | + :value="item.machineId" | ||
| 28 | + /> | ||
| 29 | + </el-select> | ||
| 30 | + </el-form-item> | ||
| 31 | + <el-form-item | ||
| 32 | + :label="$t('printerRuleMachine.quantity')" | ||
| 33 | + prop="quantity" | ||
| 34 | + > | ||
| 35 | + <el-input-number | ||
| 36 | + v-model="form.quantity" | ||
| 37 | + :min="1" | ||
| 38 | + :max="100" | ||
| 39 | + :placeholder="$t('printerRuleMachine.quantityPlaceholder')" | ||
| 40 | + /> | ||
| 41 | + </el-form-item> | ||
| 42 | + </el-form> | ||
| 43 | + | ||
| 44 | + <span slot="footer" class="dialog-footer"> | ||
| 45 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | ||
| 46 | + <el-button type="primary" @click="handleSubmit">{{ $t('common.confirm') }}</el-button> | ||
| 47 | + </span> | ||
| 48 | + </el-dialog> | ||
| 49 | +</template> | ||
| 50 | + | ||
| 51 | +<script> | ||
| 52 | +import { updatePrinterRuleMachine, listMachinePrinters } from '@/api/machine/printerRuleApi' | ||
| 53 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 54 | + | ||
| 55 | +export default { | ||
| 56 | + name: 'EditPrinterRuleMachine', | ||
| 57 | + data() { | ||
| 58 | + return { | ||
| 59 | + visible: false, | ||
| 60 | + form: { | ||
| 61 | + prmId: '', | ||
| 62 | + machineId: '', | ||
| 63 | + quantity: 1, | ||
| 64 | + communityId: '' | ||
| 65 | + }, | ||
| 66 | + machines: [], | ||
| 67 | + rules: { | ||
| 68 | + machineId: [ | ||
| 69 | + { required: true, message: this.$t('printerRuleMachine.machineRequired'), trigger: 'change' } | ||
| 70 | + ], | ||
| 71 | + quantity: [ | ||
| 72 | + { required: true, message: this.$t('printerRuleMachine.quantityRequired'), trigger: 'blur' } | ||
| 73 | + ] | ||
| 74 | + } | ||
| 75 | + } | ||
| 76 | + }, | ||
| 77 | + created() { | ||
| 78 | + this.form.communityId = getCommunityId() | ||
| 79 | + this.getMachines() | ||
| 80 | + }, | ||
| 81 | + methods: { | ||
| 82 | + open(row) { | ||
| 83 | + this.visible = true | ||
| 84 | + this.form = { | ||
| 85 | + prmId: row.prmId, | ||
| 86 | + machineId: row.machineId, | ||
| 87 | + quantity: row.quantity, | ||
| 88 | + communityId: getCommunityId() | ||
| 89 | + } | ||
| 90 | + }, | ||
| 91 | + handleClose() { | ||
| 92 | + this.$refs.form.resetFields() | ||
| 93 | + }, | ||
| 94 | + async getMachines() { | ||
| 95 | + try { | ||
| 96 | + const params = { | ||
| 97 | + page: 1, | ||
| 98 | + row: 100, | ||
| 99 | + communityId: this.form.communityId | ||
| 100 | + } | ||
| 101 | + const { data } = await listMachinePrinters(params) | ||
| 102 | + this.machines = data | ||
| 103 | + } catch (error) { | ||
| 104 | + console.error('获取打印机列表失败:', error) | ||
| 105 | + } | ||
| 106 | + }, | ||
| 107 | + async handleSubmit() { | ||
| 108 | + this.$refs.form.validate(async valid => { | ||
| 109 | + if (valid) { | ||
| 110 | + try { | ||
| 111 | + await updatePrinterRuleMachine(this.form) | ||
| 112 | + this.$message.success(this.$t('common.editSuccess')) | ||
| 113 | + this.visible = false | ||
| 114 | + this.$emit('success') | ||
| 115 | + } catch (error) { | ||
| 116 | + console.error('修改打印机规则机器失败:', error) | ||
| 117 | + } | ||
| 118 | + } | ||
| 119 | + }) | ||
| 120 | + } | ||
| 121 | + } | ||
| 122 | +} | ||
| 123 | +</script> | ||
| 0 | \ No newline at end of file | 124 | \ No newline at end of file |
src/components/machine/printerRuleDiv.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-card class="box-card"> | ||
| 3 | + <div class="button-group"> | ||
| 4 | + <el-button type="primary" size="small" @click="openAddModal"> | ||
| 5 | + <i class="el-icon-plus"></i>{{ $t('common.add') }} | ||
| 6 | + </el-button> | ||
| 7 | + <el-button type="primary" size="small" @click="openEditModal"> | ||
| 8 | + <i class="el-icon-edit"></i>{{ $t('common.edit') }} | ||
| 9 | + </el-button> | ||
| 10 | + <el-button type="primary" size="small" @click="openDeleteModal"> | ||
| 11 | + <i class="el-icon-delete"></i>{{ $t('common.delete') }} | ||
| 12 | + </el-button> | ||
| 13 | + </div> | ||
| 14 | + | ||
| 15 | + <div class="vc-org margin-top"> | ||
| 16 | + <el-tree :data="printerRules" :props="defaultProps" @node-click="handleNodeClick" highlight-current></el-tree> | ||
| 17 | + </div> | ||
| 18 | + | ||
| 19 | + <add-printer-rule ref="addPrinterRule" @success="getPrinterRules" /> | ||
| 20 | + <edit-printer-rule ref="editPrinterRule" @success="getPrinterRules" /> | ||
| 21 | + <delete-printer-rule ref="deletePrinterRule" @success="getPrinterRules" /> | ||
| 22 | + </el-card> | ||
| 23 | +</template> | ||
| 24 | + | ||
| 25 | +<script> | ||
| 26 | +import { listPrinterRules } from '@/api/machine/printerRuleApi' | ||
| 27 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 28 | +import AddPrinterRule from '@/components/machine/addPrinterRule' | ||
| 29 | +import EditPrinterRule from '@/components/machine/editPrinterRule' | ||
| 30 | +import DeletePrinterRule from '@/components/machine/deletePrinterRule' | ||
| 31 | + | ||
| 32 | +export default { | ||
| 33 | + name: 'PrinterRuleDiv', | ||
| 34 | + props: { | ||
| 35 | + value: { | ||
| 36 | + type: Object, | ||
| 37 | + default: () => ({}) | ||
| 38 | + } | ||
| 39 | + }, | ||
| 40 | + components: { | ||
| 41 | + AddPrinterRule, | ||
| 42 | + EditPrinterRule, | ||
| 43 | + DeletePrinterRule | ||
| 44 | + }, | ||
| 45 | + data() { | ||
| 46 | + return { | ||
| 47 | + printerRules: [], | ||
| 48 | + defaultProps: { | ||
| 49 | + children: 'children', | ||
| 50 | + label: 'ruleName' | ||
| 51 | + }, | ||
| 52 | + curRule:{}, | ||
| 53 | + communityId: '' | ||
| 54 | + } | ||
| 55 | + }, | ||
| 56 | + created() { | ||
| 57 | + this.communityId = getCommunityId() | ||
| 58 | + this.getPrinterRules() | ||
| 59 | + }, | ||
| 60 | + methods: { | ||
| 61 | + async getPrinterRules() { | ||
| 62 | + try { | ||
| 63 | + const params = { | ||
| 64 | + page: 1, | ||
| 65 | + row: 100, | ||
| 66 | + communityId: this.communityId | ||
| 67 | + } | ||
| 68 | + const { data } = await listPrinterRules(params) | ||
| 69 | + this.printerRules = data | ||
| 70 | + if (this.printerRules.length > 0) { | ||
| 71 | + this.handleNodeClick(this.printerRules[0]) | ||
| 72 | + } | ||
| 73 | + } catch (error) { | ||
| 74 | + console.error('获取打印机规则失败:', error) | ||
| 75 | + } | ||
| 76 | + }, | ||
| 77 | + handleNodeClick(data) { | ||
| 78 | + this.curRule = data | ||
| 79 | + }, | ||
| 80 | + openAddModal() { | ||
| 81 | + this.$refs.addPrinterRule.open() | ||
| 82 | + }, | ||
| 83 | + openEditModal() { | ||
| 84 | + if (!this.curRule.ruleId) { | ||
| 85 | + this.$message.warning(this.$t('printerRule.selectRule')) | ||
| 86 | + return | ||
| 87 | + } | ||
| 88 | + this.$refs.editPrinterRule.open(this.curRule) | ||
| 89 | + | ||
| 90 | + }, | ||
| 91 | + openDeleteModal() { | ||
| 92 | + if (!this.curRule.ruleId) { | ||
| 93 | + this.$message.warning(this.$t('printerRule.selectRule')) | ||
| 94 | + return | ||
| 95 | + } | ||
| 96 | + this.$refs.deletePrinterRule.open(this.curRule) | ||
| 97 | + }, | ||
| 98 | + refreshList() { | ||
| 99 | + this.getPrinterRules() | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | +} | ||
| 103 | +</script> | ||
| 104 | + | ||
| 105 | +<style scoped> | ||
| 106 | +.button-group { | ||
| 107 | + margin-bottom: 15px; | ||
| 108 | +} | ||
| 109 | + | ||
| 110 | +.vc-org { | ||
| 111 | + max-height: 500px; | ||
| 112 | + overflow-y: auto; | ||
| 113 | +} | ||
| 114 | + | ||
| 115 | +.margin-top { | ||
| 116 | + margin-top: 15px; | ||
| 117 | +} | ||
| 118 | +</style> | ||
| 0 | \ No newline at end of file | 119 | \ No newline at end of file |
src/components/machine/printerRuleFees.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="printer-rule-fees"> | ||
| 3 | + | ||
| 4 | + <el-form :inline="true" :model="searchForm" class="search-form"> | ||
| 5 | + <el-form-item :label="$t('printerRuleFees.id')"> | ||
| 6 | + <el-input v-model="searchForm.prfId" :placeholder="$t('printerRuleFees.idPlaceholder')" clearable /> | ||
| 7 | + </el-form-item> | ||
| 8 | + <el-form-item :label="$t('printerRuleFees.feeName')"> | ||
| 9 | + <el-input v-model="searchForm.feeConfigName" :placeholder="$t('printerRuleFees.feeNamePlaceholder')" clearable /> | ||
| 10 | + </el-form-item> | ||
| 11 | + <el-form-item> | ||
| 12 | + <el-button type="primary" @click="handleSearch"> | ||
| 13 | + {{ $t('common.search') }} | ||
| 14 | + </el-button> | ||
| 15 | + <el-button @click="handleReset"> | ||
| 16 | + {{ $t('common.reset') }} | ||
| 17 | + </el-button> | ||
| 18 | + <el-button type="primary" @click="openAddModal"> | ||
| 19 | + <i class="el-icon-plus"></i> | ||
| 20 | + {{ $t('common.add') }} | ||
| 21 | + </el-button> | ||
| 22 | + </el-form-item> | ||
| 23 | + </el-form> | ||
| 24 | + | ||
| 25 | + | ||
| 26 | + | ||
| 27 | + <el-table :data="tableData" border style="width: 100%" v-loading="loading"> | ||
| 28 | + <el-table-column prop="prfId" :label="$t('printerRuleFees.table.id')" align="center" /> | ||
| 29 | + <el-table-column prop="feeConfigName" :label="$t('printerRuleFees.table.feeName')" align="center" /> | ||
| 30 | + <el-table-column :label="$t('common.operation')" align="center" width="150"> | ||
| 31 | + <template slot-scope="scope"> | ||
| 32 | + <el-button size="mini" type="danger" @click="openDeleteModal(scope.row)"> | ||
| 33 | + {{ $t('common.delete') }} | ||
| 34 | + </el-button> | ||
| 35 | + </template> | ||
| 36 | + </el-table-column> | ||
| 37 | + </el-table> | ||
| 38 | + | ||
| 39 | + <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" | ||
| 40 | + :current-page="pagination.current" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.size" | ||
| 41 | + layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" /> | ||
| 42 | + | ||
| 43 | + | ||
| 44 | + <add-printer-rule-fee ref="addPrinterRuleFee" :rule-id="ruleId" @success="handleSuccess" /> | ||
| 45 | + <delete-printer-rule-fee ref="deletePrinterRuleFee" @success="handleSuccess" /> | ||
| 46 | + </div> | ||
| 47 | +</template> | ||
| 48 | + | ||
| 49 | +<script> | ||
| 50 | +import { listPrinterRuleFees } from '@/api/machine/printerRuleApi' | ||
| 51 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 52 | +import AddPrinterRuleFee from './addPrinterRuleFee' | ||
| 53 | +import DeletePrinterRuleFee from './deletePrinterRuleFee' | ||
| 54 | + | ||
| 55 | +export default { | ||
| 56 | + name: 'PrinterRuleFees', | ||
| 57 | + components: { | ||
| 58 | + AddPrinterRuleFee, | ||
| 59 | + DeletePrinterRuleFee | ||
| 60 | + }, | ||
| 61 | + props: { | ||
| 62 | + ruleId: { | ||
| 63 | + type: String, | ||
| 64 | + required: true | ||
| 65 | + } | ||
| 66 | + }, | ||
| 67 | + data() { | ||
| 68 | + return { | ||
| 69 | + searchForm: { | ||
| 70 | + prfId: '', | ||
| 71 | + feeConfigName: '', | ||
| 72 | + ruleId: '', | ||
| 73 | + communityId: '' | ||
| 74 | + }, | ||
| 75 | + tableData: [], | ||
| 76 | + loading: false, | ||
| 77 | + pagination: { | ||
| 78 | + current: 1, | ||
| 79 | + size: 10, | ||
| 80 | + total: 0 | ||
| 81 | + } | ||
| 82 | + } | ||
| 83 | + }, | ||
| 84 | + created() { | ||
| 85 | + this.searchForm.communityId = getCommunityId() | ||
| 86 | + this.searchForm.ruleId = this.ruleId | ||
| 87 | + this.getList() | ||
| 88 | + }, | ||
| 89 | + methods: { | ||
| 90 | + async getList() { | ||
| 91 | + this.loading = true | ||
| 92 | + try { | ||
| 93 | + const params = { | ||
| 94 | + ...this.searchForm, | ||
| 95 | + page: this.pagination.current, | ||
| 96 | + row: this.pagination.size | ||
| 97 | + } | ||
| 98 | + const { data, total } = await listPrinterRuleFees(params) | ||
| 99 | + this.tableData = data | ||
| 100 | + this.pagination.total = total | ||
| 101 | + } catch (error) { | ||
| 102 | + console.error('获取缴费自动打印列表失败:', error) | ||
| 103 | + } finally { | ||
| 104 | + this.loading = false | ||
| 105 | + } | ||
| 106 | + }, | ||
| 107 | + handleSearch() { | ||
| 108 | + this.pagination.current = 1 | ||
| 109 | + this.getList() | ||
| 110 | + }, | ||
| 111 | + handleReset() { | ||
| 112 | + this.searchForm.prfId = '' | ||
| 113 | + this.searchForm.feeConfigName = '' | ||
| 114 | + this.handleSearch() | ||
| 115 | + }, | ||
| 116 | + handleSizeChange(val) { | ||
| 117 | + this.pagination.size = val | ||
| 118 | + this.getList() | ||
| 119 | + }, | ||
| 120 | + handleCurrentChange(val) { | ||
| 121 | + this.pagination.current = val | ||
| 122 | + this.getList() | ||
| 123 | + }, | ||
| 124 | + openAddModal() { | ||
| 125 | + this.$refs.addPrinterRuleFee.open() | ||
| 126 | + }, | ||
| 127 | + openDeleteModal(row) { | ||
| 128 | + this.$refs.deletePrinterRuleFee.open(row) | ||
| 129 | + }, | ||
| 130 | + handleSuccess() { | ||
| 131 | + this.getList() | ||
| 132 | + } | ||
| 133 | + } | ||
| 134 | +} | ||
| 135 | +</script> | ||
| 136 | + | ||
| 137 | +<style scoped> | ||
| 138 | +.printer-rule-fees { | ||
| 139 | + padding: 20px; | ||
| 140 | +} | ||
| 141 | + | ||
| 142 | +.search-card { | ||
| 143 | + margin-bottom: 20px; | ||
| 144 | +} | ||
| 145 | + | ||
| 146 | +.search-form { | ||
| 147 | + display: flex; | ||
| 148 | + flex-wrap: wrap; | ||
| 149 | +} | ||
| 150 | + | ||
| 151 | +.el-pagination { | ||
| 152 | + margin-top: 20px; | ||
| 153 | + text-align: right; | ||
| 154 | +} | ||
| 155 | +</style> | ||
| 0 | \ No newline at end of file | 156 | \ No newline at end of file |
src/components/machine/printerRuleMachine.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="printer-rule-machine"> | ||
| 3 | + | ||
| 4 | + <el-form :inline="true" :model="searchForm" class="search-form"> | ||
| 5 | + <el-form-item :label="$t('printerRuleMachine.id')"> | ||
| 6 | + <el-input v-model="searchForm.prmId" :placeholder="$t('printerRuleMachine.idPlaceholder')" clearable /> | ||
| 7 | + </el-form-item> | ||
| 8 | + <el-form-item :label="$t('printerRuleMachine.machineName')"> | ||
| 9 | + <el-input v-model="searchForm.machineName" :placeholder="$t('printerRuleMachine.machineNamePlaceholder')" | ||
| 10 | + clearable /> | ||
| 11 | + </el-form-item> | ||
| 12 | + <el-form-item> | ||
| 13 | + <el-button type="primary" @click="handleSearch"> | ||
| 14 | + {{ $t('common.search') }} | ||
| 15 | + </el-button> | ||
| 16 | + <el-button @click="handleReset"> | ||
| 17 | + {{ $t('common.reset') }} | ||
| 18 | + </el-button> | ||
| 19 | + <el-button type="primary" @click="openAddModal"> | ||
| 20 | + <i class="el-icon-plus"></i> | ||
| 21 | + {{ $t('common.add') }} | ||
| 22 | + </el-button> | ||
| 23 | + </el-form-item> | ||
| 24 | + </el-form> | ||
| 25 | + | ||
| 26 | + | ||
| 27 | + <el-table :data="tableData" border style="width: 100%" v-loading="loading"> | ||
| 28 | + <el-table-column prop="prmId" :label="$t('printerRuleMachine.table.id')" align="center" /> | ||
| 29 | + <el-table-column prop="machineName" :label="$t('printerRuleMachine.table.machineName')" align="center" /> | ||
| 30 | + <el-table-column prop="quantity" :label="$t('printerRuleMachine.table.quantity')" align="center" /> | ||
| 31 | + <el-table-column :label="$t('common.operation')" align="center" width="200"> | ||
| 32 | + <template slot-scope="scope"> | ||
| 33 | + <el-button size="mini" @click="openEditModal(scope.row)"> | ||
| 34 | + {{ $t('common.edit') }} | ||
| 35 | + </el-button> | ||
| 36 | + <el-button size="mini" type="danger" @click="openDeleteModal(scope.row)"> | ||
| 37 | + {{ $t('common.delete') }} | ||
| 38 | + </el-button> | ||
| 39 | + </template> | ||
| 40 | + </el-table-column> | ||
| 41 | + </el-table> | ||
| 42 | + | ||
| 43 | + <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" | ||
| 44 | + :current-page="pagination.current" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.size" | ||
| 45 | + layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" /> | ||
| 46 | + | ||
| 47 | + | ||
| 48 | + <add-printer-rule-machine ref="addPrinterRuleMachine" :ruleId="searchForm.ruleId" @success="handleSuccess" /> | ||
| 49 | + <edit-printer-rule-machine ref="editPrinterRuleMachine" @success="handleSuccess" /> | ||
| 50 | + <delete-printer-rule-machine ref="deletePrinterRuleMachine" @success="handleSuccess" /> | ||
| 51 | + </div> | ||
| 52 | +</template> | ||
| 53 | + | ||
| 54 | +<script> | ||
| 55 | +import { listPrinterRuleMachines } from '@/api/machine/printerRuleApi' | ||
| 56 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 57 | +import AddPrinterRuleMachine from './addPrinterRuleMachine' | ||
| 58 | +import EditPrinterRuleMachine from './editPrinterRuleMachine' | ||
| 59 | +import DeletePrinterRuleMachine from './deletePrinterRuleMachine' | ||
| 60 | + | ||
| 61 | +export default { | ||
| 62 | + name: 'PrinterRuleMachine', | ||
| 63 | + components: { | ||
| 64 | + AddPrinterRuleMachine, | ||
| 65 | + EditPrinterRuleMachine, | ||
| 66 | + DeletePrinterRuleMachine | ||
| 67 | + }, | ||
| 68 | + data() { | ||
| 69 | + return { | ||
| 70 | + searchForm: { | ||
| 71 | + prmId: '', | ||
| 72 | + machineName: '', | ||
| 73 | + ruleId: '', | ||
| 74 | + communityId: '' | ||
| 75 | + }, | ||
| 76 | + tableData: [], | ||
| 77 | + loading: false, | ||
| 78 | + pagination: { | ||
| 79 | + current: 1, | ||
| 80 | + size: 10, | ||
| 81 | + total: 0 | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | + }, | ||
| 85 | + created() { | ||
| 86 | + this.searchForm.communityId = getCommunityId() | ||
| 87 | + this.getList() | ||
| 88 | + }, | ||
| 89 | + methods: { | ||
| 90 | + open(ruleId) { | ||
| 91 | + this.searchForm.ruleId = ruleId | ||
| 92 | + }, | ||
| 93 | + async getList() { | ||
| 94 | + this.loading = true | ||
| 95 | + try { | ||
| 96 | + const params = { | ||
| 97 | + ...this.searchForm, | ||
| 98 | + page: this.pagination.current, | ||
| 99 | + row: this.pagination.size | ||
| 100 | + } | ||
| 101 | + const { data, total } = await listPrinterRuleMachines(params) | ||
| 102 | + this.tableData = data | ||
| 103 | + this.pagination.total = total | ||
| 104 | + } catch (error) { | ||
| 105 | + console.error('获取打印机规则机器列表失败:', error) | ||
| 106 | + } finally { | ||
| 107 | + this.loading = false | ||
| 108 | + } | ||
| 109 | + }, | ||
| 110 | + handleSearch() { | ||
| 111 | + this.pagination.current = 1 | ||
| 112 | + this.getList() | ||
| 113 | + }, | ||
| 114 | + handleReset() { | ||
| 115 | + this.searchForm.prmId = '' | ||
| 116 | + this.searchForm.machineName = '' | ||
| 117 | + this.handleSearch() | ||
| 118 | + }, | ||
| 119 | + handleSizeChange(val) { | ||
| 120 | + this.pagination.size = val | ||
| 121 | + this.getList() | ||
| 122 | + }, | ||
| 123 | + handleCurrentChange(val) { | ||
| 124 | + this.pagination.current = val | ||
| 125 | + this.getList() | ||
| 126 | + }, | ||
| 127 | + openAddModal() { | ||
| 128 | + this.$refs.addPrinterRuleMachine.open(this.searchForm.ruleId ) | ||
| 129 | + }, | ||
| 130 | + openEditModal(row) { | ||
| 131 | + this.$refs.editPrinterRuleMachine.open(row) | ||
| 132 | + }, | ||
| 133 | + openDeleteModal(row) { | ||
| 134 | + this.$refs.deletePrinterRuleMachine.open(row) | ||
| 135 | + }, | ||
| 136 | + handleSuccess() { | ||
| 137 | + this.getList() | ||
| 138 | + } | ||
| 139 | + } | ||
| 140 | +} | ||
| 141 | +</script> | ||
| 142 | + | ||
| 143 | +<style scoped> | ||
| 144 | +.printer-rule-machine { | ||
| 145 | + padding: 20px; | ||
| 146 | +} | ||
| 147 | + | ||
| 148 | +.search-card { | ||
| 149 | + margin-bottom: 20px; | ||
| 150 | +} | ||
| 151 | + | ||
| 152 | +.search-form { | ||
| 153 | + display: flex; | ||
| 154 | + flex-wrap: wrap; | ||
| 155 | +} | ||
| 156 | + | ||
| 157 | +.el-pagination { | ||
| 158 | + margin-top: 20px; | ||
| 159 | + text-align: right; | ||
| 160 | +} | ||
| 161 | +</style> | ||
| 0 | \ No newline at end of file | 162 | \ No newline at end of file |
src/components/machine/printerRuleRepair.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="printer-rule-repair"> | ||
| 3 | + | ||
| 4 | + <el-form :inline="true" :model="searchForm" class="search-form"> | ||
| 5 | + <el-form-item :label="$t('printerRuleRepair.id')"> | ||
| 6 | + <el-input v-model="searchForm.prrId" :placeholder="$t('printerRuleRepair.idPlaceholder')" clearable /> | ||
| 7 | + </el-form-item> | ||
| 8 | + <el-form-item :label="$t('printerRuleRepair.repairType')"> | ||
| 9 | + <el-input v-model="searchForm.repairTypeName" :placeholder="$t('printerRuleRepair.repairTypePlaceholder')" | ||
| 10 | + clearable /> | ||
| 11 | + </el-form-item> | ||
| 12 | + <el-form-item> | ||
| 13 | + <el-button type="primary" @click="handleSearch"> | ||
| 14 | + {{ $t('common.search') }} | ||
| 15 | + </el-button> | ||
| 16 | + <el-button @click="handleReset"> | ||
| 17 | + {{ $t('common.reset') }} | ||
| 18 | + </el-button> | ||
| 19 | + <el-button type="primary" @click="openAddModal"> | ||
| 20 | + <i class="el-icon-plus"></i> | ||
| 21 | + {{ $t('common.add') }} | ||
| 22 | + </el-button> | ||
| 23 | + </el-form-item> | ||
| 24 | + </el-form> | ||
| 25 | + | ||
| 26 | + | ||
| 27 | + | ||
| 28 | + <el-table :data="tableData" border style="width: 100%" v-loading="loading"> | ||
| 29 | + <el-table-column prop="prrId" :label="$t('printerRuleRepair.table.id')" align="center" /> | ||
| 30 | + <el-table-column prop="repairTypeName" :label="$t('printerRuleRepair.table.repairType')" align="center" /> | ||
| 31 | + <el-table-column :label="$t('common.operation')" align="center" width="150"> | ||
| 32 | + <template slot-scope="scope"> | ||
| 33 | + <el-button size="mini" type="danger" @click="openDeleteModal(scope.row)"> | ||
| 34 | + {{ $t('common.delete') }} | ||
| 35 | + </el-button> | ||
| 36 | + </template> | ||
| 37 | + </el-table-column> | ||
| 38 | + </el-table> | ||
| 39 | + | ||
| 40 | + <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" | ||
| 41 | + :current-page="pagination.current" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.size" | ||
| 42 | + layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" /> | ||
| 43 | + | ||
| 44 | + | ||
| 45 | + <add-printer-rule-repair ref="addPrinterRuleRepair" :rule-id="ruleId" @success="handleSuccess" /> | ||
| 46 | + <delete-printer-rule-repair ref="deletePrinterRuleRepair" @success="handleSuccess" /> | ||
| 47 | + </div> | ||
| 48 | +</template> | ||
| 49 | + | ||
| 50 | +<script> | ||
| 51 | +import { listPrinterRuleRepairs } from '@/api/machine/printerRuleApi' | ||
| 52 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 53 | +import AddPrinterRuleRepair from './addPrinterRuleRepair' | ||
| 54 | +import DeletePrinterRuleRepair from './deletePrinterRuleRepair' | ||
| 55 | + | ||
| 56 | +export default { | ||
| 57 | + name: 'PrinterRuleRepair', | ||
| 58 | + components: { | ||
| 59 | + AddPrinterRuleRepair, | ||
| 60 | + DeletePrinterRuleRepair | ||
| 61 | + }, | ||
| 62 | + props: { | ||
| 63 | + ruleId: { | ||
| 64 | + type: String, | ||
| 65 | + required: true | ||
| 66 | + } | ||
| 67 | + }, | ||
| 68 | + data() { | ||
| 69 | + return { | ||
| 70 | + searchForm: { | ||
| 71 | + prrId: '', | ||
| 72 | + repairTypeName: '', | ||
| 73 | + ruleId: '', | ||
| 74 | + communityId: '' | ||
| 75 | + }, | ||
| 76 | + tableData: [], | ||
| 77 | + loading: false, | ||
| 78 | + pagination: { | ||
| 79 | + current: 1, | ||
| 80 | + size: 10, | ||
| 81 | + total: 0 | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | + }, | ||
| 85 | + created() { | ||
| 86 | + this.searchForm.communityId = getCommunityId() | ||
| 87 | + this.searchForm.ruleId = this.ruleId | ||
| 88 | + this.getList() | ||
| 89 | + }, | ||
| 90 | + methods: { | ||
| 91 | + async getList() { | ||
| 92 | + this.loading = true | ||
| 93 | + try { | ||
| 94 | + const params = { | ||
| 95 | + ...this.searchForm, | ||
| 96 | + page: this.pagination.current, | ||
| 97 | + row: this.pagination.size | ||
| 98 | + } | ||
| 99 | + const { data, total } = await listPrinterRuleRepairs(params) | ||
| 100 | + this.tableData = data | ||
| 101 | + this.pagination.total = total | ||
| 102 | + } catch (error) { | ||
| 103 | + console.error('获取报修自动打印列表失败:', error) | ||
| 104 | + } finally { | ||
| 105 | + this.loading = false | ||
| 106 | + } | ||
| 107 | + }, | ||
| 108 | + handleSearch() { | ||
| 109 | + this.pagination.current = 1 | ||
| 110 | + this.getList() | ||
| 111 | + }, | ||
| 112 | + handleReset() { | ||
| 113 | + this.searchForm.prrId = '' | ||
| 114 | + this.searchForm.repairTypeName = '' | ||
| 115 | + this.handleSearch() | ||
| 116 | + }, | ||
| 117 | + handleSizeChange(val) { | ||
| 118 | + this.pagination.size = val | ||
| 119 | + this.getList() | ||
| 120 | + }, | ||
| 121 | + handleCurrentChange(val) { | ||
| 122 | + this.pagination.current = val | ||
| 123 | + this.getList() | ||
| 124 | + }, | ||
| 125 | + openAddModal() { | ||
| 126 | + this.$refs.addPrinterRuleRepair.open() | ||
| 127 | + }, | ||
| 128 | + openDeleteModal(row) { | ||
| 129 | + this.$refs.deletePrinterRuleRepair.open(row) | ||
| 130 | + }, | ||
| 131 | + handleSuccess() { | ||
| 132 | + this.getList() | ||
| 133 | + } | ||
| 134 | + } | ||
| 135 | +} | ||
| 136 | +</script> | ||
| 137 | + | ||
| 138 | +<style scoped> | ||
| 139 | +.printer-rule-repair { | ||
| 140 | + padding: 20px; | ||
| 141 | +} | ||
| 142 | + | ||
| 143 | +.search-card { | ||
| 144 | + margin-bottom: 20px; | ||
| 145 | +} | ||
| 146 | + | ||
| 147 | +.search-form { | ||
| 148 | + display: flex; | ||
| 149 | + flex-wrap: wrap; | ||
| 150 | +} | ||
| 151 | + | ||
| 152 | +.el-pagination { | ||
| 153 | + margin-top: 20px; | ||
| 154 | + text-align: right; | ||
| 155 | +} | ||
| 156 | +</style> | ||
| 0 | \ No newline at end of file | 157 | \ No newline at end of file |
src/i18n/index.js
| @@ -205,6 +205,7 @@ import { messages as editEquipmentAccountMessages } from '../views/machine/editE | @@ -205,6 +205,7 @@ import { messages as editEquipmentAccountMessages } from '../views/machine/editE | ||
| 205 | import { messages as equipmentAccountDetailMessages } from '../views/machine/equipmentAccountDetailLang' | 205 | import { messages as equipmentAccountDetailMessages } from '../views/machine/equipmentAccountDetailLang' |
| 206 | import { messages as printEquipmentAccountLabelMessages } from '../views/resource/printEquipmentAccountLabelLang' | 206 | import { messages as printEquipmentAccountLabelMessages } from '../views/resource/printEquipmentAccountLabelLang' |
| 207 | import {messages as inspectioni18n} from './inspectionI18n' | 207 | import {messages as inspectioni18n} from './inspectionI18n' |
| 208 | +import {messages as machineI18n} from './machineI18n' | ||
| 208 | 209 | ||
| 209 | Vue.use(VueI18n) | 210 | Vue.use(VueI18n) |
| 210 | 211 | ||
| @@ -414,6 +415,7 @@ const messages = { | @@ -414,6 +415,7 @@ const messages = { | ||
| 414 | ...equipmentAccountDetailMessages.en, | 415 | ...equipmentAccountDetailMessages.en, |
| 415 | ...printEquipmentAccountLabelMessages.en, | 416 | ...printEquipmentAccountLabelMessages.en, |
| 416 | ...inspectioni18n.en, | 417 | ...inspectioni18n.en, |
| 418 | + ...machineI18n.en, | ||
| 417 | }, | 419 | }, |
| 418 | zh: { | 420 | zh: { |
| 419 | ...loginMessages.zh, | 421 | ...loginMessages.zh, |
| @@ -619,6 +621,7 @@ const messages = { | @@ -619,6 +621,7 @@ const messages = { | ||
| 619 | ...equipmentAccountDetailMessages.zh, | 621 | ...equipmentAccountDetailMessages.zh, |
| 620 | ...printEquipmentAccountLabelMessages.zh, | 622 | ...printEquipmentAccountLabelMessages.zh, |
| 621 | ...inspectioni18n.zh, | 623 | ...inspectioni18n.zh, |
| 624 | + ...machineI18n.zh, | ||
| 622 | } | 625 | } |
| 623 | } | 626 | } |
| 624 | 627 |
src/i18n/machineI18n.js
0 → 100644
| 1 | +import { messages as machineTranslateManageMessages } from '../views/machine/machineTranslateManageLang' | ||
| 2 | +import { messages as accessControlInoutMessages } from '../views/machine/accessControlInoutLang' | ||
| 3 | +import { messages as machinePrinterManageMessages } from '../views/machine/machinePrinterManageLang' | ||
| 4 | +import { messages as printerRuleMessages } from '../views/machine/printerRuleLang' | ||
| 5 | +export const messages ={ | ||
| 6 | + en:{ | ||
| 7 | + ...machineTranslateManageMessages.en, | ||
| 8 | + ...accessControlInoutMessages.en, | ||
| 9 | + ...machinePrinterManageMessages.en, | ||
| 10 | + ...printerRuleMessages.en, | ||
| 11 | + }, | ||
| 12 | + zh:{ | ||
| 13 | + ...machineTranslateManageMessages.zh, | ||
| 14 | + ...accessControlInoutMessages.zh, | ||
| 15 | + ...machinePrinterManageMessages.zh, | ||
| 16 | + ...printerRuleMessages.zh, | ||
| 17 | + } | ||
| 18 | +} | ||
| 0 | \ No newline at end of file | 19 | \ No newline at end of file |
src/router/index.js
| @@ -4,6 +4,7 @@ import Layout from '@/views/layout/layout.vue' | @@ -4,6 +4,7 @@ import Layout from '@/views/layout/layout.vue' | ||
| 4 | import Login from '@/views/user/login/Login.vue' | 4 | import Login from '@/views/user/login/Login.vue' |
| 5 | import printEquipmentAccountLabel from '@/views/resource/printEquipmentAccountLabelList.vue' | 5 | import printEquipmentAccountLabel from '@/views/resource/printEquipmentAccountLabelList.vue' |
| 6 | import inspectionRouter from './inspectionRouter' | 6 | import inspectionRouter from './inspectionRouter' |
| 7 | +import machineRouter from './machineRouter' | ||
| 7 | 8 | ||
| 8 | Vue.use(VueRouter) | 9 | Vue.use(VueRouter) |
| 9 | 10 | ||
| @@ -359,11 +360,7 @@ const routes = [ | @@ -359,11 +360,7 @@ const routes = [ | ||
| 359 | name: '/pages/iot/adminBarrier', | 360 | name: '/pages/iot/adminBarrier', |
| 360 | component: () => import('@/views/iot/adminBarrierList.vue') | 361 | component: () => import('@/views/iot/adminBarrierList.vue') |
| 361 | }, | 362 | }, |
| 362 | - { | ||
| 363 | - path: '/pages/iot/adminChargeMachine', | ||
| 364 | - name: '/pages/iot/adminChargeMachine', | ||
| 365 | - component: () => import('@/views/iot/adminChargeMachineList.vue') | ||
| 366 | - }, | 363 | + |
| 367 | { | 364 | { |
| 368 | path: '/pages/iot/adminMeter', | 365 | path: '/pages/iot/adminMeter', |
| 369 | name: '/pages/iot/adminMeter', | 366 | name: '/pages/iot/adminMeter', |
| @@ -926,32 +923,9 @@ const routes = [ | @@ -926,32 +923,9 @@ const routes = [ | ||
| 926 | name: '/pages/property/locationManage', | 923 | name: '/pages/property/locationManage', |
| 927 | component: () => import('@/views/community/locationManageList.vue') | 924 | component: () => import('@/views/community/locationManageList.vue') |
| 928 | }, | 925 | }, |
| 929 | - { | ||
| 930 | - path: '/pages/property/machineTypeTreeManage', | ||
| 931 | - name: '/pages/property/machineTypeTreeManage', | ||
| 932 | - component: () => import('@/views/machine/machineTypeTreeManageList.vue') | ||
| 933 | - }, | ||
| 934 | - { | ||
| 935 | - path: '/pages/property/equipmentAccount', | ||
| 936 | - name: '/pages/property/equipmentAccount', | ||
| 937 | - component: () => import('@/views/machine/equipmentAccountList.vue') | ||
| 938 | - }, | ||
| 939 | - { | ||
| 940 | - path: '/views/machine/addEquipmentAccount', | ||
| 941 | - name: '/views/machine/addEquipmentAccount', | ||
| 942 | - component: () => import('@/views/machine/addEquipmentAccountList.vue') | ||
| 943 | - }, | ||
| 944 | - { | ||
| 945 | - path: '/views/machine/editEquipmentAccount', | ||
| 946 | - name: '/views/machine/editEquipmentAccount', | ||
| 947 | - component: () => import('@/views/machine/editEquipmentAccountList.vue') | ||
| 948 | - }, | ||
| 949 | - { | ||
| 950 | - path: '/views/machine/equipmentAccountDetail', | ||
| 951 | - name: '/views/machine/equipmentAccountDetail', | ||
| 952 | - component: () => import('@/views/machine/equipmentAccountDetailList.vue') | ||
| 953 | - }, | ||
| 954 | - ...inspectionRouter | 926 | + |
| 927 | + ...inspectionRouter, | ||
| 928 | + ...machineRouter, | ||
| 955 | // 其他子路由可以在这里添加 | 929 | // 其他子路由可以在这里添加 |
| 956 | ] | 930 | ] |
| 957 | }, | 931 | }, |
src/router/machineRouter.js
0 → 100644
| 1 | +export default [ | ||
| 2 | + { | ||
| 3 | + path: '/pages/property/machineTypeTreeManage', | ||
| 4 | + name: '/pages/property/machineTypeTreeManage', | ||
| 5 | + component: () => import('@/views/machine/machineTypeTreeManageList.vue') | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + path: '/pages/property/equipmentAccount', | ||
| 9 | + name: '/pages/property/equipmentAccount', | ||
| 10 | + component: () => import('@/views/machine/equipmentAccountList.vue') | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + path: '/views/machine/addEquipmentAccount', | ||
| 14 | + name: '/views/machine/addEquipmentAccount', | ||
| 15 | + component: () => import('@/views/machine/addEquipmentAccountList.vue') | ||
| 16 | + }, | ||
| 17 | + { | ||
| 18 | + path: '/views/machine/editEquipmentAccount', | ||
| 19 | + name: '/views/machine/editEquipmentAccount', | ||
| 20 | + component: () => import('@/views/machine/editEquipmentAccountList.vue') | ||
| 21 | + }, | ||
| 22 | + { | ||
| 23 | + path: '/views/machine/equipmentAccountDetail', | ||
| 24 | + name: '/views/machine/equipmentAccountDetail', | ||
| 25 | + component: () => import('@/views/machine/equipmentAccountDetailList.vue') | ||
| 26 | + }, | ||
| 27 | + { | ||
| 28 | + path: '/pages/iot/adminChargeMachine', | ||
| 29 | + name: '/pages/iot/adminChargeMachine', | ||
| 30 | + component: () => import('@/views/iot/adminChargeMachineList.vue') | ||
| 31 | + }, | ||
| 32 | + { | ||
| 33 | + path: '/pages/property/machineTranslateManage', | ||
| 34 | + name: '/pages/property/machineTranslateManage', | ||
| 35 | + component: () => import('@/views/machine/machineTranslateManageList.vue') | ||
| 36 | + }, | ||
| 37 | + { | ||
| 38 | + path: '/pages/machine/accessControlInout', | ||
| 39 | + name: '/pages/machine/accessControlInout', | ||
| 40 | + component: () => import('@/views/machine/accessControlInoutList.vue') | ||
| 41 | + }, | ||
| 42 | + { | ||
| 43 | + path: '/pages/print/machinePrinterManage', | ||
| 44 | + name: '/pages/print/machinePrinterManage', | ||
| 45 | + component: () => import('@/views/machine/machinePrinterManageList.vue') | ||
| 46 | + }, | ||
| 47 | + { | ||
| 48 | + path: '/pages/print/printerRule', | ||
| 49 | + name: '/pages/print/printerRule', | ||
| 50 | + component: () => import('@/views/machine/printerRuleList.vue') | ||
| 51 | + }, | ||
| 52 | +] | ||
| 0 | \ No newline at end of file | 53 | \ No newline at end of file |
src/views/machine/accessControlInoutLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + accessControlInout: { | ||
| 4 | + search: { | ||
| 5 | + title: 'Search Conditions', | ||
| 6 | + machine: 'Please select access control', | ||
| 7 | + name: 'Please enter user name', | ||
| 8 | + tel: 'Please enter phone number', | ||
| 9 | + state: 'Please select open status', | ||
| 10 | + startTime: 'Please enter start time', | ||
| 11 | + endTime: 'Please enter end time' | ||
| 12 | + }, | ||
| 13 | + table: { | ||
| 14 | + title: 'Access Records', | ||
| 15 | + face: 'Face', | ||
| 16 | + id: 'ID', | ||
| 17 | + machineName: 'Device Name', | ||
| 18 | + machineCode: 'Device Code', | ||
| 19 | + userName: 'User Name', | ||
| 20 | + openType: 'Open Type', | ||
| 21 | + tel: 'Phone', | ||
| 22 | + idCard: 'ID Card', | ||
| 23 | + similar: 'Similarity', | ||
| 24 | + state: 'Status', | ||
| 25 | + createTime: 'Open Time' | ||
| 26 | + }, | ||
| 27 | + openType: { | ||
| 28 | + all: 'All', | ||
| 29 | + face: 'Face', | ||
| 30 | + key: 'Key', | ||
| 31 | + qrcode: 'QR Code', | ||
| 32 | + password: 'Password' | ||
| 33 | + }, | ||
| 34 | + state: { | ||
| 35 | + success: 'Success', | ||
| 36 | + fail: 'Failed' | ||
| 37 | + } | ||
| 38 | + } | ||
| 39 | + }, | ||
| 40 | + zh:{ | ||
| 41 | + accessControlInout: { | ||
| 42 | + search: { | ||
| 43 | + title: '查询条件', | ||
| 44 | + machine: '请选择门禁', | ||
| 45 | + name: '请填写用户名称', | ||
| 46 | + tel: '请填写手机号', | ||
| 47 | + state: '请选择开门状态', | ||
| 48 | + startTime: '请输入开始时间', | ||
| 49 | + endTime: '请输入结束时间' | ||
| 50 | + }, | ||
| 51 | + table: { | ||
| 52 | + title: '进出记录', | ||
| 53 | + face: '人脸', | ||
| 54 | + id: '编号', | ||
| 55 | + machineName: '设备名称', | ||
| 56 | + machineCode: '设备编码', | ||
| 57 | + userName: '用户名称', | ||
| 58 | + openType: '开门方式', | ||
| 59 | + tel: '手机号', | ||
| 60 | + idCard: '用户身份证', | ||
| 61 | + similar: '相似度', | ||
| 62 | + state: '开门状态', | ||
| 63 | + createTime: '开门时间' | ||
| 64 | + }, | ||
| 65 | + openType: { | ||
| 66 | + all: '全部', | ||
| 67 | + face: '人脸开门', | ||
| 68 | + key: '钥匙开门', | ||
| 69 | + qrcode: '二维码开门', | ||
| 70 | + password: '密码开门' | ||
| 71 | + }, | ||
| 72 | + state: { | ||
| 73 | + success: '开门成功', | ||
| 74 | + fail: '开门失败' | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | +} | ||
| 0 | \ No newline at end of file | 79 | \ No newline at end of file |
src/views/machine/accessControlInoutList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="access-control-inout-container"> | ||
| 3 | + <el-row :gutter="20"> | ||
| 4 | + <el-col :span="4"> | ||
| 5 | + <el-card class="tree-card"> | ||
| 6 | + <ul class="tree-list"> | ||
| 7 | + <li v-for="(item, index) in accessControlInoutInfo.openTypeCds" :key="index" @click="swatchOpenTypeCd(item)" | ||
| 8 | + :class="{ 'selected': accessControlInoutInfo.conditions.openTypeCd === item.openTypeCd }"> | ||
| 9 | + {{ item.openTypeName }} | ||
| 10 | + </li> | ||
| 11 | + </ul> | ||
| 12 | + </el-card> | ||
| 13 | + </el-col> | ||
| 14 | + <el-col :span="20"> | ||
| 15 | + <el-card class="search-card"> | ||
| 16 | + <div slot="header" class="flex justify-between"> | ||
| 17 | + <span>{{ $t('accessControlInout.search.title') }}</span> | ||
| 18 | + </div> | ||
| 19 | + <el-row :gutter="20"> | ||
| 20 | + <el-col :span="6"> | ||
| 21 | + <el-select v-model="accessControlInoutInfo.conditions.machineId" | ||
| 22 | + :placeholder="$t('accessControlInout.search.machine')" style="width:100%"> | ||
| 23 | + <el-option v-for="item in accessControlInoutInfo.accessControls" :key="item.machineId" | ||
| 24 | + :label="item.machineName" :value="item.machineId" /> | ||
| 25 | + </el-select> | ||
| 26 | + </el-col> | ||
| 27 | + <el-col :span="6"> | ||
| 28 | + <el-input v-model="accessControlInoutInfo.conditions.name" | ||
| 29 | + :placeholder="$t('accessControlInout.search.name')" /> | ||
| 30 | + </el-col> | ||
| 31 | + <el-col :span="6"> | ||
| 32 | + <el-input v-model="accessControlInoutInfo.conditions.tel" | ||
| 33 | + :placeholder="$t('accessControlInout.search.tel')" /> | ||
| 34 | + </el-col> | ||
| 35 | + <el-col :span="6"> | ||
| 36 | + <el-select v-model="accessControlInoutInfo.conditions.state" | ||
| 37 | + :placeholder="$t('accessControlInout.search.state')" style="width:100%"> | ||
| 38 | + <el-option label="全部" value="" /> | ||
| 39 | + <el-option label="开门成功" value="C" /> | ||
| 40 | + <el-option label="开门失败" value="F" /> | ||
| 41 | + </el-select> | ||
| 42 | + </el-col> | ||
| 43 | + </el-row> | ||
| 44 | + <el-row :gutter="20" style="margin-top:15px"> | ||
| 45 | + <el-col :span="6"> | ||
| 46 | + <el-date-picker v-model="accessControlInoutInfo.conditions.queryStartTime" type="datetime" | ||
| 47 | + :placeholder="$t('accessControlInout.search.startTime')" style="width:100%" /> | ||
| 48 | + </el-col> | ||
| 49 | + <el-col :span="6"> | ||
| 50 | + <el-date-picker v-model="accessControlInoutInfo.conditions.queryEndTime" type="datetime" | ||
| 51 | + :placeholder="$t('accessControlInout.search.endTime')" style="width:100%" /> | ||
| 52 | + </el-col> | ||
| 53 | + <el-col :span="6"> | ||
| 54 | + <el-button type="primary" @click="_queryAccessControlInoutMethod"> | ||
| 55 | + {{ $t('common.search') }} | ||
| 56 | + </el-button> | ||
| 57 | + </el-col> | ||
| 58 | + </el-row> | ||
| 59 | + </el-card> | ||
| 60 | + | ||
| 61 | + <el-card class="table-card" style="margin-top:20px"> | ||
| 62 | + <div slot="header" class="flex justify-between"> | ||
| 63 | + <span>{{ $t('accessControlInout.table.title') }}</span> | ||
| 64 | + </div> | ||
| 65 | + <el-table :data="accessControlInoutInfo.accessControlInouts" border style="width:100%" v-loading="loading"> | ||
| 66 | + <el-table-column prop="facePath" :label="$t('accessControlInout.table.face')" align="center" width="100"> | ||
| 67 | + <template slot-scope="scope"> | ||
| 68 | + <el-image style="width:60px;height:60px;cursor:pointer" :src="scope.row.facePath || '/img/noPhoto.jpg'" | ||
| 69 | + :preview-src-list="[scope.row.facePath]" fit="cover" /> | ||
| 70 | + </template> | ||
| 71 | + </el-table-column> | ||
| 72 | + <el-table-column prop="inoutId" :label="$t('accessControlInout.table.id')" align="center" /> | ||
| 73 | + <el-table-column prop="machineName" :label="$t('accessControlInout.table.machineName')" align="center" /> | ||
| 74 | + <el-table-column prop="machineCode" :label="$t('accessControlInout.table.machineCode')" align="center" /> | ||
| 75 | + <el-table-column prop="name" :label="$t('accessControlInout.table.userName')" align="center" /> | ||
| 76 | + <el-table-column prop="openTypeCd" :label="$t('accessControlInout.table.openType')" align="center"> | ||
| 77 | + <template slot-scope="scope"> | ||
| 78 | + {{ scope.row.openTypeCd === '1000' ? $t('accessControlInout.openType.face') : | ||
| 79 | + $t('accessControlInout.openType.other') }} | ||
| 80 | + </template> | ||
| 81 | + </el-table-column> | ||
| 82 | + <el-table-column prop="tel" :label="$t('accessControlInout.table.tel')" align="center" /> | ||
| 83 | + <el-table-column prop="idCard" :label="$t('accessControlInout.table.idCard')" align="center" /> | ||
| 84 | + <el-table-column prop="similar" :label="$t('accessControlInout.table.similar')" align="center" /> | ||
| 85 | + <el-table-column prop="state" :label="$t('accessControlInout.table.state')" align="center"> | ||
| 86 | + <template slot-scope="scope"> | ||
| 87 | + {{ scope.row.state === 'C' ? $t('accessControlInout.state.success') : $t('accessControlInout.state.fail') | ||
| 88 | + }} | ||
| 89 | + </template> | ||
| 90 | + </el-table-column> | ||
| 91 | + <el-table-column prop="createTime" :label="$t('accessControlInout.table.createTime')" align="center" /> | ||
| 92 | + </el-table> | ||
| 93 | + <el-pagination style="margin-top:20px;text-align:right" :current-page.sync="page.current" | ||
| 94 | + :page-sizes="[10, 20, 30, 50]" :page-size="page.size" :total="page.total" | ||
| 95 | + layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | ||
| 96 | + @current-change="handleCurrentChange" /> | ||
| 97 | + </el-card> | ||
| 98 | + </el-col> | ||
| 99 | + </el-row> | ||
| 100 | + </div> | ||
| 101 | +</template> | ||
| 102 | + | ||
| 103 | +<script> | ||
| 104 | +import { listAccessControlInouts, listAccessControls } from '@/api/machine/accessControlInoutApi' | ||
| 105 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 106 | + | ||
| 107 | +export default { | ||
| 108 | + name: 'AccessControlInoutList', | ||
| 109 | + data() { | ||
| 110 | + return { | ||
| 111 | + loading: false, | ||
| 112 | + communityId: '', | ||
| 113 | + accessControlInoutInfo: { | ||
| 114 | + accessControlInouts: [], | ||
| 115 | + accessControls: [], | ||
| 116 | + openTypeCds: [ | ||
| 117 | + { openTypeName: this.$t('accessControlInout.openType.all'), openTypeCd: '' }, | ||
| 118 | + { openTypeName: this.$t('accessControlInout.openType.face'), openTypeCd: '1000' }, | ||
| 119 | + { openTypeName: this.$t('accessControlInout.openType.key'), openTypeCd: '2000' }, | ||
| 120 | + { openTypeName: this.$t('accessControlInout.openType.qrcode'), openTypeCd: '3000' }, | ||
| 121 | + { openTypeName: this.$t('accessControlInout.openType.password'), openTypeCd: '4000' } | ||
| 122 | + ], | ||
| 123 | + total: 0, | ||
| 124 | + records: 1, | ||
| 125 | + conditions: { | ||
| 126 | + machineId: '', | ||
| 127 | + name: '', | ||
| 128 | + openTypeCd: '', | ||
| 129 | + tel: '', | ||
| 130 | + state: '', | ||
| 131 | + queryStartTime: '', | ||
| 132 | + queryEndTime: '', | ||
| 133 | + iotApiCode: 'listAccessControlInoutBmoImpl', | ||
| 134 | + page: 1, | ||
| 135 | + row: 10 | ||
| 136 | + } | ||
| 137 | + }, | ||
| 138 | + page: { | ||
| 139 | + current: 1, | ||
| 140 | + size: 10, | ||
| 141 | + total: 0 | ||
| 142 | + } | ||
| 143 | + } | ||
| 144 | + }, | ||
| 145 | + created() { | ||
| 146 | + this.communityId = getCommunityId() | ||
| 147 | + this._listAccessControls() | ||
| 148 | + this._listAccessControlInouts(this.page.current, this.page.size) | ||
| 149 | + }, | ||
| 150 | + methods: { | ||
| 151 | + async _listAccessControlInouts(page, rows) { | ||
| 152 | + try { | ||
| 153 | + this.loading = true | ||
| 154 | + this.accessControlInoutInfo.conditions.page = page | ||
| 155 | + this.accessControlInoutInfo.conditions.row = rows | ||
| 156 | + this.accessControlInoutInfo.conditions.communityId = this.communityId | ||
| 157 | + | ||
| 158 | + const { data, total } = await listAccessControlInouts(this.accessControlInoutInfo.conditions) | ||
| 159 | + this.accessControlInoutInfo.accessControlInouts = data | ||
| 160 | + this.page.total = total | ||
| 161 | + } catch (error) { | ||
| 162 | + console.error('获取门禁进出记录失败:', error) | ||
| 163 | + } finally { | ||
| 164 | + this.loading = false | ||
| 165 | + } | ||
| 166 | + }, | ||
| 167 | + async _listAccessControls() { | ||
| 168 | + try { | ||
| 169 | + const params = { | ||
| 170 | + page: 1, | ||
| 171 | + row: 100, | ||
| 172 | + communityId: this.communityId, | ||
| 173 | + iotApiCode: 'listAccessControlBmoImpl' | ||
| 174 | + } | ||
| 175 | + const { data } = await listAccessControls(params) | ||
| 176 | + this.accessControlInoutInfo.accessControls = data | ||
| 177 | + } catch (error) { | ||
| 178 | + console.error('获取门禁设备失败:', error) | ||
| 179 | + } | ||
| 180 | + }, | ||
| 181 | + _queryAccessControlInoutMethod() { | ||
| 182 | + this.page.current = 1 | ||
| 183 | + this._listAccessControlInouts(this.page.current, this.page.size) | ||
| 184 | + }, | ||
| 185 | + swatchOpenTypeCd(openType) { | ||
| 186 | + this.accessControlInoutInfo.conditions.openTypeCd = openType.openTypeCd | ||
| 187 | + this._queryAccessControlInoutMethod() | ||
| 188 | + }, | ||
| 189 | + handleSizeChange(val) { | ||
| 190 | + this.page.size = val | ||
| 191 | + this._listAccessControlInouts(this.page.current, this.page.size) | ||
| 192 | + }, | ||
| 193 | + handleCurrentChange(val) { | ||
| 194 | + this.page.current = val | ||
| 195 | + this._listAccessControlInouts(this.page.current, this.page.size) | ||
| 196 | + } | ||
| 197 | + } | ||
| 198 | +} | ||
| 199 | +</script> | ||
| 200 | + | ||
| 201 | +<style lang="scss" scoped> | ||
| 202 | +.access-control-inout-container { | ||
| 203 | + padding: 20px; | ||
| 204 | + | ||
| 205 | + .tree-card { | ||
| 206 | + height: 100%; | ||
| 207 | + | ||
| 208 | + .tree-list { | ||
| 209 | + list-style: none; | ||
| 210 | + padding: 0; | ||
| 211 | + margin: 0; | ||
| 212 | + | ||
| 213 | + li { | ||
| 214 | + padding: 10px; | ||
| 215 | + cursor: pointer; | ||
| 216 | + text-align: center; | ||
| 217 | + margin-bottom: 5px; | ||
| 218 | + border-radius: 4px; | ||
| 219 | + | ||
| 220 | + &:hover { | ||
| 221 | + background-color: #f5f7fa; | ||
| 222 | + } | ||
| 223 | + | ||
| 224 | + &.selected { | ||
| 225 | + background-color: #409eff; | ||
| 226 | + color: #fff; | ||
| 227 | + } | ||
| 228 | + } | ||
| 229 | + } | ||
| 230 | + } | ||
| 231 | + | ||
| 232 | + .search-card { | ||
| 233 | + margin-bottom: 20px; | ||
| 234 | + } | ||
| 235 | +} | ||
| 236 | +</style> | ||
| 0 | \ No newline at end of file | 237 | \ No newline at end of file |
src/views/machine/machinePrinterManageLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + machinePrinterManage: { | ||
| 4 | + search: { | ||
| 5 | + title: 'Search Conditions', | ||
| 6 | + machineName: 'Machine Name', | ||
| 7 | + machineCode: 'Machine Code' | ||
| 8 | + }, | ||
| 9 | + list: { | ||
| 10 | + title: 'Cloud Printer List' | ||
| 11 | + }, | ||
| 12 | + table: { | ||
| 13 | + machineId: 'Machine ID', | ||
| 14 | + machineName: 'Machine Name', | ||
| 15 | + machineCode: 'Machine Code', | ||
| 16 | + implBeanName: 'Manufacturer' | ||
| 17 | + }, | ||
| 18 | + form: { | ||
| 19 | + machineName: 'Machine Name', | ||
| 20 | + machineCode: 'Machine Code', | ||
| 21 | + implBean: 'Manufacturer', | ||
| 22 | + machineNamePlaceholder: 'Please enter machine name', | ||
| 23 | + machineCodePlaceholder: 'Please enter machine code', | ||
| 24 | + implBeanPlaceholder: 'Please select manufacturer' | ||
| 25 | + }, | ||
| 26 | + validate: { | ||
| 27 | + machineIdRequired: 'Machine ID is required', | ||
| 28 | + machineNameRequired: 'Machine name is required', | ||
| 29 | + machineNameMaxLength: 'Machine name cannot exceed 200 characters', | ||
| 30 | + machineCodeRequired: 'Machine code is required', | ||
| 31 | + machineCodeMaxLength: 'Machine code cannot exceed 30 characters', | ||
| 32 | + implBeanRequired: 'Manufacturer is required', | ||
| 33 | + implBeanMaxLength: 'Manufacturer cannot exceed 30 characters' | ||
| 34 | + }, | ||
| 35 | + message: { | ||
| 36 | + addSuccess: 'Add successfully', | ||
| 37 | + editSuccess: 'Edit successfully', | ||
| 38 | + deleteSuccess: 'Delete successfully', | ||
| 39 | + fetchError: 'Failed to fetch data' | ||
| 40 | + }, | ||
| 41 | + add: { | ||
| 42 | + title: 'Add Printer' | ||
| 43 | + }, | ||
| 44 | + edit: { | ||
| 45 | + title: 'Edit Printer' | ||
| 46 | + }, | ||
| 47 | + delete: { | ||
| 48 | + title: 'Delete Confirmation', | ||
| 49 | + confirmText: 'Are you sure to delete this cloud printer?' | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | + }, | ||
| 53 | + zh: { | ||
| 54 | + machinePrinterManage: { | ||
| 55 | + search: { | ||
| 56 | + title: '查询条件', | ||
| 57 | + machineName: '设备名称', | ||
| 58 | + machineCode: '设备编码' | ||
| 59 | + }, | ||
| 60 | + list: { | ||
| 61 | + title: '云打印机列表' | ||
| 62 | + }, | ||
| 63 | + table: { | ||
| 64 | + machineId: '设备编号', | ||
| 65 | + machineName: '设备名称', | ||
| 66 | + machineCode: '设备编码', | ||
| 67 | + implBeanName: '厂家' | ||
| 68 | + }, | ||
| 69 | + form: { | ||
| 70 | + machineName: '设备名称', | ||
| 71 | + machineCode: '设备编码', | ||
| 72 | + implBean: '厂家', | ||
| 73 | + machineNamePlaceholder: '请输入设备名称', | ||
| 74 | + machineCodePlaceholder: '请输入设备编码', | ||
| 75 | + implBeanPlaceholder: '请选择厂家' | ||
| 76 | + }, | ||
| 77 | + validate: { | ||
| 78 | + machineIdRequired: '设备编号不能为空', | ||
| 79 | + machineNameRequired: '设备名称不能为空', | ||
| 80 | + machineNameMaxLength: '设备名称不能超过200个字符', | ||
| 81 | + machineCodeRequired: '设备编码不能为空', | ||
| 82 | + machineCodeMaxLength: '设备编码不能超过30个字符', | ||
| 83 | + implBeanRequired: '厂家不能为空', | ||
| 84 | + implBeanMaxLength: '厂家不能超过30个字符' | ||
| 85 | + }, | ||
| 86 | + message: { | ||
| 87 | + addSuccess: '添加成功', | ||
| 88 | + editSuccess: '修改成功', | ||
| 89 | + deleteSuccess: '删除成功', | ||
| 90 | + fetchError: '获取数据失败' | ||
| 91 | + }, | ||
| 92 | + add: { | ||
| 93 | + title: '添加打印机' | ||
| 94 | + }, | ||
| 95 | + edit: { | ||
| 96 | + title: '修改打印机' | ||
| 97 | + }, | ||
| 98 | + delete: { | ||
| 99 | + title: '删除确认', | ||
| 100 | + confirmText: '确定删除该云打印机吗?' | ||
| 101 | + } | ||
| 102 | + } | ||
| 103 | + } | ||
| 104 | +} | ||
| 0 | \ No newline at end of file | 105 | \ No newline at end of file |
src/views/machine/machinePrinterManageList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="machine-printer-manage-container"> | ||
| 3 | + <!-- 查询条件 --> | ||
| 4 | + <el-card class="search-wrapper"> | ||
| 5 | + <div slot="header" class="flex justify-between"> | ||
| 6 | + <span>{{ $t('machinePrinterManage.search.title') }}</span> | ||
| 7 | + </div> | ||
| 8 | + <el-row :gutter="20"> | ||
| 9 | + <el-col :span="6"> | ||
| 10 | + <el-input v-model="searchForm.machineName" :placeholder="$t('machinePrinterManage.search.machineName')" | ||
| 11 | + clearable /> | ||
| 12 | + </el-col> | ||
| 13 | + <el-col :span="6"> | ||
| 14 | + <el-input v-model="searchForm.machineCode" :placeholder="$t('machinePrinterManage.search.machineCode')" | ||
| 15 | + clearable /> | ||
| 16 | + </el-col> | ||
| 17 | + <el-col :span="4"> | ||
| 18 | + <el-button type="primary" @click="handleSearch"> | ||
| 19 | + {{ $t('common.search') }} | ||
| 20 | + </el-button> | ||
| 21 | + <el-button @click="handleReset"> | ||
| 22 | + {{ $t('common.reset') }} | ||
| 23 | + </el-button> | ||
| 24 | + </el-col> | ||
| 25 | + </el-row> | ||
| 26 | + </el-card> | ||
| 27 | + | ||
| 28 | + <!-- 列表 --> | ||
| 29 | + <el-card class="list-wrapper"> | ||
| 30 | + <div slot="header" class="flex justify-between"> | ||
| 31 | + <span>{{ $t('machinePrinterManage.list.title') }}</span> | ||
| 32 | + <div class="header-right"> | ||
| 33 | + <el-button type="primary" size="small" @click="handleAdd"> | ||
| 34 | + {{ $t('common.add') }} | ||
| 35 | + </el-button> | ||
| 36 | + <el-button type="primary" size="small" @click="handleShowDoc"> | ||
| 37 | + {{ $t('common.document') }} | ||
| 38 | + </el-button> | ||
| 39 | + </div> | ||
| 40 | + </div> | ||
| 41 | + | ||
| 42 | + <el-table v-loading="loading" :data="tableData" border style="width: 100%"> | ||
| 43 | + <el-table-column prop="machineId" :label="$t('machinePrinterManage.table.machineId')" align="center" /> | ||
| 44 | + <el-table-column prop="machineName" :label="$t('machinePrinterManage.table.machineName')" align="center" /> | ||
| 45 | + <el-table-column prop="machineCode" :label="$t('machinePrinterManage.table.machineCode')" align="center" /> | ||
| 46 | + <el-table-column prop="implBeanName" :label="$t('machinePrinterManage.table.implBeanName')" align="center" /> | ||
| 47 | + <el-table-column :label="$t('common.operation')" align="center" width="200"> | ||
| 48 | + <template slot-scope="scope"> | ||
| 49 | + <el-button size="mini" type="primary" @click="handleEdit(scope.row)"> | ||
| 50 | + {{ $t('common.edit') }} | ||
| 51 | + </el-button> | ||
| 52 | + <el-button size="mini" type="danger" @click="handleDelete(scope.row)"> | ||
| 53 | + {{ $t('common.delete') }} | ||
| 54 | + </el-button> | ||
| 55 | + </template> | ||
| 56 | + </el-table-column> | ||
| 57 | + </el-table> | ||
| 58 | + | ||
| 59 | + <el-pagination :current-page="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size" | ||
| 60 | + :total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | ||
| 61 | + @current-change="handleCurrentChange" /> | ||
| 62 | + </el-card> | ||
| 63 | + | ||
| 64 | + <!-- 子组件 --> | ||
| 65 | + <add-machine-printer ref="addMachinePrinter" @success="handleSuccess" /> | ||
| 66 | + <edit-machine-printer ref="editMachinePrinter" @success="handleSuccess" /> | ||
| 67 | + <delete-machine-printer ref="deleteMachinePrinter" @success="handleSuccess" /> | ||
| 68 | + </div> | ||
| 69 | +</template> | ||
| 70 | + | ||
| 71 | +<script> | ||
| 72 | +import { listMachinePrinter } from '@/api/machine/machinePrinterManageApi' | ||
| 73 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 74 | +import AddMachinePrinter from '@/components/machine/addMachinePrinter' | ||
| 75 | +import EditMachinePrinter from '@/components/machine/editMachinePrinter' | ||
| 76 | +import DeleteMachinePrinter from '@/components/machine/deleteMachinePrinter' | ||
| 77 | + | ||
| 78 | +export default { | ||
| 79 | + name: 'MachinePrinterManageList', | ||
| 80 | + components: { | ||
| 81 | + AddMachinePrinter, | ||
| 82 | + EditMachinePrinter, | ||
| 83 | + DeleteMachinePrinter | ||
| 84 | + }, | ||
| 85 | + data() { | ||
| 86 | + return { | ||
| 87 | + loading: false, | ||
| 88 | + searchForm: { | ||
| 89 | + machineName: '', | ||
| 90 | + machineCode: '', | ||
| 91 | + communityId: getCommunityId() | ||
| 92 | + }, | ||
| 93 | + tableData: [], | ||
| 94 | + page: { | ||
| 95 | + current: 1, | ||
| 96 | + size: 10, | ||
| 97 | + total: 0 | ||
| 98 | + } | ||
| 99 | + } | ||
| 100 | + }, | ||
| 101 | + created() { | ||
| 102 | + this.getList() | ||
| 103 | + }, | ||
| 104 | + methods: { | ||
| 105 | + async getList() { | ||
| 106 | + try { | ||
| 107 | + this.loading = true | ||
| 108 | + const params = { | ||
| 109 | + page: this.page.current, | ||
| 110 | + row: this.page.size, | ||
| 111 | + ...this.searchForm | ||
| 112 | + } | ||
| 113 | + const { data, total } = await listMachinePrinter(params) | ||
| 114 | + this.tableData = data | ||
| 115 | + this.page.total = total | ||
| 116 | + } catch (error) { | ||
| 117 | + this.$message.error(this.$t('machinePrinterManage.fetchError')) | ||
| 118 | + } finally { | ||
| 119 | + this.loading = false | ||
| 120 | + } | ||
| 121 | + }, | ||
| 122 | + handleSearch() { | ||
| 123 | + this.page.current = 1 | ||
| 124 | + this.getList() | ||
| 125 | + }, | ||
| 126 | + handleReset() { | ||
| 127 | + this.searchForm = { | ||
| 128 | + machineName: '', | ||
| 129 | + machineCode: '', | ||
| 130 | + communityId: getCommunityId() | ||
| 131 | + } | ||
| 132 | + this.handleSearch() | ||
| 133 | + }, | ||
| 134 | + handleAdd() { | ||
| 135 | + this.$refs.addMachinePrinter.open() | ||
| 136 | + }, | ||
| 137 | + handleEdit(row) { | ||
| 138 | + this.$refs.editMachinePrinter.open(row) | ||
| 139 | + }, | ||
| 140 | + handleDelete(row) { | ||
| 141 | + this.$refs.deleteMachinePrinter.open(row) | ||
| 142 | + }, | ||
| 143 | + handleShowDoc() { | ||
| 144 | + // 显示文档逻辑 | ||
| 145 | + }, | ||
| 146 | + handleSuccess() { | ||
| 147 | + this.getList() | ||
| 148 | + }, | ||
| 149 | + handleSizeChange(val) { | ||
| 150 | + this.page.size = val | ||
| 151 | + this.getList() | ||
| 152 | + }, | ||
| 153 | + handleCurrentChange(val) { | ||
| 154 | + this.page.current = val | ||
| 155 | + this.getList() | ||
| 156 | + } | ||
| 157 | + } | ||
| 158 | +} | ||
| 159 | +</script> | ||
| 160 | + | ||
| 161 | +<style lang="scss" scoped> | ||
| 162 | +.machine-printer-manage-container { | ||
| 163 | + padding: 20px; | ||
| 164 | + | ||
| 165 | + .search-wrapper { | ||
| 166 | + margin-bottom: 20px; | ||
| 167 | + | ||
| 168 | + .el-row { | ||
| 169 | + margin-bottom: -20px; | ||
| 170 | + } | ||
| 171 | + | ||
| 172 | + .el-col { | ||
| 173 | + margin-bottom: 20px; | ||
| 174 | + } | ||
| 175 | + } | ||
| 176 | + | ||
| 177 | + .list-wrapper { | ||
| 178 | + .header-right { | ||
| 179 | + float: right; | ||
| 180 | + } | ||
| 181 | + } | ||
| 182 | + | ||
| 183 | + .el-pagination { | ||
| 184 | + margin-top: 20px; | ||
| 185 | + text-align: right; | ||
| 186 | + } | ||
| 187 | +} | ||
| 188 | +</style> | ||
| 0 | \ No newline at end of file | 189 | \ No newline at end of file |
src/views/machine/machineTranslateManageLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + machineTranslateManage: { | ||
| 4 | + search: { | ||
| 5 | + title: 'Search Conditions', | ||
| 6 | + typeCd: 'Select Object Type', | ||
| 7 | + selectType: 'Please select object type', | ||
| 8 | + objId: 'Please enter object ID', | ||
| 9 | + objName: 'Please enter object name' | ||
| 10 | + }, | ||
| 11 | + list: { | ||
| 12 | + title: 'IoT Synchronization' | ||
| 13 | + }, | ||
| 14 | + table: { | ||
| 15 | + objId: 'Object ID', | ||
| 16 | + typeCd: 'Object Type', | ||
| 17 | + objName: 'Object Name', | ||
| 18 | + machineCmd: 'Command', | ||
| 19 | + state: 'Status', | ||
| 20 | + remark: 'Remark', | ||
| 21 | + updateTime: 'Sync Time', | ||
| 22 | + operation: 'Operation' | ||
| 23 | + }, | ||
| 24 | + button: { | ||
| 25 | + resync: 'Resync' | ||
| 26 | + }, | ||
| 27 | + state: { | ||
| 28 | + notSync: 'Not Synced', | ||
| 29 | + synced: 'Synced' | ||
| 30 | + }, | ||
| 31 | + type: { | ||
| 32 | + owner: 'Owner', | ||
| 33 | + community: 'Community', | ||
| 34 | + keyInfo: 'Key Info', | ||
| 35 | + visitorInfo: 'Visitor Info', | ||
| 36 | + staffFace: 'Staff Face', | ||
| 37 | + carInfo: 'Car Info', | ||
| 38 | + deviceInfo: 'Device Info' | ||
| 39 | + }, | ||
| 40 | + add: { | ||
| 41 | + title: 'Add Device Sync', | ||
| 42 | + machineCode: 'Device Code', | ||
| 43 | + machineCodePlaceholder: 'Required, please enter device code', | ||
| 44 | + machineId: 'Device ID', | ||
| 45 | + machineIdPlaceholder: 'Required, please enter device ID', | ||
| 46 | + typeCd: 'Object Type', | ||
| 47 | + typeCdPlaceholder: 'Required, please select object type', | ||
| 48 | + objName: 'Object Name', | ||
| 49 | + objNamePlaceholder: 'Required, please enter object name', | ||
| 50 | + objId: 'Object ID', | ||
| 51 | + objIdPlaceholder: 'Required, please enter object ID', | ||
| 52 | + state: 'Status', | ||
| 53 | + statePlaceholder: 'Required, please select status' | ||
| 54 | + }, | ||
| 55 | + edit: { | ||
| 56 | + title: 'Resync', | ||
| 57 | + machineCode: 'Device Code', | ||
| 58 | + machineId: 'Device ID', | ||
| 59 | + typeCd: 'Object Type', | ||
| 60 | + objName: 'Object Name', | ||
| 61 | + objId: 'Object ID' | ||
| 62 | + }, | ||
| 63 | + validate: { | ||
| 64 | + machineCodeRequired: 'Device code cannot be empty', | ||
| 65 | + machineCodeMaxLength: 'Device code cannot exceed 30 characters', | ||
| 66 | + machineIdRequired: 'Device ID cannot be empty', | ||
| 67 | + typeCdRequired: 'Object type cannot be empty', | ||
| 68 | + objNameRequired: 'Object name cannot be empty', | ||
| 69 | + objIdRequired: 'Object ID cannot be empty', | ||
| 70 | + objIdNumber: 'Object ID must be a number', | ||
| 71 | + stateRequired: 'Status cannot be empty' | ||
| 72 | + }, | ||
| 73 | + message: { | ||
| 74 | + addSuccess: 'Add success', | ||
| 75 | + resyncSuccess: 'Resync success', | ||
| 76 | + fetchError: 'Failed to fetch data' | ||
| 77 | + } | ||
| 78 | + } | ||
| 79 | + }, | ||
| 80 | + zh: { | ||
| 81 | + machineTranslateManage: { | ||
| 82 | + search: { | ||
| 83 | + title: '查询条件', | ||
| 84 | + typeCd: '请选择对象类型', | ||
| 85 | + selectType: '请选择对象类型', | ||
| 86 | + objId: '请输入对象ID', | ||
| 87 | + objName: '请输入对象名称' | ||
| 88 | + }, | ||
| 89 | + list: { | ||
| 90 | + title: '物联网同步' | ||
| 91 | + }, | ||
| 92 | + table: { | ||
| 93 | + objId: '对象ID', | ||
| 94 | + typeCd: '对象类型', | ||
| 95 | + objName: '对象名称', | ||
| 96 | + machineCmd: '指令', | ||
| 97 | + state: '状态', | ||
| 98 | + remark: '说明', | ||
| 99 | + updateTime: '同步时间', | ||
| 100 | + operation: '操作' | ||
| 101 | + }, | ||
| 102 | + button: { | ||
| 103 | + resync: '重新同步' | ||
| 104 | + }, | ||
| 105 | + state: { | ||
| 106 | + notSync: '未同步', | ||
| 107 | + synced: '已同步' | ||
| 108 | + }, | ||
| 109 | + type: { | ||
| 110 | + owner: '业主', | ||
| 111 | + community: '小区', | ||
| 112 | + keyInfo: '钥匙信息', | ||
| 113 | + visitorInfo: '访客信息', | ||
| 114 | + staffFace: '员工人脸', | ||
| 115 | + carInfo: '车辆信息', | ||
| 116 | + deviceInfo: '设备信息' | ||
| 117 | + }, | ||
| 118 | + add: { | ||
| 119 | + title: '添加设备同步', | ||
| 120 | + machineCode: '设备编码', | ||
| 121 | + machineCodePlaceholder: '必填,请填写设备编码', | ||
| 122 | + machineId: '设备ID', | ||
| 123 | + machineIdPlaceholder: '必填,请填写设备ID', | ||
| 124 | + typeCd: '对象类型', | ||
| 125 | + typeCdPlaceholder: '必填,请选择对象类型', | ||
| 126 | + objName: '对象名称', | ||
| 127 | + objNamePlaceholder: '必填,请填写对象名称', | ||
| 128 | + objId: '对象ID', | ||
| 129 | + objIdPlaceholder: '必填,请填写对象ID', | ||
| 130 | + state: '状态', | ||
| 131 | + statePlaceholder: '必填,请选择状态' | ||
| 132 | + }, | ||
| 133 | + edit: { | ||
| 134 | + title: '重新同步', | ||
| 135 | + machineCode: '设备编码', | ||
| 136 | + machineId: '设备ID', | ||
| 137 | + typeCd: '对象类型', | ||
| 138 | + objName: '对象名称', | ||
| 139 | + objId: '对象ID' | ||
| 140 | + }, | ||
| 141 | + validate: { | ||
| 142 | + machineCodeRequired: '设备编码不能为空', | ||
| 143 | + machineCodeMaxLength: '设备编码不能超过30位', | ||
| 144 | + machineIdRequired: '设备ID不能为空', | ||
| 145 | + typeCdRequired: '对象类型不能为空', | ||
| 146 | + objNameRequired: '对象名称不能为空', | ||
| 147 | + objIdRequired: '对象ID不能为空', | ||
| 148 | + objIdNumber: '对象ID必须为数字', | ||
| 149 | + stateRequired: '状态不能为空' | ||
| 150 | + }, | ||
| 151 | + message: { | ||
| 152 | + addSuccess: '添加成功', | ||
| 153 | + resyncSuccess: '重新同步成功', | ||
| 154 | + fetchError: '获取数据失败' | ||
| 155 | + } | ||
| 156 | + } | ||
| 157 | + } | ||
| 158 | +} | ||
| 0 | \ No newline at end of file | 159 | \ No newline at end of file |
src/views/machine/machineTranslateManageList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="machine-translate-manage-container"> | ||
| 3 | + <!-- 查询条件 --> | ||
| 4 | + <el-card class="search-wrapper"> | ||
| 5 | + <div slot="header" class="flex justify-between"> | ||
| 6 | + <span>{{ $t('machineTranslateManage.search.title') }}</span> | ||
| 7 | + <el-button style="float: right; padding: 3px 0" type="text" @click="toggleMoreCondition"> | ||
| 8 | + {{ machineTranslateManageInfo.moreCondition ? $t('common.hide') : $t('common.more') }} | ||
| 9 | + </el-button> | ||
| 10 | + </div> | ||
| 11 | + <el-row :gutter="20"> | ||
| 12 | + <el-col :span="6"> | ||
| 13 | + <el-select v-model="machineTranslateManageInfo.conditions.typeCd" | ||
| 14 | + :placeholder="$t('machineTranslateManage.search.typeCd')" style="width: 100%"> | ||
| 15 | + <el-option :label="$t('machineTranslateManage.search.selectType')" value="" /> | ||
| 16 | + <el-option v-for="(item, index) in machineTranslateManageInfo.typeCds" :key="index" :label="item.name" | ||
| 17 | + :value="item.statusCd" /> | ||
| 18 | + </el-select> | ||
| 19 | + </el-col> | ||
| 20 | + <el-col :span="6"> | ||
| 21 | + <el-input v-model="machineTranslateManageInfo.conditions.objId" | ||
| 22 | + :placeholder="$t('machineTranslateManage.search.objId')" /> | ||
| 23 | + </el-col> | ||
| 24 | + <el-col :span="6"> | ||
| 25 | + <el-input v-model="machineTranslateManageInfo.conditions.objName" | ||
| 26 | + :placeholder="$t('machineTranslateManage.search.objName')" /> | ||
| 27 | + </el-col> | ||
| 28 | + <el-col :span="6"> | ||
| 29 | + <el-button type="primary" @click="queryMachineTranslateMethod"> | ||
| 30 | + {{ $t('common.search') }} | ||
| 31 | + </el-button> | ||
| 32 | + <el-button @click="resetMachineTranslateMethod"> | ||
| 33 | + {{ $t('common.reset') }} | ||
| 34 | + </el-button> | ||
| 35 | + </el-col> | ||
| 36 | + </el-row> | ||
| 37 | + </el-card> | ||
| 38 | + | ||
| 39 | + <!-- 数据列表 --> | ||
| 40 | + <el-card class="list-wrapper"> | ||
| 41 | + <div slot="header" class="flex justify-between"> | ||
| 42 | + <span>{{ $t('machineTranslateManage.list.title') }}</span> | ||
| 43 | + </div> | ||
| 44 | + <el-table v-loading="loading" :data="machineTranslateManageInfo.machineTranslates" border style="width: 100%"> | ||
| 45 | + <el-table-column prop="objId" :label="$t('machineTranslateManage.table.objId')" align="center" /> | ||
| 46 | + <el-table-column prop="typeCdName" :label="$t('machineTranslateManage.table.typeCd')" align="center" /> | ||
| 47 | + <el-table-column prop="objName" :label="$t('machineTranslateManage.table.objName')" align="center" /> | ||
| 48 | + <el-table-column prop="machineCmdName" :label="$t('machineTranslateManage.table.machineCmd')" align="center" /> | ||
| 49 | + <el-table-column prop="stateName" :label="$t('machineTranslateManage.table.state')" align="center" /> | ||
| 50 | + <el-table-column prop="remark" :label="$t('machineTranslateManage.table.remark')" align="center" width="80" /> | ||
| 51 | + <el-table-column prop="updateTime" :label="$t('machineTranslateManage.table.updateTime')" align="center" /> | ||
| 52 | + <el-table-column :label="$t('common.operation')" align="center" width="120"> | ||
| 53 | + <template slot-scope="scope"> | ||
| 54 | + <el-button v-if="scope.row.state !== '20000'" size="mini" type="primary" | ||
| 55 | + @click="openEditMachineTranslateModel(scope.row)"> | ||
| 56 | + {{ $t('machineTranslateManage.button.resync') }} | ||
| 57 | + </el-button> | ||
| 58 | + </template> | ||
| 59 | + </el-table-column> | ||
| 60 | + </el-table> | ||
| 61 | + | ||
| 62 | + <el-pagination :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size" | ||
| 63 | + :total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | ||
| 64 | + @current-change="handleCurrentChange" /> | ||
| 65 | + </el-card> | ||
| 66 | + | ||
| 67 | + <!-- 组件 --> | ||
| 68 | + <add-machine-translate ref="addMachineTranslate" @success="handleSuccess" /> | ||
| 69 | + <edit-machine-translate ref="editMachineTranslate" @success="handleSuccess" /> | ||
| 70 | + </div> | ||
| 71 | +</template> | ||
| 72 | + | ||
| 73 | +<script> | ||
| 74 | +import { listMachineTranslates } from '@/api/machine/machineTranslateManageApi' | ||
| 75 | +import { getDict } from '@/api/community/communityApi' | ||
| 76 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 77 | +import AddMachineTranslate from '@/components/machine/addMachineTranslate' | ||
| 78 | +import EditMachineTranslate from '@/components/machine/editMachineTranslate' | ||
| 79 | + | ||
| 80 | +export default { | ||
| 81 | + name: 'MachineTranslateManageList', | ||
| 82 | + components: { | ||
| 83 | + AddMachineTranslate, | ||
| 84 | + EditMachineTranslate | ||
| 85 | + }, | ||
| 86 | + data() { | ||
| 87 | + return { | ||
| 88 | + loading: false, | ||
| 89 | + communityId: '', | ||
| 90 | + machineTranslateManageInfo: { | ||
| 91 | + machineTranslates: [], | ||
| 92 | + total: 0, | ||
| 93 | + records: 1, | ||
| 94 | + moreCondition: false, | ||
| 95 | + typeCds: [], | ||
| 96 | + conditions: { | ||
| 97 | + typeCd: '', | ||
| 98 | + objName: '', | ||
| 99 | + objId: '', | ||
| 100 | + communityId: '' | ||
| 101 | + } | ||
| 102 | + }, | ||
| 103 | + page: { | ||
| 104 | + current: 1, | ||
| 105 | + size: 10, | ||
| 106 | + total: 0 | ||
| 107 | + } | ||
| 108 | + } | ||
| 109 | + }, | ||
| 110 | + created() { | ||
| 111 | + this.communityId = getCommunityId() | ||
| 112 | + this.machineTranslateManageInfo.conditions.communityId = this.communityId | ||
| 113 | + this.initData() | ||
| 114 | + }, | ||
| 115 | + methods: { | ||
| 116 | + async initData() { | ||
| 117 | + try { | ||
| 118 | + await this.getDictData() | ||
| 119 | + this.listMachineTranslates() | ||
| 120 | + } catch (error) { | ||
| 121 | + console.error('初始化数据失败:', error) | ||
| 122 | + } | ||
| 123 | + }, | ||
| 124 | + async getDictData() { | ||
| 125 | + try { | ||
| 126 | + const data = await getDict('machine_translate', 'type_cd') | ||
| 127 | + this.machineTranslateManageInfo.typeCds = data | ||
| 128 | + } catch (error) { | ||
| 129 | + console.error('获取字典数据失败:', error) | ||
| 130 | + } | ||
| 131 | + }, | ||
| 132 | + async listMachineTranslates() { | ||
| 133 | + try { | ||
| 134 | + this.loading = true | ||
| 135 | + const params = { | ||
| 136 | + page: this.page.current, | ||
| 137 | + row: this.page.size, | ||
| 138 | + ...this.machineTranslateManageInfo.conditions | ||
| 139 | + } | ||
| 140 | + const { data, total } = await listMachineTranslates(params) | ||
| 141 | + this.machineTranslateManageInfo.machineTranslates = data | ||
| 142 | + this.page.total = total | ||
| 143 | + } catch (error) { | ||
| 144 | + this.$message.error(this.$t('machineTranslateManage.fetchError')) | ||
| 145 | + } finally { | ||
| 146 | + this.loading = false | ||
| 147 | + } | ||
| 148 | + }, | ||
| 149 | + queryMachineTranslateMethod() { | ||
| 150 | + this.page.current = 1 | ||
| 151 | + this.listMachineTranslates() | ||
| 152 | + }, | ||
| 153 | + resetMachineTranslateMethod() { | ||
| 154 | + this.machineTranslateManageInfo.conditions = { | ||
| 155 | + typeCd: '', | ||
| 156 | + objName: '', | ||
| 157 | + objId: '', | ||
| 158 | + communityId: this.communityId | ||
| 159 | + } | ||
| 160 | + this.listMachineTranslates() | ||
| 161 | + }, | ||
| 162 | + toggleMoreCondition() { | ||
| 163 | + this.machineTranslateManageInfo.moreCondition = !this.machineTranslateManageInfo.moreCondition | ||
| 164 | + }, | ||
| 165 | + openEditMachineTranslateModel(row) { | ||
| 166 | + this.$refs.editMachineTranslate.open(row) | ||
| 167 | + }, | ||
| 168 | + handleSuccess() { | ||
| 169 | + this.listMachineTranslates() | ||
| 170 | + }, | ||
| 171 | + handleSizeChange(val) { | ||
| 172 | + this.page.size = val | ||
| 173 | + this.listMachineTranslates() | ||
| 174 | + }, | ||
| 175 | + handleCurrentChange(val) { | ||
| 176 | + this.page.current = val | ||
| 177 | + this.listMachineTranslates() | ||
| 178 | + } | ||
| 179 | + } | ||
| 180 | +} | ||
| 181 | +</script> | ||
| 182 | + | ||
| 183 | +<style lang="scss" scoped> | ||
| 184 | +.machine-translate-manage-container { | ||
| 185 | + padding: 20px; | ||
| 186 | + | ||
| 187 | + .search-wrapper { | ||
| 188 | + margin-bottom: 20px; | ||
| 189 | + | ||
| 190 | + .el-row { | ||
| 191 | + margin-bottom: 20px; | ||
| 192 | + } | ||
| 193 | + } | ||
| 194 | + | ||
| 195 | + .list-wrapper { | ||
| 196 | + margin-bottom: 20px; | ||
| 197 | + | ||
| 198 | + .el-pagination { | ||
| 199 | + margin-top: 20px; | ||
| 200 | + text-align: right; | ||
| 201 | + } | ||
| 202 | + } | ||
| 203 | +} | ||
| 204 | +</style> | ||
| 0 | \ No newline at end of file | 205 | \ No newline at end of file |
src/views/machine/printerRuleLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + printerRule: { | ||
| 4 | + title: 'Printer Rule Management', | ||
| 5 | + addTitle: 'Add Printer Rule', | ||
| 6 | + editTitle: 'Edit Printer Rule', | ||
| 7 | + deleteTitle: 'Delete Printer Rule', | ||
| 8 | + ruleName: 'Rule Name', | ||
| 9 | + ruleNamePlaceholder: 'Please enter rule name', | ||
| 10 | + ruleNameRequired: 'Rule name is required', | ||
| 11 | + ruleNameMaxLength: 'Rule name cannot exceed 64 characters', | ||
| 12 | + remark: 'Remark', | ||
| 13 | + remarkPlaceholder: 'Please enter remark', | ||
| 14 | + remarkMaxLength: 'Remark cannot exceed 512 characters', | ||
| 15 | + state: 'State', | ||
| 16 | + deleteConfirm: 'Are you sure to delete this printer rule?', | ||
| 17 | + tab: { | ||
| 18 | + machine: 'Cloud Printer', | ||
| 19 | + fees: 'Fee Auto Print', | ||
| 20 | + repair: 'Repair Auto Print' | ||
| 21 | + } | ||
| 22 | + }, | ||
| 23 | + printerRuleMachine: { | ||
| 24 | + title: 'Printer Machine Management', | ||
| 25 | + addTitle: 'Add Printer Machine', | ||
| 26 | + editTitle: 'Edit Printer Machine', | ||
| 27 | + deleteTitle: 'Delete Printer Machine', | ||
| 28 | + id: 'ID', | ||
| 29 | + idPlaceholder: 'Please enter ID', | ||
| 30 | + machineName: 'Printer Name', | ||
| 31 | + machineNamePlaceholder: 'Please enter printer name', | ||
| 32 | + machine: 'Printer', | ||
| 33 | + machinePlaceholder: 'Please select printer', | ||
| 34 | + machineRequired: 'Printer is required', | ||
| 35 | + quantity: 'Quantity', | ||
| 36 | + quantityPlaceholder: 'Please enter quantity', | ||
| 37 | + quantityRequired: 'Quantity is required', | ||
| 38 | + deleteConfirm: 'Are you sure to delete this printer machine?', | ||
| 39 | + table: { | ||
| 40 | + id: 'ID', | ||
| 41 | + machineName: 'Printer Name', | ||
| 42 | + quantity: 'Quantity' | ||
| 43 | + } | ||
| 44 | + }, | ||
| 45 | + printerRuleFees: { | ||
| 46 | + title: 'Fee Auto Print Management', | ||
| 47 | + addTitle: 'Add Fee Auto Print', | ||
| 48 | + deleteTitle: 'Delete Fee Auto Print', | ||
| 49 | + id: 'ID', | ||
| 50 | + idPlaceholder: 'Please enter ID', | ||
| 51 | + feeName: 'Fee Name', | ||
| 52 | + feeNamePlaceholder: 'Please enter fee name', | ||
| 53 | + fee: 'Fee', | ||
| 54 | + feePlaceholder: 'Please select fee', | ||
| 55 | + feeRequired: 'Fee is required', | ||
| 56 | + deleteConfirm: 'Are you sure to delete this fee auto print?', | ||
| 57 | + table: { | ||
| 58 | + id: 'ID', | ||
| 59 | + feeName: 'Fee Name' | ||
| 60 | + } | ||
| 61 | + }, | ||
| 62 | + printerRuleRepair: { | ||
| 63 | + title: 'Repair Auto Print Management', | ||
| 64 | + addTitle: 'Add Repair Auto Print', | ||
| 65 | + deleteTitle: 'Delete Repair Auto Print', | ||
| 66 | + id: 'ID', | ||
| 67 | + idPlaceholder: 'Please enter ID', | ||
| 68 | + repairType: 'Repair Type', | ||
| 69 | + repairTypePlaceholder: 'Please enter repair type', | ||
| 70 | + repairTypeRequired: 'Repair type is required', | ||
| 71 | + deleteConfirm: 'Are you sure to delete this repair auto print?', | ||
| 72 | + table: { | ||
| 73 | + id: 'ID', | ||
| 74 | + repairType: 'Repair Type' | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + }, | ||
| 78 | + zh: { | ||
| 79 | + printerRule: { | ||
| 80 | + title: '打印机规则管理', | ||
| 81 | + addTitle: '添加打印机规则', | ||
| 82 | + editTitle: '修改打印机规则', | ||
| 83 | + deleteTitle: '删除打印机规则', | ||
| 84 | + ruleName: '规则名称', | ||
| 85 | + ruleNamePlaceholder: '请输入规则名称', | ||
| 86 | + ruleNameRequired: '规则名称不能为空', | ||
| 87 | + ruleNameMaxLength: '规则名称不能超过64个字符', | ||
| 88 | + remark: '备注', | ||
| 89 | + remarkPlaceholder: '请输入备注', | ||
| 90 | + remarkMaxLength: '备注不能超过512个字符', | ||
| 91 | + state: '状态', | ||
| 92 | + deleteConfirm: '确定删除此打印机规则吗?', | ||
| 93 | + tab: { | ||
| 94 | + machine: '云打印机', | ||
| 95 | + fees: '缴费自动打印', | ||
| 96 | + repair: '报修自动打印' | ||
| 97 | + } | ||
| 98 | + }, | ||
| 99 | + printerRuleMachine: { | ||
| 100 | + title: '打印机机器管理', | ||
| 101 | + addTitle: '添加打印机机器', | ||
| 102 | + editTitle: '修改打印机机器', | ||
| 103 | + deleteTitle: '删除打印机机器', | ||
| 104 | + id: '编号', | ||
| 105 | + idPlaceholder: '请输入编号', | ||
| 106 | + machineName: '打印机名称', | ||
| 107 | + machineNamePlaceholder: '请输入打印机名称', | ||
| 108 | + machine: '打印机', | ||
| 109 | + machinePlaceholder: '请选择打印机', | ||
| 110 | + machineRequired: '打印机不能为空', | ||
| 111 | + quantity: '打印数量', | ||
| 112 | + quantityPlaceholder: '请输入打印数量', | ||
| 113 | + quantityRequired: '打印数量不能为空', | ||
| 114 | + deleteConfirm: '确定删除此打印机机器吗?', | ||
| 115 | + table: { | ||
| 116 | + id: '编号', | ||
| 117 | + machineName: '打印机名称', | ||
| 118 | + quantity: '打印数量' | ||
| 119 | + } | ||
| 120 | + }, | ||
| 121 | + printerRuleFees: { | ||
| 122 | + title: '缴费自动打印管理', | ||
| 123 | + addTitle: '添加缴费自动打印', | ||
| 124 | + deleteTitle: '删除缴费自动打印', | ||
| 125 | + id: '编号', | ||
| 126 | + idPlaceholder: '请输入编号', | ||
| 127 | + feeName: '费用名称', | ||
| 128 | + feeNamePlaceholder: '请输入费用名称', | ||
| 129 | + fee: '费用', | ||
| 130 | + feePlaceholder: '请选择费用', | ||
| 131 | + feeRequired: '费用不能为空', | ||
| 132 | + deleteConfirm: '确定删除此缴费自动打印吗?', | ||
| 133 | + table: { | ||
| 134 | + id: '编号', | ||
| 135 | + feeName: '费用名称' | ||
| 136 | + } | ||
| 137 | + }, | ||
| 138 | + printerRuleRepair: { | ||
| 139 | + title: '报修自动打印管理', | ||
| 140 | + addTitle: '添加报修自动打印', | ||
| 141 | + deleteTitle: '删除报修自动打印', | ||
| 142 | + id: '编号', | ||
| 143 | + idPlaceholder: '请输入编号', | ||
| 144 | + repairType: '报修类型', | ||
| 145 | + repairTypePlaceholder: '请输入报修类型', | ||
| 146 | + repairTypeRequired: '报修类型不能为空', | ||
| 147 | + deleteConfirm: '确定删除此报修自动打印吗?', | ||
| 148 | + table: { | ||
| 149 | + id: '编号', | ||
| 150 | + repairType: '报修类型' | ||
| 151 | + } | ||
| 152 | + } | ||
| 153 | + } | ||
| 154 | +} | ||
| 0 | \ No newline at end of file | 155 | \ No newline at end of file |
src/views/machine/printerRuleList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="printer-rule-container"> | ||
| 3 | + <el-row :gutter="20"> | ||
| 4 | + <el-col :span="4"> | ||
| 5 | + <printer-rule-div @switch-rule="handleSwitchRule" /> | ||
| 6 | + </el-col> | ||
| 7 | + <el-col :span="20"> | ||
| 8 | + <el-card class="box-card"> | ||
| 9 | + <div slot="header" class="text-left"> | ||
| 10 | + <h5>{{ printerRuleInfo.curPrinterRule.ruleName }}</h5> | ||
| 11 | + <div class="role-context">{{ printerRuleInfo.curPrinterRule.remark }}</div> | ||
| 12 | + </div> | ||
| 13 | + <div class="role-menu flex justify-start"> | ||
| 14 | + <el-button :type="printerRuleInfo.tabName === 'printerRuleMachine' ? 'primary' : 'text'" | ||
| 15 | + @click="_changePrinterRuleTab('printerRuleMachine')"> | ||
| 16 | + {{ $t('printerRule.tab.machine') }} | ||
| 17 | + </el-button> | ||
| 18 | + <el-button :type="printerRuleInfo.tabName === 'printerRuleFees' ? 'primary' : 'text'" | ||
| 19 | + @click="_changePrinterRuleTab('printerRuleFees')"> | ||
| 20 | + {{ $t('printerRule.tab.fees') }} | ||
| 21 | + </el-button> | ||
| 22 | + <el-button :type="printerRuleInfo.tabName === 'printerRuleRepair' ? 'primary' : 'text'" | ||
| 23 | + @click="_changePrinterRuleTab('printerRuleRepair')"> | ||
| 24 | + {{ $t('printerRule.tab.repair') }} | ||
| 25 | + </el-button> | ||
| 26 | + </div> | ||
| 27 | + | ||
| 28 | + <div v-if="printerRuleInfo.tabName === 'printerRuleMachine'"> | ||
| 29 | + <printer-rule-machine /> | ||
| 30 | + </div> | ||
| 31 | + <div v-if="printerRuleInfo.tabName === 'printerRuleFees'"> | ||
| 32 | + <printer-rule-fees /> | ||
| 33 | + </div> | ||
| 34 | + <div v-if="printerRuleInfo.tabName === 'printerRuleRepair'"> | ||
| 35 | + <printer-rule-repair /> | ||
| 36 | + </div> | ||
| 37 | + </el-card> | ||
| 38 | + </el-col> | ||
| 39 | + </el-row> | ||
| 40 | + | ||
| 41 | + | ||
| 42 | + </div> | ||
| 43 | +</template> | ||
| 44 | + | ||
| 45 | +<script> | ||
| 46 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 47 | +import PrinterRuleDiv from '@/components/machine/printerRuleDiv' | ||
| 48 | +import PrinterRuleMachine from '@/components/machine/printerRuleMachine' | ||
| 49 | +import PrinterRuleFees from '@/components/machine/printerRuleFees' | ||
| 50 | +import PrinterRuleRepair from '@/components/machine/printerRuleRepair' | ||
| 51 | + | ||
| 52 | + | ||
| 53 | +export default { | ||
| 54 | + name: 'PrinterRuleList', | ||
| 55 | + components: { | ||
| 56 | + PrinterRuleDiv, | ||
| 57 | + PrinterRuleMachine, | ||
| 58 | + PrinterRuleFees, | ||
| 59 | + PrinterRuleRepair, | ||
| 60 | + | ||
| 61 | + }, | ||
| 62 | + data() { | ||
| 63 | + return { | ||
| 64 | + printerRuleInfo: { | ||
| 65 | + curPrinterRule: {}, | ||
| 66 | + tabName: 'printerRuleMachine' | ||
| 67 | + }, | ||
| 68 | + communityId: '' | ||
| 69 | + } | ||
| 70 | + }, | ||
| 71 | + created() { | ||
| 72 | + this.communityId = getCommunityId() | ||
| 73 | + }, | ||
| 74 | + methods: { | ||
| 75 | + handleSwitchRule(rule) { | ||
| 76 | + this.printerRuleInfo.curPrinterRule = rule | ||
| 77 | + this._changePrinterRuleTab('printerRuleMachine') | ||
| 78 | + }, | ||
| 79 | + _changePrinterRuleTab(tabName) { | ||
| 80 | + this.printerRuleInfo.tabName = tabName | ||
| 81 | + setTimeout(() => { | ||
| 82 | + this.$refs[tabName].open(this.printerRuleInfo.curPrinterRule.ruleId) | ||
| 83 | + },500) | ||
| 84 | + | ||
| 85 | + }, | ||
| 86 | + handleSuccess() { | ||
| 87 | + this.$refs.printerRuleDiv.refreshList() | ||
| 88 | + } | ||
| 89 | + } | ||
| 90 | +} | ||
| 91 | +</script> | ||
| 92 | + | ||
| 93 | +<style lang="scss" scoped> | ||
| 94 | +.printer-rule-container { | ||
| 95 | + padding: 20px; | ||
| 96 | + | ||
| 97 | + .line-x { | ||
| 98 | + border-top: 1px solid #eee; | ||
| 99 | + margin: 15px 0; | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + .role-menu { | ||
| 103 | + margin-bottom: 20px; | ||
| 104 | + | ||
| 105 | + .el-button { | ||
| 106 | + margin-right: 15px; | ||
| 107 | + } | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + .role-title { | ||
| 111 | + font-size: 18px; | ||
| 112 | + font-weight: bold; | ||
| 113 | + margin-bottom: 10px; | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + .role-context { | ||
| 117 | + color: #666; | ||
| 118 | + font-size: 14px; | ||
| 119 | + } | ||
| 120 | +} | ||
| 121 | +</style> | ||
| 0 | \ No newline at end of file | 122 | \ No newline at end of file |