|
@@ -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)) {
|