From e5454b769d44a34af423bf87ac8a740bf8c20341 Mon Sep 17 00:00:00 2001
From: Crunchy <3114200645@qq.com>
Date: 星期二, 29 四月 2025 13:25:29 +0800
Subject: [PATCH] Merge branch 'dev' into dev_tides

---
 src/views/CNAS/process/disposal/sampleDisposal/index.vue |  564 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 564 insertions(+), 0 deletions(-)

diff --git a/src/views/CNAS/process/disposal/sampleDisposal/index.vue b/src/views/CNAS/process/disposal/sampleDisposal/index.vue
new file mode 100644
index 0000000..1cbcb06
--- /dev/null
+++ b/src/views/CNAS/process/disposal/sampleDisposal/index.vue
@@ -0,0 +1,564 @@
+<template>
+  <div class="capacity-scope">
+    <div style="display: flex;justify-content: space-between;align-items: flex-start">
+      <el-form :model="queryParams0" ref="queryParams0" size="small" :inline="true">
+        <el-form-item label="骞存湀" prop="month">
+          <el-date-picker v-model="queryParams0.month" type="month" placeholder="閫夋嫨鏈�" format="yyyy-MM"
+                          value-format="yyyy-MM" size="small" @change="refreshTable()">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" size="mini" @click="refreshTable">鏌ヨ</el-button>
+          <el-button size="mini" @click="refresh">閲嶇疆</el-button>
+        </el-form-item>
+      </el-form>
+      <el-button size="small" type="primary" @click="handleAdd0">鏂板</el-button>
+    </div>
+    <div class="table">
+      <lims-table :tableData="tableData0" :column="column0" :tableLoading="tableLoading"
+                  key="tableData0" :height="'calc(100vh - 240px)'" :page="page0" @pagination="pagination0"></lims-table>
+    </div>
+    <el-dialog title="璇︽儏" :visible.sync="editDialogVisible" width="70%">
+      <el-button size="small" type="primary" @click="handleAdd('add')" style="margin-bottom: 10px">鏂板</el-button>
+      <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading"
+                  key="tableData" :height="'calc(100vh - 290px)'">
+      </lims-table>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="editDialogVisible = false">鍙栨秷</el-button>
+      </span>
+    </el-dialog>
+    <!-- 鏂板鏍峰搧 -->
+    <el-dialog title="鏂板" :visible.sync="addDialogVisible" width="400px" @close="closeAddDialogVisible">
+      <el-form ref="addInfo" :model="addInfo" :rules="rules" label-width="120px">
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="鏍峰搧鍚嶇О" prop="sampleName">
+              <el-input size="small" placeholder="璇疯緭鍏�" clearable
+                        v-model="addInfo.sampleName"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="鏍峰搧缂栧彿" prop="sampleCode">
+              <el-input size="small" placeholder="璇疯緭鍏�" clearable
+                        v-model="addInfo.sampleCode"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="渚涙牱鍗曚綅" prop="sampleSupplier">
+              <el-select v-model="addInfo.sampleSupplier" size="small">
+                <el-option :label="item.company" :value="item.company" v-for="(item, index) in customPageList"
+                           :key="item.id"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="鏁伴噺" prop="num">
+              <el-input size="small" placeholder="璇疯緭鍏�" clearable
+                        v-model="addInfo.num"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="澶勭悊鏂瑰紡" prop="dealMethod">
+              <el-input size="small" placeholder="璇疯緭鍏�" clearable
+                        v-model="addInfo.dealMethod"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="鏃堕棿" prop="dealTime">
+              <el-date-picker v-model="addInfo.dealTime" type="date" size="small" placeholder="閫夋嫨鏃ユ湡" format="yyyy-MM-dd"
+                              value-format="yyyy-MM-dd" style="width: 100%;">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeAddDialogVisible">鍙� 娑�</el-button>
+        <el-button type="primary" @click="submitAdd" :loading="addLoading">纭� 瀹�</el-button>
+      </span>
+    </el-dialog>
+    <!-- 鏂板鍘嗗彶 -->
+    <el-dialog title="鏂板" :visible.sync="addDialogVisibleDeal" width="400px" @close="closeDiaDeal">
+      <el-form ref="addInfoDeal" :model="addInfoDeal" :rules="rulesDeal" label-width="80px">
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="鏈堜唤" prop="month">
+              <el-date-picker v-model="addInfoDeal.month" type="month" size="small" placeholder="閫夋嫨鏈堜唤" format="yyyy-MM"
+                              value-format="yyyy-MM" style="width: 100%;">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeDiaDeal">鍙� 娑�</el-button>
+        <el-button type="primary" @click="submitAddDeal" :loading="addLoading">纭� 瀹�</el-button>
+      </span>
+    </el-dialog>
+    <!-- 璇︽儏/涓嬭浇/瀹℃牳/鎵瑰噯 -->
+    <el-dialog :title="title0" :visible.sync="lookDialogVisible" width="400px" :class="{ downPdf: title0 == '涓嬭浇' }"
+      :modal="title0 != '涓嬭浇'" top="5vh">
+      <span>鏄惁閫氳繃{{title0}}锛�</span>
+      <span slot="footer" class="dialog-footer" v-if="title0 == '瀹℃牳' || title0 == '鎵瑰噯'">
+        <el-button @click="submitCheck('涓嶉�氳繃')" :loading="noCheckLoading">涓嶉�氳繃</el-button>
+        <el-button type="primary" @click="submitCheck('閫氳繃')" :loading="checkLoading">閫� 杩�</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import limsTable from "@/components/Table/lims-table.vue";
+import filePreview from "@/components/Preview/filePreview.vue";
+import { selectCustomPageList } from "@/api/system/customer";
+import {
+  doProcessDeal,
+  addProcessDeal,
+  submitProcessTotaldeal,
+  checkProcessTotaldeal,
+  ratifyProcessTotaldeal,
+  delProcessDeal,
+  pageProcessTotaldeal, getProcessDeal, addProcessTotaldeal,
+  exportProcessTotaldeal
+} from "@/api/cnas/process/sampleDisposal";
+export default {
+  name: 'SampleDisposal',
+  components: {
+    limsTable,
+    filePreview,
+  },
+  data() {
+    return {
+      title: '鏂板',
+      addDialogVisible: false,
+      addLoading: false,
+      outLoading: false,
+      editDialogVisible: false,
+      queryParams: {},
+      submitState: '',
+      lookDialogVisible: false,
+      title0: '鏌ョ湅',
+      noCheckLoading: false,
+      checkLoading: false,
+      // 鍘嗗彶鍒楄〃
+      addInfo: {},//鏂板鏍峰搧
+      addInfoDeal: {
+        month: ''
+      },//鏂板鏍峰搧
+      addDialogVisibleDeal: false,
+      rules: {
+        sampleName: [{ required: true, message: '璇峰~鍐欐牱鍝佸悕绉�', trigger: 'blur' }],
+        sampleCode: [{ required: true, message: '璇峰~鍐欐牱鍝佺紪鍙�', trigger: 'blur' }],
+        sampleSupplier: [{ required: true, message: '璇烽�夋嫨渚涙牱鍗曚綅', trigger: 'change' }],
+        num: [{ required: true, message: '璇峰~鍐欐暟閲�', trigger: 'blur' }],
+        dealMethod: [{ required: true, message: '璇峰~鍐欏鐞嗘柟寮�', trigger: 'blur' }],
+        dealTime: [{ required: true, message: '璇烽�夋嫨鏃堕棿', trigger: 'change' }],
+      },
+      rulesDeal: {
+        month: [{ required: true, message: '璇烽�夋嫨鏈堜唤', trigger: 'change' }],
+      },
+      customPageList: [],
+      currentInfo: {
+        arr: []
+      },//鏌ョ湅鐨勮鎯�
+      outPower: false,
+      addPower: false,
+      tableData: [],
+      column: [
+        { label: "鏍峰搧鍚嶇О", prop: "sampleName" },
+        { label: "鏍峰搧缂栧彿", prop: "sampleCode" },
+        { label: "渚涙牱鍗曚綅", prop: "sampleSupplier" },
+        { label: "鏁伴噺", prop: "num" },
+        { label: "澶勭悊鏂瑰紡", prop: "dealMethod" },
+        { label: "鏃堕棿", prop: "dealTime" },
+        {
+          dataType: "action",
+          label: "鎿嶄綔",
+          operation: [
+            {
+              name: "缂栬緫",
+              type: "text",
+              clickFun: (row) => {
+                this.handleAdd('edit',row);
+              },
+              disabled: (row) => {
+                return this.submitState === '宸叉彁浜�'
+              }
+            },
+            {
+              name: "鍒犻櫎",
+              type: "text",
+              clickFun: (row) => {
+                this.handleDelete(row);
+              },
+              disabled: (row) => {
+                return this.submitState === '宸叉彁浜�'
+              }
+            },
+          ],
+        },
+      ],
+      tableLoading: false,
+      queryParams0: {},
+      tableData0: [],
+      column0: [
+        { label: "鏈堜唤", prop: "month" },
+        { label: "鎻愪氦浜�", prop: "submitUserName" },
+        {
+          dataType: 'tag',
+          label: '鎻愪氦鐘舵��',
+          prop: 'submitState',
+          formatData: (params) => {
+            return params
+          },
+          formatType: (params) => {
+            if (params === '寰呮彁浜�') {
+              return 'danger';
+            } else if (params === '宸叉彁浜�') {
+              return 'success';
+            } else {
+              return null;
+            }
+          }
+        },
+        { label: "瀹℃牳浜�", prop: "examineUserName" },
+        {
+          dataType: 'tag',
+          label: '瀹℃牳鐘舵��',
+          prop: 'examineState',
+          formatData: (params) => {
+            return params
+          },
+          formatType: (params) => {
+            if (params === '涓嶉�氳繃') {
+              return 'danger';
+            } else if (params === '閫氳繃') {
+              return 'success';
+            } else {
+              return null;
+            }
+          }
+        },
+        { label: "鎵瑰噯浜�", prop: "ratifyUserName" },
+        {
+          dataType: 'tag',
+          label: '鎵瑰噯鐘舵��',
+          prop: 'ratifyState',
+          formatData: (params) => {
+            return params
+          },
+          formatType: (params) => {
+            if (params === '涓嶉�氳繃') {
+              return 'danger';
+            } else if (params === '閫氳繃') {
+              return 'success';
+            } else {
+              return null;
+            }
+          }
+        },
+        {
+          dataType: "action",
+          label: "鎿嶄綔",
+          operation: [
+            {
+              name: "鏌ョ湅",
+              type: "text",
+              clickFun: (row) => {
+                this.handleLook(row);
+              },
+            },
+            {
+              name: "涓嬭浇",
+              type: "text",
+              clickFun: (row) => {
+                this.handleDown0(row);
+              }
+            },
+            {
+              name: "鎻愪氦",
+              type: "text",
+              clickFun: (row) => {
+                this.handleSubmit(row);
+              },
+              disabled: (row) => {
+                return !!row.submitState && row.submitState != '寰呮彁浜�'
+              }
+            },
+            {
+              name: "瀹℃牳",
+              type: "text",
+              clickFun: (row) => {
+                this.handleCheck(row);
+              },
+              disabled: (row) => {
+                return row.examineState == '閫氳繃' || row.submitState == '寰呮彁浜�'
+              }
+            },
+            {
+              name: "鎵瑰噯",
+              type: "text",
+              clickFun: (row) => {
+                this.handleApproval(row);
+              },
+              disabled: (row) => {
+                return row.ratifyState == '閫氳繃' || row.submitState == '寰呮彁浜�'
+              }
+            },
+          ],
+        },
+      ],
+      page0: {
+        total: 0,
+        size: 20,
+        current: 1,
+      },
+      operationType: ''
+    };
+  },
+  mounted() {
+    this.getList0()
+  },
+  methods: {
+    // 鑾峰彇閫佹牱鍗曚綅鍒楄〃
+    getCustomPageList() {
+      selectCustomPageList({
+        current: -1,
+        size: -1
+      }).then(res => {
+        this.customPageList = res.data.records
+      }).catch(err => { });
+    },
+    handleDown() { },
+    refresh() {
+      this.queryParams0 = {};
+      this.page0.current = 1;
+      this.getList0();
+    },
+    refreshTable() {
+      this.page0.current = 1;
+      this.getList0();
+    },
+    // 鏌ヨ鍏ㄩ儴璁板綍
+    getList0() {
+      this.tableLoading = true;
+      let param = { ...this.queryParams0, ...this.page0 };
+      delete param.total;
+      pageProcessTotaldeal({ ...param })
+        .then((res) => {
+          this.tableLoading = false;
+          if (res.code === 200) {
+            this.tableData0 = res.data.records;
+            this.page0.total = res.data.total;
+          }
+        })
+        .catch((err) => {
+          this.tableLoading = false;
+        });
+    },
+    pagination0({ page, limit }) {
+      this.page0.current = page;
+      this.page0.size = limit;
+      this.getList0();
+    },
+    // 鎵撳紑鏂板鍘嗗彶鐣岄潰
+    handleAdd0() {
+      this.addDialogVisibleDeal = true
+      this.addInfoDeal.month = ''
+    },
+    closeAddDialogVisible() {
+      this.$refs['addInfo'].resetFields();
+      this.addDialogVisible = false
+    },
+    // 鎻愪氦鏂板-鍘嗗彶
+    submitAddDeal () {
+      this.$refs.addInfoDeal.validate(valid => {
+        if (valid) {
+          // 鏂板
+          this.addLoading = true
+          addProcessTotaldeal({
+            ...this.addInfoDeal
+          }).then(res => {
+            this.addLoading = false
+            this.addDialogVisibleDeal = false
+            this.$message({
+              type: 'success',
+              message: '鏂板鎴愬姛!'
+            });
+            this.getList0()
+          }).catch(err => {
+            this.addLoading = false
+          });
+        }
+      })
+    },
+    closeDiaDeal() {
+      this.$refs['addInfoDeal'].resetFields();
+      this.addDialogVisibleDeal = false
+    },
+    // 鎻愪氦
+    handleSubmit(row) {
+      this.$confirm('鏄惁鎻愪氦 ' + row.month + ' 鏈堜唤鐨勬暟鎹�', '鎻愪氦', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        submitProcessTotaldeal({
+          id: row.id
+        }).then(res => {
+          this.$message({
+            type: 'success',
+            message: '鎻愪氦鎴愬姛!'
+          });
+          this.refreshTable()
+        }).catch(err => { });
+      })
+    },
+    // 鏌ョ湅
+    handleLook(row) {
+      this.queryParams.id = row.id
+      this.submitState = row.submitState
+      this.$nextTick(() => {
+        this.editDialogVisible = true
+        this.getList();
+      })
+    },
+    getList() {
+      this.tableLoading = true;
+      let param = { ...this.queryParams };
+      getProcessDeal({ ...param }).then((res) => {
+          this.tableLoading = false;
+          if (res.code === 200) {
+            this.tableData = res.data;
+          }
+        })
+        .catch((err) => {
+          this.tableLoading = false;
+        });
+    },
+    // 鎵撳紑鏂板璇︽儏寮规
+    handleAdd(type, row) {
+      this.addDialogVisible = true
+      this.getCustomPageList()
+      this.operationType = type
+      if (row) {
+        this.addInfo = {...row}
+      }
+    },
+    // 鎻愪氦-璇︽儏
+    submitAdd() {
+      this.$refs.addInfo.validate(valid => {
+        if (valid) {
+          this.addLoading = true
+          addProcessDeal({
+            totaldealId: this.queryParams.id,
+            ...this.addInfo
+          }).then(res => {
+            this.addLoading = false
+            this.addDialogVisible = false
+            this.$message({
+              type: 'success',
+              message: '鏂板鎴愬姛!'
+            });
+            this.getList()
+          }).catch(err => {
+            this.addLoading = false
+          });
+        }
+      })
+    },
+    // 鎻愪氦淇敼璇︽儏
+    handleEdit() {
+      if (type === 'submit') {
+        doProcessDeal({
+          id: row.id,
+          ...row
+        }).then(res => {
+          this.$message({
+            type: 'success',
+            message: '缂栬緫鎴愬姛!'
+          });
+          this.getList();
+        }).catch(err => { });
+      }
+    },
+    // 瀹℃牳
+    handleCheck(row) {
+      this.title0 = '瀹℃牳'
+      this.lookDialogVisible = true
+      this.currentInfo = row
+      this.queryParams.id = row.id
+    },
+    // 鎵瑰噯
+    handleApproval(row) {
+      this.title0 = '鎵瑰噯'
+      this.lookDialogVisible = true
+      this.currentInfo = row
+      this.queryParams.id = row.id
+    },
+    // 鎻愪氦瀹℃牳/鎵瑰噯
+    submitCheck(state) {
+      if (state == '閫氳繃') {
+        this.checkLoading = true
+      } else {
+        this.noCheckLoading = true
+      }
+      if (this.title0 == '瀹℃牳') {
+        checkProcessTotaldeal({
+          id: this.currentInfo.id,
+          state: state
+        }).then(res => {
+          this.checkLoading = false
+          this.noCheckLoading = false
+          this.$message({
+            type: 'success',
+            message: '鎿嶄綔鎴愬姛!'
+          });
+          this.refreshTable()
+          this.lookDialogVisible = false
+        }).catch(err => { });
+      } else if (this.title0 == '鎵瑰噯') {
+        ratifyProcessTotaldeal({
+          id: this.currentInfo.id,
+          state: state
+        }).then(res => {
+          this.checkLoading = false
+          this.noCheckLoading = false
+          this.$message({
+            type: 'success',
+            message: '鎿嶄綔鎴愬姛!'
+          });
+          this.refreshTable()
+          this.lookDialogVisible = false
+        }).catch(err => { });
+      }
+    },
+    // 瀵煎嚭璇︽儏
+    handleDown0(row) {
+      exportProcessTotaldeal({ id: row.id }).then(res => {
+        this.outLoading = false
+        const blob = new Blob([res], { type: 'application/msword' });
+        this.$download.saveAs(blob, '鏍峰搧澶勭悊' + '.docx');
+      })
+    },
+    handleDelete(row) {
+      this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning",
+      }).then(() => {
+        delProcessDeal({ id: row.id }).then((res) => {
+          this.$message.success("鍒犻櫎鎴愬姛");
+          this.getList();
+         });
+      }).catch(() => { });
+    },
+  },
+}
+</script>
+
+<style scoped>
+>>>.el-dialog__body {
+  padding-top: 10px;
+}
+</style>

--
Gitblit v1.9.3