BUG 优化

dev
xiepeng 2024-04-25 18:01:55 +08:00
parent d291a9b98e
commit 9a445bc29b
2 changed files with 37 additions and 28 deletions

View File

@ -409,7 +409,7 @@ const fnGetData = async () => {
data.form.DISPATCHER = data.form.DISPATCHER.split(","); data.form.DISPATCHER = data.form.DISPATCHER.split(",");
data.form.SHIPPINGADDRESS = data.form.SHIPPING_ADDR; // data.form.SHIPPINGADDRESS = data.form.SHIPPING_ADDR; //
data.form.DESTINATIONADDRESS = data.form.DESTINATION_ADDR; // data.form.DESTINATIONADDRESS = data.form.DESTINATION_ADDR; //
data.userList = data.form.names; // | data.userList = data.form.deptList; //
data.form.CLIENTCONTACTPHONE = data.form.ENTRUST_PHONE; data.form.CLIENTCONTACTPHONE = data.form.ENTRUST_PHONE;
data.form.CONFIRMINGPHONE = data.form.CONFIRM_PHONE; data.form.CONFIRMINGPHONE = data.form.CONFIRM_PHONE;
data.form.STARTADMINISTRATIVEAREA = data.form.DEPARTURE_ADDR; data.form.STARTADMINISTRATIVEAREA = data.form.DEPARTURE_ADDR;
@ -624,6 +624,7 @@ const fnDepartmentChange = async () => {
}; };
const fnGetUser = async (DEPARTMENT_ID) => { const fnGetUser = async (DEPARTMENT_ID) => {
const resData = await getUserListAll({ DEPARTMENT_ID }); const resData = await getUserListAll({ DEPARTMENT_ID });
console.log(resData);
data.userList = resData.userList; data.userList = resData.userList;
}; };

View File

@ -29,7 +29,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item class="end"> <el-form-item class="end">
<el-button v-print="'#printContent'"> </el-button> <el-button v-print="'#printContent'"> </el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -81,29 +81,29 @@
<div id="printContent"> <div id="printContent">
<table class="print_use"> <table class="print_use">
<thead> <thead>
<tr> <tr>
<th rowspan="2" style="width: 55px">日期</th> <th rowspan="2" style="width: 55px">日期</th>
<th rowspan="2" style="width: 70px">预提额</th> <th rowspan="2" style="width: 70px">预提额</th>
<th rowspan="2" style="width: 85px">用途摘要</th> <th rowspan="2" style="width: 85px">用途摘要</th>
<th colspan="10" class="tc">费用项目</th> <th colspan="10" class="tc">费用项目</th>
<th rowspan="2" style="width: 55px">余额</th> <th rowspan="2" style="width: 55px">余额</th>
</tr> </tr>
<tr> <tr>
<th v-for="(item, index) in costItems" :key="index"> <th v-for="(item, index) in costItems" :key="index">
{{ item }} {{ item }}
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(item, index) in list" :key="index"> <tr v-for="(item, index) in list" :key="index">
<td>{{ item.USE_DATE }}</td> <td>{{ item.USE_DATE }}</td>
<td>{{ item.USE_TYPE === "1" ? item.AMOUNT : "" }}</td> <td>{{ item.USE_TYPE === "1" ? item.AMOUNT : "" }}</td>
<td>{{ item.USE_TYPE === "2" ? item.PURPOSESUMMARY : "" }}</td> <td>{{ item.USE_TYPE === "2" ? item.PURPOSESUMMARY : "" }}</td>
<td v-for="(item1, index1) in costItems" :key="index1"> <td v-for="(item1, index1) in costItems" :key="index1">
{{ item.TYPE === item1 ? item.AMOUNT : "" }} {{ item.TYPE === item1 ? item.AMOUNT : "" }}
</td> </td>
<td>{{ item.TOTAL }}</td> <td>{{ item.TOTAL }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div v-html="PRINT_STYLE" /> <div v-html="PRINT_STYLE" />
@ -121,7 +121,7 @@
import useListData from "@/assets/js/useListData.js"; import useListData from "@/assets/js/useListData.js";
import { import {
getExtractionAndUseList, getExtractionAndUseList,
setExtractionAndUseBatchDelete, setExtractionAndUseBatchDelete
} from "@/request/security_investment.js"; } from "@/request/security_investment.js";
import { debounce } from "throttle-debounce"; import { debounce } from "throttle-debounce";
import { ElMessage, ElMessageBox } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
@ -147,15 +147,17 @@ const costItems = [
"应急管理、事故救援演练以及救援队伍建设", "应急管理、事故救援演练以及救援队伍建设",
"安全标志及标识", "安全标志及标识",
"配备劳动防护用品", "配备劳动防护用品",
"其它与安全生产直接相关的物品或者活动", "其它与安全生产直接相关的物品或者活动"
]; ];
const total = await getExtractionAndUseList();
console.log(total);
const addDialogVisible = ref(false); const addDialogVisible = ref(false);
const { list, searchForm, fnGetData, tableRef } = useListData( const { list, searchForm, fnGetData, tableRef } = useListData(
getExtractionAndUseList, getExtractionAndUseList,
{ {
usePagination: false, usePagination: false,
defaultSearchForm: { defaultSearchForm: {
YEAR: new Date().getFullYear(), YEAR: new Date().getFullYear()
}, },
callbackFn: (list) => { callbackFn: (list) => {
for (let i = 0; i < list.length; i++) { for (let i = 0; i < list.length; i++) {
@ -168,7 +170,7 @@ const { list, searchForm, fnGetData, tableRef } = useListData(
else list[i].TOTAL = list[i - 1].TOTAL - list[i].AMOUNT; else list[i].TOTAL = list[i - 1].TOTAL - list[i].AMOUNT;
} }
} }
}, }
} }
); );
const fnGetSummaries = ({ columns, data }) => { const fnGetSummaries = ({ columns, data }) => {
@ -178,6 +180,13 @@ const fnGetSummaries = ({ columns, data }) => {
sums[index] = "合计"; sums[index] = "合计";
return; return;
} }
// var arr = ref([5, 6, 7, 8, 9, 10, 11, 12, 13, 14])
// if (arr.includes(index)) {
// sums[index] = total.allOutlayTotalList[index - 5].total;
// return;
// }
if (index !== columns.length - 1) { if (index !== columns.length - 1) {
sums[index] = "--"; sums[index] = "--";
return; return;
@ -212,7 +221,6 @@ const fnDelete = debounce(
await setExtractionAndUseBatchDelete({ DATA_IDS }); await setExtractionAndUseBatchDelete({ DATA_IDS });
ElMessage.success("删除成功"); ElMessage.success("删除成功");
fnGetData(); fnGetData();
}, },
{ atBegin: true } { atBegin: true }
); );