|
@@ -15,7 +15,7 @@
|
|
|
<hc-icon name="add" />
|
|
|
<span>新增</span>
|
|
|
</el-button>
|
|
|
- <el-button hc-btn type="warning" @click="reportClick">
|
|
|
+ <el-button hc-btn type="warning" :disabled="tableCheckKeys.length <= 0" @click="reportClick">
|
|
|
<hc-icon name="send-plane-2" />
|
|
|
<span>上报</span>
|
|
|
</el-button>
|
|
@@ -23,7 +23,11 @@
|
|
|
<div class="relative h-full flex">
|
|
|
<div :id="`hc_table_card_${uuid}`" class="flex-1">
|
|
|
<hc-card-item>
|
|
|
- <hc-table ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" is-current-row is-new :index-style="{ width: 60 }" @row-click="tableRowClick">
|
|
|
+ <hc-table
|
|
|
+ ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading"
|
|
|
+ is-current-row is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
|
|
|
+ @row-click="tableRowClick" @selection-change="tableCheckChange"
|
|
|
+ >
|
|
|
<template #action="{ row }">
|
|
|
<template v-if="row.approveStatus === 2">
|
|
|
<el-link v-if="row.commandStatus === 0" type="success" @click="rowExecuteChange(row.id)">下达</el-link>
|
|
@@ -122,7 +126,7 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 上报弹窗 -->
|
|
|
- <hc-report-dialog v-model="isReport" />
|
|
|
+ <hc-report-dialog v-model="isReport" :info="reportInfo" @finish="reportFinish" />
|
|
|
|
|
|
<!-- 新增修改的弹窗 -->
|
|
|
<addModal v-model="isAddShow" :ids="addEditIds" @finish="addEditFinish" />
|
|
@@ -134,7 +138,7 @@ import { nextTick, onActivated, onMounted, ref } from 'vue'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
import { actionConfirm, delMessage } from '~uti/tools'
|
|
|
import addModal from './components/order/addModal.vue'
|
|
|
-import { getArrValue, getObjValue, getRandom, isNullES } from 'js-fast-way'
|
|
|
+import { arrToId, getArrValue, getObjValue, getRandom, isNullES } from 'js-fast-way'
|
|
|
import mainApi from '~api/alter/admin/order'
|
|
|
|
|
|
defineOptions({
|
|
@@ -346,11 +350,38 @@ const rowAnnulChange = async (id) => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+//表格选择
|
|
|
+const tableCheckKeys = ref([])
|
|
|
+const tableCheckChange = (keys) => {
|
|
|
+ tableCheckKeys.value = keys
|
|
|
+}
|
|
|
+
|
|
|
//是否上报
|
|
|
const isReport = ref(false)
|
|
|
+const reportInfo = ref({})
|
|
|
const reportClick = () => {
|
|
|
- isReport.value = true
|
|
|
+ const rows = tableCheckKeys.value
|
|
|
+ //判断是否满足条件
|
|
|
+ const result = rows.every(({ approveStatus }) => {
|
|
|
+ return approveStatus === 0
|
|
|
+ })
|
|
|
+ if (!result) {
|
|
|
+ window.$message?.warning('请选择未上报的数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //处理数据
|
|
|
+ const rowIds = arrToId(rows)
|
|
|
+ reportInfo.value = { type: 4, periodId: rowIds }
|
|
|
+ nextTick(() => {
|
|
|
+ isReport.value = true
|
|
|
+ })
|
|
|
}
|
|
|
+
|
|
|
+//上报完成
|
|
|
+const reportFinish = () => {
|
|
|
+ window.location.reload()
|
|
|
+}
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|