From c3e07f7d3f7311fa6e0eb45aa30f2d66df22a6c7 Mon Sep 17 00:00:00 2001
From: zhanghl <253316343@qq.com>
Date: 星期一, 21 四月 2025 13:42:38 +0800
Subject: [PATCH] 工序异常分析-查询页面
---
src/views/mainPlan/abnormalProcessAnalysis/index.vue | 175 +++++++++++++++++++++++++++++++++++++++++++
src/api/mainPlan/abnormalProcessAnalysis.js | 44 +++++++++++
2 files changed, 219 insertions(+), 0 deletions(-)
diff --git a/src/api/mainPlan/abnormalProcessAnalysis.js b/src/api/mainPlan/abnormalProcessAnalysis.js
new file mode 100644
index 0000000..568f05e
--- /dev/null
+++ b/src/api/mainPlan/abnormalProcessAnalysis.js
@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 鏌ヨ宸ュ簭寮傚父鍒嗘瀽鍒楄〃
+export function list(query) {
+ return request({
+ url: '/aps/abnormalProcessAnalysis/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 鏌ヨ宸ュ簭寮傚父鍒嗘瀽璇︾粏
+export function get(id) {
+ return request({
+ url: '/aps/abnormalProcessAnalysis/' + id,
+ method: 'get'
+ })
+}
+
+// 鏂板宸ュ簭寮傚父鍒嗘瀽
+export function add(data) {
+ return request({
+ url: '/aps/abnormalProcessAnalysis/generator',
+ method: 'post',
+ data: data
+ })
+}
+
+// 淇敼宸ュ簭寮傚父鍒嗘瀽
+export function update(data) {
+ return request({
+ url: '/aps/abnormalProcessAnalysis/',
+ method: 'put',
+ data: data
+ })
+}
+
+// 鍒犻櫎宸ュ簭寮傚父鍒嗘瀽
+export function del(id) {
+ return request({
+ url: '/aps/abnormalProcessAnalysis/' + id,
+ method: 'delete'
+ })
+}
diff --git a/src/views/mainPlan/abnormalProcessAnalysis/index.vue b/src/views/mainPlan/abnormalProcessAnalysis/index.vue
new file mode 100644
index 0000000..2840c78
--- /dev/null
+++ b/src/views/mainPlan/abnormalProcessAnalysis/index.vue
@@ -0,0 +1,175 @@
+<template>
+ <div class="app-container">
+ <el-row :gutter="10" class="mb8">
+ <el-col :span="1.5">
+ <el-button
+ type="warning"
+ plain
+ icon="Download"
+ @click="handleExport"
+ v-hasPermi="['abnormalAnalysis:export']"
+ >瀵煎嚭</el-button>
+ </el-col>
+ <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
+ </el-row>
+ <HxlhTable
+ style="width: 100%"
+ :columns="columns"
+ :data="dataList"
+ :loading="loading"
+ :height="height" ></HxlhTable>
+
+ </div>
+</template>
+
+<script setup name="ApsAbnormalProcessAnalysis">
+import { list } from "@/api/mainPlan/abnormalProcessAnalysis";
+import HxlhTable from '@/components/HxlhTable/index.vue'
+import { ref } from "vue";
+import { getToken } from "@/utils/auth.js";
+import { ElMessage} from "element-plus";
+
+const { proxy } = getCurrentInstance();
+
+const dataList = ref([]);
+const open = ref(false);
+const loading = ref(true);
+const showSearch = ref(true);
+const ids = ref([]);
+const single = ref(true);
+const multiple = ref(true);
+const total = ref(0);
+const title = ref("");
+const height = ref(document.documentElement.clientHeight - 270 + "px;")
+
+const data = reactive({
+ form: {},
+ queryParams: {
+ pageNum: 1,
+ pageSize: 10,
+ processName: null,
+ source: null,
+ summary: null,
+ },
+ rules: {
+ }
+});
+
+const { queryParams, form, rules } = toRefs(data);
+const columns = ref([
+ { type: 'seq', title: '搴忓彿', width: 60 },
+ { title: '宸ュ簭鍚嶇О', field: 'processName', width: 200},
+ { title: '寮傚父鏉ユ簮', field: 'source', width: 200},
+ { title: '寮傚父鎻忚堪', field: 'summary', width: 200},
+ { title: '鍒涘缓鏃堕棿', field: 'createTime', width: 200},
+])
+
+/** 鏌ヨ宸ュ簭寮傚父鍒嗘瀽鍒楄〃 */
+function getList() {
+ loading.value = true;
+ list(queryParams.value).then(response => {
+ dataList.value = response.rows;
+ total.value = response.total;
+ loading.value = false;
+ });
+}
+
+
+/** 鎼滅储鎸夐挳鎿嶄綔 */
+function handleQuery() {
+ queryParams.value.pageNum = 1;
+ getList();
+}
+
+/** 閲嶇疆鎸夐挳鎿嶄綔 */
+function resetQuery() {
+ proxy.resetForm("queryRef");
+ handleQuery();
+}
+/** 瀵煎嚭鎸夐挳鎿嶄綔 */
+function handleExport() {
+ proxy.download('aps/abnormalProcessAnalysis/export', {
+ ...queryParams.value
+ }, `AbnormalProcessAnalysis_${new Date().getTime()}.xlsx`)
+}
+
+// 澶氶�夋閫変腑鏁版嵁
+function handleSelectionChange(selection) {
+ ids.value = selection.map(item => item.id);
+ single.value = selection.length != 1;
+ multiple.value = !selection.length;
+}
+
+/** 鏂板鎸夐挳鎿嶄綔 */
+function handleAdd() {
+ reset();
+ open.value = true;
+ title.value = "娣诲姞宸ュ簭寮傚父鍒嗘瀽";
+}
+
+/** 淇敼鎸夐挳鎿嶄綔 */
+function handleUpdate(row) {
+ reset();
+ const _id = row.id || ids.value
+ getApsAbnormalProcessAnalysis(_id).then(response => {
+ form.value = response.data;
+ open.value = true;
+ title.value = "淇敼宸ュ簭寮傚父鍒嗘瀽";
+ });
+}
+
+/** 鎻愪氦鎸夐挳 */
+function submitForm() {
+ proxy.$refs["ApsAbnormalProcessAnalysisRef"].validate(valid => {
+ if (valid) {
+ if (form.value.id != null) {
+ updateApsAbnormalProcessAnalysis(form.value).then(response => {
+ proxy.$modal.msgSuccess("淇敼鎴愬姛");
+ open.value = false;
+ getList();
+ });
+ } else {
+ addApsAbnormalProcessAnalysis(form.value).then(response => {
+ proxy.$modal.msgSuccess("鏂板鎴愬姛");
+ open.value = false;
+ getList();
+ });
+ }
+ }
+ });
+}
+
+/** 鍒犻櫎鎸夐挳鎿嶄綔 */
+function handleDelete(row) {
+ const _ids = row.id || ids.value;
+ proxy.$modal.confirm('鏄惁纭鍒犻櫎宸ュ簭寮傚父鍒嗘瀽缂栧彿涓�"' + _ids + '"鐨勬暟鎹」锛�').then(function() {
+ return delApsAbnormalProcessAnalysis(_ids);
+ }).then(() => {
+ getList();
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ }).catch(() => {});
+}
+
+
+// 鍙栨秷鎸夐挳
+function cancel() {
+ open.value = false;
+ reset();
+}
+
+// 琛ㄥ崟閲嶇疆
+function reset() {
+ form.value = {
+ id: null,
+ processName: null,
+ source: null,
+ summary: null,
+ createTime: null,
+ delFlag: null,
+ createBy: null
+ };
+ proxy.resetForm("ApsAbnormalProcessAnalysisRef");
+}
+
+getList();
+</script>
--
Gitblit v1.9.3