ly vor 1 Jahr
Ursprung
Commit
d51b167bf3

+ 44 - 0
src/api/business/examine.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+export function listExamine(query) {
+  request.defaults.baseURL = '/ezhizao-yzbh-entrust'
+  return request({
+    url: '/business/examine/list',
+    method: 'get',
+    params: query
+  })
+}
+
+export function getExamine(id) {
+  request.defaults.baseURL = '/ezhizao-yzbh-entrust'
+  return request({
+    url: '/business/examine/' + id,
+    method: 'get'
+  })
+}
+
+export function addExamine(data) {
+  request.defaults.baseURL = '/ezhizao-yzbh-entrust'
+  return request({
+    url: '/business/examine',
+    method: 'post',
+    data: data
+  })
+}
+
+export function updateExamine(data) {
+  request.defaults.baseURL = '/ezhizao-yzbh-entrust'
+  return request({
+    url: '/business/examine',
+    method: 'put',
+    data: data
+  })
+}
+
+export function delExamine(id) {
+  request.defaults.baseURL = '/ezhizao-yzbh-entrust'
+  return request({
+    url: '/business/examine/' + id,
+    method: 'delete'
+  })
+}

+ 11 - 0
src/api/business/history.js

@@ -0,0 +1,11 @@
+import request from '@/utils/request'
+
+
+export function list(query) {
+  request.defaults.baseURL = '/ezhizao-yzbh-production'
+  return request({
+    url: '/business/history/list',
+    method: 'get',
+    params: query
+  })
+}

+ 16 - 2
src/views/business/collect/count/index.vue

@@ -10,6 +10,10 @@
                 <el-input v-model="queryParams.companyName" size="small" placeholder="请输入客户名称:" style="width: 150px"
                     clearable @keyup.enter="handleQuery" />
             </el-form-item>
+            <el-form-item label="审核人">
+                <el-input v-model="queryParams.examineName" size="small" placeholder="请输入客户名称:" style="width: 150px"
+                    clearable @keyup.enter="handleQuery" />
+            </el-form-item>
             <el-form-item label="合同编号:" prop="contractNo">
                 <el-input v-model="queryParams.contractNo" size="small" placeholder="请输入合同编号" style="width: 150px"
                     clearable @keyup.enter="handleQuery" />
@@ -30,6 +34,11 @@
                     format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
                     end-placeholder="业务日期" style="width: 100%;"></el-date-picker>
             </el-form-item>
+            <el-form-item  label="确认所属时间:" label-width="95px">
+                <el-date-picker v-model="queryParams.actuallyDateFilter" size="small" type="daterange" clearable
+                    format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
+                    end-placeholder="业务日期" style="width: 100%;"></el-date-picker>
+            </el-form-item>
             <div style="margin-top: 10px;">
                 <el-form-item label="是否是项目:" prop="isProject" label-width="auto">
                     <el-select size="small" v-model="queryParams.isProject" placeholder="是否是项目" clearable
@@ -57,7 +66,7 @@
         <el-table v-loading="loading" :data="accountList" size="small" border height="100%"
             @selection-change="handleSelectionChange">
             <el-table-column type="index" width="55" align="center" />
-            <el-table-column label="公司名称" align="center" prop="companyName">
+            <el-table-column label="公司名称" align="center" prop="companyName" >
             </el-table-column>
             <el-table-column label="产品名称" align="center" prop="typeName">
             </el-table-column>
@@ -65,6 +74,8 @@
             </el-table-column>
             <el-table-column label="到账日期" align="center" prop="receiptDate">
             </el-table-column>
+            <el-table-column label="确认所属时间" align="center" prop="actuallyDate">
+            </el-table-column>
             <el-table-column label="提收款金额" align="center" prop="withdrawalAmount">
             </el-table-column>
             <el-table-column label="申请人" align="center" prop="applierName">
@@ -93,7 +104,9 @@
                         {{scope.row.outAmount}}</el-link>
                 </template>
             </el-table-column>
-            <el-table-column label="审核时间" align="center" prop="examineTime">
+            <el-table-column label="审核人" align="center" prop="examineName">
+            </el-table-column>
+            <el-table-column label="审核时间" align="center" prop="examineTime" >
             </el-table-column>
         </el-table>
 
@@ -240,6 +253,7 @@
         queryParams.value.taskTypeIds = [];
         queryParams.value.receiptDateFilter = []
         queryParams.value.examineTimeFilter = []
+        queryParams.value.actuallyDateFilter = []
         handleQuery();
     }
 

+ 177 - 0
src/views/business/examine/form.vue

@@ -0,0 +1,177 @@
+<template>
+    <!-- 添加或修改项目信息对话框 -->
+    <div class="el-drawer__wrapper">
+        <el-drawer :title="title" v-model="visible" direction="rtl" size="100%">
+            <div class="page-container form-container">
+            <div class="form-btns-container">
+                    <span class="title-label"><el-icon>
+                            <Document />
+                        </el-icon> 项目信息</span>
+                <el-button-group>
+                    <el-button v-if="editStatus" type="primary" size="small" icon="Finished"
+                               @click="submitForm">保存</el-button>
+                    <el-button v-else type="warning" size="small" icon="Edit" @click="editStatus = true">编辑</el-button>
+                    <el-button v-if="form.id && editStatus" type="info" size="small" icon="Close"
+                               @click="editStatus = false">取消编辑</el-button>
+                    <el-button v-if="form.id" type="success" size="small" @click="getForm">
+                        <i class="fa fa-refresh" aria-hidden="true" /> 刷新
+                    </el-button>
+                </el-button-group>
+                <div class="screen-btn" @click="handleScreen">
+                    <template v-if="!isFullscreen">
+                        <i class="fa fa-window-maximize" aria-hidden="true" />
+                        <!-- <span>全屏</span> -->
+                    </template>
+                    <template v-else>
+                        <i class="fa fa-window-restore" aria-hidden="true" />
+                        <!-- <span>还原</span> -->
+                    </template>
+                </div>
+                <div class="close-btn" @click="cancel">
+                    <i class="fa fa-times" aria-hidden="true" />
+                    <!-- <span>关闭</span> -->
+                </div>
+            </div>
+            <div class="Y-scrollbar" style="position: absolute; top: 32px; bottom: 0; width: 100%; overflow: auto">
+            </div>
+            <el-form ref="examineRef" class="master-container" :model="form" :rules="rules" label-width="120px">
+                <el-row :gutter="30">
+                                    <el-col :span="6">
+                                        <el-form-item label="所属期" prop="currentPeriod">
+                                            <el-input  v-if="editStatus" v-model="form.currentPeriod" placeholder="请输入所属期" />
+                                            <span v-else>{{ form.currentPeriod }}</span>
+                                        </el-form-item>
+                                    </el-col>
+                                    <el-col :span="6">
+                                        <el-form-item label="委托来源" prop="entrustCome">
+                                            <el-input  v-if="editStatus" v-model="form.entrustCome" placeholder="请输入委托来源" />
+                                            <span v-else>{{ form.entrustCome }}</span>
+                                        </el-form-item>
+                                    </el-col>
+                                    <el-col :span="6">
+                                        <el-form-item label="取消理由" prop="cancelReason">
+                                            <el-input  v-if="editStatus" v-model="form.cancelReason" placeholder="请输入取消理由" />
+                                            <span v-else>{{ form.cancelReason }}</span>
+                                        </el-form-item>
+                                    </el-col>
+                </el-row>
+            </el-form>
+            </div>
+        </el-drawer>
+    </div>
+</template>
+<script setup>
+    import {getExamine} from "@/api/business/examine";
+    const { proxy } = getCurrentInstance()
+    /** 父组件传参 */
+    const props = defineProps({
+        getList: {
+            type: Function,
+            default: () => { }
+        }
+    })
+    const { getList } = toRefs(props)
+    /** 字典数组区 */
+    /** 表单抽屉 页变量 */
+    const title = ref("")
+    const loading = ref(false)
+    const multiple = ref(true)
+    const visible = ref(false)
+    const editStatus = ref(false)
+    const isFullscreen = ref(false)
+    const webHost = import.meta.env.VITE_APP_BASE_API
+    const data = reactive({
+        form: {},
+        rules: {
+        }
+    });
+    const { form, rules } = toRefs(data);
+/***********************  方法区  ****************************/
+    /** 打开抽屉 */
+    function open(id) {
+        reset();
+        visible.value = true;
+        if (id) {
+            getExamine(id).then(response => {
+                form.value = response.data;
+                editStatus.value = false
+                title.value = "修改项目信息"
+            })
+        } else {
+            editStatus.value = true
+            title.value = "添加项目信息"
+        }
+    }
+
+    /** 取消按钮 */
+    function cancel() {
+        visible.value = false;
+        reset();
+    }
+
+    /** 表单重置 */
+    function reset() {
+        form.value = {
+                        id: null,
+                        workOrderId: null,
+                        entrustId: null,
+                        companyId: null,
+                        taskTypeId: null,
+                        currentPeriod: null,
+                        entrustCome: null,
+                        cancelReason: null,
+                        status: null,
+                        createTime: null,
+                        creatorId: null,
+                        updateTime: null,
+                        updaterId: null,
+                        deleted: null,
+                        version: null,
+                        tenantId: null
+        };
+        proxy.resetForm("examineRef");
+    }
+
+    /** 全屏缩放 */
+    function handleScreen() {
+    const dom = document.querySelector('.list-container > .el-drawer__wrapper > .el-overlay')
+    isFullscreen.value = !isFullscreen.value
+    dom.style.position = isFullscreen.value ? 'fixed' : 'absolute'
+    }
+
+
+/** 提交按钮 */
+function submitForm() {
+  proxy.$refs["examineRef"].validate(valid => {
+    if (valid) {
+      if (form.value.id != null) {
+        updateExamine(form.value).then(response => {
+          proxy.$modal.msgSuccess("修改成功");
+          visible.value = false;
+          getList.value()
+        });
+      } else {
+        addExamine(form.value).then(response => {
+          proxy.$modal.msgSuccess("新增成功");
+          visible.value = false;
+          getList.value()
+        });
+      }
+    }
+  });
+}
+
+    /** 查询表单信息  */
+    function getForm() {
+    loading.value = true
+    getExamine(form.value.id).then(response => {
+        loading.value = false
+        form.value = response.data
+    })
+    }
+
+    /** 暴露给父组件的方法 */
+    defineExpose({
+        open
+    })
+</script>

+ 181 - 0
src/views/business/examine/index.vue

@@ -0,0 +1,181 @@
+<template>
+    <div class="page-container list-container">
+        <!-- 功能按钮区 -->
+        <div class="list-btns-container">
+            <el-button
+                    type="primary"
+                    size="small"
+                    icon="Plus"
+                    @click="handleAdd"
+                    v-hasPermi="['business:examine:add']"
+            >新增</el-button>
+
+            <el-button
+                    type="success"
+                    size="small"
+                    icon="Edit"
+                    :disabled="single"
+                    @click="handleUpdate"
+                    v-hasPermi="['business:examine:edit']"
+            >修改</el-button>
+
+            <el-button
+                    type="danger"
+                    size="small"
+                    icon="Delete"
+                    :disabled="multiple"
+                    @click="handleDelete"
+                    v-hasPermi="['business:examine:remove']"
+            >删除</el-button>
+
+            <el-button
+                    type="warning"
+                    size="small"
+                    icon="Download"
+                    @click="handleExport"
+                    v-hasPermi="['business:examine:export']"
+            >导出</el-button>
+            <!--<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>-->
+        </div>
+        <!-- 搜索区 -->
+        <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
+                        <el-form-item label="所属期:" prop="currentPeriod">
+                            <el-input
+                                    v-model="queryParams.currentPeriod"
+                                    placeholder="请输入所属期"
+                                    clearable
+                                    @keyup.enter="handleQuery"
+                            />
+                        </el-form-item>
+                        <el-form-item label="委托来源:" prop="entrustCome">
+                            <el-input
+                                    v-model="queryParams.entrustCome"
+                                    placeholder="请输入委托来源"
+                                    clearable
+                                    @keyup.enter="handleQuery"
+                            />
+                        </el-form-item>
+                        <el-form-item label="取消理由:" prop="cancelReason">
+                            <el-input
+                                    v-model="queryParams.cancelReason"
+                                    placeholder="请输入取消理由"
+                                    clearable
+                                    @keyup.enter="handleQuery"
+                            />
+                        </el-form-item>
+            <el-form-item>
+                <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+                <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+            </el-form-item>
+        </el-form>
+
+        <!-- 列表区 -->
+        <el-table v-loading="loading" :data="examineList" size="small" border height="100%" @selection-change="handleSelectionChange">
+            <el-table-column type="selection" width="55" align="center" />
+                    <el-table-column label="${comment}" align="center" prop="id" />
+                    <el-table-column label="所属期" align="center" prop="currentPeriod" />
+                    <el-table-column label="委托来源" align="center" prop="entrustCome" />
+                    <el-table-column label="取消理由" align="center" prop="cancelReason" />
+                    <el-table-column label="1同意 2拒绝" align="center" prop="status" />
+            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+                <template #default="scope">
+                    <el-button link type="warning" size="small" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['business:examine:edit']">修改</el-button>
+                    <el-button link type="danger" size="small" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['business:examine:remove']">删除</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+
+        <!-- 分页 -->
+        <pagination v-show="total>0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList"/>
+
+        <!-- 表单 -->
+        <examine-form ref="examineRef" :get-list="getList"></examine-form>
+    </div>
+</template>
+
+<script setup name="Examine">
+    import { listExamine, delExamine } from "@/api/business/examine";
+    import examineForm from "./form"
+    const { proxy } = getCurrentInstance()
+    /** 字典数组区 */
+    /** 查询 对象 */
+
+    const examineList = ref([]);
+    const loading = ref(true);
+    const ids = ref([])
+    const single = ref(true);
+    const multiple = ref(true);
+    const total = ref(0);
+    /** 查询对象 */
+   const queryParams=ref({
+        pageNum: 1,
+        pageSize: 10,
+                    currentPeriod: null,
+                    entrustCome: null,
+                    cancelReason: null,
+                    status: null,
+    })
+
+  /***********************  方法区  ****************************/
+
+    /** 查询企业租户列表 */
+   function getList() {
+        loading.value = true;
+        listExamine(queryParams.value).then(response => {
+                examineList.value = response.rows;
+            total.value = response.total;
+            loading.value = false;
+        });
+    }
+
+    /** 搜索按钮操作 */
+    function handleQuery() {
+        queryParams.value.pageNum = 1;
+        getList();
+    }
+
+    /** 重置按钮操作 */
+    function resetQuery() {
+        proxy.resetForm("queryRef");
+        handleQuery();
+    }
+
+    // 多选框选中数据
+    function handleSelectionChange(selection) {
+        ids.value = selection.map(item => item.id);
+        single.value = selection.length != 1;
+        multiple.value = !selection.length;
+    }
+
+    /** 新增按钮操作 */
+    function handleAdd() {
+         proxy.$refs.examineRef.open()
+    }
+
+    /** 修改按钮操作 */
+    function handleUpdate(row) {
+        const id = row.id || ids.value
+        proxy.$refs.examineRef.open(id)
+    }
+
+
+    /** 删除按钮操作 */
+    function handleDelete(row) {
+        const _ids = row.id || ids.value;
+        proxy.$modal.confirm('是否确认删除选中的数据项?').then(function() {
+            return delExamine(_ids);
+        }).then(() => {
+            getList();
+            proxy.$modal.msgSuccess("删除成功!");
+        }).catch(() => {});
+    }
+
+    /** 导出按钮操作 */
+    function handleExport() {
+        proxy.download('business/examine/export', {
+            ...queryParams.value
+        }, `examine_${new Date().getTime()}.xlsx`)
+    }
+
+   getList();
+</script>

+ 19 - 32
src/views/business/housingFund/declare/form.vue

@@ -55,8 +55,12 @@
                 <div>{{ form.housingFundDeductionPassword }}</div>
               </el-form-item>
             </el-col>
+            <el-col :span="24" style="text-align: right;">
+              <el-button size="small" type="success" @click="getHistory">历史记录</el-button>
+            </el-col>
             <el-col :span="24">
-              <div style="display: flex; justify-content: flex-end;margin-bottom: 10px;"  v-hasPermi="['business:housingFundDeclare:exportDetail']">
+              <div style="display: flex; justify-content: flex-end;margin-bottom: 10px;margin-top: 10px;"
+                v-hasPermi="['business:housingFundDeclare:exportDetail']">
                 <el-button type="primary" @click="exportExcel" v-if="housingFundPersonList.length>0">导出明细表</el-button>
               </div>
             </el-col>
@@ -92,10 +96,6 @@
                 </template>
               </el-table-column>
             </el-table>
-
-
-
-
             <el-col :span="24">
               <el-divider />
             </el-col>
@@ -139,40 +139,19 @@
                     <Delete />
                   </el-icon>
                 </div>
-                <!-- <el-upload action="#" :http-request="upload" :with-credentials="true" :show-file-list="false" multiple>
-                <el-button size="small" type="primary" icon="Upload"  v-if="form.status !==3" >点击上传</el-button>
-              </el-upload> -->
-                <!-- <dragUpload :accept="accept" style="width:100%" @file="upload"/>
-              <el-table style="margin-top: 15px;" ref="dbTable" :data="form.evidenceFiles" size="small" border
-                header-row-class-name="list-header-row" row-class-name="list-row">
-                <el-table-column label="文件名" prop="originalFileName" align="center" show-overflow-tooltip>
-                  <template #default="scope">
-                    <el-button size="small" type="text" @click="openFile(scope.row)">{{
-                      scope.row.originalFileName == ""
-                      ? "打开文件"
-                      : scope.row.originalFileName
-                      }}</el-button>
-                  </template>
-                </el-table-column>
-                <el-table-column label="操作" width="80" prop="fileType" align="center">
-                  <template #default="scope">
-                    <el-button size="small" link type="danger"
-                      @click="handleDel(scope.row, scope.$index)"  v-if="form.status !==3" >删除</el-button>
-                  </template>
-                </el-table-column>
-              </el-table> -->
               </el-form-item>
             </el-col>
           </el-row>
         </el-form>
       </div>
-      <div class="form-btns-container" style="height: 40px" v-if="!stopUseBack">
+      <div class="form-btns-container" style="height: 40px">
         <el-button size="small" icon="close" v-if="form.status !== 3"
           style="float: right; margin-left: 12px; margin-right: 12px" @click="close">取消</el-button>
         <el-button type="primary" style="float: right" size="small" v-if="form.status !== 3" icon="Finished"
           @click="handleSave">
           保存</el-button>
-        <el-button v-hasPermi="['business:housingFundDeclare:verify']" style="float: right;"
+        <el-button v-hasPermi="['business:housingFundDeclare:verify']"
+          v-show="(toTenantId == form?.entrust?.toTenantId || tenantMyself.tenantId == 0)" style="float: right;"
           icon="back" size="small" type="warning" :disabled="
     form == null || form.status !== 3
   " @click="turnBack(form)">退回</el-button>
@@ -180,6 +159,7 @@
     </div>
     <!-- <feedback-dialog ref="feedbackDialogView" :parent="this" />
     <print-dialog ref="printDialog" :parent="this" /> -->
+    <history ref="fromDialog" :currentMember=currentMember></history>
   </el-dialog>
 </template>
 <script setup>
@@ -193,6 +173,10 @@
   import dragUpload from "@/components/dragUpload"
   import { rowNum } from "@/utils/index";
   import { ref } from "vue";
+  import { getTenant } from "@/utils/auth";
+  import useUserStore from "@/store/modules/user";
+  import history from "./history";
+  const tenantMyself = useUserStore().user;
   const { proxy } = getCurrentInstance();
   const visible = ref(false);
   const width = ref(800);
@@ -229,7 +213,7 @@
     proxy.moment().format("YYYY-MM-01")
   );
   const form = ref({});
-
+  const toTenantId = ref([])
   const emptyForm = {
     details: [],
   };
@@ -254,6 +238,7 @@
     visible.value = true;
     currentMonth.value = proxy.moment().format("YYYY-MM-01")
     form.value = detail;
+    toTenantId.value = getTenant()
     loadData();
   }
   function loadData() {
@@ -268,7 +253,7 @@
       //   proxy.$modal.msgError("该信息已提交待审核");
       //   close();
       // }
-    
+
       let query = { "companyId": companyId, "year": form.value.year, "month": form.value.month }
       getMembersNoDelete(query)
         .then((res) => {
@@ -384,7 +369,9 @@
   function handleCheckChange(selection) {
     selections.value = selection.map((item) => item);
   }
-
+  function getHistory() {
+    proxy.$refs.fromDialog.open(form.value.companyId);
+  }
   function handleSave() {
 
     if (form.value.isFirstHousingFund === 0 && form.value.isPayOnWindow === 0) {

+ 126 - 0
src/views/business/housingFund/declare/history.vue

@@ -0,0 +1,126 @@
+<template>
+  <!-- 添加或修改菜单对话框 -->
+  <el-dialog title="历史记录" v-model="visible" width="800px" append-to-body draggable :close-on-click-modal="false">
+    <el-row>
+   
+      <el-form  :model="queryParams" ref="queryRef" label-width="120px">
+        <el-form-item label="客户名称:">
+         <span style="font-size: 12px;">{{currentMember}}</span>
+        </el-form-item>
+        <el-form-item label="所属期:" prop="year">
+          <el-date-picker size="small" v-model="queryParams.currentMonth" type="month" format="YYYY年MM月" style="width: 130px"
+            value-format="YYYY-MM-01" 
+            :clearable="true" @change="getList" />
+        </el-form-item>
+
+        <el-form-item prop="dateFilter" label="操作时间:">
+          <el-date-picker size="small" v-model="queryParams.dateFilter" type="daterange" clearable
+            format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
+            end-placeholder="业务日期" style="width: 70%;" @change="getList"></el-date-picker>
+        </el-form-item>
+  
+      </el-form>
+    </el-row>
+    <div style="padding: 8px 24px 16px 24px">
+
+
+      <!-- 列表区 -->
+      <el-table v-loading="loading" :data="detailList" size="small" border>
+
+        <el-table-column label="所属期" align="center" prop="belongPeriod" />
+        <el-table-column label="操作" align="center" prop="event" min-width="130" />
+        <el-table-column label="说明" align="center" width="100" prop="reason" />
+        <el-table-column label="操作时间" align="center" min-width="120" prop="createTime" />
+        <el-table-column label="操作人" align="center" prop="userName" min-width="100" />
+        <el-table-column label="操作机构" align="center" prop="tenantName" min-width="100" :show-overflow-tooltip="true" />
+
+      </el-table>
+      <!-- 分页 -->
+      <div class="pagination-container">
+        <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+          v-model:limit="queryParams.pageSize" @pagination="getList" />
+      </div>
+    </div>
+  </el-dialog>
+</template>
+
+
+<script setup>
+  import {
+    list,
+  } from "@/api/business/history";
+  const { proxy } = getCurrentInstance();
+
+
+  /** 父组件传参 */
+  const props = defineProps({
+    currentMember: {
+      type: String,
+      default: () => { },
+    }
+  });
+  const {currentMember} = toRefs(props);
+  /** 字典数组区 */
+  const { develop_type } = proxy.useDict("develop_type");
+  /** 表单抽屉 页变量 */
+  const detailList = ref([]);
+  const title = ref("");
+  const total = ref(0);
+  const loading = ref(false);
+  const multiple = ref(true);
+  const visible = ref(false);
+  const editStatus = ref(false);
+  const content = ref("");
+  const isFullscreen = ref(false);
+  const addDetailNum = ref(1);
+  const cities = ref([]);
+  const districts = ref([]);
+  const sourceCategories = ref([]);
+  const companyId = ref([]);
+
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    companyId: null,
+    tableName:"biz_housing_fund_declare"
+  });
+  const webHost = import.meta.env.VITE_APP_BASE_API;
+
+  const followQuery = ref({});
+
+  /***********************  表单页方法 ****************************/
+
+  /** 抽屉打开 */
+  function open(companyId) {
+    queryParams.value.companyId = companyId
+    visible.value = true;
+    getList()
+  }
+  function getList() {
+    loading.value = true;
+    list(queryParams.value).then((response) => {
+      detailList.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
+    });
+  }
+
+  function init() { }
+
+  // 暴露给父组件的方法
+  defineExpose({
+    open,
+  });
+  init();
+</script>
+
+<style scoped>
+  ::v-deep .el-dialog .el-dialog-body {
+    height: 800px;
+    overflow-y: auto;
+  }
+
+  .pagination-container {
+    background: #fff;
+  }
+</style>

+ 71 - 55
src/views/business/housingFund/declare/view.vue

@@ -54,9 +54,15 @@
                 <div>{{ form.housingFundDeductionPassword }}</div>
               </el-form-item>
             </el-col>
+
+            <el-col :span="24" style="text-align: right;">
+              <el-button size="small" type="success" @click="getHistory">历史记录</el-button>
+            </el-col>
             <el-col :span="24">
-              <div style="display: flex; justify-content: flex-end;margin-bottom: 10px;" v-hasPermi="['business:housingFundDeclare:exportDetail']">
-                <el-button type="primary"  @click="exportExcel" v-if="housingFundPersonList != null && housingFundPersonList.length>0">导出明细表</el-button>
+              <div style="display: flex; justify-content: flex-end;margin-bottom: 10px;margin-top: 10px;"
+                v-hasPermi="['business:housingFundDeclare:exportDetail']">
+                <el-button type="primary" @click="exportExcel"
+                  v-if="housingFundPersonList != null && housingFundPersonList.length>0">导出明细表</el-button>
               </div>
             </el-col>
             <el-table :data="housingFundPersonList" border style="width: 100%" show-summary
@@ -94,7 +100,7 @@
                 <div v-else>{{ rowNum(form.individualAmount) }}</div>
               </el-form-item>
             </el-col>
-           
+
             <el-col :span="24">
               <el-divider />
             </el-col>
@@ -106,8 +112,8 @@
             </el-col>
             <el-col :span="24">
               <el-form-item label="凭证" required>
-                <img  style="height: 148px; width: 148px" :src="`${baseUrl}/${form.evidenceFile}`"
-                class="avatar" @click="openEvidience()" />
+                <img style="height: 148px; width: 148px" :src="`${baseUrl}/${form.evidenceFile}`" class="avatar"
+                  @click="openEvidience()" />
                 <!-- <el-upload action="#" :http-request="upload" :with-credentials="true" :show-file-list="false" multiple>
                   <el-button size="small" type="primary" icon="Upload" v-if="form.status !==3">点击上传</el-button>
                 </el-upload>
@@ -134,12 +140,13 @@
           </el-row>
         </el-form>
       </div>
-      <div class="form-btns-container" style="height: 40px" v-if="!stopUseBack">
-        <el-button size="small" icon="close" v-if="form.status !== 3" style="float: right; margin-left: 12px; margin-right: 12px"
-          @click="close">取消</el-button>
-        <el-button type="primary" style="float: right" size="small" v-if="form.status !== 3" icon="Finished" @click="handleSave">
+      <div class="form-btns-container" style="height: 40px">
+        <el-button size="small" icon="close" v-if="form.status !== 3"
+          style="float: right; margin-left: 12px; margin-right: 12px" @click="close">取消</el-button>
+        <el-button type="primary" style="float: right" size="small" v-if="form.status !== 3" icon="Finished"
+          @click="handleSave">
           保存</el-button>
-          <el-button v-hasPermi="['business:housingFundDeclare:return']"  style="float: right;" icon="back" size="small"
+        <el-button v-show="(toTenantId == form?.entrust?.toTenantId || tenantMyself.tenantId == 0)" v-hasPermi="['business:housingFundDeclare:return']" style="float: right;" icon="back" size="small"
           type="warning" :disabled="
       form == null || form.status !== 3
     " @click="turnBack(form)">退回</el-button>
@@ -147,17 +154,21 @@
     </div>
     <!-- <feedback-dialog ref="feedbackDialogView" :parent="this" />
     <print-dialog ref="printDialog" :parent="this" /> -->
+    <history ref="fromDialog" :currentMember=currentMember></history>
   </el-dialog>
 </template>
 <script setup>
   import {
     getDetail,
-    saveDetail, turnBackDetail,exportDetail
+    saveDetail, turnBackDetail, exportDetail
   } from "@/api/business/production/housingFundDeclare";
   import { getMembers, getMembersNoDelete } from "@/api/business/production/housingFundDeclare";
   import { uploadFile } from "@/api/tool/file";
   import { ref } from "vue";
   import { rowNum } from "@/utils/index";
+  import { getTenant } from "@/utils/auth";
+  import useUserStore from "@/store/modules/user";
+  import history from "./history";
   const { proxy } = getCurrentInstance();
   const visible = ref(false);
   const width = ref(800);
@@ -166,10 +177,12 @@
   const editStatus = ref(false);
   const canSave = ref(false);
   const loading = ref(false);
+  const tenantMyself = useUserStore().user;
   const stopUseBack = ref(false)
   const currentMonth = ref(
     // proxy.moment().format("YYYY-MM-01") 
   );
+  const toTenantId = ref([])
   const baseUrl = ref(import.meta.env.VITE_APP_BASE_API);
   const props = defineProps({
     getList: {
@@ -202,13 +215,14 @@
 
   function open(detail) {
     visible.value = true;
-     currentMonth.value = detail.year + "-" + detail.month + "-01"
+    currentMonth.value = detail.year + "-" + detail.month + "-01"
     // currentMonth.value = proxy.moment().format("YYYY-MM-01")
     form.value = detail;
+    toTenantId.value = getTenant()
     loadData();
   }
   function openEvidience() {
-    
+
     window.open(`${baseUrl.value}${form.value.evidenceFile}`);
   }
   function loadData() {
@@ -219,13 +233,13 @@
     const clearForm = { year, month, socialSecurityDeclareId, companyId }
     getDetail(clearForm).then((res) => {
       form.value = { ...proxy.deepClone(emptyForm), ...res.data };
-      form.value.evidenceFile =  form.value.evidenceFiles[0].fileUrl;
+      form.value.evidenceFile = form.value.evidenceFiles[0].fileUrl;
       amountChangeHandler();
       let query = { "companyId": companyId, "year": form.value.year, "month": form.value.month }
       getMembersNoDelete(query)
         .then((res) => {
           housingFundPersonList.value = res.data
-          
+
         })
         .catch((err) => {
           console.log(err);
@@ -237,48 +251,48 @@
   }
   const getSummaries = (param) => {
 
-const { columns, data } = param;
-const sums = [];
-columns.forEach((column, index) => {
-  if (index === 0) {
-    sums[index] = '合计';
-    return;
-  }
-  if (index === 1 || index === 2 || index === 3) {
-    return;
-  }
+    const { columns, data } = param;
+    const sums = [];
+    columns.forEach((column, index) => {
+      if (index === 0) {
+        sums[index] = '合计';
+        return;
+      }
+      if (index === 1 || index === 2 || index === 3) {
+        return;
+      }
 
-  const values = data.map(item => Number(item[column.property]));
-  // if (column.property === 'companyAmount') {
-  //   if (form.value.unitAmount) {
-  //     sums[index] = form.value.unitAmount
-  //     return
-  //   }
-  // } else if (column.property === 'oneSelfAmount') {
-  //   if (form.value.unitAmount) {
-  //     sums[index] = form.value.individualAmount
-  //     return
-  //   }
-  // }
-  // else if (column.property === 'totalAmount') {
-  //   if (form.value.unitAmount && form.value.individualAmount) {
-  //     sums[index] = form.value.individualAmount + form.value.unitAmount
-  //     return
-  //   }
-  // }
+      const values = data.map(item => Number(item[column.property]));
+      // if (column.property === 'companyAmount') {
+      //   if (form.value.unitAmount) {
+      //     sums[index] = form.value.unitAmount
+      //     return
+      //   }
+      // } else if (column.property === 'oneSelfAmount') {
+      //   if (form.value.unitAmount) {
+      //     sums[index] = form.value.individualAmount
+      //     return
+      //   }
+      // }
+      // else if (column.property === 'totalAmount') {
+      //   if (form.value.unitAmount && form.value.individualAmount) {
+      //     sums[index] = form.value.individualAmount + form.value.unitAmount
+      //     return
+      //   }
+      // }
 
-  sums[index] = values.reduce((prev, curr) => {
-    const value = Number(curr);
-    if (!isNaN(value)) {
-      return prev + curr;
-    } else {
-      return prev;
-    }
-  }, 0);
-});
+      sums[index] = values.reduce((prev, curr) => {
+        const value = Number(curr);
+        if (!isNaN(value)) {
+          return prev + curr;
+        } else {
+          return prev;
+        }
+      }, 0);
+    });
 
-return sums
-}
+    return sums
+  }
   function changeMonthHandle() {
 
     // isView.value = true
@@ -397,7 +411,9 @@ return sums
         proxy.$modal.msg("取消保存");
       });
   }
-
+  function getHistory() {
+    proxy.$refs.fromDialog.open(form.value.companyId);
+  }
   function passwordCheckHandler(value, field) {
     // console.log(value)
     if (!passwordCheck(form.value[field])) {

+ 17 - 6
src/views/business/production/IndividualIncomeTaxIs/FormDialog.vue

@@ -6,7 +6,7 @@
       <div style="padding: 8px 24px 16px 24px">
         <el-form size="small" label-width="110px">
           <el-row :gutter="30">
-            <el-col :span="24">
+            <el-col :span="12">
               <el-form-item label="客户名称">
                 <div>{{ currentMember }}</div>
               </el-form-item>
@@ -16,6 +16,9 @@
                   @change="changeMonthHandle" />
               </el-form-item>
             </el-col>
+            <el-col :span="12" style="text-align: right;">
+              <el-button size="small" type="success" @click="getHistory">历史记录</el-button>
+            </el-col>
             <el-col :span="24">
               <el-divider />
             </el-col>
@@ -89,7 +92,7 @@
         </el-form>
 
 
-        <div class="form-btns-container" style="height: 40px" v-if="!stopUseBack">
+        <div class="form-btns-container" style="height: 40px">
           <el-button size="small" icon="close" v-if="!isView || emptyForm.status !== 3"
             style="float: right; margin-left: 12px; margin-right: 12px" @click="close">
             取消
@@ -100,21 +103,24 @@
             保存
           </el-button>
           <el-button v-hasPermi="['business:individualIncomeTaxDetail:deductionTurnBack']" icon="back" type="warning"
-            size="small" style="float: right;" 
+            size="small" style="float: right;"
+            v-show="(toTenantId() == emptyForm?.entrust?.toTenantId || tenantMyself.tenantId == 0)"
             :disabled="(emptyForm == null || emptyForm.status !== 3)  " @click="turnBack(emptyForm)">
             退回
           </el-button>
         </div>
       </div>
-
-
     </div>
+    <history ref="fromDialog"  :currentMember=currentMember></history>
   </el-dialog>
 </template>
 
 
 <script setup>
   const { proxy } = getCurrentInstance();
+  import { getTenant } from "@/utils/auth";
+  import useUserStore from "@/store/modules/user";
+  import history from "./history";
   import { rowNum } from "@/utils/index";
 
   /** 父组件传参 */
@@ -130,6 +136,7 @@
   /** 表单抽屉 页变量 */
   const title = ref("");
   const loading = ref(false);
+  const tenantMyself = useUserStore().user;
   const multiple = ref(true);
   const visible = ref(false);
   const editStatus = ref(false);
@@ -138,6 +145,7 @@
   const isAdd = ref(false);
   const isView = ref(false);
   const mainInfo = ref({});
+  const toTenantId = ref([])
   const monthInfo = ref({});
   const currentMember = ref({});
   const year = ref({});
@@ -209,6 +217,7 @@
     mainInfo.value = mainRow;
     monthInfo.value = monthItem;
     currentMonth.value = proxy.moment().subtract(1, "month").format("YYYY-MM-01")
+    toTenantId.value = getTenant()
     if (id == 0) {
       isAdd.value = true;
       isView.value = false;
@@ -231,7 +240,9 @@
       loading.value = false;
     });
   }
-
+  function getHistory() {
+    proxy.$refs.fromDialog.open(emptyForm.value.companyId);
+  }
   function getInfoId(id) {
     getInfo(mainInfo.value.id, monthInfo.value.year, monthInfo.value.month).then((response) => {
       mainInfo.value.detail = response.data;

+ 126 - 0
src/views/business/production/IndividualIncomeTaxIs/history.vue

@@ -0,0 +1,126 @@
+<template>
+  <!-- 添加或修改菜单对话框 -->
+  <el-dialog title="历史记录" v-model="visible" width="800px" append-to-body draggable :close-on-click-modal="false">
+    <el-row>
+   
+      <el-form  :model="queryParams" ref="queryRef" label-width="120px">
+        <el-form-item label="客户名称:">
+         <span style="font-size: 12px;">{{currentMember}}</span>
+        </el-form-item>
+        <el-form-item label="所属期:" prop="year">
+          <el-date-picker size="small" v-model="queryParams.currentMonth" type="month" format="YYYY年MM月" style="width: 130px"
+            value-format="YYYY-MM-01" 
+            :clearable="true" @change="getList" />
+        </el-form-item>
+
+        <el-form-item prop="dateFilter" label="操作时间:">
+          <el-date-picker size="small" v-model="queryParams.dateFilter" type="daterange" clearable
+            format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
+            end-placeholder="业务日期" style="width: 70%;" @change="getList"></el-date-picker>
+        </el-form-item>
+  
+      </el-form>
+    </el-row>
+    <div style="padding: 8px 24px 16px 24px">
+
+
+      <!-- 列表区 -->
+      <el-table v-loading="loading" :data="detailList" size="small" border>
+
+        <el-table-column label="所属期" align="center" prop="belongPeriod" />
+        <el-table-column label="操作" align="center" prop="event" min-width="130" />
+        <el-table-column label="说明" align="center" width="100" prop="reason" />
+        <el-table-column label="操作时间" align="center" min-width="120" prop="createTime" />
+        <el-table-column label="操作人" align="center" prop="userName" min-width="100" />
+        <el-table-column label="操作机构" align="center" prop="tenantName" min-width="100" :show-overflow-tooltip="true" />
+
+      </el-table>
+      <!-- 分页 -->
+      <div class="pagination-container">
+        <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+          v-model:limit="queryParams.pageSize" @pagination="getList" />
+      </div>
+    </div>
+  </el-dialog>
+</template>
+
+
+<script setup>
+  import {
+    list,
+  } from "@/api/business/history";
+  const { proxy } = getCurrentInstance();
+
+
+  /** 父组件传参 */
+  const props = defineProps({
+    currentMember: {
+      type: String,
+      default: () => { },
+    }
+  });
+  const {currentMember} = toRefs(props);
+  /** 字典数组区 */
+  const { develop_type } = proxy.useDict("develop_type");
+  /** 表单抽屉 页变量 */
+  const detailList = ref([]);
+  const title = ref("");
+  const total = ref(0);
+  const loading = ref(false);
+  const multiple = ref(true);
+  const visible = ref(false);
+  const editStatus = ref(false);
+  const content = ref("");
+  const isFullscreen = ref(false);
+  const addDetailNum = ref(1);
+  const cities = ref([]);
+  const districts = ref([]);
+  const sourceCategories = ref([]);
+  const companyId = ref([]);
+
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    tableName:"biz_financial_individual_income_tax"
+  });
+  const webHost = import.meta.env.VITE_APP_BASE_API;
+
+  const followQuery = ref({});
+
+  /***********************  表单页方法 ****************************/
+
+  /** 抽屉打开 */
+  function open(companyId) {
+    queryParams.value.companyId = companyId
+    visible.value = true;
+    getList()
+  }
+  function getList() {
+    loading.value = true;
+    
+    list(queryParams.value).then((response) => {
+      detailList.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
+    });
+  }
+
+  function init() { }
+
+  // 暴露给父组件的方法
+  defineExpose({
+    open,
+  });
+  init();
+</script>
+
+<style scoped>
+  ::v-deep .el-dialog .el-dialog-body {
+    height: 800px;
+    overflow-y: auto;
+  }
+
+  .pagination-container {
+    background: #fff;
+  }
+</style>

+ 41 - 23
src/views/business/production/IndividualIncomeTaxIsZero/FormDialog.vue

@@ -7,7 +7,7 @@
         <div style="padding: 8px 24px 16px 24px">
           <el-form size="small" label-width="110px">
             <el-row :gutter="30">
-              <el-col :span="24">
+              <el-col :span="12">
                 <el-form-item label="客户名称">
                   <div>{{ currentMember }}</div>
                 </el-form-item>
@@ -17,6 +17,9 @@
                     @change="changeMonthHandle" />
                 </el-form-item>
               </el-col>
+              <el-col :span="12" style="text-align: right;">
+                <el-button size="small" type="success" @click="getHistory">历史记录</el-button>
+              </el-col>
               <el-col :span="24">
                 <el-divider />
               </el-col>
@@ -49,7 +52,8 @@
           </el-form>
         </div>
       </div>
-      <div class="form-btns-container" style="height: 40px" v-if="!stopUseBack">
+
+      <div class="form-btns-container" style="height: 40px">
         <el-button size="small" icon="close" v-if="!isView || emptyForm.status !== 3"
           style="float: right; margin-left: 12px; margin-right: 12px" @click="close">
           取消
@@ -57,20 +61,21 @@
         <el-button type="primary" size="small" v-if="!isView || emptyForm.status !== 3" icon="Finished"
           style="float: right" @click="handleSave">
           保存</el-button>
-        <el-button 
-        type="warning" size="small" 
-        style="float: right;" 
-        :disabled="emptyForm == null || emptyForm.status !== 3 " 
-        @click="turnBack(emptyForm)" v-hasPermi="['business:tax:saveDetail']">
-        退回
-      </el-button>
+        <el-button type="warning" size="small"
+          v-show="(toTenantId == emptyForm?.entrust?.toTenantId || tenantMyself.tenantId == 0)" style="float: right;"
+          :disabled="emptyForm == null || emptyForm.status !== 3 " @click="turnBack(emptyForm)"
+          v-hasPermi="['business:tax:saveDetail']">
+          退回
+        </el-button>
+      </div>
     </div>
-  </div>
+    <history ref="fromDialog"  :currentMember=currentMember></history>
   </el-dialog>
 </template>
-
-
 <script setup>
+  import { getTenant } from "@/utils/auth";
+  import useUserStore from "@/store/modules/user";
+  import history from "./history";
   const { proxy } = getCurrentInstance();
   /** 父组件传参 */
   const props = defineProps({
@@ -88,6 +93,7 @@
   const { develop_type } = proxy.useDict("develop_type");
   /** 表单抽屉 页变量 */
   const title = ref("");
+  const tenantMyself = useUserStore().user;
   const loading = ref(false);
   const multiple = ref(true);
   const visible = ref(false);
@@ -102,6 +108,7 @@
   const year = ref({});
   const month = ref({});
   const cities = ref([]);
+  const toTenantId = ref([])
   const districts = ref([]);
   const fileList = ref([]);
   const tenantId = ref(0);
@@ -171,6 +178,9 @@
     parentId.value = id
     console.log("id", id);
     currentMonth.value = proxy.moment().subtract(1, "month").format("YYYY-MM-01")
+    toTenantId.value = getTenant()
+
+
     if (id == 0) {
       isAdd.value = true;
       isView.value = false;
@@ -186,7 +196,16 @@
       currentMonth.value = monthInfo.value.year + monthInfo.value.month
       getInfoId(id);
     }
+
+
+
+  }
+
+  function getHistory() {
+    proxy.$refs.fromDialog.open(emptyForm.value.companyId);
   }
+
+
   /** 退回按钮操作 */
   function turnBack(row) {
     loading.value = true
@@ -194,7 +213,7 @@
     emptyForm.value.workOrderId = workOrderId;
     emptyForm.value.year = proxy.moment(currentMonth.value).format("YYYY");
     emptyForm.value.month = proxy.moment(currentMonth.value).format("MM");
-    console.log( emptyForm.value);
+    console.log(emptyForm.value);
     updateIndividualIncomeTaxDetail(emptyForm.value);
     loading.value = false;
     getList.value();
@@ -210,22 +229,22 @@
   }
   function changeMonthHandle(parentId) {
     loading.value = true
-    isView.value =true
+    isView.value = true
     const nowDate = ref(
-    proxy.moment().subtract(1, "month").format("YYYY-MM-01")
+      proxy.moment().subtract(1, "month").format("YYYY-MM-01")
     );
     let nowyear = proxy.moment(nowDate.value).format("YYYY");
     let nowmonth = proxy.moment(nowDate.value).format("MM");
     const year = proxy.moment(currentMonth.value).format("YYYY");
     const month = proxy.moment(currentMonth.value).format("MM");
-    if(nowyear+nowmonth == year+month){
-      if(emptyForm.value.status === 3 ){
-        isView.value =true
-      }else{
-        isView.value =false
+    if (nowyear + nowmonth == year + month) {
+      if (emptyForm.value.status === 3) {
+        isView.value = true
+      } else {
+        isView.value = false
       }
       stopUseBack.value = false
-    }else{
+    } else {
       stopUseBack.value = true
     }
     getInfo(mainInfo.value.id, year, month).then((response) => {
@@ -239,8 +258,7 @@
 
 
   function loadData(id) {
-    console.log(123,emptyForm.value);
-    
+
     year.value = monthInfo.value.year;
     month.value = monthInfo.value.month;
     currentMember.value = mainInfo.value.companyName;

+ 126 - 0
src/views/business/production/IndividualIncomeTaxIsZero/history.vue

@@ -0,0 +1,126 @@
+<template>
+  <!-- 添加或修改菜单对话框 -->
+  <el-dialog title="历史记录" v-model="visible" width="800px" append-to-body draggable :close-on-click-modal="false">
+    <el-row>
+   
+      <el-form  :model="queryParams" ref="queryRef" label-width="120px">
+        <el-form-item label="客户名称:">
+         <span style="font-size: 12px;">{{currentMember}}</span>
+        </el-form-item>
+        <el-form-item label="所属期:" prop="year">
+          <el-date-picker size="small" v-model="queryParams.currentMonth" type="month" format="YYYY年MM月" style="width: 130px"
+            value-format="YYYY-MM-01" 
+            :clearable="true" @change="getList" />
+        </el-form-item>
+
+        <el-form-item prop="dateFilter" label="操作时间:">
+          <el-date-picker size="small" v-model="queryParams.dateFilter" type="daterange" clearable
+            format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
+            end-placeholder="业务日期" style="width: 70%;" @change="getList"></el-date-picker>
+        </el-form-item>
+  
+      </el-form>
+    </el-row>
+    <div style="padding: 8px 24px 16px 24px">
+
+
+      <!-- 列表区 -->
+      <el-table v-loading="loading" :data="detailList" size="small" border>
+
+        <el-table-column label="所属期" align="center" prop="belongPeriod" />
+        <el-table-column label="操作" align="center" prop="event" min-width="130" />
+        <el-table-column label="说明" align="center" width="100" prop="reason" />
+        <el-table-column label="操作时间" align="center" min-width="120" prop="createTime" />
+        <el-table-column label="操作人" align="center" prop="userName" min-width="100" />
+        <el-table-column label="操作机构" align="center" prop="tenantName" min-width="100" :show-overflow-tooltip="true" />
+
+      </el-table>
+      <!-- 分页 -->
+      <div class="pagination-container">
+        <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+          v-model:limit="queryParams.pageSize" @pagination="getList" />
+      </div>
+    </div>
+  </el-dialog>
+</template>
+
+
+<script setup>
+  import {
+    list,
+  } from "@/api/business/history";
+  const { proxy } = getCurrentInstance();
+
+
+  /** 父组件传参 */
+  const props = defineProps({
+    currentMember: {
+      type: String,
+      default: () => { },
+    }
+  });
+  const {currentMember} = toRefs(props);
+  /** 字典数组区 */
+  const { develop_type } = proxy.useDict("develop_type");
+  /** 表单抽屉 页变量 */
+  const detailList = ref([]);
+  const title = ref("");
+  const total = ref(0);
+  const loading = ref(false);
+  const multiple = ref(true);
+  const visible = ref(false);
+  const editStatus = ref(false);
+  const content = ref("");
+  const isFullscreen = ref(false);
+  const addDetailNum = ref(1);
+  const cities = ref([]);
+  const districts = ref([]);
+  const sourceCategories = ref([]);
+  const companyId = ref([]);
+
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    tableName:"biz_financial_individual_income_tax_zero"
+  });
+  const webHost = import.meta.env.VITE_APP_BASE_API;
+
+  const followQuery = ref({});
+
+  /***********************  表单页方法 ****************************/
+
+  /** 抽屉打开 */
+  function open(companyId) {
+    queryParams.value.companyId = companyId
+    visible.value = true;
+    getList()
+  }
+  function getList() {
+    loading.value = true;
+    
+    list(queryParams.value).then((response) => {
+      detailList.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
+    });
+  }
+
+  function init() { }
+
+  // 暴露给父组件的方法
+  defineExpose({
+    open,
+  });
+  init();
+</script>
+
+<style scoped>
+  ::v-deep .el-dialog .el-dialog-body {
+    height: 800px;
+    overflow-y: auto;
+  }
+
+  .pagination-container {
+    background: #fff;
+  }
+</style>

+ 32 - 27
src/views/business/production/financialReportTax/FormDialog.vue

@@ -11,17 +11,11 @@
                 <el-form-item label="客户名称">
                   <div>{{ currentMember }}</div>
                 </el-form-item>
-              </el-col>
-
-              <el-col :span="12">
                 <el-form-item label="所属月份">
                   <!-- <div>{{ year }}-{{ month }}</div> -->
                   <el-date-picker v-model="currentMonth" type="month" placeholder="请选择时间" format="YYYY-MM"
                     @change="changeMonthHandle" />
                 </el-form-item>
-              </el-col>
-
-              <el-col :span="12">
                 <el-form-item label="可弥补之前年度亏损">
                   <el-input-number v-if="(editStatus && !isView)|| emptyForm.status !== 3" size="small"
                     placeholder="可弥补之前年度亏损" v-model="emptyForm.previousAnnualLosses" style="width: 120%" :precision="2"
@@ -36,7 +30,9 @@
                   </template>
                 </el-form-item>
               </el-col>
-
+              <el-col :span="12" style="text-align: right;">
+                <el-button size="small" type="success" @click="getHistory">历史记录</el-button>
+              </el-col>
               <el-col :span="24">
                 <el-divider />
               </el-col>
@@ -247,31 +243,34 @@
           </el-form>
         </div>
       </div>
-      <div class="form-btns-container" style="height: 40px" v-if="!stopUseBack" >
-        <el-button size="small" icon="close" v-if="!isView || emptyForm.status !== 3"
-          style="float: right; margin-left: 12px; margin-right: 12px" @click="close">取消
-        </el-button>
-        <div  v-if="!isView || emptyForm.status !== 3" >
-          <el-button type="primary" size="small" icon="Finished"
-          @click="handleSave" v-hasPermi="['business:financialReportTax:saveDetail']" style="float: right">
-          保存</el-button>
-        </div>
-        <div >
-          <el-button type="warning" size="small" style="float: right;" icon="back"
-          :disabled="emptyForm == null || emptyForm.status !== 3 " @click="turnBack(emptyForm)"
-          v-hasPermi="['business:financialReportTaxNonZero:back']">
-          退回
-        </el-button>
+      <div class="form-btns-container" style="height: 40px">
+        <div class="form-btns-container" style="height: 40px">
+          <el-button size="small" icon="close" v-if="!isView || emptyForm.status !== 3"
+            style="float: right; margin-left: 12px; margin-right: 12px" @click="close">取消
+          </el-button>
+          <el-button type="primary" size="small" icon="Finished" v-show="!isView || emptyForm.status !== 3"
+            @click="handleSave" v-hasPermi="['business:financialReportTax:saveDetail']" style="float: right">
+            保存</el-button>
+          <el-button type="warning" size="small" style="float: right; " icon="back"
+            v-show="(toTenantId == emptyForm?.entrust?.toTenantId || tenantMyself.tenantId == 0)"
+            :disabled="emptyForm == null || emptyForm.status !== 3 " @click="turnBack(emptyForm)"
+            v-hasPermi="['business:financialReportTaxNonZero:back']">
+            退回
+          </el-button>
         </div>
-       
       </div>
     </div>
+
+    <history ref="fromDialog" :currentMember=currentMember></history>
   </el-dialog>
 </template>
 
 
 <script setup>
   import { rowNum } from "@/utils/index";
+  import { getTenant } from "@/utils/auth";
+  import useUserStore from "@/store/modules/user";
+  import history from "./history";
   const { proxy } = getCurrentInstance();
   /** 父组件传参 */
   const props = defineProps({
@@ -280,6 +279,7 @@
       default: () => { },
     },
   });
+  const tenantMyself = useUserStore().user;
   const { getList } = toRefs(props);
   /** 字典数组区 */
   const { develop_type } = proxy.useDict("develop_type");
@@ -303,6 +303,7 @@
   const files = ref([]);
   const reportFiles = ref([]);
   const tenantId = ref(0);
+  const toTenantId = ref([])
   const currentMonth = ref(
     proxy.moment().subtract(1, "month").format("YYYY-MM-01")
   );
@@ -361,6 +362,7 @@
     tenantId.value = mainRow.tenantId;
     currentMonth.value = proxy.moment().subtract(1, "month").format("YYYY-MM-01")
     parentId.value = id
+    toTenantId.value = getTenant()
     if (id == 0) {
       isAdd.value = true;
       isView.value = false;
@@ -404,10 +406,10 @@
     const year = proxy.moment(currentMonth.value).format("YYYY");
     const month = proxy.moment(currentMonth.value).format("MM");
     if (nowyear + nowmonth == year + month) {
-      if(emptyForm.value.status === 3 ){
-        isView.value =true
-      }else{
-        isView.value =false
+      if (emptyForm.value.status === 3) {
+        isView.value = true
+      } else {
+        isView.value = false
       }
       stopUseBack.value = false
     } else {
@@ -498,6 +500,9 @@
     reportFiles.value.splice(index, 1);
   }
 
+  function getHistory() {
+    proxy.$refs.fromDialog.open(mainInfo.value.companyId);
+  }
   /**  保存 */
   function handleSave() {
     emptyForm.value.reportFiles = reportFiles;

+ 126 - 0
src/views/business/production/financialReportTax/history.vue

@@ -0,0 +1,126 @@
+<template>
+  <!-- 添加或修改菜单对话框 -->
+  <el-dialog title="历史记录" v-model="visible" width="800px" append-to-body draggable :close-on-click-modal="false">
+    <el-row>
+   
+      <el-form  :model="queryParams" ref="queryRef" label-width="120px">
+        <el-form-item label="客户名称:">
+         <span style="font-size: 12px;">{{currentMember}}</span>
+        </el-form-item>
+        <el-form-item label="所属期:" prop="year">
+          <el-date-picker size="small" v-model="queryParams.currentMonth" type="month" format="YYYY年MM月" style="width: 130px"
+            value-format="YYYY-MM-01" 
+            :clearable="true" @change="getList" />
+        </el-form-item>
+
+        <el-form-item prop="dateFilter" label="操作时间:">
+          <el-date-picker size="small" v-model="queryParams.dateFilter" type="daterange" clearable
+            format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
+            end-placeholder="业务日期" style="width: 70%;" @change="getList"></el-date-picker>
+        </el-form-item>
+  
+      </el-form>
+    </el-row>
+    <div style="padding: 8px 24px 16px 24px">
+
+
+      <!-- 列表区 -->
+      <el-table v-loading="loading" :data="detailList" size="small" border>
+
+        <el-table-column label="所属期" align="center" prop="belongPeriod" />
+        <el-table-column label="操作" align="center" prop="event" min-width="130" />
+        <el-table-column label="说明" align="center" width="100" prop="reason" />
+        <el-table-column label="操作时间" align="center" min-width="120" prop="createTime" />
+        <el-table-column label="操作人" align="center" prop="userName" min-width="100" />
+        <el-table-column label="操作机构" align="center" prop="tenantName" min-width="100" :show-overflow-tooltip="true" />
+
+      </el-table>
+      <!-- 分页 -->
+      <div class="pagination-container">
+        <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+          v-model:limit="queryParams.pageSize" @pagination="getList" />
+      </div>
+    </div>
+  </el-dialog>
+</template>
+
+
+<script setup>
+  import {
+    list,
+  } from "@/api/business/history";
+  const { proxy } = getCurrentInstance();
+
+
+  /** 父组件传参 */
+  const props = defineProps({
+    currentMember: {
+      type: String,
+      default: () => { },
+    }
+  });
+  const {currentMember} = toRefs(props);
+  /** 字典数组区 */
+  const { develop_type } = proxy.useDict("develop_type");
+  /** 表单抽屉 页变量 */
+  const detailList = ref([]);
+  const title = ref("");
+  const total = ref(0);
+  const loading = ref(false);
+  const multiple = ref(true);
+  const visible = ref(false);
+  const editStatus = ref(false);
+  const content = ref("");
+  const isFullscreen = ref(false);
+  const addDetailNum = ref(1);
+  const cities = ref([]);
+  const districts = ref([]);
+  const sourceCategories = ref([]);
+  const companyId = ref([]);
+
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    tableName:"biz_financial_report_tax"
+  });
+  const webHost = import.meta.env.VITE_APP_BASE_API;
+
+  const followQuery = ref({});
+
+  /***********************  表单页方法 ****************************/
+
+  /** 抽屉打开 */
+  function open(companyId) {
+    queryParams.value.companyId = companyId
+    visible.value = true;
+    getList()
+  }
+  function getList() {
+    loading.value = true;
+    
+    list(queryParams.value).then((response) => {
+      detailList.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
+    });
+  }
+
+  function init() { }
+
+  // 暴露给父组件的方法
+  defineExpose({
+    open,
+  });
+  init();
+</script>
+
+<style scoped>
+  ::v-deep .el-dialog .el-dialog-body {
+    height: 800px;
+    overflow-y: auto;
+  }
+
+  .pagination-container {
+    background: #fff;
+  }
+</style>

+ 28 - 47
src/views/business/production/financialReportTaxIsZero/FormDialog.vue

@@ -11,22 +11,22 @@
                 <el-form-item label="客户名称">
                   <div>{{ currentMember }}</div>
                 </el-form-item>
-              </el-col>
-
-              <el-col :span="12">
                 <el-form-item label="所属月份">
                   <!-- <div>{{ year }}-{{ month }}</div> -->
                   <el-date-picker v-model="currentMonth" type="month" placeholder="请选择时间" format="YYYY-MM"
                     @change="changeMonthHandle" />
                 </el-form-item>
               </el-col>
+              <el-col :span="12" style="text-align: right;">
+                <el-button size="small" type="success" @click="getHistory">历史记录</el-button>
+              </el-col>
               <el-col :span="24">
                 <el-divider />
               </el-col>
               <el-col :span="12">
                 <el-form-item label="备注">
-                  <el-input v-if="!isView||emptyForm.status !== 3" type="textarea" rows="2" show-word-limit maxlength="200"
-                    v-model="emptyForm.content" />
+                  <el-input v-if="!isView||emptyForm.status !== 3" type="textarea" rows="2" show-word-limit
+                    maxlength="200" v-model="emptyForm.content" />
                   <span v-else>{{ emptyForm.content }}</span>
                 </el-form-item>
               </el-col>
@@ -46,37 +46,6 @@
                     </div>
                     <div v-else>
                     </div>
-                    <!-- <el-upload
-                    v-if="!isView"
-                    action="#"
-                    :http-request="upload"
-                    :with-credentials="true"
-                    list-type="picture-card"
-                    :show-file-list="false"
-                    :file-list="files"
-                    multiple
-                  >
-                    <img
-                      v-if="
-                        emptyForm.evidenceFile != null &&
-                        emptyForm.evidenceFile !== ''
-                      "
-                      style="height: 148px; width: 148px"
-                      :src="`${baseUrl}/${emptyForm.evidenceFile}`"
-                      class="avatar"
-                    />
-                    <i v-else class="el-icon-plus avatar-uploader-icon" />
-                  </el-upload>
-                  <img
-                    v-else-if="
-                      emptyForm.evidenceFile != null &&
-                      emptyForm.evidenceFile !== ''
-                    "
-                    style="height: 148px; width: 148px"
-                    :src="`${baseUrl}/${emptyForm.evidenceFile}`"
-                    class="avatar"
-                    @click="openEvidience('evidenceFile')"
-                  /> -->
                   </el-form-item>
                 </div>
               </el-col>
@@ -120,7 +89,7 @@
           </el-form>
         </div>
       </div>
-      <div class="form-btns-container" style="height: 40px"  v-if="!stopUseBack">
+      <div class="form-btns-container" style="height: 40px">
         <el-button size="small" icon="close" v-if="!isView || emptyForm.status !== 3"
           style="float: right; margin-left: 12px; margin-right: 12px" @click="close">取消
         </el-button>
@@ -128,6 +97,7 @@
           icon="Finished" @click="handleSave">
           保存</el-button>
         <el-button type="warning" icon="back" size="small" style="float: right;"
+          v-show="(toTenantId == emptyForm?.entrust?.toTenantId || tenantMyself.tenantId == 0)"
           :disabled="emptyForm == null || emptyForm.status !== 3 " @click="turnBack(emptyForm)"
           v-hasPermi="['business:financialReportTax:back']">
           退回
@@ -135,10 +105,15 @@
       </div>
     </div>
   </el-dialog>
+
+  <history ref="fromDialog" :currentMember=currentMember></history>
 </template>
 
 
 <script setup>
+  import { getTenant } from "@/utils/auth";
+  import useUserStore from "@/store/modules/user";
+  import history from "./history";
   const { proxy } = getCurrentInstance();
   /** 父组件传参 */
   const props = defineProps({
@@ -155,6 +130,7 @@
   const loading = ref(false);
   const multiple = ref(true);
   const visible = ref(false);
+  const tenantMyself = useUserStore().user;
   const editStatus = ref(false);
   const isFullscreen = ref(false);
   const addDetailNum = ref(1);
@@ -214,6 +190,7 @@
   const parentId = ref(null);
   const followQuery = ref({});
   const stopUseBack = ref(false);
+  const toTenantId = ref([])
   /***********************  表单页方法 ****************************/
 
   /** 抽屉打开 */
@@ -225,6 +202,7 @@
     tenantId.value = mainRow.tenantId;
     parentId.value = id
     console.log("打开form", mainRow);
+    toTenantId.value = getTenant()
     currentMonth.value = proxy.moment().subtract(1, "month").format("YYYY-MM-01")
     if (id == 0) {
       isAdd.value = true;
@@ -242,13 +220,16 @@
       isAdd.value = false;
       currentMonth.value = monthInfo.value.year + monthInfo.value.month
     }
-    console.log(isView.value,2323);
+    console.log(isView.value, 2323);
     getTaxId(mainRow, id);
   }
 
+
+  function getHistory() {
+    proxy.$refs.fromDialog.open( mainInfo.value.companyId);
+  }
+
   function getTaxId(mainRow, id) {
-    
-    console.log("获取", mainRow);
     if (mainRow.detail != null) {
       loading.value = true
       getTax(mainInfo.value.id, monthInfo.value.year, monthInfo.value.month).then((res) => {
@@ -258,7 +239,7 @@
           reportFiles.value = emptyForm.value.reportFiles;
           loadData(id);
         }
-      }).finally(() =>{
+      }).finally(() => {
         loading.value = false
       });
     } else {
@@ -277,14 +258,14 @@
     const year = proxy.moment(currentMonth.value).format("YYYY");
     const month = proxy.moment(currentMonth.value).format("MM");
     if (nowyear + nowmonth == year + month) {
-      if(emptyForm.value.status === 3 ){
-        isView.value =true
-      }else{
-        isView.value =false
+      if (emptyForm.value.status === 3) {
+        isView.value = true
+      } else {
+        isView.value = false
       }
       stopUseBack.value = false
     } else {
-        stopUseBack.value = true
+      stopUseBack.value = true
     }
     getTax(mainInfo.value.id, year, month).then((res) => {
       if (res.code === 200) {
@@ -304,7 +285,7 @@
     emptyForm.value.status = 1;
     emptyForm.value.year = proxy.moment(currentMonth.value).format("YYYY");
     emptyForm.value.month = proxy.moment(currentMonth.value).format("MM");
-    deductionTurnBack( emptyForm.value)
+    deductionTurnBack(emptyForm.value)
       .then((res) => {
         getList.value();
       })

+ 126 - 0
src/views/business/production/financialReportTaxIsZero/history.vue

@@ -0,0 +1,126 @@
+<template>
+  <!-- 添加或修改菜单对话框 -->
+  <el-dialog title="历史记录" v-model="visible" width="800px" append-to-body draggable :close-on-click-modal="false">
+    <el-row>
+   
+      <el-form  :model="queryParams" ref="queryRef" label-width="120px">
+        <el-form-item label="客户名称:">
+         <span style="font-size: 12px;">{{currentMember}}</span>
+        </el-form-item>
+        <el-form-item label="所属期:" prop="year">
+          <el-date-picker size="small" v-model="queryParams.currentMonth" type="month" format="YYYY年MM月" style="width: 130px"
+            value-format="YYYY-MM-01" 
+            :clearable="true" @change="getList" />
+        </el-form-item>
+
+        <el-form-item prop="dateFilter" label="操作时间:">
+          <el-date-picker size="small" v-model="queryParams.dateFilter" type="daterange" clearable
+            format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
+            end-placeholder="业务日期" style="width: 70%;" @change="getList"></el-date-picker>
+        </el-form-item>
+  
+      </el-form>
+    </el-row>
+    <div style="padding: 8px 24px 16px 24px">
+
+
+      <!-- 列表区 -->
+      <el-table v-loading="loading" :data="detailList" size="small" border>
+
+        <el-table-column label="所属期" align="center" prop="belongPeriod" />
+        <el-table-column label="操作" align="center" prop="event" min-width="130" />
+        <el-table-column label="说明" align="center" width="100" prop="reason" />
+        <el-table-column label="操作时间" align="center" min-width="120" prop="createTime" />
+        <el-table-column label="操作人" align="center" prop="userName" min-width="100" />
+        <el-table-column label="操作机构" align="center" prop="tenantName" min-width="100" :show-overflow-tooltip="true" />
+
+      </el-table>
+      <!-- 分页 -->
+      <div class="pagination-container">
+        <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+          v-model:limit="queryParams.pageSize" @pagination="getList" />
+      </div>
+    </div>
+  </el-dialog>
+</template>
+
+
+<script setup>
+  import {
+    list,
+  } from "@/api/business/history";
+  const { proxy } = getCurrentInstance();
+
+
+  /** 父组件传参 */
+  const props = defineProps({
+    currentMember: {
+      type: String,
+      default: () => { },
+    }
+  });
+  const {currentMember} = toRefs(props);
+  /** 字典数组区 */
+  const { develop_type } = proxy.useDict("develop_type");
+  /** 表单抽屉 页变量 */
+  const detailList = ref([]);
+  const title = ref("");
+  const total = ref(0);
+  const loading = ref(false);
+  const multiple = ref(true);
+  const visible = ref(false);
+  const editStatus = ref(false);
+  const content = ref("");
+  const isFullscreen = ref(false);
+  const addDetailNum = ref(1);
+  const cities = ref([]);
+  const districts = ref([]);
+  const sourceCategories = ref([]);
+  const companyId = ref([]);
+
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    companyId: null,
+    tableName:"biz_financial_report_tax_zero"
+  });
+  const webHost = import.meta.env.VITE_APP_BASE_API;
+
+  const followQuery = ref({});
+
+  /***********************  表单页方法 ****************************/
+
+  /** 抽屉打开 */
+  function open(companyId) {
+    queryParams.value.companyId = companyId
+    visible.value = true;
+    getList()
+  }
+  function getList() {
+    loading.value = true;
+    list(queryParams.value).then((response) => {
+      detailList.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
+    });
+  }
+
+  function init() { }
+
+  // 暴露给父组件的方法
+  defineExpose({
+    open,
+  });
+  init();
+</script>
+
+<style scoped>
+  ::v-deep .el-dialog .el-dialog-body {
+    height: 800px;
+    overflow-y: auto;
+  }
+
+  .pagination-container {
+    background: #fff;
+  }
+</style>

+ 35 - 42
src/views/business/socialSecurity/declare/form.vue

@@ -68,7 +68,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="12">
-              <el-form-item label="单位工伤险比例:" required  label-width="130px">
+              <el-form-item label="单位工伤险比例:" required label-width="130px">
                 <div v-if="form.status !== 3">
                   <el-input-number v-model="form.injuryRadio" size="small" placeholder="单位工伤险比例" :precision="2"
                     :controls="false" style="width: 80%;" @change="changeUnitInjuryRadio" />
@@ -77,9 +77,14 @@
                 <div v-else>{{ rowNum(form.injuryRadio) }}</div>
               </el-form-item>
             </el-col>
+            <el-col :span="12" style="text-align: right;">
+              <el-button size="small" type="success" @click="getHistory">历史记录</el-button>
+            </el-col>
             <el-col :span="24">
-              <div style="display: flex; justify-content: flex-end;margin-bottom: 10px;" v-hasPermi="['business:socialSecurityDeclare:exportDetail']">
-                <el-button type="primary" @click="exportExcel" v-if="tableData!= null && tableData.length > 0" >导出明细表</el-button>
+              <div style="display: flex; justify-content: flex-end;margin-bottom: 10px;margin-top: 10px;" 
+                v-hasPermi="['business:socialSecurityDeclare:exportDetail']">
+                <el-button type="primary" @click="exportExcel"
+                  v-if="tableData!= null && tableData.length > 0">导出明细表</el-button>
               </div>
             </el-col>
             <el-table :data="tableData" style="width: 100%" show-summary :summary-method="getSummaries">
@@ -302,28 +307,6 @@
                     <Delete />
                   </el-icon>
                 </div>
-                <!-- <el-upload action="#" :http-request="upload" :with-credentials="true" :show-file-list="false" multiple>
-                  <el-button size="small" type="primary" icon="Upload" v-if="form.status !==3">点击上传</el-button>
-                </el-upload>" -->
-                <!-- <dragUpload :accept="accept" style="width:100%" @file="upload"/>
-                <el-table ref="dbTable" :data="form.evidenceFiles" size="small" border
-                  header-row-class-name="list-header-row" row-class-name="list-row">
-                  <el-table-column label="文件名" prop="originalFileName" align="center" show-overflow-tooltip>
-                    <template #default="scope">
-                      <el-button size="small" type="text" @click="openFile(scope.row)">{{
-                        scope.row.originalFileName == ""
-                        ? "打开文件"
-                        : scope.row.originalFileName
-                        }}</el-button>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="操作" width="80" prop="fileType" align="center">
-                    <template #default="scope">
-                      <el-button size="small" link type="danger" v-if=" form.status !== 3"
-                        @click="handlerEportFilesDel(scope.row, scope.$index)">删除</el-button>
-                    </template>
-                  </el-table-column>
-                </el-table> -->
               </el-form-item>
             </el-col>
             <el-col :span="24">
@@ -356,21 +339,23 @@
           </el-row>
         </el-form>
       </div>
-      <div class="form-btns-container" style="height: 40px" v-if="!stopUseBack">
+      <div class="form-btns-container" style="height: 40px">
         <el-button size="small" v-if="form.status !== 3" icon="close"
           style="float: right; margin-left: 12px; margin-right: 12px" @click="close">
           取消</el-button>
         <el-button type="primary" v-if="form.status !== 3" size="small" icon="Finished" style="float: right"
           @click="handleSave">
           保存</el-button>
-        <el-button v-hasPermi="['business:socialSecurityDeclare:edit']" style="float: right;" 
-          icon="back" size="small" type="warning" :disabled="
+        <el-button v-hasPermi="['business:socialSecurityDeclare:edit']" style="float: right;" icon="back" size="small"
+          type="warning" :disabled="
       form == null || form.status !== 3
-    " @click="turnBack(form)">退回</el-button>
+    " @click="turnBack(form)"
+          v-show="(toTenantId == form?.entrust?.toTenantId || tenantMyself.tenantId == 0)">退回</el-button>
       </div>
     </div>
     <!-- <feedback-dialog ref="feedbackDialogView" :parent="this" />
     <print-dialog ref="printDialog" :parent="this" /> -->
+    <history ref="fromDialog" :currentMember=currentMember></history>
   </el-dialog>
 </template>
 <script setup>
@@ -384,6 +369,10 @@
   import { rowNum } from "@/utils/index";
   import dragUpload from "@/components/dragUpload"
   import { ref } from "vue";
+  import { getTenant } from "@/utils/auth";
+  import useUserStore from "@/store/modules/user";
+  import history from "./history";
+  const tenantMyself = useUserStore().user;
   const { proxy } = getCurrentInstance();
   const visible = ref(false);
   const width = ref(1600);
@@ -394,6 +383,7 @@
   const loading = ref(false);
   const stopUseBack = ref(false);
   const tableData = ref([]);
+  const toTenantId = ref([])
   const currentMonth = ref(
     proxy.moment().format("YYYY-MM-01")
   );
@@ -431,7 +421,7 @@
     visible.value = true;
     currentMonth.value = proxy.moment().format("YYYY-MM-01")
     form.value = detail;
-    console.log(detail);
+    toTenantId.value = getTenant()
     loadData();
   }
 
@@ -439,8 +429,8 @@
     loading.value = true;
     form.value.year = proxy.moment(currentMonth.value).format("YYYY");
     form.value.month = proxy.moment(currentMonth.value).format("MM");
-    const { year, month, socialSecurityDeclareId, companyId,injuryRadio } = form.value
-    const clearForm = { year, month, socialSecurityDeclareId, companyId,injuryRadio }
+    const { year, month, socialSecurityDeclareId, companyId, injuryRadio } = form.value
+    const clearForm = { year, month, socialSecurityDeclareId, companyId, injuryRadio }
     getDetail(clearForm).then((res) => {
       form.value = { ...proxy.deepClone(emptyForm), ...res.data };
       // if (form.value.status === 2 || form.value.status === 3) {
@@ -643,6 +633,9 @@
   function handleCurrentChange(row) {
     currentSource.value = row;
   }
+  function getHistory() {
+    proxy.$refs.fromDialog.open(form.value.companyId);
+  }
   function turnBack(detail) {
     loading.value = true
     form.value.status = 1;
@@ -691,19 +684,19 @@
   }
 
   function handleSave() {
-    console.log("form.value.injuryRadio",form.value.injuryRadio);
-    
-    if (form.value.injuryRadio  == null) {
-        proxy.$modal.msgError("请输入单位工伤险比例");
-        return;
-      }
+    console.log("form.value.injuryRadio", form.value.injuryRadio);
+
+    if (form.value.injuryRadio == null) {
+      proxy.$modal.msgError("请输入单位工伤险比例");
+      return;
+    }
     if (form.value.isFirstSocialSecurity === 0) {
-    
+
       if (!form.value.governmentAccountNo) {
         proxy.$modal.msgError("请输入政务网账号");
         return;
       }
-    
+
       if (!form.value.governmentPassword) {
         proxy.$modal.msgError("请输入政务网密码");
         return;
@@ -848,8 +841,8 @@
         ? 0
         : form.value.individualUnemployment;
     amount += form.value.unitHeatingFee == null ? 0 : form.value.unitHeatingFee;
-   
-    
+
+
     form.value.amount = amount;
     canSave.value =
       form.value.unitInjury !== undefined &&

+ 126 - 0
src/views/business/socialSecurity/declare/history.vue

@@ -0,0 +1,126 @@
+<template>
+  <!-- 添加或修改菜单对话框 -->
+  <el-dialog title="历史记录" v-model="visible" width="800px" append-to-body draggable :close-on-click-modal="false">
+    <el-row>
+   
+      <el-form  :model="queryParams" ref="queryRef" label-width="120px">
+        <el-form-item label="客户名称:">
+         <span style="font-size: 12px;">{{currentMember}}</span>
+        </el-form-item>
+        <el-form-item label="所属期:" prop="year">
+          <el-date-picker size="small" v-model="queryParams.currentMonth" type="month" format="YYYY年MM月" style="width: 130px"
+            value-format="YYYY-MM-01" 
+            :clearable="true" @change="getList" />
+        </el-form-item>
+
+        <el-form-item prop="dateFilter" label="操作时间:">
+          <el-date-picker size="small" v-model="queryParams.dateFilter" type="daterange" clearable
+            format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
+            end-placeholder="业务日期" style="width: 70%;" @change="getList"></el-date-picker>
+        </el-form-item>
+  
+      </el-form>
+    </el-row>
+    <div style="padding: 8px 24px 16px 24px">
+
+
+      <!-- 列表区 -->
+      <el-table v-loading="loading" :data="detailList" size="small" border>
+
+        <el-table-column label="所属期" align="center" prop="belongPeriod" />
+        <el-table-column label="操作" align="center" prop="event" min-width="130" />
+        <el-table-column label="说明" align="center" width="100" prop="reason" />
+        <el-table-column label="操作时间" align="center" min-width="120" prop="createTime" />
+        <el-table-column label="操作人" align="center" prop="userName" min-width="100" />
+        <el-table-column label="操作机构" align="center" prop="tenantName" min-width="100" :show-overflow-tooltip="true" />
+
+      </el-table>
+      <!-- 分页 -->
+      <div class="pagination-container">
+        <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+          v-model:limit="queryParams.pageSize" @pagination="getList" />
+      </div>
+    </div>
+  </el-dialog>
+</template>
+
+
+<script setup>
+  import {
+    list,
+  } from "@/api/business/history";
+  const { proxy } = getCurrentInstance();
+
+
+  /** 父组件传参 */
+  const props = defineProps({
+    currentMember: {
+      type: String,
+      default: () => { },
+    }
+  });
+  const {currentMember} = toRefs(props);
+  /** 字典数组区 */
+  const { develop_type } = proxy.useDict("develop_type");
+  /** 表单抽屉 页变量 */
+  const detailList = ref([]);
+  const title = ref("");
+  const total = ref(0);
+  const loading = ref(false);
+  const multiple = ref(true);
+  const visible = ref(false);
+  const editStatus = ref(false);
+  const content = ref("");
+  const isFullscreen = ref(false);
+  const addDetailNum = ref(1);
+  const cities = ref([]);
+  const districts = ref([]);
+  const sourceCategories = ref([]);
+  const companyId = ref([]);
+
+  const queryParams = ref({
+    pageNum: 1,
+    pageSize: 20,
+    companyId: null,
+    tableName:"biz_social_security_declare"
+  });
+  const webHost = import.meta.env.VITE_APP_BASE_API;
+
+  const followQuery = ref({});
+
+  /***********************  表单页方法 ****************************/
+
+  /** 抽屉打开 */
+  function open(companyId) {
+    queryParams.value.companyId = companyId
+    visible.value = true;
+    getList()
+  }
+  function getList() {
+    loading.value = true;
+    list(queryParams.value).then((response) => {
+      detailList.value = response.rows;
+      total.value = response.total;
+      loading.value = false;
+    });
+  }
+
+  function init() { }
+
+  // 暴露给父组件的方法
+  defineExpose({
+    open,
+  });
+  init();
+</script>
+
+<style scoped>
+  ::v-deep .el-dialog .el-dialog-body {
+    height: 800px;
+    overflow-y: auto;
+  }
+
+  .pagination-container {
+    background: #fff;
+  }
+</style>

+ 73 - 55
src/views/business/socialSecurity/declare/view.vue

@@ -72,9 +72,14 @@
                 <div v-else>{{ rowNum(form.injuryRadio) + "%"}}</div>
               </el-form-item>
             </el-col>
+            <el-col :span="12" style="text-align: right;">
+              <el-button size="small" type="success" @click="getHistory">历史记录</el-button>
+            </el-col>
             <el-col :span="24">
-              <div style="display: flex; justify-content: flex-end;margin-bottom: 10px;" v-hasPermi="['business:socialSecurityDeclare:exportDetail']">
-                <el-button type="primary" @click="exportExcel" v-if="tableData!= null && tableData.length > 0" >导出明细表</el-button>
+              <div style="display: flex; justify-content: flex-end;margin-bottom: 10px;margin-top: 10px;"
+                v-hasPermi="['business:socialSecurityDeclare:exportDetail']">
+                <el-button type="primary" @click="exportExcel"
+                  v-if="tableData!= null && tableData.length > 0">导出明细表</el-button>
               </div>
             </el-col>
             <el-table :data="tableData" style="width: 100%" show-summary :summary-method="getSummaries">
@@ -278,8 +283,8 @@
             </el-col>
             <el-col :span="24">
               <el-form-item label="凭证" required>
-                <img  style="height: 148px; width: 148px" :src="`${baseUrl}/${form.evidenceFile}`"
-                class="avatar" @click="openEvidience()" />
+                <img style="height: 148px; width: 148px" :src="`${baseUrl}/${form.evidenceFile}`" class="avatar"
+                  @click="openEvidience()" />
                 <!-- <el-upload action="#" :http-request="upload" :with-credentials="true" :show-file-list="false" multiple>
                   <el-button size="small" type="primary" icon="Upload" v-if="form.status !==3">点击上传</el-button>
                 </el-upload>
@@ -340,12 +345,15 @@
         </el-form>
       </div>
       <div class="form-btns-container" style="height: 40px">
-        <el-button size="small" v-if="form.status !== 3" icon="close" style="float: right; margin-left: 12px; margin-right: 12px" @click="close">
+        <el-button size="small" v-if="form.status !== 3" icon="close"
+          style="float: right; margin-left: 12px; margin-right: 12px" @click="close">
           取消</el-button>
-        <el-button type="primary" v-if="form.status !== 3" size="small" icon="Finished" style="float: right" @click="handleSave">
+        <el-button type="primary" v-if="form.status !== 3" size="small" icon="Finished" style="float: right"
+          @click="handleSave">
           保存</el-button>
-        <el-button v-hasPermi="['business:socialSecurityDeclare:return']" style="float: right;" v-if="!stopUseBack"  icon="back" size="small" type="warning"
-          :disabled="
+        <el-button v-hasPermi="['business:socialSecurityDeclare:return']" style="float: right;"
+          v-show="(toTenantId == form?.entrust?.toTenantId || tenantMyself.tenantId == 0)" icon="back" size="small"
+          type="warning" :disabled="
         form == null || form.status !== 3
       " @click="turnBack(form)">退回</el-button>
       </div>
@@ -353,15 +361,20 @@
     <!-- <feedback-dialog ref="feedbackDialogView" :parent="this" />
     <print-dialog ref="printDialog" :parent="this" /> -->
   </el-dialog>
+  <history ref="fromDialog" :currentMember=currentMember></history>
 </template>
 <script setup>
   import {
     getDetail,
-    saveDetail, turnBackDetail,getTableDetail, exportDetail
+    saveDetail, turnBackDetail, getTableDetail, exportDetail
   } from "@/api/business/production/socialSecurityDeclare";
   import { uploadFile } from "@/api/tool/file";
   import { ref } from "vue";
   import { rowNum } from "@/utils/index";
+  import { getTenant } from "@/utils/auth";
+  import useUserStore from "@/store/modules/user";
+  import history from "./history";
+  const tenantMyself = useUserStore().user;
   const { proxy } = getCurrentInstance();
   const visible = ref(false);
   const tableData = ref([]);
@@ -369,11 +382,12 @@
   const stopUseBack = ref(false);
   const selections = ref([]);
   const currentSource = ref(null);
+  const toTenantId = ref([])
   const editStatus = ref(false);
   const canSave = ref(false);
   const loading = ref(false);
   const currentMonth = ref(
-   
+
   );
   const baseUrl = ref(import.meta.env.VITE_APP_BASE_API);
   const props = defineProps({
@@ -407,7 +421,8 @@
 
   function open(detail) {
     visible.value = true;
-   console.log(12,detail.month);
+    console.log(12, detail.month);
+    toTenantId.value = getTenant()
     // currentMonth.value = proxy.moment().format("YYYY-MM-01")
     currentMonth.value = detail.year + "-" + detail.month + "-01"
     form.value = detail;
@@ -418,11 +433,11 @@
     loading.value = true;
     form.value.year = proxy.moment(currentMonth.value).format("YYYY");
     form.value.month = proxy.moment(currentMonth.value).format("MM");
-    const { year, month, socialSecurityDeclareId, companyId,injuryRadio } = form.value
-    const clearForm = { year, month, socialSecurityDeclareId, companyId ,injuryRadio}
+    const { year, month, socialSecurityDeclareId, companyId, injuryRadio } = form.value
+    const clearForm = { year, month, socialSecurityDeclareId, companyId, injuryRadio }
     getDetail(clearForm).then((res) => {
       form.value = { ...proxy.deepClone(emptyForm), ...res.data };
-      form.value.evidenceFile =  form.value.evidenceFiles[0].fileUrl;
+      form.value.evidenceFile = form.value.evidenceFiles[0].fileUrl;
       getTableDetail(clearForm).then((res) => {
         tableData.value = res.data;
         if (form.value.unitPension === undefined || form.value.unitPension == 0) {
@@ -529,7 +544,7 @@
         amountChangeHandler();
       });
     }).finally(() => {
-        loading.value = false;
+      loading.value = false;
     });
   }
 
@@ -562,6 +577,9 @@
   function handleCurrentChange(row) {
     currentSource.value = row;
   }
+  function getHistory() {
+    proxy.$refs.fromDialog.open(form.value.companyId);
+  }
   function exportExcel() {
     let data = {
       "companyId": form.value.companyId,
@@ -665,48 +683,48 @@
   }
   const getSummaries = (param) => {
 
-const { columns, data } = param;
-const sums = [];
-columns.forEach((column, index) => {
-  if (index === 0) {
-    sums[index] = '合计';
-    return;
-  }
-  if (index === 1) {
-    return;
-  }
+    const { columns, data } = param;
+    const sums = [];
+    columns.forEach((column, index) => {
+      if (index === 0) {
+        sums[index] = '合计';
+        return;
+      }
+      if (index === 1) {
+        return;
+      }
 
-  const values = data.map(item => Number(item[column.property]));
-  // if (column.property === 'companyAmount') {
-  //   if (form.value.unitAmount) {
-  //     sums[index] = form.value.unitAmount
-  //     return
-  //   }
-  // } else if (column.property === 'oneSelfAmount') {
-  //   if (form.value.unitAmount) {
-  //     sums[index] = form.value.individualAmount
-  //     return
-  //   }
-  // }
-  // else if (column.property === 'totalAmount') {
-  //   if (form.value.unitAmount && form.value.individualAmount) {
-  //     sums[index] = form.value.individualAmount + form.value.unitAmount
-  //     return
-  //   }
-  // }
-
-  sums[index] = values.reduce((prev, curr) => {
-    const value = Number(curr);
-    if (!isNaN(value)) {
-      return prev + curr;
-    } else {
-      return prev;
-    }
-  }, 0).toFixed(2);
-});
+      const values = data.map(item => Number(item[column.property]));
+      // if (column.property === 'companyAmount') {
+      //   if (form.value.unitAmount) {
+      //     sums[index] = form.value.unitAmount
+      //     return
+      //   }
+      // } else if (column.property === 'oneSelfAmount') {
+      //   if (form.value.unitAmount) {
+      //     sums[index] = form.value.individualAmount
+      //     return
+      //   }
+      // }
+      // else if (column.property === 'totalAmount') {
+      //   if (form.value.unitAmount && form.value.individualAmount) {
+      //     sums[index] = form.value.individualAmount + form.value.unitAmount
+      //     return
+      //   }
+      // }
+
+      sums[index] = values.reduce((prev, curr) => {
+        const value = Number(curr);
+        if (!isNaN(value)) {
+          return prev + curr;
+        } else {
+          return prev;
+        }
+      }, 0).toFixed(2);
+    });
 
-return sums
-}
+    return sums
+  }
   function passwordCheck(value) {
     const pattern = /^[A-Za-z0-9~!@#$%^&*()_+-=]*$/;
     if (!pattern.test(value)) {