diff --git a/src/locales/zh-chs.json b/src/locales/zh-chs.json
index 47083633..b829815f 100644
--- a/src/locales/zh-chs.json
+++ b/src/locales/zh-chs.json
@@ -3080,7 +3080,7 @@
"end_time": "结束时间"
},
"rework_management": {
- "active": "激活",
+ "active": "已激活",
"not_activated": "未激活",
"reset": "重置",
"battery_id": "电池条码",
diff --git a/src/views/planning-production/production-monitoring/rework-management/components/BatteryInputDialog/index.vue b/src/views/planning-production/production-monitoring/rework-management/components/BatteryInputDialog/index.vue
new file mode 100644
index 00000000..aef5a041
--- /dev/null
+++ b/src/views/planning-production/production-monitoring/rework-management/components/BatteryInputDialog/index.vue
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+ {{ $t(key('cancel')) }}
+ {{ $t(key('confirm')) }}
+
+
+
+
+
diff --git a/src/views/planning-production/production-monitoring/rework-management/index.vue b/src/views/planning-production/production-monitoring/rework-management/index.vue
index 82a57e72..d6a337c7 100644
--- a/src/views/planning-production/production-monitoring/rework-management/index.vue
+++ b/src/views/planning-production/production-monitoring/rework-management/index.vue
@@ -44,7 +44,6 @@
:pagination="null"
:table-attrs="{ size: 'mini', rowKey: 'battery_id', highlightCurrentRow: true }"
auto-height
- @selection-change="onSelectionChange"
>
@@ -56,17 +55,11 @@
-
-
-
-
-
-
-
- {{ $t(key('cancel')) }}
- {{ $t(key('confirm')) }}
-
-
+
@@ -74,12 +67,13 @@
import { useTableColumns } from '@/composables/useTableColumns'
import { i18nMixin } from '@/composables/useI18n'
import PageTable from '@/components/page-table'
+import BatteryInputDialog from './components/BatteryInputDialog'
import { sendWorkerman } from '@/api/production-master-data/workerman'
import { verifyBatteryRebatchInfo } from '@/api/planning-production/rework-management'
export default {
name: 'planning-production-rework-management',
- components: { PageTable },
+ components: { PageTable, BatteryInputDialog },
mixins: [i18nMixin('page.planning_production.production_monitoring.rework_management')],
data () {
return {
@@ -88,7 +82,6 @@ export default {
battery_ids: ''
},
tableData: [],
- selectedRows: [],
dialogVisible: false,
dialogBatteryIds: ''
}
@@ -133,17 +126,34 @@ export default {
this.dialogBatteryIds = ''
this.dialogVisible = true
},
- confirmBatchInput () {
- this.form.battery_ids = this.normalizeBatteryIds(this.dialogBatteryIds)
- this.dialogVisible = false
+ confirmBatchInput (value) {
+ this.dialogBatteryIds = value
+ this.form.battery_ids = this.normalizeBatteryIds(value)
+ },
+ normalizeVerifyPayload (res) {
+ const payload = res && res.code !== undefined && res.data !== undefined ? res.data : res
+ if (
+ payload &&
+ !Array.isArray(payload) &&
+ payload.data &&
+ !Array.isArray(payload.data) &&
+ payload.data.data
+ ) {
+ return payload.data
+ }
+ return payload || {}
+ },
+ normalizeVerifyRows (payload) {
+ if (Array.isArray(payload)) return payload
+ return Array.isArray(payload.data) ? payload.data : []
},
verifyData () {
if (!this.ensureBatteryInput()) return
this.loading = true
verifyBatteryRebatchInfo(this.form)
.then(res => {
- const data = res && res.data ? res.data : res
- this.tableData = data.data || []
+ const data = this.normalizeVerifyPayload(res)
+ this.tableData = this.normalizeVerifyRows(data)
})
.finally(() => {
this.loading = false
@@ -151,8 +161,7 @@ export default {
},
setBatteryRebatch () {
if (!this.ensureBatteryInput()) return
- const sourceRows = this.selectedRows.length ? this.selectedRows : this.tableData
- const batteryIds = sourceRows.map(item => item.battery_id).filter(Boolean)
+ const batteryIds = this.tableData.map(item => item.battery_id).filter(Boolean)
if (!batteryIds.length) {
this.$message.warning(this.$t(this.key('verify_data_before_action')))
return
@@ -189,11 +198,7 @@ export default {
resetForm () {
if (this.$refs.form) this.$refs.form.resetFields()
this.tableData = []
- this.selectedRows = []
this.dialogBatteryIds = ''
- },
- onSelectionChange (rows) {
- this.selectedRows = rows
}
}
}