|
@@ -97,8 +97,17 @@
|
|
|
</HcDialog>
|
|
|
|
|
|
<!--复制任意时间-->
|
|
|
- <HcDialog :show="copyTimeModal" title="复制任意时间" widths="360px" bg-color="#f1f5f8" saveText="复制" @close="copyTimeModal = false" :loading="copyTimeLoading" @save="copyTimeSaveClick">
|
|
|
- <el-alert title="等接口中..." type="warning" show-icon/>
|
|
|
+ <HcDialog :show="copyTimeModal" isTable title="复制任意时间" widths="62rem" saveText="复制" :padding="false" @close="copyTimeModal = false" :loading="copyTimeLoading" @save="copyTimeSaveClick">
|
|
|
+ <div class="hc-user-time-box">
|
|
|
+ <div class="tree-box">
|
|
|
+ <el-scrollbar>
|
|
|
+ <el-tree class="hc-tree-node" :props="copyTimeTreeProps" :data="copyTimeTreeData" node-key="hierarchy" :default-expanded-keys="copyTimeTreeKeys" highlight-current accordion @node-click="copyTimeTreeNodeClick"/>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ <div class="user-box">
|
|
|
+ <HcTable ref="copyTimeTableRef" :column="copyTimeTableColumn" :datas="copyTimeTableData" :loading="copyTimeTableLoading" isCheck @selection-change="copyTimeTableSelection"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</HcDialog>
|
|
|
|
|
|
<!--批量上报审批-->
|
|
@@ -113,7 +122,7 @@ import queryApi from '~api/ledger/query';
|
|
|
import wbsQueryApi from '~api/data-fill/query';
|
|
|
import HTableForm from "~src/plugins/HTableForm"
|
|
|
import DateCalendar from "./dateCalendar/index.vue"
|
|
|
-import {getObjValue, getObjNullValue, isString, getArrValue, isValueNull, deepClone} from "vue-utils-plus"
|
|
|
+import {getObjValue, getObjNullValue, isString, getArrValue, isValueNull} from "vue-utils-plus"
|
|
|
|
|
|
//参数
|
|
|
const props = defineProps({
|
|
@@ -530,37 +539,112 @@ const copyTableFormClick = () => {
|
|
|
}
|
|
|
|
|
|
//复制任意时间
|
|
|
+const copyTimeModal = ref(false)
|
|
|
const copyTimeLogModal = () => {
|
|
|
copyTimeModal.value = true
|
|
|
copyTimeLoading.value = false
|
|
|
+ queryReportLogTimeTree()
|
|
|
}
|
|
|
-const copyTimeModal = ref(false)
|
|
|
-//选择日期
|
|
|
-const copyTimeChoices = ref('')
|
|
|
-const copyTimeChoice = ({choices}) => {
|
|
|
- copyTimeChoices.value = choices
|
|
|
+
|
|
|
+//日期数
|
|
|
+const copyTimeTreeProps = {
|
|
|
+ children: 'treeList', label: 'name'
|
|
|
+}
|
|
|
+const copyTimeTreeData = ref([])
|
|
|
+const copyTimeTreeKeys = ref([])
|
|
|
+
|
|
|
+//获取当前合同段下本日志节点的填报资料日期树
|
|
|
+const queryReportLogTimeTree = async () => {
|
|
|
+ const { primaryKeyId } = menuItem.value
|
|
|
+ const { data } = await queryApi.queryReportLogTimeTree({
|
|
|
+ contractId: contractId.value || '',
|
|
|
+ nodePrimaryKeyId: primaryKeyId
|
|
|
+ })
|
|
|
+ const res = getArrValue(data)
|
|
|
+ copyTimeTreeData.value = res
|
|
|
+ if (res.length > 0) {
|
|
|
+ copyTimeTreeKeys.value = [res[0]?.hierarchy]
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//日期树被点击
|
|
|
+const copyTimeTreeNodeClick = (data, node) => {
|
|
|
+ if (node.level === 3) {
|
|
|
+ queryLogTimeTreeList(data?.hierarchy)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//复制任意时间的记录人
|
|
|
+const copyTimeTableRef = ref(null)
|
|
|
+const copyTimeTableColumn = ref([
|
|
|
+ {key:'createUserName', name: '记录人'},
|
|
|
+])
|
|
|
+const copyTimeTableData = ref([])
|
|
|
+
|
|
|
+//获取填报记录
|
|
|
+const copyTimeTableLoading = ref(false)
|
|
|
+const queryLogTimeTreeList = async (time) => {
|
|
|
+ copyTimeTableLoading.value = true
|
|
|
+ const { primaryKeyId } = menuItem.value
|
|
|
+ const { data } = await queryApi.queryLogTimeTreeList({
|
|
|
+ contractId: contractId.value || '',
|
|
|
+ nodePrimaryKeyId: primaryKeyId,
|
|
|
+ time: time
|
|
|
+ })
|
|
|
+ copyTimeTableLoading.value = false
|
|
|
+ copyTimeTableData.value = getArrValue(data)
|
|
|
+}
|
|
|
+
|
|
|
+//多选
|
|
|
+const copyTimeTableKeys = ref([]);
|
|
|
+const copyTimeTableSelection = (rows) => {
|
|
|
+ copyTimeTableKeys.value = rows.filter((item) => {
|
|
|
+ return (item??'') !== '';
|
|
|
+ })
|
|
|
}
|
|
|
+
|
|
|
//确认复制
|
|
|
const copyTimeLoading = ref(false)
|
|
|
-const copyTimeSaveClick = async () => {
|
|
|
- copyTimeModal.value = false
|
|
|
- /*copyTimeLoading.value = true
|
|
|
+const copyTimeSaveClick = () => {
|
|
|
+ const rows = copyTimeTableKeys.value
|
|
|
+ if (rows.length > 0) {
|
|
|
+ const ids = rowsToId(rows)
|
|
|
+ copyTheLogBusinessData(ids)
|
|
|
+ } else {
|
|
|
+ window.$message?.warning('请先勾选记录人')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//复制任意时间
|
|
|
+const copyTheLogBusinessData = async (ids) => {
|
|
|
+ copyTimeLoading.value = true
|
|
|
const {primaryKeyId} = menuItem.value
|
|
|
const { error, code } = await queryApi.copyTheLogBusinessData({
|
|
|
contractId: contractId.value || '',
|
|
|
nodePrimaryKeyId: primaryKeyId,
|
|
|
currentTime: recordTime.value,
|
|
|
- targetTime: copyTimeChoices.value
|
|
|
- }, false)
|
|
|
+ theLogId: ids
|
|
|
+ })
|
|
|
//处理数据
|
|
|
copyTimeLoading.value = false
|
|
|
if (!error && code === 200) {
|
|
|
- window?.location?.reload() //刷新页面
|
|
|
- } else {
|
|
|
- window?.$message?.warning('复制失败')
|
|
|
- }*/
|
|
|
+ copyTimeModal.value = false
|
|
|
+ window?.$message?.success('复制成功');
|
|
|
+ setTimeout(() => {
|
|
|
+ window?.location?.reload() //刷新页面
|
|
|
+ }, 3000)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+//拼接ID
|
|
|
+const rowsToId = (rows) => {
|
|
|
+ return rows.map((obj) => {
|
|
|
+ return obj.id;
|
|
|
+ }).join(",")
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
//设置表单默认数据
|
|
|
const setFormDefaultData = (formInfo = {}) => {
|
|
|
return {
|
|
@@ -757,6 +841,22 @@ const theLogOneAbolish = async () => {
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.hc-user-time-box {
|
|
|
+ position: relative;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ .tree-box {
|
|
|
+ border-right: 1px solid #EEEEEE;
|
|
|
+ position: relative;
|
|
|
+ padding: 20px;
|
|
|
+ width: 200px;
|
|
|
+ }
|
|
|
+ .user-box {
|
|
|
+ position: relative;
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|
|
|
|
|
|
<style lang="scss">
|