From 42f135086753fc6784e1b4894a4fcc6164a06669 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期三, 05 三月 2025 11:20:26 +0800
Subject: [PATCH] Merge branch 'refs/heads/dev'
---
src/views/CNAS/process/nonconformingWork/nonconformingDistribution/index.vue | 237 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 237 insertions(+), 0 deletions(-)
diff --git a/src/views/CNAS/process/nonconformingWork/nonconformingDistribution/index.vue b/src/views/CNAS/process/nonconformingWork/nonconformingDistribution/index.vue
new file mode 100644
index 0000000..8a39ebc
--- /dev/null
+++ b/src/views/CNAS/process/nonconformingWork/nonconformingDistribution/index.vue
@@ -0,0 +1,237 @@
+<template>
+ <div>
+ <div>
+ <!-- <div class="view-title">
+ <span>涓嶇鍚堥」鐨勫垎甯�</span>
+ <span>
+ <el-button size="medium" type="primary" @click="openFormDia('add')">鏂� 澧�</el-button>
+ </span>
+ </div> -->
+ <div class="search-background">
+ <span class="search-group">
+ <span style="width: 120px">骞翠唤锛�</span>
+ <el-input v-model="searchForm.distributionYear" clearable size="small"></el-input>
+ </span>
+ <span class="search-group">
+ <el-button size="medium" @click="resetSearchForm">閲� 缃�</el-button>
+ <el-button size="medium" type="primary" @click="searchList">鏌� 璇�</el-button>
+ </span>
+ <div class="btn">
+ <el-button size="medium" type="primary" @click="openFormDia('add')">鏂� 澧�</el-button>
+ </div>
+ </div>
+ <div class="table">
+ <div>
+ <TableCard :showForm="false" :showTitle="false">
+ <template v-slot:table>
+ <limsTable :column="tableColumn" :height="'calc(100vh - 19em)'" :table-data="tableData"
+ :table-loading="tableLoading" style="padding: 0 15px;margin-bottom: 16px" :page="page"
+ @pagination="pagination">
+ </limsTable>
+ </template>
+ </TableCard>
+ </div>
+ </div>
+ </div>
+ <form-dia v-if="formDia" ref="formDia" @closeDia="closeDia"></form-dia>
+ </div>
+</template>
+
+<script>
+import limsTable from "@/components/Table/lims-table.vue";
+import TableCard from '@/components/TableCard/index.vue';
+import FormDia from './components/formDia.vue';
+import {
+ pageInconsistentDistribution,
+ delInconsistentDistribution,
+ exportInconsistentDistribution,
+} from '@/api/cnas/process/nonconformingWork.js'
+
+export default {
+ name: 'a7-distribution-of-nonconforming',
+ // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+ components: { FormDia, TableCard, limsTable },
+ data() {
+ // 杩欓噷瀛樻斁鏁版嵁
+ return {
+ searchForm: {
+ distributionYear: '',
+ },
+ tableColumn: [
+ {
+ label: '骞翠唤',
+ prop: 'distributionYear',
+ minWidth: '100'
+ },
+ {
+ label: '鍒涘缓浜�',
+ prop: 'createUserName',
+ minWidth: '100'
+ },
+ {
+ label: '鍒涘缓鏃堕棿',
+ prop: 'createTime',
+ minWidth: '100'
+ },
+ {
+ label: '淇敼浜�',
+ prop: 'updateUserName',
+ minWidth: '100'
+ },
+ {
+ label: '淇敼鏃堕棿',
+ prop: 'updateTime',
+ minWidth: '100'
+ },
+ {
+ dataType: 'action',
+ minWidth: '220',
+ label: '鎿嶄綔',
+ operation: [
+ {
+ name: '缂栬緫',
+ type: 'text',
+ clickFun: (row) => {
+ this.openFormDia('edit', row);
+ },
+ },
+ {
+ name: '瀵煎嚭',
+ type: 'text',
+ clickFun: (row) => {
+ this.handleDown(row)
+ }
+ },
+ {
+ name: '鍒犻櫎',
+ type: 'text',
+ color: '#f56c6c',
+ clickFun: (row) => {
+ this.delPlan(row)
+ },
+ }
+ ]
+ }
+ ],
+ tableData: [],
+ tableLoading: false,
+ page: {
+ size: 20,
+ current: 1,
+ total: 0,
+ },
+ formDia: false,
+ };
+ },
+ mounted() {
+ this.searchList()
+ },
+ // 鏂规硶闆嗗悎
+ methods: {
+ // 鏌ヨ鍒楄〃
+ searchList() {
+ const entity = this.searchForm
+ const page = this.page
+ this.tableLoading = true
+ pageInconsistentDistribution({ ...entity, ...page }).then(res => {
+ this.tableLoading = false
+ if (res.code === 201) return
+ this.tableData = res.data.records
+ this.page.total = res.data.total
+ }).catch(err => {
+ console.log('err---', err);
+ this.tableLoading = false
+ })
+ },
+ // 鍒犻櫎
+ delPlan(row) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ this.tableLoading = true
+ delInconsistentDistribution({ distributionId: row.distributionId }).then(res => {
+ this.tableLoading = false
+ if (res.code === 201) return
+ this.$message.success('鍒犻櫎鎴愬姛')
+ this.searchList()
+ }).catch(err => {
+ this.tableLoading = false
+ console.log('err---', err);
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
+ },
+ // 鏂板锛岀紪杈戯紝鎵瑰噯寮规
+ openFormDia(type, row) {
+ this.formDia = true
+ this.$nextTick(() => {
+ this.$refs.formDia.openDia(type, row)
+ })
+ },
+ // 瀵煎嚭
+ handleDown(row) {
+ exportInconsistentDistribution({ distributionId: row.distributionId }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/msword' });
+ this.$download.saveAs(blob, '涓嶇鍚堥」鐨勫垎甯�' + '.docx');
+ })
+ },
+ closeDia() {
+ this.formDia = false
+ this.searchList()
+ },
+ // 閲嶇疆鏌ヨ鏉′欢
+ resetSearchForm() {
+ this.searchForm.distributionYear = '';
+ this.searchList()
+ },
+ // 鍒嗛〉
+ pagination({ page, limit }) {
+ this.page.current = page;
+ this.page.size = limit;
+ this.searchList();
+ },
+ }
+};
+</script>
+
+<style scoped>
+.view-title {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ height: 60px;
+ padding-left: 20px;
+}
+
+.search-background {
+ width: 100%;
+ height: 80px;
+ line-height: 80px;
+ background-color: #ffffff;
+ display: flex;
+ position: relative;
+}
+
+.search-group {
+ display: flex;
+ align-items: center;
+ margin: 0 20px;
+}
+
+.table {
+ background-color: #ffffff;
+}
+
+.btn {
+ position: absolute;
+ right: 20px;
+ top: 16px;
+}
+</style>
--
Gitblit v1.9.3