|
@@ -12,13 +12,13 @@
|
|
<hc-body class="hc-task-body-card" padding="10px" scrollbar>
|
|
<hc-body class="hc-task-body-card" padding="10px" scrollbar>
|
|
<el-timeline class="hc-time-line">
|
|
<el-timeline class="hc-time-line">
|
|
<template v-for="(item, index) in flowList" :key="index">
|
|
<template v-for="(item, index) in flowList" :key="index">
|
|
- <el-timeline-item :class="item.currentBol ? 'success' : item.current ? 'primary' : ''" size="large">
|
|
|
|
|
|
+ <el-timeline-item :class="item.status === '2' ? 'success' : 'primary'" size="large">
|
|
<div class="timeline-item-icon">
|
|
<div class="timeline-item-icon">
|
|
- <hc-icon v-if="item.currentBol" class="check-icon" name="check" />
|
|
|
|
|
|
+ <hc-icon v-if="item.status === '2'" class="check-icon" name="check" />
|
|
</div>
|
|
</div>
|
|
<div class="reply-name">{{ item.name }}</div>
|
|
<div class="reply-name">{{ item.name }}</div>
|
|
- <div class="reply-time">{{ item.time }}</div>
|
|
|
|
- <div class="reply-content" v-html="item.content" />
|
|
|
|
|
|
+ <div class="reply-time">{{ item.date }}</div>
|
|
|
|
+ <div class="reply-content" v-html="item.flowValue" />
|
|
</el-timeline-item>
|
|
</el-timeline-item>
|
|
</template>
|
|
</template>
|
|
</el-timeline>
|
|
</el-timeline>
|
|
@@ -27,20 +27,19 @@
|
|
<div :id="`hc_task_table_${uuid}`" class="hc-task-table">
|
|
<div :id="`hc_task_table_${uuid}`" class="hc-task-table">
|
|
<hc-body class="hc-task-body-card" padding="10px">
|
|
<hc-body class="hc-task-body-card" padding="10px">
|
|
<hc-table
|
|
<hc-table
|
|
- ref="tableRef" :column="tableColumn" :datas="tableData"
|
|
|
|
- :is-stripe="false" is-new :index-style="{ width: 60 }" is-current-row
|
|
|
|
- @row-click="tableRowClick"
|
|
|
|
|
|
+ ref="tableRef" :column="tableColumn" :datas="tableData" :is-stripe="false"
|
|
|
|
+ is-new :index-style="{ width: 60 }" is-current-row @row-click="tableRowClick"
|
|
>
|
|
>
|
|
<template #action="{ row }">
|
|
<template #action="{ row }">
|
|
- <div class="hc-task-table-action" :class="row.isRemark ? 'is-cur' : ''" @click="rowRemarkClick(row)">
|
|
|
|
|
|
+ <div class="hc-task-table-action" :class="row.isComment === 1 ? 'is-cur' : ''" @click="rowRemarkClick(row)">
|
|
<i class="i-iconoir-star-solid" />
|
|
<i class="i-iconoir-star-solid" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<template #state="{ row }">
|
|
<template #state="{ row }">
|
|
<div class="hc-task-table-state">
|
|
<div class="hc-task-table-state">
|
|
- <i v-if="row.state === 1" class="i-iconoir-xmark-circle-solid is-danger" />
|
|
|
|
- <i v-else-if="row.state === 2" class="i-iconoir-check-circle-solid is-success" />
|
|
|
|
- <span v-else-if="row.state === 3">审批结束</span>
|
|
|
|
|
|
+ <i v-if="row.status === 1" class="i-iconoir-check-circle-solid is-success" />
|
|
|
|
+ <i v-else-if="row.status === 2" class="i-iconoir-xmark-circle-solid is-danger" />
|
|
|
|
+ <span v-else-if="row.status === 3">审批结束</span>
|
|
<i v-else class="i-iconoir-help-circle-solid" />
|
|
<i v-else class="i-iconoir-help-circle-solid" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -49,7 +48,7 @@
|
|
</div>
|
|
</div>
|
|
<div :id="`hc_task_form_${uuid}`" class="hc-task-form">
|
|
<div :id="`hc_task_form_${uuid}`" class="hc-task-form">
|
|
<hc-body class="hc-task-body-card" padding="10px" scrollbar>
|
|
<hc-body class="hc-task-body-card" padding="10px" scrollbar>
|
|
- <HcTaskForm v-model="tableInfo" :is-edit="tabsKey === 1" :type="rowInfo.meterType" />
|
|
|
|
|
|
+ <HcTaskForm :table="tableInfo" :info="rowInfo" :is-edit="tabsKey === 1" />
|
|
</hc-body>
|
|
</hc-body>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -67,8 +66,7 @@
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import { nextTick, ref, watch } from 'vue'
|
|
import { nextTick, ref, watch } from 'vue'
|
|
-import { useAppStore } from '~src/store'
|
|
|
|
-import { getRandom } from 'js-fast-way'
|
|
|
|
|
|
+import { getArrValue, getObjValue, getRandom } from 'js-fast-way'
|
|
import HcTaskForm from './task-form.vue'
|
|
import HcTaskForm from './task-form.vue'
|
|
import HcTaskNotes from './task-notes.vue'
|
|
import HcTaskNotes from './task-notes.vue'
|
|
import mainApi from '~api/tasks/hc-data'
|
|
import mainApi from '~api/tasks/hc-data'
|
|
@@ -85,12 +83,6 @@ const props = defineProps({
|
|
})
|
|
})
|
|
//事件
|
|
//事件
|
|
const emit = defineEmits(['finish', 'close'])
|
|
const emit = defineEmits(['finish', 'close'])
|
|
-
|
|
|
|
-//项目合同段信息
|
|
|
|
-const useAppState = useAppStore()
|
|
|
|
-const projectId = ref(useAppState.getProjectId || '')
|
|
|
|
-const contractId = ref(useAppState.getContractId || '')
|
|
|
|
-
|
|
|
|
const uuid = getRandom(4)
|
|
const uuid = getRandom(4)
|
|
|
|
|
|
//双向绑定
|
|
//双向绑定
|
|
@@ -159,15 +151,30 @@ const getTableDetail = async () => {
|
|
isLoading.value = true
|
|
isLoading.value = true
|
|
rejectionLoading.value = true
|
|
rejectionLoading.value = true
|
|
confirmLoading.value = true
|
|
confirmLoading.value = true
|
|
|
|
+ //获取数据
|
|
const { data } = await mainApi.getDetail(rowInfo.value.id)
|
|
const { data } = await mainApi.getDetail(rowInfo.value.id)
|
|
- console.log(data)
|
|
|
|
|
|
+ const { taskProcessInfo, taskCenterDataInfo } = getObjValue(data)
|
|
|
|
+ tableData.value = getArrValue(taskCenterDataInfo)
|
|
|
|
+ flowList.value = getArrValue(taskProcessInfo)
|
|
|
|
+
|
|
|
|
+ //默认选中第一行
|
|
|
|
+ let info = {}
|
|
|
|
+ if (tableData.value.length > 0) {
|
|
|
|
+ info = tableData.value[0]
|
|
|
|
+ }
|
|
|
|
+ await nextTick(() => {
|
|
|
|
+ tableInfo.value = info
|
|
|
|
+ tableRef.value?.tableRef?.setCurrentRow(info)
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ //关闭加载状态
|
|
|
|
+ isLoading.value = false
|
|
|
|
+ rejectionLoading.value = false
|
|
|
|
+ confirmLoading.value = false
|
|
}
|
|
}
|
|
|
|
|
|
-//流程信息
|
|
|
|
-const flowList = ref([
|
|
|
|
- { currentBol: true, current: false, name: '张三', time: '2023-10-17 10:00:21', content: '上报' },
|
|
|
|
- { currentBol: false, current: true, name: '李四', time: '2023-11-01 09:00:21', content: '结束流程</br>同意' },
|
|
|
|
-])
|
|
|
|
|
|
+//流程信息,1待审批,2已审批
|
|
|
|
+const flowList = ref([])
|
|
|
|
|
|
//中间计量单的表格数据
|
|
//中间计量单的表格数据
|
|
const middlepayTableColumn = ref([
|
|
const middlepayTableColumn = ref([
|
|
@@ -205,35 +212,8 @@ const materialTableColumn = ref([
|
|
])
|
|
])
|
|
|
|
|
|
//表格数据
|
|
//表格数据
|
|
-const tableLoading = ref(false)
|
|
|
|
const tableColumn = ref([])
|
|
const tableColumn = ref([])
|
|
-const tableData = ref([
|
|
|
|
- { isRemark: false, key1: '你猜1', key2: '猜猜1', state: 1 },
|
|
|
|
- { isRemark: false, key1: '你猜2', key2: '猜猜2', state: 1 },
|
|
|
|
- { isRemark: true, key1: '你猜3', key2: '猜猜3', state: 2 },
|
|
|
|
- { isRemark: true, key1: '你猜4', key2: '猜猜4', state: 2 },
|
|
|
|
-])
|
|
|
|
-const getTableData = async () => {
|
|
|
|
- //tableData.value = []
|
|
|
|
- tableLoading.value = true
|
|
|
|
- /*const { data } = await mainApi.getPage({
|
|
|
|
- ...searchForm.value,
|
|
|
|
- projectId: projectId.value,
|
|
|
|
- contractId: contractId.value,
|
|
|
|
- })
|
|
|
|
- tableData.value = getArrValue(data)*/
|
|
|
|
- tableLoading.value = false
|
|
|
|
- //默认选中第一行
|
|
|
|
- let info = {}
|
|
|
|
- if (tableData.value.length > 0) {
|
|
|
|
- info = tableData.value[0]
|
|
|
|
- }
|
|
|
|
- await nextTick(() => {
|
|
|
|
- tableInfo.value = info
|
|
|
|
- tableRef.value?.tableRef?.setCurrentRow(info)
|
|
|
|
- })
|
|
|
|
- //getTableDetail(info).then()
|
|
|
|
-}
|
|
|
|
|
|
+const tableData = ref([])
|
|
|
|
|
|
//表格行被点击
|
|
//表格行被点击
|
|
const tableInfo = ref({})
|
|
const tableInfo = ref({})
|
|
@@ -241,13 +221,12 @@ const tableRowClick = ({ row }) => {
|
|
tableInfo.value = row
|
|
tableInfo.value = row
|
|
}
|
|
}
|
|
|
|
|
|
-//批注
|
|
|
|
|
|
+//批注, isComment 是否已批注,1=是,0=否
|
|
const isNotesShow = ref(false)
|
|
const isNotesShow = ref(false)
|
|
const rowRemarkClick = (row) => {
|
|
const rowRemarkClick = (row) => {
|
|
isNotesShow.value = true
|
|
isNotesShow.value = true
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
//确认审批
|
|
//确认审批
|
|
const confirmLoading = ref(false)
|
|
const confirmLoading = ref(false)
|
|
const confirmClick = () => {
|
|
const confirmClick = () => {
|
|
@@ -263,11 +242,12 @@ const rejectionClick = () => {
|
|
//取消审批
|
|
//取消审批
|
|
const cancelClick = () => {
|
|
const cancelClick = () => {
|
|
isShow.value = false
|
|
isShow.value = false
|
|
- rowInfo.value = {}
|
|
|
|
- tabsKey.value = ''
|
|
|
|
- tableLoading.value = false
|
|
|
|
|
|
+ isLoading.value = false
|
|
|
|
+ rejectionLoading.value = false
|
|
|
|
+ confirmLoading.value = false
|
|
tableColumn.value = []
|
|
tableColumn.value = []
|
|
- //tableData.value = []
|
|
|
|
|
|
+ tableData.value = []
|
|
|
|
+ tableInfo.value = {}
|
|
emit('close')
|
|
emit('close')
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|