From 0d85df4a7ef4d4692d58325b6c6785fe28a5a732 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 25 二月 2025 14:23:27 +0800
Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/lims-ruoyi-before into dev

---
 src/views/CNAS/resourceDemand/standardMaterial/index.vue |  290 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 290 insertions(+), 0 deletions(-)

diff --git a/src/views/CNAS/resourceDemand/standardMaterial/index.vue b/src/views/CNAS/resourceDemand/standardMaterial/index.vue
new file mode 100644
index 0000000..e75f44f
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/standardMaterial/index.vue
@@ -0,0 +1,290 @@
+<template>
+  <div class="capacity-scope">
+    <div class="search">
+      <div>
+        <el-form :model="searchForm" ref="searchForm" size="small" :inline="true">
+          <el-form-item label="鏍囧噯鐗╄川鍚嶇О" prop="name">
+            <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="searchForm.name"
+                      @keyup.enter.native="searchList"></el-input>
+          </el-form-item>
+          <el-form-item label="鐢熶骇鍘傚" prop="factoryManufacturer">
+            <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="searchForm.factoryManufacturer"
+                      @keyup.enter.native="searchList"></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" icon="el-icon-search" size="mini" @click="searchList">鏌� 璇�</el-button>
+            <el-button icon="el-icon-refresh" size="mini" @click="resetSearchForm">閲� 缃�</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+      <div>
+        <el-button size="medium" @click="exportFun">瀵� 鍑�</el-button>
+        <el-button size="medium" type="primary" @click="openFormDia('add')">鏂� 澧�</el-button>
+      </div>
+    </div>
+    <div class="table">
+      <lims-table :tableData="tableData" :column="tableColumn" :height="'calc(100vh - 250px)'" @pagination="pagination"
+                  :page="page" :tableLoading="tableLoading"></lims-table>
+    </div>
+    <form-dia v-if="formDia" ref="formDia" @closeYearDia="closeYearDia"></form-dia>
+    <borrow-dia v-if="borrowDia" ref="borrowDia" @closeYearDia="closeBorrowDia"></borrow-dia>
+    <return-dia v-if="returnDia" ref="returnDia" @closeYearDia="closeReturnDia"></return-dia>
+  </div>
+
+</template>
+
+<script>
+
+// import FormDia from '../do/a6-standard-material-list/formDia.vue';
+// import BorrowDia from '../do/a6-standard-material-list/borrowDia.vue';
+// import ReturnDia from '../do/a6-standard-material-list/returnDia.vue';
+import limsTable from '@/components/Table/lims-table.vue'
+import {
+  getPageStandardSubstance,
+  removeStandardSubstance,
+  exportOfStandardSubstanceList
+} from '@/api/cnas/resourceDemand/standardMaterial/standardMaterial'
+import FormDia from '../standardMaterial/component/formDia.vue';
+import BorrowDia from '../standardMaterial/component/borrowDia.vue';
+import ReturnDia from '../standardMaterial/component/returnDia.vue';
+export default {
+  components: {
+    limsTable,
+    FormDia,
+    BorrowDia,
+    ReturnDia
+  },
+  data() {
+    return {
+      searchForm: {
+        name: '',
+        factoryManufacturer: '',
+      },
+      tableColumn: [
+        {
+          label: '鏍囧噯鐗╄川鍚嶇О',
+          prop: 'name',
+          minWidth: '120'
+        },
+        {
+          label: '瑙勬牸鍨嬪彿',
+          prop: 'model',
+          minWidth: '100'
+        },
+        {
+          label: '鐢熶骇鍘傚',
+          prop: 'factoryManufacturer',
+          minWidth: '100'
+        },
+        {
+          label: '鍑哄巶缂栧彿',
+          prop: 'factoryNum',
+          minWidth: '100'
+        },
+        {
+          label: '绠$悊缂栧彿',
+          prop: 'manageNum',
+          minWidth: '100'
+        },
+        {
+          label: '涓嶇‘瀹氬害',
+          prop: 'uncertainty',
+          minWidth: '100'
+        },
+        {
+          label: '鏁伴噺',
+          prop: 'quantity',
+          minWidth: '100'
+        },
+        {
+          label: '璐疆鏃ユ湡',
+          prop: 'acquisitionDate',
+          minWidth: '150'
+        },
+        {
+          label: '鏈夋晥鏈�',
+          prop: 'effectiveDate',
+          minWidth: '150'
+        },
+        {
+          label: '妗f缂栧彿',
+          prop: 'fileNum',
+          minWidth: '100'
+        },
+        {
+          label: '瀛樻斁浣嶇疆',
+          prop: 'position',
+          minWidth: '100'
+        },
+        {
+          label: '澶囨敞',
+          prop: 'remark',
+          minWidth: '100'
+        },
+        // {
+        //   label: '鍒涘缓浜�',
+        //   prop: 'createUser',
+        //   minWidth: '100'
+        // },
+        {
+          label: '鍒涘缓鏃堕棿',
+          prop: 'createTime',
+          minWidth: '150'
+        },
+        {
+          dataType: 'action',
+          fixed: 'right',
+          minWidth: '180',
+          label: '鎿嶄綔',
+          operation: [
+            {
+              name: '缂栬緫',
+              type: 'text',
+              clickFun: (row) => {
+                this.openFormDia('edit', row);
+              },
+            },
+            {
+              name: '鍊熺敤',
+              type: 'text',
+              clickFun: (row) => {
+                this.borrow(row);
+              },
+            },
+            {
+              name: '褰掕繕',
+              type: 'text',
+              clickFun: (row) => {
+                this.return(row);
+              }
+            },
+            {
+              name: '鍒犻櫎',
+              type: 'text',
+              color: '#f56c6c',
+              clickFun: (row) => {
+                this.delPlan(row)
+              },
+            }
+          ]
+        }
+      ],
+      tableData: [],
+      tableLoading: false,
+      page: {
+        total: 0,
+        size: 10,
+        current: 1
+      },
+      total: 0,
+      formDia: false,
+      borrowDia: false,
+      returnDia: false,
+    }
+  },
+  mounted() {
+    this.searchList()
+  },
+  methods :{
+    exportFun() {
+      this.outLoading = true
+      exportOfStandardSubstanceList(this.searchForm).then(res =>{
+        this.outLoading = false
+        const blob = new Blob([res], {type: 'application/octet-stream'},false);
+        this.$download.saveAs(blob, '鏍囧噯鐗╄川娓呭崟.xlsx')
+        this.$message.success('瀵煎嚭鎴愬姛')
+      })
+    },
+    // 鏌ヨ鍒楄〃
+    searchList () {
+      this.tableLoading = true
+      getPageStandardSubstance({
+        ...this.page,
+        ...this.searchForm
+      }).then(res => {
+        this.tableLoading = false
+        if (res.code === 200){
+          this.tableData = res.data.records
+          this.page.total = res.data.total
+        }
+      })
+    },
+    // 鍒犻櫎
+    delPlan (row) {
+      this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        this.tableLoading = true
+        removeStandardSubstance({id:row.id}).then(res => {
+          this.tableLoading = false
+          if (res.code === 200) {
+            this.$message.success('鍒犻櫎鎴愬姛')
+            this.searchList()
+          }
+        }).catch(err => {
+          this.tableLoading = false
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '宸插彇娑堝垹闄�'
+        });
+      });
+    },
+    // 鏂板锛岀紪杈戯紝鎵瑰噯寮规
+    openFormDia (type, row) {
+      this.formDia = true
+      this.$nextTick(() => {
+        this.$refs.formDia.openDia(type, row)
+      })
+    },
+    closeYearDia () {
+      this.formDia = false
+      this.searchList()
+    },
+    // 鍊熺敤
+    borrow (row) {
+      this.borrowDia = true
+      this.$nextTick(() => {
+        this.$refs.borrowDia.openDia(row)
+      })
+    },
+    closeBorrowDia () {
+      this.borrowDia = false
+      this.searchList()
+    },
+    // 褰掕繕
+    return (row) {
+      this.returnDia = true
+      this.$nextTick(() => {
+        this.$refs.returnDia.openDia(row)
+      })
+    },
+    closeReturnDia () {
+      this.returnDia = false
+      this.searchList()
+    },
+    // 閲嶇疆鏌ヨ鏉′欢
+    resetSearchForm () {
+      this.searchForm.name = '';
+      this.searchForm.factoryManufacturer = '';
+      this.searchList()
+    },
+    // 鍒嗛〉鍒囨崲
+    pagination(page) {
+      this.page.size = page.limit
+      this.searchList();
+    },
+    // 鍒嗛〉
+  }
+}
+</script>
+<style scoped>
+.search {
+  height: 46px;
+  display: flex;
+  justify-content: space-between;
+}
+</style>

--
Gitblit v1.9.3