Compare commits

..

2 Commits

Author SHA1 Message Date
xiepeng 1306882ed0 Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
#	src/views/enterprise_management/basics_info_management/operation_vehicle/index.vue
#	src/views/mechanical_files/inspect_annually/index.vue
2024-04-01 10:44:15 +08:00
xiepeng 3de96ec2c2 BUG 优化 2024-04-01 10:37:47 +08:00
2 changed files with 67 additions and 12 deletions

View File

@ -69,7 +69,7 @@
</el-select>
</el-form-item>
</el-col>-->
<el-col :span="10">
<el-col :span="12">
<el-form-item label-width="10px">
<el-button type="primary" native-type="submit">搜索</el-button>
<el-button native-type="reset" @click="fnResetPaginationTransfer"
@ -77,9 +77,12 @@
>
</el-form-item>
</el-col>
<el-col :span="30">
<el-col :span="6">
<el-form-item label-width="10px" class="end">
<el-button @click="fnExport"></el-button>
<el-button type="primary" @click="fnImportDialogChangeShow">
导入
</el-button>
<el-button type="primary" @click="fnExport"></el-button>
</el-form-item>
</el-col>
</el-row>
@ -170,6 +173,11 @@
</template>
</layout-table>
</layout-card>
<layout-import-file
v-model:visible="data.importDialogVisible"
template-url="/template/truckExcelTemplate.xls"
@submit="fnSubmitImport"
/>
</div>
</template>
@ -186,8 +194,15 @@ import useButtonJurisdiction from "@/assets/js/useButtonJurisdiction.js";
import { debounce } from "throttle-debounce";
import { ElMessage, ElMessageBox } from "element-plus";
import { NETWORK_STATE } from "@/assets/js/constant.js";
import { reactive } from "vue";
import { setFreightTrailerImport } from "@/request/enterprise_management.js";
const router = useRouter();
const data = reactive({
importDialogVisible: false,
});
const { list, pagination, searchForm, fnGetData, fnResetPagination, tableRef } =
useListData(getOperationVehicleList, {});
const troubleshootingCycleList = await layoutFnGetVehicleColor();
@ -213,6 +228,23 @@ const fnDelete = debounce(
{ atBegin: true }
);
const fnImportDialogChangeShow = () => {
data.importDialogVisible = !data.importDialogVisible;
};
const fnSubmitImport = async (formData) => {
const resData = await setFreightTrailerImport(formData);
if (resData.resultStr) {
ElMessage({
dangerouslyUseHTMLString: true,
message: resData.resultStr,
type: resData.resultType,
});
}
fnImportDialogChangeShow();
fnResetPaginationTransfer();
};
const fnExport = async () => {
const selectionData = tableRef.value.getSelectionRows();
if (selectionData.length === 0) {

View File

@ -56,7 +56,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-col :span="4">
<el-form-item label="提醒状态" prop="REMINDER_STATUS">
<el-select v-model="searchForm.REMINDER_STATUS">
<el-option
@ -76,9 +76,10 @@
</el-button>
</el-form-item>
</el-col>
<el-col :span="2">
<el-col :span="4">
<el-form-item label-width="10px" class="end">
<el-button link @click="fnExport"></el-button>
<el-button type="primary" @click="fnImportDialogChangeShow"></el-button>
<el-button type="primary" @click="fnExport"></el-button>
</el-form-item>
</el-col>
</el-row>
@ -211,10 +212,10 @@
</template>
</layout-table>
</layout-card>
<export-excel
v-model:visible="data.exportExcelDialog.visible"
:search-form="searchForm"
:ids="data.exportExcelDialog.ids"
<layout-import-file
v-model:visible="data.importDialogVisible"
template-url="/template/truckExcelTemplate.xls"
@submit="fnSubmitImport"
/>
</div>
</template>
@ -229,7 +230,6 @@ import {
setInspectAnnuallyDelete,
setInspectAnnuallyEdit2,
} from "@/request/mechanical_files.js";
import ExportExcel from "./components/export_excel.vue";
import { reactive } from "vue";
import { debounce } from "throttle-debounce";
import { ElMessageBox, ElMessage } from "element-plus";
@ -238,12 +238,15 @@ import {
DUE_STATUS_LIST,
REMINDER_STATUS_LIST,
} from "@/assets/js/constant.js";
import { setFreightTrailerImport } from "@/request/enterprise_management.js";
import LayoutImportFile from "@/components/import_file/index.vue";
const router = useRouter();
const data = reactive({
exportExcelDialog: {
visible: false,
ids: [],
},
importDialogVisible: false,
});
const { list, pagination, searchForm, fnGetData, fnResetPagination, tableRef } =
useListData(getInspectAnnuallyList);
@ -306,8 +309,26 @@ const fnStatusChange = debounce(
);
const buttonJurisdiction = await useButtonJurisdiction("hidden");
const fnImportDialogChangeShow = () => {
data.importDialogVisible = !data.importDialogVisible;
};
const fnSubmitImport = async (formData) => {
const resData = await setFreightTrailerImport(formData);
if (resData.resultStr) {
ElMessage({
dangerouslyUseHTMLString: true,
message: resData.resultStr,
type: resData.resultType,
});
}
fnImportDialogChangeShow();
fnResetPaginationTransfer();
};
const fnExport = async () => {
const selectionData = tableRef.value.getSelectionRows();
console.log("selectionData",selectionData);
if (selectionData.length === 0) {
ElMessage.warning("请选择需要导出至excel报表的记录信息");
return;
@ -318,12 +339,14 @@ const fnExport = async () => {
.join(",");
window.location.href =
import.meta.env[import.meta.env.DEV ? "VITE_PROXY" : "VITE_BASE_URL"] +
"/operatingvehicles/excel?" +
"/inspectAnnually/excel?" +
"&KEYWORDS=" +
(searchForm.value.KEYWORDS || "") +
"&DATA_IDS=" +
DATA_IDS;
};
</script>
<style scoped></style>